Permalink
Browse files

bcmdhd: Bring in bcmdhd driver from N7000 Update3 source drop

Change-Id: I296aff7b074eb2092d0bfe4b4726980084936907
  • Loading branch information...
1 parent a891a9d commit 693f9a8410b82c0b9853f4abd1449155b3428da9 @Entropy512 Entropy512 committed May 23, 2012
Showing with 6,827 additions and 1,714 deletions.
  1. +26 −1 drivers/net/wireless/bcmdhd/Kconfig
  2. +95 −27 drivers/net/wireless/bcmdhd/Makefile
  3. +1 −0 drivers/net/wireless/bcmdhd/src/bcmsdio/sys/bcmsdh.c
  4. +29 −26 drivers/net/wireless/bcmdhd/src/bcmsdio/sys/bcmsdh_linux.c
  5. +222 −104 drivers/net/wireless/bcmdhd/src/bcmsdio/sys/bcmsdh_sdmmc.c
  6. +135 −37 drivers/net/wireless/bcmdhd/src/bcmsdio/sys/bcmsdh_sdmmc_linux.c
  7. +91 −18 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd.h
  8. +7 −0 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_bus.h
  9. +45 −5 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_cdc.c
  10. +19 −2 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_cfg80211.c
  11. +32 −42 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_common.c
  12. +61 −50 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_custom_gpio.c
  13. +342 −117 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_custom_sec.c
  14. +1 −7 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_dbg.h
  15. +787 −169 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_linux.c
  16. +5 −1 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_proto.h
  17. +618 −210 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_sdio.c
  18. +108 −0 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_sec_feature.h
  19. +1 −0 drivers/net/wireless/bcmdhd/src/dhd/sys/dhd_wlfc.h
  20. +26 −23 drivers/net/wireless/bcmdhd/src/include/bcmcdc.h
  21. +14 −13 drivers/net/wireless/bcmdhd/src/include/bcmdefs.h
  22. +16 −9 drivers/net/wireless/bcmdhd/src/include/bcmdevs.h
  23. +11 −0 drivers/net/wireless/bcmdhd/src/include/bcmsdh.h
  24. +5 −4 drivers/net/wireless/bcmdhd/src/include/bcmsdh_sdmmc.h
  25. +1 −0 drivers/net/wireless/bcmdhd/src/include/bcmutils.h
  26. +4 −0 drivers/net/wireless/bcmdhd/src/include/dhdioctl.h
  27. +7 −7 drivers/net/wireless/bcmdhd/src/include/epivers.h
  28. +3 −2 drivers/net/wireless/bcmdhd/src/include/hndsoc.h
  29. +10 −20 drivers/net/wireless/bcmdhd/src/include/linux_osl.h
  30. +8 −5 drivers/net/wireless/bcmdhd/src/include/linuxver.h
  31. +5 −0 drivers/net/wireless/bcmdhd/src/include/pcicfg.h
  32. +150 −11 drivers/net/wireless/bcmdhd/src/include/proto/802.11.h
  33. +5 −12 drivers/net/wireless/bcmdhd/src/include/proto/bcmevent.h
  34. +1 −2 drivers/net/wireless/bcmdhd/src/include/proto/ethernet.h
  35. +54 −2 drivers/net/wireless/bcmdhd/src/include/proto/p2p.h
  36. +6 −3 drivers/net/wireless/bcmdhd/src/include/proto/wpa.h
  37. +22 −0 drivers/net/wireless/bcmdhd/src/include/sbchipc.h
  38. +40 −0 drivers/net/wireless/bcmdhd/src/include/sbhnddma.h
  39. +5 −0 drivers/net/wireless/bcmdhd/src/include/sbsdio.h
  40. +5 −0 drivers/net/wireless/bcmdhd/src/include/sdio.h
  41. +4 −2 drivers/net/wireless/bcmdhd/src/include/siutils.h
  42. +2 −2 drivers/net/wireless/bcmdhd/src/include/wlfc_proto.h
  43. +397 −47 drivers/net/wireless/bcmdhd/src/include/wlioctl.h
  44. +3 −2 drivers/net/wireless/bcmdhd/src/shared/bcmevent.c
  45. +27 −15 drivers/net/wireless/bcmdhd/src/shared/bcmutils.c
  46. +23 −57 drivers/net/wireless/bcmdhd/src/shared/linux_osl.c
  47. +104 −11 drivers/net/wireless/bcmdhd/src/shared/siutils.c
  48. +13 −7 drivers/net/wireless/bcmdhd/src/shared/siutils_priv.h
  49. +18 −28 drivers/net/wireless/bcmdhd/src/{include/bcmwifi.h → wl/bcmwifi/include/bcmwifi_channels.h}
  50. +39 −33 drivers/net/wireless/bcmdhd/src/{shared/bcmwifi.c → wl/bcmwifi/src/bcmwifi_channels.c}
  51. +284 −43 drivers/net/wireless/bcmdhd/src/wl/sys/wl_android.c
  52. +2,151 −424 drivers/net/wireless/bcmdhd/src/wl/sys/wl_cfg80211.c
  53. +170 −27 drivers/net/wireless/bcmdhd/src/wl/sys/wl_cfg80211.h
  54. +224 −62 drivers/net/wireless/bcmdhd/src/wl/sys/wl_cfgp2p.c
  55. +23 −3 drivers/net/wireless/bcmdhd/src/wl/sys/wl_cfgp2p.h
  56. +168 −14 drivers/net/wireless/bcmdhd/src/wl/sys/wl_iw.c
  57. +10 −2 drivers/net/wireless/bcmdhd/src/wl/sys/wl_linux_mon.c
  58. +125 −0 drivers/net/wireless/bcmdhd/src/wl/sys/wl_roam.c
  59. +16 −6 drivers/net/wireless/bcmdhd/src/wl/sys/wldev_common.c
  60. +3 −0 drivers/net/wireless/bcmdhd/src/wl/sys/wldev_common.h
@@ -11,8 +11,33 @@ config BCM4330
---help---
Select this option to build Broadcom wlan driver
+config BCM43241
+ tristate "---Broadcom WiFi Driver for 43241"
+ depends on WLAN
+ ---help---
+ Select this option to build Broadcom wlan driver
+
config BROADCOM_WIFI_RESERVED_MEM
bool "BROADCOM Reserved memory for wifi device"
- depends on (BCM4330 || BCM4334)
+ depends on (BCM4330 || BCM4334 || BCM43241)
---help---
This is a configuration for broadcom WLAN driver.
+
+config WLAN_COUNTRY_CODE
+ tristate "---Broadcom WiFi Driver for 5GH channel setting"
+ depends on WLAN
+ default n
+
+config WLAN_REGION_CODE
+ int "---Region codes for Broadcom WiFi Driver"
+ depends on (BCM4330 || BCM4334 || BCM43241)
+ default 100
+ ---help---
+ This is a region code for Broadcom Wi-Fi featured functions.
+ - 100 : EUR OPEN
+ - 101 : EUR ORG
+ - 200 : KOR OPEN
+ - 201 : KOR SKT
+ - 202 : KOR KTT
+ - 203 : KOR LGT
+ - 300 : CHN OPEN
@@ -1,68 +1,132 @@
# bcmdhd
DHDCFLAGS = -Wall -Wstrict-prototypes -Dlinux -DBCMDRIVER \
-DBCMDONGLEHOST -DUNRELEASEDCHIP -DBCMDMA32 -DWLBTAMP -DBCMFILEIMAGE \
- -DDHDTHREAD -DDHD_GPL -DDHD_SCHED -DDHD_DEBUG -DSDTEST -DBDC -DTOE \
+ -DDHDTHREAD -DDHD_GPL -DDHD_SCHED -DDHD_DEBUG -DBDC -DTOE \
-DDHD_BCMEVENTS -DSHOW_EVENTS -DDONGLEOVERLAYS -DBCMDBG \
-DCUSTOMER_HW_SAMSUNG -DOOB_INTR_ONLY \
-DMMC_SDIO_ABORT -DBCMSDIO -DBCMLXSDMMC -DBCMPLATFORM_BUS -DWLP2P \
-DNEW_COMPAT_WIRELESS -DWIFI_ACT_FRAME -DARP_OFFLOAD_SUPPORT \
-DKEEP_ALIVE -DCSCAN -DPKT_FILTER_SUPPORT \
- -DEMBEDDED_PLATFORM -DPNO_SUPPORT
+ -DEMBEDDED_PLATFORM
+#-DPNO_SUPPORT
# distinguish between the 43xx chip
ifeq ($(CONFIG_BCM4334),m)
-DHDCFLAGS += -DHW_OOB -DBCM4334_CHECK_CHIP_REV
+DHDCFLAGS += -DBCM4334_CHIP -DHW_OOB -DBCM4334_CHECK_CHIP_REV
DHDCFLAGS += -DUSE_CID_CHECK -DCONFIG_CONTROL_PM
DHDCFLAGS += -DPROP_TXSTATUS
+DHDCFLAGS += -DVSDB -DHT40_GO
+DHDCFLAGS += -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST
+DHDCFLAGS += -DDHD_USE_IDLECOUNT
endif
ifeq ($(CONFIG_BCM4334),y)
-DHDCFLAGS += -DHW_OOB -DBCM4334_CHECK_CHIP_REV
+DHDCFLAGS += -DBCM4334_CHIP -DHW_OOB -DBCM4334_CHECK_CHIP_REV
DHDCFLAGS += -DUSE_CID_CHECK -DCONFIG_CONTROL_PM
DHDCFLAGS += -DPROP_TXSTATUS
+DHDCFLAGS += -DVSDB -DHT40_GO
+DHDCFLAGS += -DWL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST
+DHDCFLAGS += -DDHD_USE_IDLECOUNT
endif
-
ifeq ($(CONFIG_BCM4330),m)
-DHDCFLAGS += -DCONFIG_CONTROL_PM -DPOWER_ON_DELAY_4330
+DHDCFLAGS += -DBCM4330_CHIP
+DHDCFLAGS += -DMCAST_LIST_ACCUMULATION
+DHDCFLAGS += -DCONFIG_CONTROL_PM
endif
ifeq ($(CONFIG_BCM4330),y)
-DHDCFLAGS += -DCONFIG_CONTROL_PM -DPOWER_ON_DELAY_4330
+DHDCFLAGS += -DBCM4330_CHIP
+DHDCFLAGS += -DMCAST_LIST_ACCUMULATION
+DHDCFLAGS += -DCONFIG_CONTROL_PM
endif
-
-ifeq ($(CONFIG_MACH_U1),y)
-DHDCFLAGS += -DUSE_CID_CHECK -DWRITE_MACADDR -DU1_MACADDR
+ifeq ($(CONFIG_BCM43241),m)
+DHDCFLAGS += -DBCM43241_CHIP -DHW_OOB
+DHDCFLAGS += -DMCAST_LIST_ACCUMULATION
+DHDCFLAGS += -fno-pic
endif
-
-ifeq ($(CONFIG_TARGET_LOCALE_KOR),y)
-DHDCFLAGS += -DUSE_CID_CHECK -DRDWR_MACADDR -DU1_MACADDR
-DHDCFLAGS += -DROAM_ENABLE -DROAM_API
+ifeq ($(CONFIG_BCM43241),y)
+DHDCFLAGS += -DBCM43241_CHIP -DHW_OOB
+DHDCFLAGS += -DMCAST_LIST_ACCUMULATION
endif
-ifeq ($(CONFIG_MACH_U1_KOR_KT), y)
-DHDCFLAGS += -DVLAN_MODE_OFF
-DHDCFLAGS += -DKEEP_ALIVE_PACKET_PERIOD_30_SEC
-DHDCFLAGS += -DFULL_ROAMING_SCAN_PERIOD_60_SEC
+# For p2p connection issue
+DHDCFLAGS += -DWL_CFG80211_GON_COLLISION
+DHDCFLAGS += -DWL_CFG80211_SYNC_GON_TIME
+#end p2p connection
+
+# For Passing all multicast packets to host when not in suspend mode.
+DHDCFLAGS += -DPASS_ALL_MCAST_PKTS
+
+#For INITIAL 2G scan features
+#select only one from USE_INIITAL_2G_SCAN and INITIAL_2G_SCAN_ORG
+
+#DHDCFLAGS += -DUSE_INITIAL_2G_SCAN
+DHDCFLAGS += -DUSE_INITIAL_2G_SCAN_ORG
+
+DHDCFLAGS +=-DINITIAL_2G_SCAN_BY_ESCAN
+
+# For Scan result patch
+DHDCFLAGS += -DESCAN_RESULT_PATCH
+
+ifeq ($(CONFIG_MACH_SAMSUNG_T1),y)
+DHDCFLAGS += -DUSE_CID_CHECK -DWRITE_MACADDR
endif
+DHDCFLAGS += -DROAM_ENABLE -DROAM_CHANNEL_CACHE -DROAM_API
+
# For Static Buffer
ifeq ($(CONFIG_BROADCOM_WIFI_RESERVED_MEM),y)
DHDCFLAGS += -DCONFIG_DHD_USE_STATIC_BUF
endif
+# For CCX
+ifeq ($(CONFIG_BRCM_CCX),y)
+DHDCFLAGS += -DBCMCCX
+endif
+
+# For SLP feature
+ifeq ($(CONFIG_SLP),y)
+DHDCFLAGS += -DSLP_PATH -DWRITE_MACADDR
+endif
+
+# 5GHz channels setting
+ifeq ($(CONFIG_WLAN_COUNTRY_CODE),y)
+DHDCFLAGS += -DGLOBALCONFIG_WLAN_COUNTRY_CODE
+endif
+
+# For ICS SEC Features
ifneq ($(findstring GlobalConfig, $(wildcard $(srctree)/include/sec_feature/*)),)
DHDCFLAGS += -DUSE_SECFEATURE
endif
-ifeq ($(SEC_REGION),CHN)
-DHDCFLAGS += -DBCMWAPI_WPI -DBCMWAPI_WAI
+
+##############################################################
+# dhd_sec_feature.h
+
+REGION_CODE := $(CONFIG_WLAN_REGION_CODE)
+
+ifeq ($(CONFIG_TARGET_LOCALE_KOR),y)
+REGION_CODE=200
endif
-# For SLP feature
-ifeq ($(CONFIG_SLP),y)
-DHDCFLAGS += -DSLP_PATH
+ifeq ($(CONFIG_MACH_U1_KOR_KT), y)
+REGION_CODE=202
+endif
+
+ifeq ($(CONFIG_TARGET_LOCALE_CHN),y)
+REGION_CODE=300
+endif
+
+ifeq ($(SEC_MODEL_NAME),U1)
+ifeq ($(X_BUILD_LOCALE),EUR_ORG)
+REGION_CODE=101
+endif
endif
+DHDCFLAGS += -DWLAN_REGION_CODE=$(REGION_CODE)
+
+##############################################################
+
# For Debug
-EXTRA_CFLAGS += $(DHDCFLAGS) -DWL_CFG80211
+EXTRA_CFLAGS += $(DHDCFLAGS) -DWL_CFG80211 -DRSSI_OFFSET=0
EXTRA_CFLAGS += -DDHD_DEBUG -DSRCBASE=\"$(src)/src\"
EXTRA_CFLAGS += -I$(src)/src/include/
@@ -71,6 +135,8 @@ EXTRA_CFLAGS += -I$(src)/src/dongle/
EXTRA_CFLAGS += -I$(src)/src/bcmsdio/sys/
EXTRA_CFLAGS += -I$(src)/src/wl/sys/
EXTRA_CFLAGS += -I$(src)/src/shared/
+EXTRA_CFLAGS += -I$(src)/src/wl/bcmwifi/src/
+EXTRA_CFLAGS += -I$(src)/src/wl/bcmwifi/include/
EXTRA_LDFLAGS += --strip-debug
KBUILD_CFLAGS += -I$(LINUXDIR)/include -I$(shell pwd)
@@ -85,12 +151,12 @@ dhd-y := src/bcmsdio/sys/bcmsdh.o src/bcmsdio/sys/bcmsdh_linux.o \
src/dhd/sys/dhd_linux.o src/dhd/sys/dhd_linux_sched.o \
src/dhd/sys/dhd_cfg80211.o src/dhd/sys/dhd_sdio.o \
src/shared/aiutils.o src/shared/bcmevent.o \
- src/shared/bcmutils.o src/shared/bcmwifi.o \
+ src/shared/bcmutils.o src/wl/bcmwifi/src/bcmwifi_channels.o \
src/shared/hndpmu.o src/shared/linux_osl.o \
src/shared/sbutils.o src/shared/siutils.o \
src/wl/sys/wl_android.o src/wl/sys/wl_cfg80211.o \
src/wl/sys/wl_cfgp2p.o src/wl/sys/wldev_common.o \
- src/wl/sys/wl_linux_mon.o
+ src/wl/sys/wl_linux_mon.o src/wl/sys/wl_roam.o
all:
@echo "$(MAKE) --no-print-directory -C $(KDIR) SUBDIRS=$(CURDIR) modules"
@@ -111,7 +177,9 @@ clean:
src/shared/.*.o.cmd \
src/wl/sys/*.o \
src/wl/sys/*.o.cmd \
- src/wl/sys/.*.o.cmd
+ src/wl/sys/.*.o.cmd \
+ src/wl/bcmwifi/src/bcmwifi_channels.o \
+ src/wl/bcmwifi/src/.*.o.cmd
install:
@$(MAKE) --no-print-directory -C $(KDIR) \
@@ -38,6 +38,7 @@
#include <hndsoc.h>
#include <siutils.h>
#include <osl.h>
+#include <dhd_sec_feature.h>
#include <bcmsdh.h> /* BRCM API for SDIO clients (such as wl, dhd) */
#include <bcmsdbus.h> /* common SDIO/controller interface */
@@ -147,17 +147,6 @@ static int __devexit bcmsdh_remove(struct device *dev);
#endif /* BCMLXSDMMC */
#ifndef BCMLXSDMMC
-static struct device_driver bcmsdh_driver = {
- .name = "pxa2xx-mci",
- .bus = &platform_bus_type,
- .probe = bcmsdh_probe,
- .remove = bcmsdh_remove,
- .suspend = NULL,
- .resume = NULL,
- };
-#endif /* BCMLXSDMMC */
-
-#ifndef BCMLXSDMMC
static
#endif /* BCMLXSDMMC */
int bcmsdh_probe(struct device *dev)
@@ -523,6 +512,24 @@ bcmsdh_pci_remove(struct pci_dev *pdev)
extern int sdio_function_init(void);
+extern int sdio_func_reg_notify(void* semaphore);
+extern void sdio_func_unreg_notify(void);
+
+#if defined(BCMLXSDMMC)
+int bcmsdh_reg_sdio_notify(void* semaphore)
+{
+
+ return sdio_func_reg_notify(semaphore);
+
+}
+
+void bcmsdh_unreg_sdio_notify(void)
+{
+ sdio_func_unreg_notify();
+
+}
+#endif /* defined(BCMLXSDMMC) */
+
int
bcmsdh_register(bcmsdh_driver_t *driver)
{
@@ -531,13 +538,8 @@ bcmsdh_register(bcmsdh_driver_t *driver)
drvinfo = *driver;
#if defined(BCMPLATFORM_BUS)
-#if defined(BCMLXSDMMC)
SDLX_MSG(("Linux Kernel SDIO/MMC Driver\n"));
error = sdio_function_init();
-#else
- SDLX_MSG(("Intel PXA270 SDIO Driver\n"));
- error = driver_register(&bcmsdh_driver);
-#endif /* defined(BCMLXSDMMC) */
return error;
#endif /* defined(BCMPLATFORM_BUS) */
@@ -565,14 +567,12 @@ bcmsdh_unregister(void)
if (bcmsdh_pci_driver.node.next)
#endif
-#if defined(BCMPLATFORM_BUS) && !defined(BCMLXSDMMC)
- driver_unregister(&bcmsdh_driver);
-#endif
#if defined(BCMLXSDMMC)
sdio_function_cleanup();
#endif /* BCMLXSDMMC */
+
#if !defined(BCMPLATFORM_BUS) && !defined(BCMLXSDMMC)
- pci_unregister_driver(&bcmsdh_pci_driver);
+ pci_unregister_driver(&bcmsdh_pci_driver);
#endif /* BCMPLATFORM_BUS */
}
@@ -638,12 +638,6 @@ 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) {
@@ -671,6 +665,15 @@ void bcmsdh_unregister_oob_intr(void)
}
#endif /* defined(OOB_INTR_ONLY) */
+#if defined(BCMLXSDMMC)
+void *bcmsdh_get_drvdata(void)
+{
+ if (!sdhcinfo)
+ return NULL;
+ return dev_get_drvdata(sdhcinfo->dev);
+}
+#endif /* defined(OOB_INTR_ONLY) */
+
/* Module parameters specific to each host-controller driver */
extern uint sd_msglevel; /* Debug message level */
Oops, something went wrong.

0 comments on commit 693f9a8

Please sign in to comment.