wireless: bcm4329 wlan driver update to 4.218.248.6

This commit is contained in:
lbt 2011-01-27 11:22:17 +08:00
parent e43caac69d
commit 1ce1a68c19
29 changed files with 4386 additions and 1483 deletions

View File

@ -90,6 +90,7 @@ struct wifi_platform_data {
int (*set_reset)(int val);
int (*set_carddetect)(int val);
void *(*mem_prealloc)(int section, unsigned long size);
int (*get_mac_addr)(unsigned char *buf);
};
struct rk29_sdmmc_platform_data {

View File

@ -1,16 +1,27 @@
choice BCM4329_MODULE_NAME
depends on BCM4329
prompt "BCM4329 WiFi module"
config BCM4329
tristate "Broadcom 4329 wireless cards support"
depends on MMC
select WIRELESS_EXT
select WEXT_PRIV
---help---
Different module need own firmware file even if they
are based on the same BCM4329 WiFi chip.
This module adds support for wireless adapters based on
Broadcom 4329 chipset.
config BCM4329_SAMSUNG_B23
bool "Samsung SWL-B23"
This driver uses the kernel's wireless extensions subsystem.
config BCM4329_USI
bool "USI SWL-B23"
If you choose to build a module, it'll be called dhd. Say M if
unsure.
endchoice
config BCM4329_FW_PATH
depends on BCM4329
string "Firmware path"
default "/system/etc/firmware/fw_bcm4329.bin"
---help---
Path to the firmware file.
config BCM4329_NVRAM_PATH
depends on BCM4329
string "NVRAM path"
default "/system/etc/firmware/nvram_B23.txt"
---help---
Path to the calibration file.

View File

@ -1,32 +1,23 @@
EXTRA_CFLAGS += -Idrivers/net/wireless/bcm4329 -Idrivers/net/wireless/bcm4329/include \
-DLINUX -DSRCBASE=\"$(BROADCOM_SRC_DIR)\" -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD \
-DBCMWPA2 -DBCMWAPI_WPI -DUNRELEASEDCHIP -DOEM_ANDROID -DEMBEDDED_PLATFORM \
-DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC \
-DBCMPLATFORM_BUS -DSDIO_ISR_THREAD -DBDC -DTOE -DDHD_BCMEVENTS -DSHOW_EVENTS \
-DDHD_SCHED -DDHD_DEBUG -DSDTEST -Wall -Wstrict-prototypes -Werror
# bcm4329
DHDCFLAGS = -DLINUX -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD -DBCMWPA2 \
-DUNRELEASEDCHIP -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64 \
-DDHD_FIRSTREAD=64 -DDHD_GPL -DDHD_SCHED -DBDC -DTOE -DDHD_BCMEVENTS \
-DSHOW_EVENTS -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC -DBCMPLATFORM_BUS \
-Wall -Wstrict-prototypes -Werror -DCUSTOMER_HW2 \
-DDHD_DEBUG_TRAP -DSOFTAP \
-DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT \
-DGET_CUSTOM_MAC_ENABLE -DSET_RANDOM_MAC_SOFTAP \
-Idrivers/net/wireless/bcm4329 -Idrivers/net/wireless/bcm4329/include
bcmsdio-objs := bcmsdh.o bcmsdh_linux.o bcmsdh_sdmmc.o \
bcmsdh_sdmmc_linux.o
#options defines dependent on platform board and applicantion requirements:
#-DOOB_INTR_ONLY -DDHD_USE_STATIC_BUF -DMMC_SDIO_ABORT -DHW_OOB -DCSCAN
dhd-objs := dhd_common.o dhd_linux.o dhd_linux_sched.o dhd_sdio.o \
dhd_custom_gpio.o dhd_cdc.o
shared-objs := aiutils.o bcmutils.o bcmwifi.o hndpmu.o \
linux_osl.o sbutils.o siutils.o
wl-objs := wl_iw.o
bcm4329-objs := $(bcmsdio-objs) $(dhd-objs) $(shared-objs) $(wl-objs)
DHDOFILES = dhd_linux.o linux_osl.o bcmutils.o dhd_common.o dhd_custom_gpio.o \
wl_iw.o siutils.o sbutils.o aiutils.o hndpmu.o bcmwifi.o dhd_sdio.o \
dhd_linux_sched.o dhd_cdc.o bcmsdh_sdmmc.o bcmsdh.o bcmsdh_linux.o \
bcmsdh_sdmmc_linux.o
obj-$(CONFIG_BCM4329) += bcm4329.o
bcm4329-objs += $(DHDOFILES)
EXTRA_CFLAGS = $(DHDCFLAGS)
EXTRA_LDFLAGS += --strip-debug

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bcmpcispi.c,v 1.22.2.4.4.5 2008/07/09 21:23:30 Exp $
* $Id: bcmpcispi.c,v 1.22.2.4.4.5.6.1 2010/08/13 00:26:05 Exp $
*/
#include <typedefs.h>
@ -606,18 +606,23 @@ spi_spinbits(sdioh_info_t *sd)
spin_count = 0;
while ((SPIPCI_RREG(sd->osh, &regs->spih_stat) & SPIH_WFEMPTY) == 0) {
if (spin_count > SPI_SPIN_BOUND) {
ASSERT(FALSE); /* Spin bound exceeded */
sd_err(("%s: SPIH_WFEMPTY spin bits out of bound %u times \n",
__FUNCTION__, spin_count));
ASSERT(FALSE);
}
spin_count++;
}
spin_count = 0;
/* Wait for SPI Transfer state machine to return to IDLE state.
* The state bits are only implemented in Rev >= 5 FPGA. These
* bits are hardwired to 00 for Rev < 5, so this check doesn't cause
* any problems.
*/
spin_count = 0;
while ((SPIPCI_RREG(osh, &regs->spih_stat) & SPIH_STATE_MASK) != 0) {
if (spin_count > SPI_SPIN_BOUND) {
sd_err(("%s: SPIH_STATE_MASK spin bits out of bound %u times \n",
__FUNCTION__, spin_count));
ASSERT(FALSE);
}
spin_count++;

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bcmsdh_linux.c,v 1.42.10.10.2.12 2010/03/10 03:09:48 Exp $
* $Id: bcmsdh_linux.c,v 1.42.10.10.2.14.4.2 2010/09/15 00:30:11 Exp $
*/
/**
@ -76,6 +76,10 @@ struct bcmsdh_hc {
void *ch;
unsigned int oob_irq;
unsigned long oob_flags; /* OOB Host specifiction as edge and etc */
bool oob_irq_registered;
#if defined(OOB_INTR_ONLY)
spinlock_t irq_lock;
#endif
};
static bcmsdh_hc_t *sdhcinfo = NULL;
@ -187,7 +191,12 @@ int bcmsdh_probe(struct device *dev)
#endif /* BCMLXSDMMC */
#if defined(OOB_INTR_ONLY)
irq_flags = IRQF_TRIGGER_FALLING;
#ifdef HW_OOB
irq_flags = \
IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL | IORESOURCE_IRQ_SHAREABLE;
#else
irq_flags = IRQF_TRIGGER_FALLING;
#endif /* HW_OOB */
irq = dhd_customer_oob_irq_map(&irq_flags);
if (irq < 0) {
SDLX_MSG(("%s: Host irq is not defined\n", __FUNCTION__));
@ -226,6 +235,10 @@ int bcmsdh_probe(struct device *dev)
sdhc->sdh = sdh;
sdhc->oob_irq = irq;
sdhc->oob_flags = irq_flags;
sdhc->oob_irq_registered = FALSE; /* to make sure.. */
#if defined(OOB_INTR_ONLY)
spin_lock_init(&sdhc->irq_lock);
#endif
/* chain SDIO Host Controller info together */
sdhc->next = sdhcinfo;
@ -332,18 +345,18 @@ static struct pci_driver bcmsdh_pci_driver = {
#endif
suspend: NULL,
resume: NULL,
};
};
extern uint sd_pci_slot; /* Force detection to a particular PCI */
/* slot only . Allows for having multiple */
/* WL devices at once in a PC */
/* Only one instance of dhd will be */
/* useable at a time */
/* Upper word is bus number, */
/* lower word is slot number */
/* Default value of 0xFFFFffff turns this */
/* off */
/* slot only . Allows for having multiple */
/* WL devices at once in a PC */
/* Only one instance of dhd will be */
/* usable at a time */
/* Upper word is bus number, */
/* lower word is slot number */
/* Default value of 0xFFFFffff turns this */
/* off */
module_param(sd_pci_slot, uint, 0);
@ -366,20 +379,21 @@ bcmsdh_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (pdev->bus->number != (sd_pci_slot>>16) ||
PCI_SLOT(pdev->devfn) != (sd_pci_slot&0xffff)) {
SDLX_MSG(("%s: %s: bus %X, slot %X, vend %X, dev %X\n",
__FUNCTION__,
bcmsdh_chipmatch(pdev->vendor, pdev->device)
?"Found compatible SDIOHC"
:"Probing unknown device",
pdev->bus->number, PCI_SLOT(pdev->devfn), pdev->vendor,
pdev->device));
__FUNCTION__,
bcmsdh_chipmatch(pdev->vendor, pdev->device) ?
"Found compatible SDIOHC" :
"Probing unknown device",
pdev->bus->number, PCI_SLOT(pdev->devfn),
pdev->vendor, pdev->device));
return -ENODEV;
}
SDLX_MSG(("%s: %s: bus %X, slot %X, vendor %X, device %X (good PCI location)\n",
__FUNCTION__,
bcmsdh_chipmatch(pdev->vendor, pdev->device)
?"Using compatible SDIOHC"
:"WARNING, forced use of unkown device",
pdev->bus->number, PCI_SLOT(pdev->devfn), pdev->vendor, pdev->device));
__FUNCTION__,
bcmsdh_chipmatch(pdev->vendor, pdev->device) ?
"Using compatible SDIOHC" :
"WARNING, forced use of unkown device",
pdev->bus->number, PCI_SLOT(pdev->devfn),
pdev->vendor, pdev->device));
}
if ((pdev->vendor == VENDOR_TI) && ((pdev->device == PCIXX21_FLASHMEDIA_ID) ||
@ -440,7 +454,7 @@ bcmsdh_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_master(pdev);
rc = pci_enable_device(pdev);
if (rc) {
SDLX_MSG(("%s: Cannot enble PCI device\n", __FUNCTION__));
SDLX_MSG(("%s: Cannot enable PCI device\n", __FUNCTION__));
goto err;
}
if (!(sdh = bcmsdh_attach(osh, (void *)(uintptr)pci_resource_start(pdev, 0),
@ -567,21 +581,38 @@ bcmsdh_unregister(void)
#endif /* BCMPLATFORM_BUS */
}
#if defined(OOB_INTR_ONLY)
void bcmsdh_oob_intr_set(bool enable)
{
static bool curstate = 1;
unsigned long flags;
spin_lock_irqsave(&sdhcinfo->irq_lock, flags);
if (curstate != enable) {
if (enable)
enable_irq(sdhcinfo->oob_irq);
else
disable_irq_nosync(sdhcinfo->oob_irq);
curstate = enable;
}
spin_unlock_irqrestore(&sdhcinfo->irq_lock, flags);
}
static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
{
dhd_pub_t *dhdp;
dhdp = (dhd_pub_t *)dev_get_drvdata(sdhcinfo->dev);
bcmsdh_oob_intr_set(0);
if (dhdp == NULL) {
disable_irq(sdhcinfo->oob_irq);
SDLX_MSG(("Out of band GPIO interrupt fired way too early\n"));
return IRQ_HANDLED;
}
WAKE_LOCK_TIMEOUT(dhdp, WAKE_LOCK_TMOUT, 25);
dhdsdio_isr((void *)dhdp->bus);
return IRQ_HANDLED;
@ -595,15 +626,18 @@ int bcmsdh_register_oob_intr(void * dhdp)
dev_set_drvdata(sdhcinfo->dev, dhdp);
if (!sdhcinfo->oob_irq_registered) {
SDLX_MSG(("%s IRQ=%d Type=%X \n", __FUNCTION__, \
(int)sdhcinfo->oob_irq, (int)sdhcinfo->oob_flags));
/* Refer to customer Host IRQ docs about proper irqflags definition */
error = request_irq(sdhcinfo->oob_irq, wlan_oob_irq, sdhcinfo->oob_flags,
"bcmsdh_sdmmc", NULL);
if (error)
return -ENODEV;
/* Refer to customer Host IRQ docs about proper irqflags definition */
error = request_irq(sdhcinfo->oob_irq, wlan_oob_irq, sdhcinfo->oob_flags,
"bcmsdh_sdmmc", NULL);
if (error)
return -ENODEV;
set_irq_wake(sdhcinfo->oob_irq, 1);
set_irq_wake(sdhcinfo->oob_irq, 1);
sdhcinfo->oob_irq_registered = TRUE;
}
return 0;
}
@ -615,14 +649,7 @@ void bcmsdh_unregister_oob_intr(void)
set_irq_wake(sdhcinfo->oob_irq, 0);
disable_irq(sdhcinfo->oob_irq); /* just in case.. */
free_irq(sdhcinfo->oob_irq, NULL);
}
void bcmsdh_oob_intr_set(bool enable)
{
if (enable)
enable_irq(sdhcinfo->oob_irq);
else
disable_irq(sdhcinfo->oob_irq);
sdhcinfo->oob_irq_registered = FALSE;
}
#endif /* defined(OOB_INTR_ONLY) */
/* Module parameters specific to each host-controller driver */

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bcmsdh_sdmmc.c,v 1.1.2.5.6.29 2010/03/19 17:16:08 Exp $
* $Id: bcmsdh_sdmmc.c,v 1.1.2.5.6.30.4.1 2010/09/02 23:12:21 Exp $
*/
#include <typedefs.h>
@ -55,7 +55,7 @@ extern void sdio_function_cleanup(void);
#if !defined(OOB_INTR_ONLY)
static void IRQHandler(struct sdio_func *func);
static void IRQHandlerF2(struct sdio_func *func);
#endif
#endif /* !defined(OOB_INTR_ONLY) */
static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, uint32 regaddr);
extern int sdio_reset_comm(struct mmc_card *card);
@ -676,6 +676,8 @@ sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
else
data = 4; /* disable hw oob interrupt */
data |= 4; /* Active HIGH */
status = sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
return status;
}
@ -1064,14 +1066,18 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, u
return (Status);
}
/* this function performs "abort" for both of host & device */
extern int
sdioh_abort(sdioh_info_t *sd, uint func)
{
#if defined(MMC_SDIO_ABORT)
char t_func = (char) func;
#endif /* defined(MMC_SDIO_ABORT) */
sd_trace(("%s: Enter\n", __FUNCTION__));
#if defined(MMC_SDIO_ABORT)
/* issue abort cmd52 command through F1 */
sdioh_request_byte(sd, SD_IO_OP_WRITE, SDIO_FUNC_0, SDIOD_CCCR_IOABORT, (uint8 *)&func);
sdioh_request_byte(sd, SD_IO_OP_WRITE, SDIO_FUNC_0, SDIOD_CCCR_IOABORT, &t_func);
#endif /* defined(MMC_SDIO_ABORT) */
sd_trace(("%s: Exit\n", __FUNCTION__));

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bcmsdh_sdmmc_linux.c,v 1.1.2.5.6.15 2010/04/14 21:11:46 Exp $
* $Id: bcmsdh_sdmmc_linux.c,v 1.1.2.5.6.17 2010/08/13 00:36:19 Exp $
*/
#include <typedefs.h>
@ -34,19 +34,27 @@
#include <linux/mmc/core.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
#if !defined(SDIO_VENDOR_ID_BROADCOM)
#define SDIO_VENDOR_ID_BROADCOM 0x02d0
#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4325) */
#endif /* !defined(SDIO_VENDOR_ID_BROADCOM) */
#define SDIO_DEVICE_ID_BROADCOM_DEFAULT 0x0000
#if !defined(SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)
#define SDIO_DEVICE_ID_BROADCOM_4325_SDGWB 0x0492 /* BCM94325SDGWB */
#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4325_SDGWB) */
#if !defined(SDIO_DEVICE_ID_BROADCOM_4325)
#define SDIO_DEVICE_ID_BROADCOM_4325 0x0000
#define SDIO_DEVICE_ID_BROADCOM_4325 0x0493
#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4325) */
#if !defined(SDIO_DEVICE_ID_BROADCOM_4329)
#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
#if !defined(SDIO_DEVICE_ID_BROADCOM_4319)
#define SDIO_DEVICE_ID_BROADCOM_4319 0x4319
#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
#include <bcmsdh_sdmmc.h>
@ -117,15 +125,18 @@ static void bcmsdh_sdmmc_remove(struct sdio_func *func)
sd_info(("Function#: 0x%04x\n", func->num));
if (func->num == 2) {
sd_trace(("F2 found, calling bcmsdh_probe...\n"));
sd_trace(("F2 found, calling bcmsdh_remove...\n"));
bcmsdh_remove(&sdmmc_dev);
}
}
/* devices we support, null terminated */
static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_DEFAULT) },
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325_SDGWB) },
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325) },
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4329) },
{ SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4319) },
{ /* end: all zeroes */ },
};
@ -242,6 +253,7 @@ int sdio_function_init(void)
bzero(&sdmmc_dev, sizeof(sdmmc_dev));
error = sdio_register_driver(&bcmsdh_sdmmc_driver);
return error;
}

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bcmsdstd.c,v 1.64.4.1.4.4.2.17 2010/03/10 03:09:48 Exp $
* $Id: bcmsdstd.c,v 1.64.4.1.4.4.2.18 2010/08/17 17:00:48 Exp $
*/
#include <typedefs.h>
@ -119,7 +119,7 @@ extern void sdstd_wreg16(sdioh_info_t *sd, uint reg, uint16 data);
void
sdstd_wreg16(sdioh_info_t *sd, uint reg, uint16 data)
{
*(volatile uint16 *)(sd->mem_space + reg) = (volatile uint16) data;
*(volatile uint16 *)(sd->mem_space + reg) = (uint16)data;
sd_ctrl(("16: W Reg 0x%02x, Data 0x%x\n", reg, data));
}
@ -129,7 +129,7 @@ sdstd_or_reg16(sdioh_info_t *sd, uint reg, uint16 val)
volatile uint16 data = *(volatile uint16 *)(sd->mem_space + reg);
sd_ctrl(("16: OR Reg 0x%02x, Val 0x%x\n", reg, val));
data |= val;
*(volatile uint16 *)(sd->mem_space + reg) = (volatile uint16)data;
*(volatile uint16 *)(sd->mem_space + reg) = (uint16)data;
}
static void
@ -140,7 +140,7 @@ sdstd_mod_reg16(sdioh_info_t *sd, uint reg, int16 mask, uint16 val)
sd_ctrl(("16: MOD Reg 0x%02x, Mask 0x%x, Val 0x%x\n", reg, mask, val));
data &= ~mask;
data |= (val & mask);
*(volatile uint16 *)(sd->mem_space + reg) = (volatile uint16)data;
*(volatile uint16 *)(sd->mem_space + reg) = (uint16)data;
}
@ -155,7 +155,7 @@ sdstd_rreg(sdioh_info_t *sd, uint reg)
static inline void
sdstd_wreg(sdioh_info_t *sd, uint reg, uint32 data)
{
*(volatile uint32 *)(sd->mem_space + reg) = (volatile uint32)data;
*(volatile uint32 *)(sd->mem_space + reg) = (uint32)data;
sd_ctrl(("32: W Reg 0x%02x, Data 0x%x\n", reg, data));
}
@ -164,7 +164,7 @@ sdstd_wreg(sdioh_info_t *sd, uint reg, uint32 data)
static inline void
sdstd_wreg8(sdioh_info_t *sd, uint reg, uint8 data)
{
*(volatile uint8 *)(sd->mem_space + reg) = (volatile uint8)data;
*(volatile uint8 *)(sd->mem_space + reg) = (uint8)data;
sd_ctrl(("08: W Reg 0x%02x, Data 0x%x\n", reg, data));
}
static uint8
@ -287,7 +287,7 @@ sdioh_detach(osl_t *osh, sdioh_info_t *sd)
return SDIOH_API_RC_SUCCESS;
}
/* Configure callback to client when we recieve client interrupt */
/* Configure callback to client when we receive client interrupt */
extern SDIOH_API_RC
sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
{
@ -2778,10 +2778,6 @@ sdstd_card_buf(sdioh_info_t *sd, int rw, int func, bool fifo, uint32 addr, int n
data++;
}
/* Handle < 4 bytes. wlc_pio.c currently (as of 12/20/05) truncates buflen
* to be evenly divisable by 4. However dongle passes arbitrary lengths,
* so handle it here
*/
bytes = blocksize % 4;
/* If no leftover bytes, go to next block */
@ -2898,7 +2894,8 @@ set_client_block_size(sdioh_info_t *sd, int func, int block_size)
}
/* Reset and re-initialize the device */
int sdioh_sdio_reset(sdioh_info_t *si)
int
sdioh_sdio_reset(sdioh_info_t *si)
{
uint8 hreg;

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: bcmsdstd_linux.c,v 1.11.18.2 2008/05/28 18:36:56 Exp $
* $Id: bcmsdstd_linux.c,v 1.11.18.2.16.1 2010/08/17 17:03:13 Exp $
*/
#include <typedefs.h>
@ -186,7 +186,9 @@ sdstd_lock(sdioh_info_t *sd)
spin_lock_irqsave(&sdos->lock, flags);
if (sd->lockcount) {
sd_err(("%s: Already locked!\n", __FUNCTION__));
sd_err(("%s: Already locked! called from %p\n",
__FUNCTION__,
__builtin_return_address(0)));
ASSERT(sd->lockcount == 0);
}
sdstd_devintr_off(sd);

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: dhd.h,v 1.32.4.7.2.4.14.44 2010/06/03 21:27:48 Exp $
* $Id: dhd.h,v 1.32.4.7.2.4.14.49 2010/08/20 17:32:48 Exp $
*/
/****************
@ -35,9 +35,6 @@
#define _dhd_h_
#if defined(LINUX)
#if defined(CHROMIUMOS_COMPAT_WIRELESS)
#include <linux/sched.h>
#endif
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/slab.h>
@ -49,9 +46,7 @@
#include <linux/ethtool.h>
#include <asm/uaccess.h>
#include <asm/unaligned.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
#include <linux/wakelock.h>
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
/* The kernel threading is sdio-specific */
#else /* LINUX */
#define ENOMEM 1
@ -64,6 +59,11 @@
#include <wlioctl.h>
#ifdef DHD_DEBUG
#ifndef DHD_DEBUG_TRAP
#define DHD_DEBUG_TRAP
#endif
#endif
/* Forward decls */
struct dhd_bus;
@ -150,6 +150,14 @@ typedef struct dhd_pub {
/* Last error from dongle */
int dongle_error;
/* Suspend disable flag and "in suspend" flag */
int suspend_disable_flag; /* "1" to disable all extra powersaving during suspend */
int in_suspend; /* flag set to 1 when early suspend called */
#ifdef PNO_SUPPORT
int pno_enable; /* pno status : "1" is pno enable */
#endif /* PNO_SUPPORT */
int dtim_skip; /* dtim skip , default 0 means wake each dtim */
/* Pkt filter defination */
char * pktfilter[100];
int pktfilter_count;
@ -157,26 +165,19 @@ typedef struct dhd_pub {
uint8 country_code[WLC_CNTRY_BUF_SZ];
char eventmask[WL_EVENTING_MASK_LEN];
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
struct wake_lock wakelock[WAKE_LOCK_MAX];
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
struct mutex wl_start_stop_lock; /* lock/unlock for Android start/stop */
struct mutex wl_softap_lock; /* lock/unlock for any SoftAP/STA settings */
#endif
} dhd_pub_t;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP)
#define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
#define _DHD_PM_RESUME_WAIT(a, b) do {\
#define _DHD_PM_RESUME_WAIT(a, b) do { \
int retry = 0; \
smp_mb(); \
while (dhd_mmc_suspend && retry++ != b) { \
wait_event_timeout(a, FALSE, HZ/100); \
wait_event_interruptible_timeout(a, FALSE, HZ/100); \
} \
} while (0)
#define DHD_PM_RESUME_WAIT(a) _DHD_PM_RESUME_WAIT(a, 30)
#define DHD_PM_RESUME_WAIT(a) _DHD_PM_RESUME_WAIT(a, 30)
#define DHD_PM_RESUME_WAIT_FOREVER(a) _DHD_PM_RESUME_WAIT(a, ~0)
#define DHD_PM_RESUME_RETURN_ERROR(a) do { if (dhd_mmc_suspend) return a; } while (0)
#define DHD_PM_RESUME_RETURN do { if (dhd_mmc_suspend) return; } while (0)
@ -185,12 +186,12 @@ typedef struct dhd_pub {
#define SPINWAIT_SLEEP(a, exp, us) do { \
uint countdown = (us) + 9999; \
while ((exp) && (countdown >= 10000)) { \
wait_event_timeout(a, FALSE, HZ/100); \
wait_event_interruptible_timeout(a, FALSE, HZ/100); \
countdown -= 10000; \
} \
} while (0)
#else
#else
#define DHD_PM_RESUME_WAIT_INIT(a)
#define DHD_PM_RESUME_WAIT(a)
@ -207,111 +208,18 @@ typedef struct dhd_pub {
} \
} while (0)
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */
#define DHD_IF_VIF 0x01 /* Virtual IF (Hidden from user) */
inline static void MUTEX_LOCK_INIT(dhd_pub_t * dhdp)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_init(&dhdp->wl_start_stop_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void MUTEX_LOCK(dhd_pub_t * dhdp)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_lock(&dhdp->wl_start_stop_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void MUTEX_UNLOCK(dhd_pub_t * dhdp)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_unlock(&dhdp->wl_start_stop_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void MUTEX_LOCK_SOFTAP_SET_INIT(dhd_pub_t * dhdp)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_init(&dhdp->wl_softap_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void MUTEX_LOCK_SOFTAP_SET(dhd_pub_t * dhdp)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_lock(&dhdp->wl_softap_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t * dhdp)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_unlock(&dhdp->wl_softap_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
extern struct mutex g_wl_ss_scan_lock; /* lock/unlock for Scan/Cache settings */
#endif
inline static void MUTEX_LOCK_WL_SCAN_SET_INIT(void)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_init(&g_wl_ss_scan_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void MUTEX_LOCK_WL_SCAN_SET(void)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_lock(&g_wl_ss_scan_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void MUTEX_UNLOCK_WL_SCAN_SET(void)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)) && 1
mutex_unlock(&g_wl_ss_scan_lock);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
}
inline static void WAKE_LOCK_INIT(dhd_pub_t * dhdp, int index, char * y)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
wake_lock_init(&dhdp->wakelock[index], WAKE_LOCK_SUSPEND, y);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
}
inline static void WAKE_LOCK(dhd_pub_t * dhdp, int index)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
wake_lock(&dhdp->wakelock[index]);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
}
inline static void WAKE_UNLOCK(dhd_pub_t * dhdp, int index)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
wake_unlock(&dhdp->wakelock[index]);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
}
inline static void WAKE_LOCK_TIMEOUT(dhd_pub_t * dhdp, int index, long time)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
wake_lock_timeout(&dhdp->wakelock[index], time);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
}
inline static void WAKE_LOCK_DESTROY(dhd_pub_t * dhdp, int index)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_HAS_WAKELOCK)
wake_lock_destroy(&dhdp->wakelock[index]);
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined (CONFIG_HAS_WAKELOCK) */
}
/* Wakelock Functions */
extern int dhd_os_wake_lock(dhd_pub_t *pub);
extern int dhd_os_wake_unlock(dhd_pub_t *pub);
extern int dhd_os_wake_lock_timeout(dhd_pub_t *pub);
extern int dhd_os_wake_lock_timeout_enable(dhd_pub_t *pub);
extern void dhd_os_start_lock(dhd_pub_t *pub);
extern void dhd_os_start_unlock(dhd_pub_t *pub);
typedef struct dhd_if_event {
uint8 ifidx;
@ -378,7 +286,7 @@ extern void dhd_os_sdlock_rxq(dhd_pub_t * pub);
extern void dhd_os_sdunlock_rxq(dhd_pub_t * pub);
extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t * pub);
extern void dhd_customer_gpio_wlan_ctrl(int onoff);
extern int dhd_custom_get_mac_address(unsigned char *buf);
extern int dhd_custom_get_mac_address(unsigned char *buf);
extern void dhd_os_sdunlock_sndup_rxq(dhd_pub_t * pub);
extern void dhd_os_sdlock_eventq(dhd_pub_t * pub);
extern void dhd_os_sdunlock_eventq(dhd_pub_t * pub);
@ -511,9 +419,6 @@ extern char nv_path[MOD_PARAM_PATHLEN];
#define DHD_DEL_IF -0xe
#define DHD_BAD_IF -0xf
#ifdef APSTA_PINGTEST
#define MAX_GUEST 8
#endif
extern void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar);
extern void dhd_wait_event_wakeup(dhd_pub_t*dhd);

View File

@ -40,13 +40,9 @@
#include <dhd_proto.h>
#include <dhd_bus.h>
#include <dhd_dbg.h>
#ifdef CUSTOMER_HW2
int wifi_get_mac_addr(unsigned char *buf);
#endif
extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
/* Packet alignment for most efficient SDIO (can change based on platform) */
#ifndef DHD_SDALIGN
#define DHD_SDALIGN 32
@ -78,9 +74,12 @@ dhdcdc_msg(dhd_pub_t *dhd)
{
dhd_prot_t *prot = dhd->prot;
int len = ltoh32(prot->msg.len) + sizeof(cdc_ioctl_t);
int ret;
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
dhd_os_wake_lock(dhd);
/* NOTE : cdc->msg.len holds the desired length of the buffer to be
* returned. Only up to CDC_MAX_MSG_SIZE of this buffer area
* is actually sent to the dongle
@ -89,7 +88,9 @@ dhdcdc_msg(dhd_pub_t *dhd)
len = CDC_MAX_MSG_SIZE;
/* Send request */
return dhd_bus_txctl(dhd->bus, (uchar*)&prot->msg, len);
ret = dhd_bus_txctl(dhd->bus, (uchar*)&prot->msg, len);
dhd_os_wake_unlock(dhd);
return ret;
}
static int
@ -322,23 +323,12 @@ dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
bcm_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
}
#ifdef APSTA_PINGTEST
extern struct ether_addr guest_eas[MAX_GUEST];
#endif
void
dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *pktbuf)
{
#ifdef BDC
struct bdc_header *h;
#ifdef APSTA_PINGTEST
struct ether_header *eh;
int i;
#ifdef DHD_DEBUG
char eabuf1[ETHER_ADDR_STR_LEN];
char eabuf2[ETHER_ADDR_STR_LEN];
#endif /* DHD_DEBUG */
#endif /* APSTA_PINGTEST */
#endif /* BDC */
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
@ -346,9 +336,6 @@ dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *pktbuf)
#ifdef BDC
/* Push BDC header used to convey priority for buses that don't */
#ifdef APSTA_PINGTEST
eh = (struct ether_header *)PKTDATA(dhd->osh, pktbuf);
#endif
PKTPUSH(dhd->osh, pktbuf, BDC_HEADER_LEN);
@ -361,19 +348,6 @@ dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *pktbuf)
h->priority = (PKTPRIO(pktbuf) & BDC_PRIORITY_MASK);
h->flags2 = 0;
#ifdef APSTA_PINGTEST
for (i = 0; i < MAX_GUEST; ++i) {
if (!ETHER_ISNULLADDR(eh->ether_dhost) &&
bcmp(eh->ether_dhost, guest_eas[i].octet, ETHER_ADDR_LEN) == 0) {
DHD_TRACE(("send on if 1; sa %s, da %s\n",
bcm_ether_ntoa((struct ether_addr *)(eh->ether_shost), eabuf1),
bcm_ether_ntoa((struct ether_addr *)(eh->ether_dhost), eabuf2)));
/* assume all guest STAs are on interface 1 */
h->flags2 = 1;
break;
}
}
#endif /* APSTA_PINGTEST */
h->rssi = 0;
#endif /* BDC */
BDC_SET_IF_IDX(h, ifidx);

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: dhd_common.c,v 1.5.6.8.2.6.6.65 2010/07/07 00:05:07 Exp $
* $Id: dhd_common.c,v 1.5.6.8.2.6.6.69.4.3 2010/09/10 21:30:16 Exp $
*/
#include <typedefs.h>
#include <osl.h>
@ -37,17 +37,23 @@
#include <dhd_dbg.h>
#include <msgtrace.h>
#include <wlioctl.h>
#ifdef SET_RANDOM_MAC_SOFTAP
#include <linux/random.h>
#include <linux/jiffies.h>
#endif
#ifdef GET_CUSTOM_MAC_ENABLE
int wifi_get_mac_addr(unsigned char *buf);
#endif /* GET_CUSTOM_MAC_ENABLE */
int dhd_msg_level;
#if defined(CSCAN)
#include <wl_iw.h>
#endif
#define CONFIG_BCM4329_FW_PATH "/etc/firmware/fw_bcm4329.bin"
#define CONFIG_BCM4329_NVRAM_PATH "/etc/firmware/nvram_bcm4329_B23_26M.txt"
#define CONFIG_BCM4329_FW_PATH "/system/etc/firmware/fw_bcm4329.bin"
#define CONFIG_BCM4329_NVRAM_PATH "/system/etc/firmware/nvram_B23.txt"
char fw_path[MOD_PARAM_PATHLEN];
char nv_path[MOD_PARAM_PATHLEN];
@ -134,7 +140,7 @@ dhd_common_init(void)
* behaviour since the value of the globals may be different on the
* first time that the driver is initialized vs subsequent initializations.
*/
dhd_msg_level = DHD_ERROR_VAL;
dhd_msg_level = DHD_ERROR_VAL |DHD_TRACE_VAL|DHD_INFO_VAL;
#ifdef CONFIG_BCM4329_FW_PATH
strncpy(fw_path, CONFIG_BCM4329_FW_PATH, MOD_PARAM_PATHLEN-1);
#else
@ -231,7 +237,6 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, uint32 actionid, const ch
dhd_msg_level = int_val;
break;
case IOV_GVAL(IOV_BCMERRORSTR):
strncpy((char *)arg, bcmerrorstr(dhd_pub->bcmerror), BCME_STRLEN);
((char *)arg)[BCME_STRLEN - 1] = 0x00;
@ -510,9 +515,6 @@ dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
return bcmerror;
}
#ifdef APSTA_PINGTEST
struct ether_addr guest_eas[MAX_GUEST];
#endif
#ifdef SHOW_EVENTS
static void
@ -621,16 +623,6 @@ wl_show_host_event(wl_event_msg_t *event, void *event_data)
case WLC_E_ASSOC_IND:
case WLC_E_REASSOC_IND:
#ifdef APSTA_PINGTEST
{
int i;
for (i = 0; i < MAX_GUEST; ++i)
if (ETHER_ISNULLADDR(&guest_eas[i]))
break;
if (i < MAX_GUEST)
bcopy(event->addr.octet, guest_eas[i].octet, ETHER_ADDR_LEN);
}
#endif /* APSTA_PINGTEST */
DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
break;
@ -651,18 +643,6 @@ wl_show_host_event(wl_event_msg_t *event, void *event_data)
case WLC_E_DEAUTH_IND:
case WLC_E_DISASSOC_IND:
#ifdef APSTA_PINGTEST
{
int i;
for (i = 0; i < MAX_GUEST; ++i) {
if (bcmp(guest_eas[i].octet, event->addr.octet,
ETHER_ADDR_LEN) == 0) {
bzero(guest_eas[i].octet, ETHER_ADDR_LEN);
break;
}
}
}
#endif /* APSTA_PINGTEST */
DHD_EVENT(("MACEVENT: %s, MAC %s, reason %d\n", event_name, eabuf, (int)reason));
break;
@ -968,6 +948,7 @@ void print_buf(void *pbuf, int len, int bytes_per_line)
#define strtoul(nptr, endptr, base) bcm_strtoul((nptr), (endptr), (base))
#ifdef PKT_FILTER_SUPPORT
/* Convert user's input in hex pattern to byte-size mask */
static int
wl_pattern_atoh(char *src, char *dst)
@ -1197,7 +1178,9 @@ dhd_pktfilter_offload_set(dhd_pub_t * dhd, char *arg)
if (buf)
MFREE(dhd->osh, buf, BUF_SIZE);
}
#endif
#ifdef ARP_OFFLOAD_SUPPORT
void
dhd_arp_offload_set(dhd_pub_t * dhd, int arp_mode)
{
@ -1231,6 +1214,7 @@ dhd_arp_offload_enable(dhd_pub_t * dhd, int arp_enable)
DHD_TRACE(("%s: successfully enabed ARP offload to %d\n",
__FUNCTION__, arp_enable));
}
#endif
int
dhd_preinit_ioctls(dhd_pub_t *dhd)
@ -1243,18 +1227,20 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
uint32 glom = 0;
uint bcn_timeout = 3;
int scan_assoc_time = 40;
int scan_unassoc_time = 80;
int scan_unassoc_time = 40;
#ifdef GET_CUSTOM_MAC_ENABLE
int ret = 0;
int ret;
struct ether_addr ea_addr;
#endif /* GET_CUSTOM_MAC_ENABLE */
dhd_os_proto_block(dhd);
#ifdef GET_CUSTOM_MAC_ENABLE
/* Read MAC address from external customer place
** NOTE that default mac address has to be present in otp or nvram file to bring up
** firmware but unique per board mac address maybe provided by customer code
/*
** Read MAC address from external customer place
** NOTE that default mac address has to be present in otp or nvram file
** to bring up firmware but unique per board mac address maybe provided
** by customer code
*/
ret = dhd_custom_get_mac_address(ea_addr.octet);
if (!ret) {
@ -1262,14 +1248,36 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n", __FUNCTION__, ret));
}
else
} else
memcpy(dhd->mac.octet, (void *)&ea_addr, ETHER_ADDR_LEN);
}
#endif /* GET_CUSTOM_MAC_ENABLE */
memset(dhd->country_code, 0, sizeof(dhd->country_code));
strncpy(dhd->country_code,"JP", 2); //set max numbers of radio channels
#endif /* GET_CUSTOM_MAC_ENABLE */
#ifdef SET_RANDOM_MAC_SOFTAP
if (strstr(fw_path, "apsta") != NULL) {
uint rand_mac;
int ret;
srandom32((uint)jiffies);
rand_mac = random32();
iovbuf[0] = 0x02; /* locally administered bit */
iovbuf[1] = 0x1A;
iovbuf[2] = 0x11;
iovbuf[3] = (unsigned char)(rand_mac & 0x0F) | 0xF0;
iovbuf[4] = (unsigned char)(rand_mac >> 8);
iovbuf[5] = (unsigned char)(rand_mac >> 16);
printk("Broadcom Dongle Host Driver mac=%02x:%02x:%02x:%02x:%02x:%02x\n",
iovbuf[0], iovbuf[1], iovbuf[2], iovbuf[3], iovbuf[4], iovbuf[5]);
bcm_mkiovar("cur_etheraddr", (void *)iovbuf, ETHER_ADDR_LEN, buf, sizeof(buf));
ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n", __FUNCTION__, ret));
} else
memcpy(dhd->mac.octet, iovbuf, ETHER_ADDR_LEN);
}
#endif /* SET_RANDOM_MAC_SOFTAP */
/* Set Country code */
if (dhd->country_code[0] != 0) {
@ -1307,6 +1315,52 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
bcm_mkiovar("roam_off", (char *)&dhd_roam, 4, iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
if (dhd_roam == 0)
{
/* set internal roaming roaming parameters */
int roam_scan_period = 30; /* in sec */
int roam_fullscan_period = 120; /* in sec */
int roam_trigger = -85;
int roam_delta = 15;
int band;
int band_temp_set = WLC_BAND_2G;
if (dhdcdc_set_ioctl(dhd, 0, WLC_SET_ROAM_SCAN_PERIOD, \
(char *)&roam_scan_period, sizeof(roam_scan_period)) < 0)
DHD_ERROR(("%s: roam scan setup failed\n", __FUNCTION__));
bcm_mkiovar("fullroamperiod", (char *)&roam_fullscan_period, \
4, iovbuf, sizeof(iovbuf));
if (dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, \
iovbuf, sizeof(iovbuf)) < 0)
DHD_ERROR(("%s: roam fullscan setup failed\n", __FUNCTION__));
if (dhdcdc_query_ioctl(dhd, 0, WLC_GET_BAND, \
(char *)&band, sizeof(band)) < 0)
DHD_ERROR(("%s: roam delta setting failed\n", __FUNCTION__));
else {
if ((band == WLC_BAND_AUTO) || (band == WLC_BAND_ALL))
{
/* temp set band to insert new roams values */
if (dhdcdc_set_ioctl(dhd, 0, WLC_SET_BAND, \
(char *)&band_temp_set, sizeof(band_temp_set)) < 0)
DHD_ERROR(("%s: local band seting failed\n", __FUNCTION__));
}
if (dhdcdc_set_ioctl(dhd, 0, WLC_SET_ROAM_DELTA, \
(char *)&roam_delta, sizeof(roam_delta)) < 0)
DHD_ERROR(("%s: roam delta setting failed\n", __FUNCTION__));
if (dhdcdc_set_ioctl(dhd, 0, WLC_SET_ROAM_TRIGGER, \
(char *)&roam_trigger, sizeof(roam_trigger)) < 0)
DHD_ERROR(("%s: roam trigger setting failed\n", __FUNCTION__));
/* Restore original band settinngs */
if (dhdcdc_set_ioctl(dhd, 0, WLC_SET_BAND, \
(char *)&band, sizeof(band)) < 0)
DHD_ERROR(("%s: Original band restore failed\n", __FUNCTION__));
}
}
/* Force STA UP */
if (dhd_radio_up)
dhdcdc_set_ioctl(dhd, 0, WLC_UP, (char *)&up, sizeof(up));
@ -1366,9 +1420,9 @@ dhd_iscan_allocate_buf(dhd_pub_t *dhd, iscan_buf_t **iscanbuf)
iscanbuf_alloc->next = NULL;
iscanbuf_head = *iscanbuf;
DHD_ISCAN(("%s: addr of allocated node = 0x%X, addr of iscanbuf_head \
= 0x%X dhd = 0x%X\n", __FUNCTION__, iscanbuf_alloc,
iscanbuf_head, dhd));
DHD_ISCAN(("%s: addr of allocated node = 0x%X"
"addr of iscanbuf_head = 0x%X dhd = 0x%X\n",
__FUNCTION__, iscanbuf_alloc, iscanbuf_head, dhd));
if (iscanbuf_head == NULL) {
*iscanbuf = iscanbuf_alloc;
@ -1529,10 +1583,10 @@ dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
break;
if (!memcmp(bi->BSSID.octet, addr, ETHER_ADDR_LEN)) {
DHD_ISCAN(("%s: Del BSS[%2.2d:%2.2d] %X:%X:%X:%X:%X:%X\n", \
__FUNCTION__, l, i, bi->BSSID.octet[0], \
bi->BSSID.octet[1], bi->BSSID.octet[2], \
bi->BSSID.octet[3], bi->BSSID.octet[4], \
DHD_ISCAN(("%s: Del BSS[%2.2d:%2.2d] %X:%X:%X:%X:%X:%X\n",
__FUNCTION__, l, i, bi->BSSID.octet[0],
bi->BSSID.octet[1], bi->BSSID.octet[2],
bi->BSSID.octet[3], bi->BSSID.octet[4],
bi->BSSID.octet[5]));
bi_new = bi;
@ -1549,8 +1603,8 @@ dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
for (j = i; j < results->count; j++) {
if (bi && bi_new) {
DHD_ISCAN(("%s: Moved up BSS[%2.2d:%2.2d] \
%X:%X:%X:%X:%X:%X\n",
DHD_ISCAN(("%s: Moved up BSS[%2.2d:%2.2d]"
"%X:%X:%X:%X:%X:%X\n",
__FUNCTION__, l, j, bi->BSSID.octet[0],
bi->BSSID.octet[1], bi->BSSID.octet[2],
bi->BSSID.octet[3], bi->BSSID.octet[4],
@ -1728,15 +1782,166 @@ dhd_iscan_get_partial_result(void *dhdp, uint *scan_count)
#endif
/* Android ComboSCAN support */
#ifdef PNO_SUPPORT
int dhd_pno_clean(dhd_pub_t *dhd)
{
char iovbuf[128];
int pfn_enabled = 0;
int iov_len = 0;
int ret;
/* Disable pfn */
iov_len = bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf, sizeof(iovbuf));
if ((ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf))) >= 0) {
/* clear pfn */
iov_len = bcm_mkiovar("pfnclear", 0, 0, iovbuf, sizeof(iovbuf));
if (iov_len) {
if ((ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, iov_len)) < 0) {
DHD_ERROR(("%s failed code %d\n", __FUNCTION__, ret));
}
}
else {
ret = -1;
DHD_ERROR(("%s failed code %d\n", __FUNCTION__, iov_len));
}
}
else
DHD_ERROR(("%s failed code %d\n", __FUNCTION__, ret));
return ret;
}
int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled)
{
char iovbuf[128];
int ret = -1;
if ((!dhd) && ((pfn_enabled != 0) || (pfn_enabled != 1))) {
DHD_ERROR(("%s error exit\n", __FUNCTION__));
return ret;
}
/* Enable/disable PNO */
if ((ret = bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf, sizeof(iovbuf))) > 0) {
if ((ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf))) < 0) {
DHD_ERROR(("%s failed for error=%d\n", __FUNCTION__, ret));
return ret;
}
else {
dhd->pno_enable = pfn_enabled;
DHD_TRACE(("%s set pno as %d\n", __FUNCTION__, dhd->pno_enable));
}
}
else DHD_ERROR(("%s failed err=%d\n", __FUNCTION__, ret));
return ret;
}
/* Function to execute combined scan */
int
dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t* ssids_local, int nssid, ushort scan_fr)
{
int err = -1;
char iovbuf[128];
int k, i;
wl_pfn_param_t pfn_param;
wl_pfn_t pfn_element;
DHD_TRACE(("%s nssid=%d nchan=%d\n", __FUNCTION__, nssid, scan_fr));
if ((!dhd) && (!ssids_local)) {
DHD_ERROR(("%s error exit\n", __FUNCTION__));
err = -1;
}
/* Check for broadcast ssid */
for (k = 0; k < nssid; k++) {
if (!ssids_local[k].SSID_len) {
DHD_ERROR(("%d: Broadcast SSID is ilegal for PNO setting\n", k));
return err;
}
}
/* #define PNO_DUMP 1 */
#ifdef PNO_DUMP
{
int j;
for (j = 0; j < nssid; j++) {
DHD_ERROR(("%d: scan for %s size =%d\n", j,
ssids_local[j].SSID, ssids_local[j].SSID_len));
}
}
#endif /* PNO_DUMP */
/* clean up everything */
if ((err = dhd_pno_clean(dhd)) < 0) {
DHD_ERROR(("%s failed error=%d\n", __FUNCTION__, err));
return err;
}
memset(&pfn_param, 0, sizeof(pfn_param));
memset(&pfn_element, 0, sizeof(pfn_element));
/* set pfn parameters */
pfn_param.version = htod32(PFN_VERSION);
pfn_param.flags = htod16((PFN_LIST_ORDER << SORT_CRITERIA_BIT));
/* set up pno scan fr */
if (scan_fr != 0)
pfn_param.scan_freq = htod32(scan_fr);
bcm_mkiovar("pfn_set", (char *)&pfn_param, sizeof(pfn_param), iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
/* set all pfn ssid */
for (i = 0; i < nssid; i++) {
pfn_element.bss_type = htod32(DOT11_BSSTYPE_INFRASTRUCTURE);
pfn_element.auth = (DOT11_OPEN_SYSTEM);
pfn_element.wpa_auth = htod32(WPA_AUTH_PFN_ANY);
pfn_element.wsec = htod32(0);
pfn_element.infra = htod32(1);
memcpy((char *)pfn_element.ssid.SSID, ssids_local[i].SSID, ssids_local[i].SSID_len);
pfn_element.ssid.SSID_len = ssids_local[i].SSID_len;
if ((err =
bcm_mkiovar("pfn_add", (char *)&pfn_element,
sizeof(pfn_element), iovbuf, sizeof(iovbuf))) > 0) {
if ((err =
dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf))) < 0) {
DHD_ERROR(("%s failed for i=%d error=%d\n",
__FUNCTION__, i, err));
return err;
}
}
else DHD_ERROR(("%s failed err=%d\n", __FUNCTION__, err));
}
/* Enable PNO */
/* dhd_pno_enable(dhd, 1); */
return err;
}
int dhd_pno_get_status(dhd_pub_t *dhd)
{
int ret = -1;
if (!dhd)
return ret;
else
return (dhd->pno_enable);
}
#endif /* PNO_SUPPORT */
#if defined(CSCAN)
/* Androd ComboSCAN support */
/*
* data parsing from ComboScan tlv list
*/
int
wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token, \
int input_size, int *bytes_left)
wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token,
int input_size, int *bytes_left)
{
char* str = *list_str;
uint16 short_temp;
@ -1752,8 +1957,8 @@ wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token,
while (*bytes_left > 0) {
if (str[0] != token) {
DHD_TRACE(("%s NOT Type=%d get=%d left_parse=%d \n", __FUNCTION__, \
token, str[0], *bytes_left));
DHD_TRACE(("%s NOT Type=%d get=%d left_parse=%d \n",
__FUNCTION__, token, str[0], *bytes_left));
return -1;
}
@ -1764,11 +1969,11 @@ wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token,
memcpy(dst, str, input_size);
}
else if (input_size == 2) {
memcpy(dst, (char *)htod16(memcpy(&short_temp, str, input_size)), \
input_size);
memcpy(dst, (char *)htod16(memcpy(&short_temp, str, input_size)),
input_size);
}
else if (input_size == 4) {
memcpy(dst, (char *)htod32(memcpy(&int_temp, str, input_size)), \
memcpy(dst, (char *)htod32(memcpy(&int_temp, str, input_size)),
input_size);
}
@ -1784,8 +1989,8 @@ wl_iw_parse_data_tlv(char** list_str, void *dst, int dst_size, const char token,
* channel list parsing from cscan tlv list
*/
int
wl_iw_parse_channel_list_tlv(char** list_str, uint16* channel_list, \
int channel_num, int *bytes_left)
wl_iw_parse_channel_list_tlv(char** list_str, uint16* channel_list,
int channel_num, int *bytes_left)
{
char* str = *list_str;
int idx = 0;
@ -1870,7 +2075,7 @@ wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid, int max, int *bytes
/* Get SSID */
if (ssid[idx].SSID_len > *bytes_left) {
DHD_ERROR(("%s out of memory range len=%d but left=%d\n", \
DHD_ERROR(("%s out of memory range len=%d but left=%d\n",
__FUNCTION__, ssid[idx].SSID_len, *bytes_left));
return -1;
}
@ -1880,8 +2085,8 @@ wl_iw_parse_ssid_list_tlv(char** list_str, wlc_ssid_t* ssid, int max, int *bytes
*bytes_left -= ssid[idx].SSID_len;
str += ssid[idx].SSID_len;
DHD_TRACE(("%s :size=%d left=%d\n", (char*)ssid[idx].SSID, \
ssid[idx].SSID_len, *bytes_left));
DHD_TRACE(("%s :size=%d left=%d\n",
(char*)ssid[idx].SSID, ssid[idx].SSID_len, *bytes_left));
}
else {
DHD_ERROR(("### SSID size more that %d\n", str[0]));

View File

@ -20,7 +20,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: dhd_custom_gpio.c,v 1.1.4.7 2010/06/03 21:27:48 Exp $
* $Id: dhd_custom_gpio.c,v 1.1.4.8.4.1 2010/09/02 23:13:16 Exp $
*/
@ -46,11 +46,7 @@ extern void bcm_wlan_power_on(int);
int wifi_set_carddetect(int on);
int wifi_set_power(int on, unsigned long msec);
int wifi_get_irq_number(unsigned long *irq_flags_ptr);
#endif
#if defined(CONFIG_WIFI_CONTROL_FUNC)
int wifi_set_power(int on, unsigned long msec);
int wifi_set_reset(int on, unsigned long msec);
int wifi_get_mac_addr(unsigned char *buf);
#endif
#if defined(OOB_INTR_ONLY)
@ -82,7 +78,7 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
dhd_oob_gpio_num = CUSTOM_OOB_GPIO_NUM;
}
#endif
*irq_flags_ptr = IRQF_TRIGGER_FALLING;
if (dhd_oob_gpio_num < 0) {
WL_ERROR(("%s: ERROR customer specific Host GPIO is NOT defined \n",
__FUNCTION__));
@ -118,10 +114,6 @@ dhd_customer_gpio_wlan_ctrl(int onoff)
#endif /* CUSTOMER_HW */
#ifdef CUSTOMER_HW2
wifi_set_power(0, 0);
#endif
#if defined(CONFIG_WIFI_CONTROL_FUNC)
wifi_set_power(0, 0);
wifi_set_reset(0, 0);
#endif
WL_ERROR(("=========== WLAN placed in RESET ========\n"));
break;
@ -134,10 +126,6 @@ dhd_customer_gpio_wlan_ctrl(int onoff)
#endif /* CUSTOMER_HW */
#ifdef CUSTOMER_HW2
wifi_set_power(1, 0);
#endif
#if defined(CONFIG_WIFI_CONTROL_FUNC)
wifi_set_power(1, 0);
wifi_set_reset(1, 0);
#endif
WL_ERROR(("=========== WLAN going back to live ========\n"));
break;
@ -155,9 +143,9 @@ dhd_customer_gpio_wlan_ctrl(int onoff)
__FUNCTION__));
#ifdef CUSTOMER_HW
bcm_wlan_power_on(1);
#endif /* CUSTOMER_HW */
/* Lets customer power to get stable */
OSL_DELAY(500);
OSL_DELAY(50);
#endif /* CUSTOMER_HW */
break;
}
}
@ -167,11 +155,16 @@ dhd_customer_gpio_wlan_ctrl(int onoff)
int
dhd_custom_get_mac_address(unsigned char *buf)
{
int ret = 0;
WL_TRACE(("%s Enter\n", __FUNCTION__));
if (!buf)
return -EINVAL;
/* Customer access to MAC address stored outside of DHD driver */
#ifdef CUSTOMER_HW2
ret = wifi_get_mac_addr(buf);
#endif
#ifdef EXAMPLE_GET_MAC
/* EXAMPLE code */
@ -181,6 +174,6 @@ dhd_custom_get_mac_address(unsigned char *buf)
}
#endif /* EXAMPLE_GET_MAC */
return 0;
return ret;
}
#endif /* GET_CUSTOM_MAC_ENABLE */

View File

@ -27,10 +27,10 @@
#ifndef _dhd_dbg_
#define _dhd_dbg_
#if 0 || (defined DHD_DEBUG)
#ifdef DHD_DEBUG
#define DHD_ERROR(args) do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
printf args;} while (0)
#define DHD_ERROR(args) do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
printf args;} while (0)
#define DHD_TRACE(args) do {if (dhd_msg_level & DHD_TRACE_VAL) printf args;} while (0)
#define DHD_INFO(args) do {if (dhd_msg_level & DHD_INFO_VAL) printf args;} while (0)
#define DHD_DATA(args) do {if (dhd_msg_level & DHD_DATA_VAL) printf args;} while (0)
@ -58,7 +58,7 @@
#define DHD_BTA_ON() (dhd_msg_level & DHD_BTA_VAL)
#define DHD_ISCAN_ON() (dhd_msg_level & DHD_ISCAN_VAL)
#else /* (defined BCMDBG) || (defined DHD_DEBUG) */
#else /* DHD_DEBUG */
#define DHD_ERROR(args) do {if (net_ratelimit()) printf args;} while (0)
#define DHD_TRACE(args)
@ -87,7 +87,7 @@
#define DHD_EVENT_ON() 0
#define DHD_BTA_ON() 0
#define DHD_ISCAN_ON() 0
#endif
#endif /* DHD_DEBUG */
#define DHD_LOG(args)

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@
#include <wlioctl.h>
#ifndef IOCTL_RESP_TIMEOUT
#define IOCTL_RESP_TIMEOUT 2000 /* In milli second */
#define IOCTL_RESP_TIMEOUT 3000 /* In milli second */
#endif
#ifndef IOCTL_CHIP_ACTIVE_TIMEOUT

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: dhd_sdio.c,v 1.157.2.27.2.33.2.126 2010/06/15 23:38:39 Exp $
* $Id: dhd_sdio.c,v 1.157.2.27.2.33.2.129.4.1 2010/09/02 23:13:16 Exp $
*/
#include <typedefs.h>
@ -36,17 +36,11 @@
#include <bcmutils.h>
#include <bcmendian.h>
#include <bcmdevs.h>
#include <siutils.h>
#include <hndpmu.h>
#include <hndsoc.h>
#ifdef DHD_DEBUG
#include <hndrte_armtrap.h>
#include <hndrte_cons.h>
#endif /* DHD_DEBUG */
#include <sbchipc.h>
#include <sbhnddma.h>
#include <sdio.h>
#include <sbsdio.h>
#include <sbsdpcmdev.h>
@ -64,9 +58,12 @@
#include <dhdioctl.h>
#include <sdiovar.h>
#ifndef DHDSDIO_MEM_DUMP_FNAME
#define DHDSDIO_MEM_DUMP_FNAME "mem_dump"
#endif
#ifdef DHD_DEBUG
#include <hndrte_cons.h>
#endif /* DHD_DEBUG */
#ifdef DHD_DEBUG_TRAP
#include <hndrte_armtrap.h>
#endif /* DHD_DEBUG_TRAP */
#define QLEN 256 /* bulk rx and tx queue lengths */
#define FCHI (QLEN - 10)
@ -127,11 +124,11 @@
/* Bump up limit on waiting for HT to account for first startup;
* if the image is doing a CRC calculation before programming the PMU
* for HT availability, it could take a couple hundred ms more, so
* max out at a half second (500000us).
* max out at a 1 second (1000000us).
*/
#if (PMU_MAX_TRANSITION_DLY <= 500000)
#if (PMU_MAX_TRANSITION_DLY < 1000000)
#undef PMU_MAX_TRANSITION_DLY
#define PMU_MAX_TRANSITION_DLY 500000
#define PMU_MAX_TRANSITION_DLY 1000000
#endif
/* Value for ChipClockCSR during initial setup */
@ -427,10 +424,10 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, void *pkt, uint seq);
static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start);
#endif
#ifdef DHD_DEBUG
#ifdef DHD_DEBUG_TRAP
static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size);
static int dhdsdio_mem_dump(dhd_bus_t *bus);
#endif /* DHD_DEBUG */
#endif /* DHD_DEBUG_TRAP */
static int dhdsdio_download_state(dhd_bus_t *bus, bool enter);
static void dhdsdio_release(dhd_bus_t *bus, osl_t *osh);
@ -551,7 +548,6 @@ dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, devctl, &err);
DHD_INFO(("CLKCTL: set PENDING\n"));
bus->clkstate = CLK_PENDING;
return BCME_OK;
} else if (bus->clkstate == CLK_PENDING) {
/* Cancel CA-only interrupt filter */
@ -1298,7 +1294,6 @@ dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen)
bus->ctrl_frame_stat = FALSE;
ret = dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2, F2SYNC,
frame, len, NULL, NULL, NULL);
ASSERT(ret != BCME_PENDING);
if (ret < 0) {
@ -1372,21 +1367,21 @@ dhd_bus_rxctl(struct dhd_bus *bus, uchar *msg, uint msglen)
__FUNCTION__, rxlen, msglen));
} else if (timeleft == 0) {
DHD_ERROR(("%s: resumed on timeout\n", __FUNCTION__));
#ifdef DHD_DEBUG
#ifdef DHD_DEBUG_TRAP
dhd_os_sdlock(bus->dhd);
dhdsdio_checkdied(bus, NULL, 0);
dhd_os_sdunlock(bus->dhd);
#endif /* DHD_DEBUG */
#endif /* DHD_DEBUG_TRAP */
} else if (pending == TRUE) {
DHD_CTL(("%s: cancelled\n", __FUNCTION__));
return -ERESTARTSYS;
} else {
DHD_CTL(("%s: resumed for unknown reason?\n", __FUNCTION__));
#ifdef DHD_DEBUG
#ifdef DHD_DEBUG_TRAP
dhd_os_sdlock(bus->dhd);
dhdsdio_checkdied(bus, NULL, 0);
dhd_os_sdunlock(bus->dhd);
#endif /* DHD_DEBUG */
#endif /* DHD_DEBUG_TRAP */
}
if (rxlen)
@ -1406,7 +1401,7 @@ enum {
IOV_SDCIS,
IOV_MEMBYTES,
IOV_MEMSIZE,
#ifdef DHD_DEBUG
#ifdef DHD_DEBUG_TRAP
IOV_CHECKDIED,
#endif
IOV_DOWNLOAD,
@ -1459,10 +1454,10 @@ const bcm_iovar_t dhdsdio_iovars[] = {
{"rxbound", IOV_RXBOUND, 0, IOVT_UINT32, 0 },
{"txminmax", IOV_TXMINMAX, 0, IOVT_UINT32, 0 },
{"cpu", IOV_CPU, 0, IOVT_BOOL, 0 },
#ifdef DHD_DEBUG
{"checkdied", IOV_CHECKDIED, 0, IOVT_BUFFER, 0 },
#endif /* DHD_DEBUG */
#endif /* DHD_DEBUG */
#ifdef DHD_DEBUG_TRAP
{"checkdied", IOV_CHECKDIED, 0, IOVT_BUFFER, 0 },
#endif /* DHD_DEBUG_TRAP */
#ifdef SDTEST
{"extloop", IOV_EXTLOOP, 0, IOVT_BOOL, 0 },
{"pktgen", IOV_PKTGEN, 0, IOVT_BUFFER, sizeof(dhd_pktgen_t) },
@ -1691,7 +1686,7 @@ dhdsdio_membytes(dhd_bus_t *bus, bool write, uint32 address, uint8 *data, uint s
return bcmerror;
}
#ifdef DHD_DEBUG
#ifdef DHD_DEBUG_TRAP
static int
dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh)
{
@ -1844,12 +1839,10 @@ dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size)
DHD_ERROR(("%s: %s\n", __FUNCTION__, strbuf.origbuf));
}
#ifdef DHD_DEBUG
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
/* Mem dump to a file on device */
dhdsdio_mem_dump(bus);
/* Mem dump to a file on device */
dhdsdio_mem_dump(bus);
}
#endif /* DHD_DEBUG */
done:
if (mbuffer)
@ -1900,17 +1893,22 @@ dhdsdio_mem_dump(dhd_bus_t *bus)
}
printf("Done\n");
#ifdef DHD_DEBUG
/* free buf before return !!! */
if (write_to_file(bus->dhd, buf, bus->ramsize))
{
printf("%s: Error writing to files\n", __FUNCTION__);
return -1;
}
/* buf free handled in write_to_file, not here */
#else
MFREE(bus->dhd->osh, buf, size);
#endif
return 0;
}
#endif /* DHD_DEBUG_TRAP */
#ifdef DHD_DEBUG
#define CONSOLE_LINE_MAX 192
static int
@ -4228,6 +4226,9 @@ dhdsdio_dpc(dhd_bus_t *bus)
DHD_INTR(("%s: enable SDIO interrupts, rxdone %d framecnt %d\n",
__FUNCTION__, rxdone, framecnt));
bus->intdis = FALSE;
#if defined(OOB_INTR_ONLY)
bcmsdh_oob_intr_set(1);
#endif /* (OOB_INTR_ONLY) */
bcmsdh_intr_enable(sdh);
}
@ -4362,13 +4363,14 @@ dhdsdio_isr(void *arg)
#if defined(SDIO_ISR_THREAD)
DHD_TRACE(("Calling dhdsdio_dpc() from %s\n", __FUNCTION__));
dhd_os_wake_lock(bus->dhd);
while (dhdsdio_dpc(bus));
dhd_os_wake_unlock(bus->dhd);
#else
bus->dpc_sched = TRUE;
dhd_sched_dpc(bus->dhd);
#endif
}
#ifdef SDTEST
@ -4695,8 +4697,6 @@ dhd_bus_watchdog(dhd_pub_t *dhdp)
bus->idlecount = 0;
if (bus->activity) {
bus->activity = FALSE;
dhd_os_wd_timer(bus->dhd,dhd_watchdog_ms);
} else {
dhdsdio_clkctl(bus, CLK_NONE, FALSE);
}
}
@ -4955,12 +4955,15 @@ dhdsdio_probe(uint16 venid, uint16 devid, uint16 bus_no, uint16 slot,
/* if firmware path present try to download and bring up bus */
if ((ret = dhd_bus_start(bus->dhd)) != 0) {
#if 1
DHD_ERROR(("%s: failed\n", __FUNCTION__));
goto fail;
#else
if (ret == BCME_NOTUP) {
DHD_ERROR(("%s: dongle is not responding\n", __FUNCTION__));
goto fail;
}
#endif
}
/* Ok, have the per-port tell the stack we're open for business */
if (dhd_net_attach(bus->dhd, 0) != 0) {
@ -5261,7 +5264,6 @@ dhd_bus_download_firmware(struct dhd_bus *bus, osl_t *osh,
ret = dhdsdio_download_firmware(bus, osh, bus->sdh);
return ret;
}
@ -5271,12 +5273,13 @@ dhdsdio_download_firmware(struct dhd_bus *bus, osl_t *osh, void *sdh)
bool ret;
/* Download the firmware */
dhd_os_wake_lock(bus->dhd);
dhdsdio_clkctl(bus, CLK_AVAIL, FALSE);
ret = _dhdsdio_download_firmware(bus) == 0;
dhdsdio_clkctl(bus, CLK_SDONLY, FALSE);
dhd_os_wake_unlock(bus->dhd);
return ret;
}
@ -5805,6 +5808,8 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
dhd_os_proto_unblock(dhdp);
/* Expect app to have torn down any connection before calling */
/* Stop the bus, disable F2 */
dhd_os_sdlock(dhdp);
dhd_bus_stop(bus, FALSE);
/* Clean tx/rx buffer pointers, detach from the dongle */
@ -5813,6 +5818,8 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
bus->dhd->dongle_reset = TRUE;
bus->dhd->up = FALSE;
dhd_os_sdunlock(dhdp);
DHD_TRACE(("%s: WLAN OFF DONE\n", __FUNCTION__));
/* App can now remove power from device */
} else
@ -5824,6 +5831,8 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
if (bus->dhd->dongle_reset) {
/* Turn on WLAN */
dhd_os_sdlock(dhdp);
/* Reset SD client */
bcmsdh_reset(bus->sdh);
@ -5855,6 +5864,7 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
bcmerror = BCME_SDIO_ERROR;
} else
bcmerror = BCME_SDIO_ERROR;
dhd_os_sdunlock(dhdp);
} else {
bcmerror = BCME_NOTDOWN;
DHD_ERROR(("%s: Set DEVRESET=FALSE invoked when device is on\n",

View File

@ -29,7 +29,6 @@
#define STATIC static
#define SI_BUS 0
#define PCI_BUS 1
#define PCMCIA_BUS 2

View File

@ -28,7 +28,7 @@
#define __BCMSDH_SDMMC_H__
#define sd_err(x)
#define sd_trace(x)
#define sd_trace(x)
#define sd_info(x)
#define sd_debug(x)
#define sd_data(x)

View File

@ -0,0 +1,134 @@
/*
* SD-SPI Protocol Conversion - BCMSDH->gSPI Translation Layer
*
* Copyright (C) 2010, Broadcom Corporation
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
* the contents of this file may not be disclosed to third parties, copied
* or duplicated in any form, in whole or in part, without the prior
* written permission of Broadcom Corporation.
*
* $Id: bcmspibrcm.h,v 1.4.4.1.4.3.6.1 2008/09/27 17:03:25 Exp $
*/
/* global msglevel for debug messages - bitvals come from sdiovar.h */
#define sd_err(x)
#define sd_trace(x)
#define sd_info(x)
#define sd_debug(x)
#define sd_data(x)
#define sd_ctrl(x)
#define sd_log(x)
#define SDIOH_ASSERT(exp) \
do { if (!(exp)) \
printf("!!!ASSERT fail: file %s lines %d", __FILE__, __LINE__); \
} while (0)
#define BLOCK_SIZE_F1 64
#define BLOCK_SIZE_F2 2048
#define BLOCK_SIZE_F3 2048
/* internal return code */
#define SUCCESS 0
#undef ERROR
#define ERROR 1
#define ERROR_UF 2
#define ERROR_OF 3
/* private bus modes */
#define SDIOH_MODE_SPI 0
#define USE_BLOCKMODE 0x2 /* Block mode can be single block or multi */
#define USE_MULTIBLOCK 0x4
struct sdioh_info {
uint cfg_bar; /* pci cfg address for bar */
uint32 caps; /* cached value of capabilities reg */
void *bar0; /* BAR0 for PCI Device */
osl_t *osh; /* osh handler */
void *controller; /* Pointer to SPI Controller's private data struct */
uint lockcount; /* nest count of spi_lock() calls */
bool client_intr_enabled; /* interrupt connnected flag */
bool intr_handler_valid; /* client driver interrupt handler valid */
sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
void *intr_handler_arg; /* argument to call interrupt handler */
bool initialized; /* card initialized */
uint32 target_dev; /* Target device ID */
uint32 intmask; /* Current active interrupts */
void *sdos_info; /* Pointer to per-OS private data */
uint32 controller_type; /* Host controller type */
uint8 version; /* Host Controller Spec Compliance Version */
uint irq; /* Client irq */
uint32 intrcount; /* Client interrupts */
uint32 local_intrcount; /* Controller interrupts */
bool host_init_done; /* Controller initted */
bool card_init_done; /* Client SDIO interface initted */
bool polled_mode; /* polling for command completion */
bool sd_use_dma; /* DMA on CMD53 */
bool sd_blockmode; /* sd_blockmode == FALSE => 64 Byte Cmd 53s. */
/* Must be on for sd_multiblock to be effective */
bool use_client_ints; /* If this is false, make sure to restore */
/* polling hack in wl_linux.c:wl_timer() */
int adapter_slot; /* Maybe dealing with multiple slots/controllers */
int sd_mode; /* SD1/SD4/SPI */
int client_block_size[SPI_MAX_IOFUNCS]; /* Blocksize */
uint32 data_xfer_count; /* Current transfer */
uint16 card_rca; /* Current Address */
uint8 num_funcs; /* Supported funcs on client */
uint32 card_dstatus; /* 32bit device status */
uint32 com_cis_ptr;
uint32 func_cis_ptr[SPI_MAX_IOFUNCS];
void *dma_buf;
ulong dma_phys;
int r_cnt; /* rx count */
int t_cnt; /* tx_count */
uint32 wordlen; /* host processor 16/32bits */
uint32 prev_fun;
uint32 chip;
uint32 chiprev;
bool resp_delay_all;
bool dwordmode;
struct spierrstats_t spierrstats;
};
/************************************************************
* Internal interfaces: per-port references into bcmspibrcm.c
*/
/* Global message bits */
extern uint sd_msglevel;
/**************************************************************
* Internal interfaces: bcmspibrcm.c references to per-port code
*/
/* Interrupt (de)registration routines */
extern int spi_register_irq(sdioh_info_t *sd, uint irq);
extern void spi_free_irq(uint irq, sdioh_info_t *sd);
/* OS-specific interrupt wrappers (atomic interrupt enable/disable) */
extern void spi_lock(sdioh_info_t *sd);
extern void spi_unlock(sdioh_info_t *sd);
/* Allocate/init/free per-OS private data */
extern int spi_osinit(sdioh_info_t *sd);
extern void spi_osfree(sdioh_info_t *sd);
#define SPI_RW_FLAG_M BITFIELD_MASK(1) /* Bit [31] - R/W Command Bit */
#define SPI_RW_FLAG_S 31
#define SPI_ACCESS_M BITFIELD_MASK(1) /* Bit [30] - Fixed/Incr Access */
#define SPI_ACCESS_S 30
#define SPI_FUNCTION_M BITFIELD_MASK(2) /* Bit [29:28] - Function Number */
#define SPI_FUNCTION_S 28
#define SPI_REG_ADDR_M BITFIELD_MASK(17) /* Bit [27:11] - Address */
#define SPI_REG_ADDR_S 11
#define SPI_LEN_M BITFIELD_MASK(11) /* Bit [10:0] - Packet length */
#define SPI_LEN_S 0

View File

@ -31,18 +31,18 @@
#define EPI_MINOR_VERSION 218
#define EPI_RC_NUMBER 245
#define EPI_RC_NUMBER 248
#define EPI_INCREMENTAL_NUMBER 0
#define EPI_INCREMENTAL_NUMBER 6
#define EPI_BUILD_NUMBER 0
#define EPI_VERSION 4, 218, 245, 0
#define EPI_VERSION 4, 218, 248, 6
#define EPI_VERSION_NUM 0x04daf500
#define EPI_VERSION_NUM 0x04daf806
#define EPI_VERSION_STR "4.218.245.0"
#define EPI_ROUTER_VERSION_STR "4.219.245.0"
#define EPI_VERSION_STR "4.218.248.6"
#define EPI_ROUTER_VERSION_STR "4.219.248.6"
#endif

View File

@ -32,13 +32,9 @@
#include <linux/version.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0))
#include <linux/config.h>
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 33))
#include <generated/autoconf.h>
#else
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 33))
#include <linux/autoconf.h>
#endif
#endif
#include <linux/module.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0))
@ -70,6 +66,7 @@
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/semaphore.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28))
#undef IP_TOS
#endif
@ -429,22 +426,11 @@ pci_restore_state(struct pci_dev *dev, u32 *buffer)
#define CHECKSUM_HW CHECKSUM_PARTIAL
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31))
#define KILL_PROC(nr, sig) \
{ \
struct task_struct *tsk; \
struct pid *pid; \
pid = find_get_pid((pid_t)nr); \
tsk = pid_task(pid, PIDTYPE_PID); \
if (tsk) send_sig(sig, tsk, 1); \
}
#else
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (LINUX_VERSION_CODE <= \
KERNEL_VERSION(2, 6, 30))
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
#define KILL_PROC(pid, sig) \
{ \
struct task_struct *tsk; \
tsk = find_task_by_vpid(pid); \
tsk = pid_task(find_vpid(pid), PIDTYPE_PID); \
if (tsk) send_sig(sig, tsk, 1); \
}
#else
@ -453,7 +439,6 @@ if (tsk) send_sig(sig, tsk, 1); \
kill_proc(pid, sig, 1); \
}
#endif
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0))
#define netdev_priv(dev) dev->priv

View File

@ -1001,7 +1001,6 @@ typedef volatile struct {
#define CST4315_CBUCK_MODE_BURST 0x00000400
#define CST4315_CBUCK_MODE_LPBURST 0x00000c00
#define PMU_MAX_TRANSITION_DLY 15000

View File

@ -0,0 +1,153 @@
/*
* SPI device spec header file
*
* Copyright (C) 2010, Broadcom Corporation
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Broadcom Corporation;
* the contents of this file may not be disclosed to third parties, copied
* or duplicated in any form, in whole or in part, without the prior
* written permission of Broadcom Corporation.
*
* $Id: spid.h,v 1.7.10.1.16.3 2009/04/09 19:23:14 Exp $
*/
#ifndef _SPI_H
#define _SPI_H
/*
* Brcm SPI Device Register Map.
*
*/
typedef volatile struct {
uint8 config; /* 0x00, len, endian, clock, speed, polarity, wakeup */
uint8 response_delay; /* 0x01, read response delay in bytes (corerev < 3) */
uint8 status_enable; /* 0x02, status-enable, intr with status, response_delay
* function selection, command/data error check
*/
uint8 reset_bp; /* 0x03, reset on wlan/bt backplane reset (corerev >= 1) */
uint16 intr_reg; /* 0x04, Intr status register */
uint16 intr_en_reg; /* 0x06, Intr mask register */
uint32 status_reg; /* 0x08, RO, Status bits of last spi transfer */
uint16 f1_info_reg; /* 0x0c, RO, enabled, ready for data transfer, blocksize */
uint16 f2_info_reg; /* 0x0e, RO, enabled, ready for data transfer, blocksize */
uint16 f3_info_reg; /* 0x10, RO, enabled, ready for data transfer, blocksize */
uint32 test_read; /* 0x14, RO 0xfeedbead signature */
uint32 test_rw; /* 0x18, RW */
uint8 resp_delay_f0; /* 0x1c, read resp delay bytes for F0 (corerev >= 3) */
uint8 resp_delay_f1; /* 0x1d, read resp delay bytes for F1 (corerev >= 3) */
uint8 resp_delay_f2; /* 0x1e, read resp delay bytes for F2 (corerev >= 3) */
uint8 resp_delay_f3; /* 0x1f, read resp delay bytes for F3 (corerev >= 3) */
} spi_regs_t;
/* SPI device register offsets */
#define SPID_CONFIG 0x00
#define SPID_RESPONSE_DELAY 0x01
#define SPID_STATUS_ENABLE 0x02
#define SPID_RESET_BP 0x03 /* (corerev >= 1) */
#define SPID_INTR_REG 0x04 /* 16 bits - Interrupt status */
#define SPID_INTR_EN_REG 0x06 /* 16 bits - Interrupt mask */
#define SPID_STATUS_REG 0x08 /* 32 bits */
#define SPID_F1_INFO_REG 0x0C /* 16 bits */
#define SPID_F2_INFO_REG 0x0E /* 16 bits */
#define SPID_F3_INFO_REG 0x10 /* 16 bits */
#define SPID_TEST_READ 0x14 /* 32 bits */
#define SPID_TEST_RW 0x18 /* 32 bits */
#define SPID_RESP_DELAY_F0 0x1c /* 8 bits (corerev >= 3) */
#define SPID_RESP_DELAY_F1 0x1d /* 8 bits (corerev >= 3) */
#define SPID_RESP_DELAY_F2 0x1e /* 8 bits (corerev >= 3) */
#define SPID_RESP_DELAY_F3 0x1f /* 8 bits (corerev >= 3) */
/* Bit masks for SPID_CONFIG device register */
#define WORD_LENGTH_32 0x1 /* 0/1 16/32 bit word length */
#define ENDIAN_BIG 0x2 /* 0/1 Little/Big Endian */
#define CLOCK_PHASE 0x4 /* 0/1 clock phase delay */
#define CLOCK_POLARITY 0x8 /* 0/1 Idle state clock polarity is low/high */
#define HIGH_SPEED_MODE 0x10 /* 1/0 High Speed mode / Normal mode */
#define INTR_POLARITY 0x20 /* 1/0 Interrupt active polarity is high/low */
#define WAKE_UP 0x80 /* 0/1 Wake-up command from Host to WLAN */
/* Bit mask for SPID_RESPONSE_DELAY device register */
#define RESPONSE_DELAY_MASK 0xFF /* Configurable rd response delay in multiples of 8 bits */
/* Bit mask for SPID_STATUS_ENABLE device register */
#define STATUS_ENABLE 0x1 /* 1/0 Status sent/not sent to host after read/write */
#define INTR_WITH_STATUS 0x2 /* 0/1 Do-not / do-interrupt if status is sent */
#define RESP_DELAY_ALL 0x4 /* Applicability of resp delay to F1 or all func's read */
#define DWORD_PKT_LEN_EN 0x8 /* Packet len denoted in dwords instead of bytes */
#define CMD_ERR_CHK_EN 0x20 /* Command error check enable */
#define DATA_ERR_CHK_EN 0x40 /* Data error check enable */
/* Bit mask for SPID_RESET_BP device register */
#define RESET_ON_WLAN_BP_RESET 0x4 /* enable reset for WLAN backplane */
#define RESET_ON_BT_BP_RESET 0x8 /* enable reset for BT backplane */
#define RESET_SPI 0x80 /* reset the above enabled logic */
/* Bit mask for SPID_INTR_REG device register */
#define DATA_UNAVAILABLE 0x0001 /* Requested data not available; Clear by writing a "1" */
#define F2_F3_FIFO_RD_UNDERFLOW 0x0002
#define F2_F3_FIFO_WR_OVERFLOW 0x0004
#define COMMAND_ERROR 0x0008 /* Cleared by writing 1 */
#define DATA_ERROR 0x0010 /* Cleared by writing 1 */
#define F2_PACKET_AVAILABLE 0x0020
#define F3_PACKET_AVAILABLE 0x0040
#define F1_OVERFLOW 0x0080 /* Due to last write. Bkplane has pending write requests */
#define MISC_INTR0 0x0100
#define MISC_INTR1 0x0200
#define MISC_INTR2 0x0400
#define MISC_INTR3 0x0800
#define MISC_INTR4 0x1000
#define F1_INTR 0x2000
#define F2_INTR 0x4000
#define F3_INTR 0x8000
/* Bit mask for 32bit SPID_STATUS_REG device register */
#define STATUS_DATA_NOT_AVAILABLE 0x00000001
#define STATUS_UNDERFLOW 0x00000002
#define STATUS_OVERFLOW 0x00000004
#define STATUS_F2_INTR 0x00000008
#define STATUS_F3_INTR 0x00000010
#define STATUS_F2_RX_READY 0x00000020
#define STATUS_F3_RX_READY 0x00000040
#define STATUS_HOST_CMD_DATA_ERR 0x00000080
#define STATUS_F2_PKT_AVAILABLE 0x00000100
#define STATUS_F2_PKT_LEN_MASK 0x000FFE00
#define STATUS_F2_PKT_LEN_SHIFT 9
#define STATUS_F3_PKT_AVAILABLE 0x00100000
#define STATUS_F3_PKT_LEN_MASK 0xFFE00000
#define STATUS_F3_PKT_LEN_SHIFT 21
/* Bit mask for 16 bits SPID_F1_INFO_REG device register */
#define F1_ENABLED 0x0001
#define F1_RDY_FOR_DATA_TRANSFER 0x0002
#define F1_MAX_PKT_SIZE 0x01FC
/* Bit mask for 16 bits SPID_F2_INFO_REG device register */
#define F2_ENABLED 0x0001
#define F2_RDY_FOR_DATA_TRANSFER 0x0002
#define F2_MAX_PKT_SIZE 0x3FFC
/* Bit mask for 16 bits SPID_F3_INFO_REG device register */
#define F3_ENABLED 0x0001
#define F3_RDY_FOR_DATA_TRANSFER 0x0002
#define F3_MAX_PKT_SIZE 0x3FFC
/* Bit mask for 32 bits SPID_TEST_READ device register read in 16bit LE mode */
#define TEST_RO_DATA_32BIT_LE 0xFEEDBEAD
/* Maximum number of I/O funcs */
#define SPI_MAX_IOFUNCS 4
#define SPI_MAX_PKT_LEN (2048*4)
/* Misc defines */
#define SPI_FUNC_0 0
#define SPI_FUNC_1 1
#define SPI_FUNC_2 2
#define SPI_FUNC_3 3
#define WAIT_F2RXFIFORDY 100
#define WAIT_F2RXFIFORDY_DELAY 20
#endif /* _SPI_H */

View File

@ -24,7 +24,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: wlioctl.h,v 1.601.4.15.2.14.2.61 2010/05/04 20:26:25 Exp $
* $Id: wlioctl.h,v 1.601.4.15.2.14.2.62 2010/08/19 01:20:12 Exp $
*/
@ -1317,6 +1317,8 @@ enum {
#define PFN_VERSION 1
#define MAX_PFN_LIST_COUNT 16
typedef struct wl_pfn_param {
int32 version;

View File

@ -26,9 +26,7 @@
#define LINUX_OSL
#if defined(CHROMIUMOS_COMPAT_WIRELESS)
#include <linux/sched.h>
#endif
#include <typedefs.h>
#include <bcmendian.h>
#include <linuxver.h>
@ -153,8 +151,10 @@ osl_t *
osl_attach(void *pdev, uint bustype, bool pkttag)
{
osl_t *osh;
gfp_t flags;
osh = kmalloc(sizeof(osl_t), GFP_ATOMIC);
flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
osh = kmalloc(sizeof(osl_t), flags);
ASSERT(osh);
bzero(osh, sizeof(osl_t));
@ -195,9 +195,9 @@ osl_attach(void *pdev, uint bustype, bool pkttag)
STATIC_BUF_TOTAL_LEN))) {
printk("can not alloc static buf!\n");
}
else
printk("alloc static buf at %x!\n", (unsigned int)bcm_static_buf);
else {
/* printk("alloc static buf at %x!\n", (unsigned int)bcm_static_buf); */
}
init_MUTEX(&bcm_static_buf->static_sem);
@ -455,8 +455,8 @@ void*
osl_malloc(osl_t *osh, uint size)
{
void *addr;
gfp_t flags;
if (osh)
ASSERT(osh->magic == OS_HANDLE_MAGIC);
@ -493,8 +493,8 @@ osl_malloc(osl_t *osh, uint size)
}
original:
#endif
if ((addr = kmalloc(size, GFP_ATOMIC)) == NULL) {
flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
if ((addr = kmalloc(size, flags)) == NULL) {
if (osh)
osh->failed++;
return (NULL);
@ -606,8 +606,10 @@ void *
osl_pktdup(osl_t *osh, void *skb)
{
void * p;
gfp_t flags;
if ((p = skb_clone((struct sk_buff*)skb, GFP_ATOMIC)) == NULL)
flags = (in_atomic()) ? GFP_ATOMIC : GFP_KERNEL;
if ((p = skb_clone((struct sk_buff*)skb, flags)) == NULL)
return NULL;

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
* $Id: wl_iw.h,v 1.5.34.1.6.24 2010/07/27 20:46:02 Exp $
* $Id: wl_iw.h,v 1.5.34.1.6.36.4.1 2010/09/10 19:24:30 Exp $
*/
@ -43,29 +43,41 @@
#define GET_HOME_DWELL "HOME="
#define GET_SCAN_TYPE "TYPE="
#define BAND_GET_CMD "BANDGET"
#define BAND_SET_CMD "BANDSET"
#define BAND_GET_CMD "GETBAND"
#define BAND_SET_CMD "SETBAND"
#define DTIM_SKIP_GET_CMD "DTIMSKIPGET"
#define DTIM_SKIP_SET_CMD "DTIMSKIPSET"
#define SETSUSPEND_CMD "SETSUSPENDOPT"
#define PNOSSIDCLR_SET_CMD "PNOSSIDCLR"
#define PNOSETUP_SET_CMD "PNOSETUP "
#define PNOENABLE_SET_CMD "PNOFORCE"
#define PNODEBUG_SET_CMD "PNODEBUG"
#define SOFTAP 1
#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
#define WL_IW_RSSI_MINVAL -200
#define WL_IW_RSSI_NO_SIGNAL -91
#define WL_IW_RSSI_VERY_LOW -80
#define WL_IW_RSSI_LOW -70
#define WL_IW_RSSI_GOOD -68
#define WL_IW_RSSI_VERY_GOOD -58
#define WL_IW_RSSI_EXCELLENT -57
#define WL_IW_RSSI_INVALID 0
#define MAX_WX_STRING 80
#define isprint(c) bcm_isprint(c)
typedef struct wl_iw_extra_params {
int target_channel;
} wl_iw_extra_params_t;
#define WL_IW_RSSI_MINVAL -200
#define WL_IW_RSSI_NO_SIGNAL -91
#define WL_IW_RSSI_VERY_LOW -80
#define WL_IW_RSSI_LOW -70
#define WL_IW_RSSI_GOOD -68
#define WL_IW_RSSI_VERY_GOOD -58
#define WL_IW_RSSI_EXCELLENT -57
#define WL_IW_RSSI_INVALID 0
#define MAX_WX_STRING 80
#define isprint(c) bcm_isprint(c)
#define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
#define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
#define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
#define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
#define WL_IW_GET_LINK_SPEED (SIOCIWFIRSTPRIV+7)
#define WL_IW_GET_CURR_MACADDR (SIOCIWFIRSTPRIV+9)
#define WL_IW_SET_STOP (SIOCIWFIRSTPRIV+11)
#define WL_IW_SET_START (SIOCIWFIRSTPRIV+13)
#define WL_IW_SET_STOP (SIOCIWFIRSTPRIV+11)
#define WL_IW_SET_START (SIOCIWFIRSTPRIV+13)
#define WL_SET_AP_CFG (SIOCIWFIRSTPRIV+15)
@ -75,12 +87,12 @@
#define AP_LPB_CMD (SIOCIWFIRSTPRIV+23)
#define WL_AP_STOP (SIOCIWFIRSTPRIV+25)
#define WL_FW_RELOAD (SIOCIWFIRSTPRIV+27)
#define WL_COMBO_SCAN (SIOCIWFIRSTPRIV+29)
#define WL_COMBO_SCAN (SIOCIWFIRSTPRIV+29)
#define WL_AP_SPARE3 (SIOCIWFIRSTPRIV+31)
#define G_SCAN_RESULTS 8*1024
#define WE_ADD_EVENT_FIX 0x80
#define G_WLAN_SET_ON 0
#define G_WLAN_SET_OFF 1
#define G_SCAN_RESULTS (8*1024)
#define WE_ADD_EVENT_FIX 0x80
#define G_WLAN_SET_ON 0
#define G_WLAN_SET_OFF 1
#define CHECK_EXTRA_FOR_NULL(extra) \
if (!extra) { \
@ -94,9 +106,9 @@ typedef struct wl_iw {
struct iw_statistics wstats;
int spy_num;
uint32 pwsec;
uint32 gwsec;
bool privacy_invoked;
uint32 pwsec;
uint32 gwsec;
bool privacy_invoked;
struct ether_addr spy_addr[IW_MAX_SPY];
struct iw_quality spy_qual[IW_MAX_SPY];
@ -104,19 +116,19 @@ typedef struct wl_iw {
dhd_pub_t * pub;
} wl_iw_t;
int wl_control_wl_start(struct net_device *dev);
#define WLC_IW_SS_CACHE_MAXLEN 512
#define WLC_IW_SS_CACHE_CTRL_FIELD_MAXLEN 32
#define WLC_IW_BSS_INFO_MAXLEN \
(WLC_IW_SS_CACHE_MAXLEN - WLC_IW_SS_CACHE_CTRL_FIELD_MAXLEN)
typedef struct wl_iw_ss_cache {
struct wl_iw_ss_cache *next;
uint32 buflen;
uint32 version;
uint32 count;
int dirty;
wl_bss_info_t bss_info[1];
char dummy[WLC_IW_BSS_INFO_MAXLEN - sizeof(wl_bss_info_t)];
int dirty;
struct wl_iw_ss_cache *next;
} wl_iw_ss_cache_t;
typedef struct wl_iw_ss_cache_ctrl {
@ -143,36 +155,48 @@ struct ap_profile {
uint8 ssid[SSID_LEN];
uint8 sec[SEC_LEN];
uint8 key[KEY_LEN];
uint32 channel;
uint32 channel;
uint32 preamble;
uint32 max_scb;
uint32 max_scb;
};
#define MACLIST_MODE_DISABLED 0
#define MACLIST_MODE_ENABLED 1
#define MACLIST_MODE_ALLOW 2
#define MACLIST_MODE_ALLOW 2
struct mflist {
uint count;
struct ether_addr ea[16];
};
struct mac_list_set {
uint32 mode;
struct mflist white_list;
struct mflist black_list;
};
#endif
#endif
#if WIRELESS_EXT > 12
#include <net/iw_handler.h>
extern const struct iw_handler_def wl_iw_handler_def;
#endif
#endif
extern int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
extern void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void* data);
extern int wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats);
int wl_iw_attach(struct net_device *dev, void * dhdp);
void wl_iw_detach(void);
int wl_control_wl_start(struct net_device *dev);
extern int net_os_wake_lock(struct net_device *dev);
extern int net_os_wake_unlock(struct net_device *dev);
extern int net_os_wake_lock_timeout(struct net_device *dev);
extern int net_os_wake_lock_timeout_enable(struct net_device *dev);
extern int net_os_set_suspend_disable(struct net_device *dev, int val);
extern int net_os_set_suspend(struct net_device *dev, int val);
extern int net_os_set_dtim_skip(struct net_device *dev, int val);
extern int net_os_set_packet_filter(struct net_device *dev, int val);
extern int net_os_send_hang_message(struct net_device *dev);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
#define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \
@ -190,6 +214,31 @@ void wl_iw_detach(void);
iwe_stream_add_point(stream, ends, iwe, extra)
#endif
extern int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled);
extern int dhd_pno_clean(dhd_pub_t *dhd);
extern int dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t* ssids_local, int nssid, ushort scan_fr);
extern int dhd_pno_get_status(dhd_pub_t *dhd);
extern int dhd_dev_pno_reset(struct net_device *dev);
extern int dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t* ssids_local, \
int nssid, ushort scan_fr);
extern int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled);
extern int dhd_dev_get_pno_status(struct net_device *dev);
#define PNO_TLV_PREFIX 'S'
#define PNO_TLV_VERSION 1
#define PNO_TLV_SUBVERSION 1
#define PNO_TLV_RESERVED 0
#define PNO_TLV_TYPE_SSID_IE 'S'
#define PNO_TLV_TYPE_TIME 'T'
#define PNO_EVENT_UP "PNO_EVENT"
typedef struct cmd_tlv {
char prefix;
char version;
char subver;
char reserved;
} cmd_tlv_t;
#if defined(CSCAN)
typedef struct cscan_tlv {
@ -203,13 +252,13 @@ typedef struct cscan_tlv {
#define CSCAN_TLV_PREFIX 'S'
#define CSCAN_TLV_VERSION 1
#define CSCAN_TLV_SUBVERSION 0
#define CSCAN_TLV_TYPE_SSID_IE 'S'
#define CSCAN_TLV_TYPE_CHANNEL_IE 'C'
#define CSCAN_TLV_TYPE_NPROBE_IE 'N'
#define CSCAN_TLV_TYPE_ACTIVE_IE 'A'
#define CSCAN_TLV_TYPE_PASSIVE_IE 'P'
#define CSCAN_TLV_TYPE_HOME_IE 'H'
#define CSCAN_TLV_TYPE_STYPE_IE 'T'
#define CSCAN_TLV_TYPE_SSID_IE 'S'
#define CSCAN_TLV_TYPE_CHANNEL_IE 'C'
#define CSCAN_TLV_TYPE_NPROBE_IE 'N'
#define CSCAN_TLV_TYPE_ACTIVE_IE 'A'
#define CSCAN_TLV_TYPE_PASSIVE_IE 'P'
#define CSCAN_TLV_TYPE_HOME_IE 'H'
#define CSCAN_TLV_TYPE_STYPE_IE 'T'
extern int wl_iw_parse_channel_list_tlv(char** list_str, uint16* channel_list, \
int channel_num, int *bytes_left);