Skip to content

Commit

Permalink
Update to bcmdhd from jb-chocolate
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad0989 authored and Snuzzo committed Dec 30, 2012
1 parent 9d2caf2 commit 5b9a364
Show file tree
Hide file tree
Showing 121 changed files with 8,103 additions and 8,252 deletions.
4 changes: 4 additions & 0 deletions arch/arm/configs/vigor_aosp_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@ CONFIG_CFG80211_WEXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set
CONFIG_LIB80211=y
# CONFIG_LIB80211_DEBUG is not set
CONFIG_CFG80211_ALLOW_RECONNECT=y
# CONFIG_MAC80211 is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
Expand Down Expand Up @@ -1249,6 +1250,9 @@ CONFIG_LIBRA_SDIOIF=y
CONFIG_BCMDHD=y
CONFIG_BCMDHD_FW_PATH="/system/vendor/firmware/fw_bcmdhd.bin"
CONFIG_BCMDHD_NVRAM_PATH="/proc/calibration"
# CONFIG_DHD_USE_STATIC_BUF is not set
# CONFIG_DHD_USE_SCHED_SCAN is not set
# CONFIG_DHD_ENABLE_P2P is not set
# CONFIG_HOSTAP is not set
# CONFIG_IWM is not set
# CONFIG_LIBERTAS is not set
Expand Down
33 changes: 30 additions & 3 deletions drivers/net/wireless/bcmdhd/Kconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
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 @@ -22,6 +20,35 @@ config BCMDHD_FW_PATH
config BCMDHD_NVRAM_PATH
depends on BCMDHD
string "NVRAM path"
default "/proc/calibration"
default "/system/etc/wifi/bcmdhd.cal"
---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

config DHD_USE_STATIC_BUF
bool "Enable memory preallocation"
depends on BCMDHD
default n
---help---
Use memory preallocated in platform

config DHD_USE_SCHED_SCAN
bool "Use CFG80211 sched scan"
depends on BCMDHD && CFG80211
default n
---help---
Use CFG80211 sched scan

config DHD_ENABLE_P2P
bool "Enable Wifi Direct"
depends on BCMDHD && CFG80211
default n
---help---
Use Enable Wifi Direct
77 changes: 28 additions & 49 deletions drivers/net/wireless/bcmdhd/Makefile
Original file line number Diff line number Diff line change
@@ -1,59 +1,38 @@

#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 \
# 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 \
-DSET_RANDOM_MAC_SOFTAP -DWL_CFG80211_STA_EVENT \
-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 dhd_cfg80211.o

obj-$(CONFIG_BCMDHD) += bcmdhd.o
bcmdhd-objs += $(DHDOFILES)
ifneq ($(CONFIG_WIRELESS_EXT),)
bcmdhd-objs += wl_iw.o
DHDCFLAGS += -DSOFTAP
DHDCFLAGS += -DSOFTAP -DWL_WIRELESS_EXT
endif
ifneq ($(CONFIG_CFG80211),)
bcmdhd-objs += wl_cfg80211.o wl_cfgp2p.o wl_linux_mon.o
DHDCFLAGS += -DWL_CFG80211
endif
ifneq ($(CONFIG_DHD_USE_SCHED_SCAN),)
DHDCFLAGS += -DWL_SCHED_SCAN
endif
ifneq ($(CONFIG_DHD_ENABLE_P2P),)
DHDCFLAGS += -DWL_ENABLE_P2P_IF
endif
EXTRA_CFLAGS = $(DHDCFLAGS)
ifeq ($(CONFIG_BCMDHD),m)
EXTRA_LDFLAGS += --strip-debug
endif
34 changes: 3 additions & 31 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 275693 2011-08-04 19:59:34Z $
* $Id: aiutils.c,v 1.26.2.1 2010-03-09 18:41:21 $
*/


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

#include "siutils_priv.h"

#define BCM47162_DMP() (0)




Expand Down Expand Up @@ -417,10 +417,6 @@ 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 @@ -544,12 +540,7 @@ 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 @@ -629,13 +620,6 @@ 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 @@ -655,12 +639,6 @@ 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 @@ -682,12 +660,6 @@ 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: 4 additions & 9 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 275693 2011-08-04 19:59:34Z $
* $Id: bcmevent.c,v 1.8.2.7 2011-02-01 06:23:39 $
*/

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

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

Expand Down Expand Up @@ -96,10 +96,6 @@ 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 @@ -123,9 +119,8 @@ const bcmevent_name_t bcmevent_names[] = {
#ifdef SOFTAP
{ 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" }
{ WLC_E_ASSOC_REQ_IE, "ASSOC_REQ_IE" },
{ WLC_E_ASSOC_RESP_IE, "ASSOC_RESP_IE" }
};


Expand Down
39 changes: 1 addition & 38 deletions drivers/net/wireless/bcmdhd/bcmsdh.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: bcmsdh.c 275784 2011-08-04 22:41:49Z $
* $Id: bcmsdh.c 300445 2011-12-03 05:37:20Z $
*/

/**
Expand Down Expand Up @@ -688,40 +688,3 @@ 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);
}

Loading

0 comments on commit 5b9a364

Please sign in to comment.