Skip to content

Commit

Permalink
Revert "Update bcmdhd to that found in codeaurora's ics-chocolate bra…
Browse files Browse the repository at this point in the history
…nch"

This reverts commit 1c40aba.
  • Loading branch information
Chad0989 authored and Snuzzo committed Dec 30, 2012
1 parent cae66c5 commit 9d2caf2
Show file tree
Hide file tree
Showing 104 changed files with 10,693 additions and 4,932 deletions.
12 changes: 3 additions & 9 deletions drivers/net/wireless/bcmdhd/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
config BCMDHD
tristate "Broadcom 4329/30 wireless cards support"
depends on MMC
select WIRELESS_EXT
select WEXT_PRIV
---help---
This module adds support for wireless adapters based on
Broadcom 4329/30 chipset.
Expand All @@ -20,14 +22,6 @@ config BCMDHD_FW_PATH
config BCMDHD_NVRAM_PATH
depends on BCMDHD
string "NVRAM path"
default "/system/etc/wifi/bcmdhd.cal"
default "/proc/calibration"
---help---
Path to the calibration file.

config BCMDHD_WEXT
bool "Enable WEXT support"
depends on BCMDHD && CFG80211 = n
select WIRELESS_EXT
select WEXT_PRIV
help
Enables WEXT support
68 changes: 48 additions & 20 deletions drivers/net/wireless/bcmdhd/Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,59 @@
# bcmdhd
DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \
-DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DWLBTAMP -DBCMFILEIMAGE \
-DDHDTHREAD -DDHD_GPL -DDHD_SCHED -DDHD_DEBUG -DSDTEST -DBDC -DTOE \
-DDHD_BCMEVENTS -DSHOW_EVENTS -DDONGLEOVERLAYS -DBCMDBG \
-DCUSTOMER_HW2 -DCUSTOM_OOB_GPIO_NUM=2 -DOOB_INTR_ONLY -DHW_OOB \
-DMMC_SDIO_ABORT -DBCMSDIO -DBCMLXSDMMC -DBCMPLATFORM_BUS -DWLP2P \
-DNEW_COMPAT_WIRELESS -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT \
-DKEEP_ALIVE -DCSCAN -DGET_CUSTOM_MAC_ENABLE -DPKT_FILTER_SUPPORT \
-DEMBEDDED_PLATFORM -DENABLE_INSMOD_NO_FW_LOAD -DPNO_SUPPORT \

#bcm4330

#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 -DSDIO_ISR_THREAD \
-DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT \
-DKEEP_ALIVE -DCONFIG_FIRST_SCAN -DAP_ONLY -DCUSTOM_OOB_GPIO_NUM=299 \
-DOOB_INTR_ONLY -DMMC_SDIO_ABORT \
-I/home/takara/work/HTC/bcm4330b1 -I/home/takara/work/HTC/bcm4330b1/include
#-DPNO_SUPPORT -DCSCAN -DSET_RANDOM_MAC_SOFTAP -DGET_CUSTOM_MAC_ENABLE


DHDCFLAGS = -DLINUX -DBCMDRIVER -DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 \
-DBCMFILEIMAGE -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64 \
-DDHD_FIRSTREAD=64 -DDHDTHREAD -DDHD_GPL -DDHD_SCHED -DBDC \
-DTOE -DDHD_BCMEVENTS -DSHOW_EVENTS -DDONGLEOVERLAYS -DOEM_ANDROID \
-DBCMDBG -DDHD_USE_STATIC_BUF -DCONFIG_FIRST_SCAN -DAP_ONLY \
-DCUSTOM_OOB_GPIO_NUM=46 -DOOB_INTR_ONLY -DMMC_SDIO_ABORT -DEMBEDDED_PLATFORM -DCUSTOMER_HW2 -DDHD_PRINT_DEBUG \
-DPNO_SUPPORT -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC -DBCMPLATFORM_BUS -DWIFI_ACT_FRAME -DKEEP_ALIVE \
-DCSCAN -DBCM4329_LOW_POWER -DBCMWAPI_WAI -DBCMWAPI_WPI -DHTC_KlocWork -DWL_CFG80211 -DWLP2P -DWL_COMPAT_WIRELESS\
-Wall -Wstrict-prototypes -Werror \
-Idrivers/net/wireless/bcmdhd -Idrivers/net/wireless/bcmdhd/include
#-I$(M) -I$(M)/include
# CFG 80211 and P2P compile flag
#-DWL_CFG80211 -DWLP2P -DWL_COMPAT_WIRELESS \
#ifdef P2P
DHDCFLAGS += -DWL_CFG80211 -DWLP2P -DWL_COMPAT_WIRELESS
#endif

ifdef COMPAT_WIRELESS
NOSTDINC_FLAGS := -I$(COMPAT_WIRELESS)/include/ \
-include $(COMPAT_WIRELESS)/include/linux/compat-2.6.h
endif

DHDOFILES = dhd_linux.o linux_osl.o bcmutils.o dhd_common.o dhd_custom_gpio.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 bcmevent.o dhd_bta.o wl_android.o wldev_common.o wl_linux_mon.o wl_cfg80211.o wl_cfgp2p.o dhd_cfg80211.o

#ifdef P2P
DHDOFILES += wl_linux_mon.o wl_cfg80211.o wl_cfgp2p.o
#endif




DHDOFILES = aiutils.o bcmsdh_sdmmc_linux.o dhd_linux.o siutils.o bcmutils.o \
dhd_linux_sched.o bcmwifi.o dhd_sdio.o bcmevent.o dhd_bta.o hndpmu.o \
bcmsdh.o dhd_cdc.o bcmsdh_linux.o dhd_common.o linux_osl.o \
bcmsdh_sdmmc.o dhd_custom_gpio.o sbutils.o wldev_common.o wl_android.o

obj-$(CONFIG_BCMDHD) += bcmdhd.o
bcmdhd-objs += $(DHDOFILES)
ifneq ($(CONFIG_WIRELESS_EXT),)
bcmdhd-objs += wl_iw.o
DHDCFLAGS += -DSOFTAP
endif
ifneq ($(CONFIG_CFG80211),)
bcmdhd-objs += wl_cfg80211.o wl_cfgp2p.o dhd_linux_mon.o
DHDCFLAGS += -DWL_CFG80211
endif
EXTRA_CFLAGS = $(DHDCFLAGS)
ifeq ($(CONFIG_BCMDHD),m)
EXTRA_LDFLAGS += --strip-debug
endif
34 changes: 31 additions & 3 deletions drivers/net/wireless/bcmdhd/aiutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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: aiutils.c,v 1.26.2.1 2010-03-09 18:41:21 Exp $
* $Id: aiutils.c 275693 2011-08-04 19:59:34Z $
*/


Expand All @@ -37,7 +37,7 @@

#include "siutils_priv.h"


#define BCM47162_DMP() (0)



Expand Down Expand Up @@ -417,6 +417,10 @@ ai_flag(si_t *sih)
aidmp_t *ai;

sii = SI_INFO(sih);
if (BCM47162_DMP()) {
SI_ERROR(("%s: Attempting to read MIPS DMP registers on 47162a0", __FUNCTION__));
return sii->curidx;
}
ai = sii->curwrap;

return (R_REG(sii->osh, &ai->oobselouta30) & 0x1f);
Expand Down Expand Up @@ -540,7 +544,12 @@ ai_corereg(si_t *sih, uint coreidx, uint regoff, uint mask, uint val)
r = (uint32*) ((uchar*) ai_setcoreidx(&sii->pub, coreidx) + regoff);
}
ASSERT(r != NULL);

#ifdef HTC_KlocWork
if(r == NULL) {
printf("[HTCKW] r is NULL at ai_corereg\n");
return 0;
}
#endif

if (mask || val) {
w = (R_REG(sii->osh, r) & ~mask) | val;
Expand Down Expand Up @@ -620,6 +629,13 @@ ai_core_cflags_wo(si_t *sih, uint32 mask, uint32 val)
uint32 w;

sii = SI_INFO(sih);

if (BCM47162_DMP()) {
SI_ERROR(("%s: Accessing MIPS DMP register (ioctrl) on 47162a0",
__FUNCTION__));
return;
}

ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap;

Expand All @@ -639,6 +655,12 @@ ai_core_cflags(si_t *sih, uint32 mask, uint32 val)
uint32 w;

sii = SI_INFO(sih);
if (BCM47162_DMP()) {
SI_ERROR(("%s: Accessing MIPS DMP register (ioctrl) on 47162a0",
__FUNCTION__));
return 0;
}

ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap;

Expand All @@ -660,6 +682,12 @@ ai_core_sflags(si_t *sih, uint32 mask, uint32 val)
uint32 w;

sii = SI_INFO(sih);
if (BCM47162_DMP()) {
SI_ERROR(("%s: Accessing MIPS DMP register (iostatus) on 47162a0",
__FUNCTION__));
return 0;
}

ASSERT(GOODREGS(sii->curwrap));
ai = sii->curwrap;

Expand Down
13 changes: 10 additions & 3 deletions drivers/net/wireless/bcmdhd/bcmevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Notwithstanding the above, under no circumstances may you combine this
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
* $Id: bcmevent.c,v 1.8.2.7 2011-02-01 06:23:39 Exp $
* $Id: bcmevent.c 275693 2011-08-04 19:59:34Z $
*/

#include <typedefs.h>
Expand All @@ -29,7 +29,7 @@
#include <proto/bcmeth.h>
#include <proto/bcmevent.h>

#if WLC_E_LAST != 85
#if WLC_E_LAST != 90
#error "You need to add an entry to bcmevent_names[] for the new event"
#endif

Expand Down Expand Up @@ -96,6 +96,10 @@ const bcmevent_name_t bcmevent_names[] = {
{ WLC_E_ACTION_FRAME_RX, "ACTION_FRAME_RX" },
{ WLC_E_ACTION_FRAME_COMPLETE, "ACTION_FRAME_COMPLETE" },
#endif
#ifdef BCMWAPI_WAI
{ WLC_E_WAI_STA_EVENT, "WAI_STA_EVENT" },
{ WLC_E_WAI_MSG, "WAI_MSG" },
#endif /* BCMWAPI_WAI */
{ WLC_E_ESCAN_RESULT, "WLC_E_ESCAN_RESULT" },
{ WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE, "WLC_E_AF_OFF_CHAN_COMPLETE" },
#ifdef WLP2P
Expand All @@ -117,8 +121,11 @@ const bcmevent_name_t bcmevent_names[] = {
{ WLC_E_PFN_SCAN_NONE, "PFN_SCAN_NONE" },
{ WLC_E_PFN_SCAN_ALLGONE, "PFN_SCAN_ALLGONE" },
#ifdef SOFTAP
{ WLC_E_GTK_PLUMBED, "GTK_PLUMBED" }
{ WLC_E_GTK_PLUMBED, "GTK_PLUMBED" },
#endif
{ WLC_E_RELOAD, "RELOAD_EVENT" },
{ WLC_E_RSSI_LOW, "RSSI_LOW_EVENT" },
{ WLC_E_ASSOCREQ_IE, "ASSOC_REQ_EVENT" }
};


Expand Down
37 changes: 37 additions & 0 deletions drivers/net/wireless/bcmdhd/bcmsdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,3 +688,40 @@ bcmsdh_sleep(void *sdh, bool enab)
return BCME_UNSUPPORTED;
#endif
}

int
bcmsdh_gpio_init(void *sdh)
{
bcmsdh_info_t *p = (bcmsdh_info_t *)sdh;
sdioh_info_t *sd = (sdioh_info_t *)(p->sdioh);

return sdioh_gpio_init(sd);
}

bool
bcmsdh_gpioin(void *sdh, uint32 gpio)
{
bcmsdh_info_t *p = (bcmsdh_info_t *)sdh;
sdioh_info_t *sd = (sdioh_info_t *)(p->sdioh);

return sdioh_gpioin(sd, gpio);
}

int
bcmsdh_gpioouten(void *sdh, uint32 gpio)
{
bcmsdh_info_t *p = (bcmsdh_info_t *)sdh;
sdioh_info_t *sd = (sdioh_info_t *)(p->sdioh);

return sdioh_gpioouten(sd, gpio);
}

int
bcmsdh_gpioout(void *sdh, uint32 gpio, bool enab)
{
bcmsdh_info_t *p = (bcmsdh_info_t *)sdh;
sdioh_info_t *sd = (sdioh_info_t *)(p->sdioh);

return sdioh_gpioout(sd, gpio, enab);
}

29 changes: 19 additions & 10 deletions drivers/net/wireless/bcmdhd/bcmsdh_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.72.6.5 2010-12-23 01:13:15 Exp $
* $Id: bcmsdh_linux.c 281719 2011-09-02 23:50:57Z $
*/

/**
Expand Down Expand Up @@ -238,9 +238,9 @@ int bcmsdh_probe(struct device *dev)
/* chain SDIO Host Controller info together */
sdhc->next = sdhcinfo;
sdhcinfo = sdhc;

/* Read the vendor/device ID from the CIS */
vendevid = bcmsdh_query_device(sdh);

/* try to attach to the target device */
if (!(sdhc->ch = drvinfo.attach((vendevid >> 16),
(vendevid & 0xFFFF), 0, 0, 0, 0,
Expand Down Expand Up @@ -274,6 +274,7 @@ int bcmsdh_remove(struct device *dev)
sdhc = sdhcinfo;
drvinfo.detach(sdhc->ch);
bcmsdh_detach(sdhc->osh, sdhc->sdh);

/* find the SDIO Host Controller state for this pdev and take it out from the list */
for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
if (sdhc->dev == (void *)dev) {
Expand All @@ -290,7 +291,6 @@ int bcmsdh_remove(struct device *dev)
return 0;
}


/* release SDIO Host Controller info */
osh = sdhc->osh;
MFREE(osh, sdhc, sizeof(bcmsdh_hc_t));
Expand Down Expand Up @@ -599,9 +599,14 @@ static irqreturn_t wlan_oob_irq(int irq, void *dev_id)

dhdp = (dhd_pub_t *)dev_get_drvdata(sdhcinfo->dev);

#ifdef HW_OOB
bcmsdh_oob_intr_set(0);
#endif

if (dhdp == NULL) {
#ifndef HW_OOB
bcmsdh_oob_intr_set(0);
#endif
SDLX_MSG(("Out of band GPIO interrupt fired way too early\n"));
return IRQ_HANDLED;
}
Expand All @@ -611,13 +616,6 @@ static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
return IRQ_HANDLED;
}

void *bcmsdh_get_drvdata(void)
{
if (!sdhcinfo)
return NULL;
return dev_get_drvdata(sdhcinfo->dev);
}

int bcmsdh_register_oob_intr(void * dhdp)
{
int error = 0;
Expand Down Expand Up @@ -645,6 +643,13 @@ int bcmsdh_register_oob_intr(void * dhdp)
return 0;
}

void *bcmsdh_get_drvdata(void)
{
if (!sdhcinfo)
return NULL;
return dev_get_drvdata(sdhcinfo->dev);
}

void bcmsdh_set_irq(int flag)
{
if (sdhcinfo->oob_irq_registered && sdhcinfo->oob_irq_enable_flag != flag) {
Expand All @@ -671,6 +676,7 @@ void bcmsdh_unregister_oob_intr(void)
}
}
#endif /* defined(OOB_INTR_ONLY) */

/* Module parameters specific to each host-controller driver */

extern uint sd_msglevel; /* Debug message level */
Expand All @@ -694,6 +700,9 @@ module_param(sd_hiok, uint, 0);
extern uint sd_f2_blocksize;
module_param(sd_f2_blocksize, int, 0);

#ifdef BCMSDIOH_STD
module_param(sd_uhsimode, int, 0);
#endif

#ifdef BCMSDH_MODULE
EXPORT_SYMBOL(bcmsdh_attach);
Expand Down
Loading

0 comments on commit 9d2caf2

Please sign in to comment.