local/net: bcm4358: add the exynos5433-tm2 board and version check
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 10 Feb 2015 08:07:05 +0000 (17:07 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:44:29 +0000 (13:44 +0900)
Add the ARCH_EXYNOS5433 to use the exynos5433-tm2 board.
And checking linux version at build time.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
[Remove EXT_VENDOR for 3.18 and later version to build]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
13 files changed:
drivers/net/wireless/bcmdhd4358/Makefile
drivers/net/wireless/bcmdhd4358/bcmsdh_linux.c
drivers/net/wireless/bcmdhd4358/dhd.h
drivers/net/wireless/bcmdhd4358/dhd_custom_exynos.c
drivers/net/wireless/bcmdhd4358/dhd_linux.c
drivers/net/wireless/bcmdhd4358/dhd_linux_platdev.c
drivers/net/wireless/bcmdhd4358/dhd_pcie.c
drivers/net/wireless/bcmdhd4358/dhd_sec_feature.h
drivers/net/wireless/bcmdhd4358/include/linuxver.h
drivers/net/wireless/bcmdhd4358/siutils.c
drivers/net/wireless/bcmdhd4358/wl_cfg80211.c
drivers/net/wireless/bcmdhd4358/wl_cfg80211.h
drivers/net/wireless/bcmdhd4358/wl_cfgvendor.h

index 8f0f152..60b4711 100644 (file)
@@ -533,6 +533,11 @@ obj-$(CONFIG_MACH_UNIVERSAL7420) += dhd_custom_exynos.o
 DHDCFLAGS += -DDHD_OF_SUPPORT
 DHDCFLAGS += -DBCMPCIE_OOB_HOST_WAKE
 endif
+ifneq ($(CONFIG_ARCH_EXYNOS),)
+obj-$(CONFIG_ARCH_EXYNOS) += dhd_custom_exynos.o
+DHDCFLAGS += -DDHD_OF_SUPPORT
+DHDCFLAGS += -DBCMPCIE_OOB_HOST_WAKE
+endif
 ifneq ($(CONFIG_MACH_UNIVERSAL5433),)
 obj-$(CONFIG_MACH_UNIVERSAL5433) += dhd_custom_exynos.o
 DHDCFLAGS += -DDHD_OF_SUPPORT
index 8e3d6f4..6423cda 100644 (file)
 
 #include <typedefs.h>
 #include <linuxver.h>
+#ifdef CONFIG_PCI_TM2
+#include <linux/pci-tm2.h>
+#else
 #include <linux/pci.h>
+#endif
 #include <linux/completion.h>
 
 #include <osl.h>
index baefe35..ff86f5f 100644 (file)
@@ -1175,7 +1175,7 @@ extern void *dhd_pub_wlinfo(dhd_pub_t *dhd_pub);
 int dhd_rps_cpus_enable(struct net_device *net, int enable);
 int custom_rps_map_set(struct netdev_rx_queue *queue, char *buf, size_t len);
 void custom_rps_map_clear(struct netdev_rx_queue *queue);
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) 
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
 #define RPS_CPUS_MASK "10"
 #define RPS_CPUS_MASK_P2P "10"
 #define RPS_CPUS_MASK_IBSS "10"
index 1b0f5bb..9a178ce 100644 (file)
 #include <linux/wlan_plat.h>
 
 #if defined(CONFIG_64BIT)
-#include <asm/gpio.h>
+#include <linux/gpio.h>
 #else
 #include <mach/gpio.h>
 #endif
-#include <mach/irqs.h>
+//#include <mach/irqs.h>
 #include <linux/sec_sysfs.h>
 
-#include <plat/gpio-cfg.h>
+//#include <plat/gpio-cfg.h>
 
 #ifdef CONFIG_BROADCOM_WIFI_RESERVED_MEM
 
@@ -373,7 +373,8 @@ static int wlan_pwr_on = -1;
 int wlan_host_wake_irq = 0;
 EXPORT_SYMBOL(wlan_host_wake_irq);
 
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) 
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
+
 extern void exynos_pcie_poweron(void);
 extern void exynos_pcie_poweroff(void);
 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420 */
@@ -384,7 +385,7 @@ static int dhd_wlan_power(int onoff)
        printk(KERN_INFO"------------------------------------------------\n");
        printk(KERN_INFO"%s Enter: power %s\n", __FUNCTION__, onoff ? "on" : "off");
 
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) 
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
        if (!onoff)
                exynos_pcie_poweroff();
 
@@ -457,7 +458,7 @@ int __init dhd_wlan_init_gpio(void)
        }
 #ifdef CONFIG_BCMDHD_PCIE
        gpio_direction_output(wlan_pwr_on, 1);
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420)
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
        exynos_pcie_poweron(); //Dean
 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420 */
 #else
@@ -490,7 +491,7 @@ int __init dhd_wlan_init_gpio(void)
 #if defined(CONFIG_ARGOS)
 void set_cpucore_for_interrupt(cpumask_var_t default_cpu_mask,
        cpumask_var_t affinity_cpu_mask) {
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420)
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
        argos_irq_affinity_setup_label(277, "WIFI", affinity_cpu_mask, default_cpu_mask);
 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420 */
 }
index af40ee1..e8ba781 100644 (file)
@@ -8627,7 +8627,7 @@ static void dhd_hang_process(void *dhd_info, void *event_info, u8 event)
 }
 
 #ifdef CUSTOMER_HW4
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420)
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
 extern dhd_pub_t *link_recovery;
 void dhd_host_recover_link(void)
 {
index 6bf9db2..50da47e 100644 (file)
@@ -244,7 +244,7 @@ void *wifi_platform_get_country_code(wifi_adapter_info_t *adapter, char *ccode)
 
        DHD_TRACE(("%s\n", __FUNCTION__));
        if (plat_data->get_country_code) {
-               return plat_data->get_country_code(ccode , 0);
+               return plat_data->get_country_code(ccode);
        }
 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)) */
 
index c50586d..76b17dd 100644 (file)
@@ -435,7 +435,7 @@ dhdpcie_bus_isr(dhd_bus_t *bus)
 }
 
 #ifdef CUSTOMER_HW4
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420)
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
 dhd_pub_t *link_recovery = NULL;
 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420*/
 #endif /* CUSTOMER_HW4 */
@@ -453,7 +453,7 @@ dhdpcie_dongle_attach(dhd_bus_t *bus)
                __FUNCTION__));
 
 #ifdef CUSTOMER_HW4
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420)
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
        link_recovery = bus->dhd;
 #endif /* CONFIG_MACH_UNIVERSAL5433 || CONFIG_MACH_UNIVERSAL7420 */
 #endif /* CUSTOMER_HW4 */
index febe8d8..35389b9 100644 (file)
@@ -84,7 +84,7 @@
 #define HW_OOB
 #endif /* CONFIG_MACH_SAMSUNG_ESPRESSO && CONFIG_MACH_SAMSUNG_ESPRESSO_10 */
 
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420)
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
 #undef CUSTOM_SET_CPUCORE
 #define PRIMARY_CPUCORE 0
 #define DPC_CPUCORE 4
index f388752..f6142fc 100644 (file)
 #include <linux/init.h>
 #include <linux/mm.h>
 #include <linux/string.h>
+#ifdef CONFIG_PCI_TM2
+#include <linux/pci-tm2.h>
+#else
 #include <linux/pci.h>
+#endif
 #include <linux/interrupt.h>
 #include <linux/kthread.h>
 #include <linux/netdevice.h>
index 53516d3..dc265f2 100644 (file)
@@ -90,7 +90,7 @@ static void si_config_gcigpio(si_t *sih, uint32 gci_pos, uint8 gcigpio,
 #endif /* BCMLTECOEX */
 
 #ifdef CUSTOMER_HW4
-#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420)
+#if defined(CONFIG_MACH_UNIVERSAL5433) || defined(CONFIG_MACH_UNIVERSAL7420) || defined(CONFIG_ARCH_EXYNOS)
 extern int check_pcie_link_status(void);
 #endif /* CONFIG_MACH_UNIVERSAL5433 || defined(CONFIG_MACH_UNIVERSAL7420) */
 #endif /* CUSTOMER_HW4 */
index c02bb16..199098f 100644 (file)
@@ -8832,7 +8832,9 @@ wl_notify_connect_status_ap(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        isfree = true;
 
        if (event == WLC_E_ASSOC_IND && reason == DOT11_SC_SUCCESS) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
        defined(WL_COMPAT_WIRELESS)
@@ -8841,7 +8843,9 @@ wl_notify_connect_status_ap(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
 #endif /* LINUX_VERSION >= VERSION(3, 12, 0) */
        } else if (event == WLC_E_DISASSOC_IND) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
        defined(WL_COMPAT_WIRELESS)
@@ -8850,7 +8854,9 @@ wl_notify_connect_status_ap(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                cfg80211_rx_mgmt(ndev, freq, mgmt_frame, len, GFP_ATOMIC);
 #endif /* LINUX_VERSION >= VERSION(3, 12, 0) */
        } else if ((event == WLC_E_DEAUTH_IND) || (event == WLC_E_DEAUTH)) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+               cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
                cfg80211_rx_mgmt(ndev, freq, 0, mgmt_frame, len, 0, GFP_ATOMIC);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
        defined(WL_COMPAT_WIRELESS)
@@ -8916,6 +8922,7 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        u16 flags = ntoh16(e->flags);
        u32 status =  ntoh32(e->status);
        bool active;
+       struct ieee80211_channel *chan;
 
        if (event == WLC_E_JOIN) {
                WL_DBG(("joined in IBSS network\n"));
@@ -8923,6 +8930,8 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
        if (event == WLC_E_START) {
                WL_DBG(("started IBSS network\n"));
        }
+
+       chan = ieee80211_get_channel(cfg->wiphy, cfg->channel);
        if (event == WLC_E_JOIN || event == WLC_E_START ||
                (event == WLC_E_LINK && (flags == WLC_EVENT_MSG_LINK))) {
                if (wl_get_drv_status(cfg, CONNECTED, ndev)) {
@@ -8938,7 +8947,7 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                        wl_get_assoc_ies(cfg, ndev);
                        wl_update_prof(cfg, ndev, NULL, (void *)&e->addr, WL_PROF_BSSID);
                        wl_update_bss_info(cfg, ndev, false);
-                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, GFP_KERNEL);
+                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, chan, GFP_KERNEL);
                }
                else {
                        /* New connection */
@@ -8947,7 +8956,7 @@ wl_notify_connect_status_ibss(struct bcm_cfg80211 *cfg, struct net_device *ndev,
                        wl_get_assoc_ies(cfg, ndev);
                        wl_update_prof(cfg, ndev, NULL, (void *)&e->addr, WL_PROF_BSSID);
                        wl_update_bss_info(cfg, ndev, false);
-                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, GFP_KERNEL);
+                       cfg80211_ibss_joined(ndev, (s8 *)&e->addr, chan, GFP_KERNEL);
                        wl_set_drv_status(cfg, CONNECTED, ndev);
                        active = true;
                        wl_update_prof(cfg, ndev, NULL, (void *)&active, WL_PROF_ACT);
@@ -10092,8 +10101,9 @@ wl_notify_rx_mgmt_frame(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
                        }
                }
        }
-
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+       cfg80211_rx_mgmt(cfgdev, freq, 0,  mgmt_frame, mgmt_frame_len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
        cfg80211_rx_mgmt(cfgdev, freq, 0,  mgmt_frame, mgmt_frame_len, 0, GFP_ATOMIC);
 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)) || \
        defined(WL_COMPAT_WIRELESS)
@@ -11524,6 +11534,7 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *context)
        ndev->ieee80211_ptr = wdev;
        SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
        wdev->netdev = ndev;
+       cfg->wiphy = wdev->wiphy;
        cfg->state_notifier = wl_notifier_change_state;
        err = wl_alloc_netinfo(cfg, ndev, wdev, WL_MODE_BSS, PM_ENABLE);
        if (err) {
index 0e11877..2ec17b4 100644 (file)
@@ -520,6 +520,7 @@ typedef struct wl_if_event_info {
 
 /* private data of cfg80211 interface */
 struct bcm_cfg80211 {
+       struct wiphy *wiphy;
        struct wireless_dev *wdev;      /* representing cfg cfg80211 device */
 
        struct wireless_dev *p2p_wdev;  /* representing cfg cfg80211 device for P2P */
index 7672683..7d279e4 100644 (file)
 #ifndef _wl_cfgvendor_h_
 #define _wl_cfgvendor_h_
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0))
 #if (LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0)) && !defined(VENDOR_EXT_SUPPORT)
 #define VENDOR_EXT_SUPPORT
 #endif /* LINUX_VERSION_CODE > KERNEL_VERSION(3, 14, 0) && !VENDOR_EXT_SUPPORT */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) */
 
 enum wl_vendor_event {
        BRCM_VENDOR_EVENT_UNSPEC,
@@ -44,8 +46,8 @@ enum wl_vendor_event {
 extern int cfgvendor_attach(struct wiphy *wiphy);
 extern int cfgvendor_detach(struct wiphy *wiphy);
 #else
-static INLINE int cfgvendor_attach(struct wiphy *wiphy) { return 0; }
-static INLINE int cfgvendor_detach(struct wiphy *wiphy) { return 0; }
+static inline int cfgvendor_attach(struct wiphy *wiphy) { return 0; }
+static inline int cfgvendor_detach(struct wiphy *wiphy) { return 0; }
 #endif /*  VENDOR_EXT_SUPPORT */
 
 #endif /* _wl_cfgvendor_h_ */