pd#108773 add ap6356 wifi support
authorRongjun Chen <rongjun.chen@amlogic.com>
Wed, 8 Jul 2015 05:50:18 +0000 (13:50 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Wed, 8 Jul 2015 05:58:26 +0000 (13:58 +0800)
Change-Id: I696771a2a49f3247c1a6aec6be21a1fa269dd6ad

bcmdhd_1_201_59_x/dhd_config.c
bcmdhd_1_201_59_x/dhd_linux_platdev.c
bcmdhd_1_201_59_x/dhd_sdio.c
bcmdhd_1_201_59_x/include/bcmdevs.h
bcmdhd_1_201_59_x/include/epivers.sh [changed mode: 0644->0755]
bcmdhd_1_201_59_x/wl_cfg80211.c
bcmdhd_1_201_59_x/wl_cfgp2p.c

index 4e8113e4b1516ac9d498a573ff398bae95f61c64..075d60b3458e0bbbe44a6c38e82f152e3957f8fa 100644 (file)
@@ -1693,7 +1693,9 @@ dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path)
                        printf("%s: dhd_master_mode = %d\n", __FUNCTION__, dhd_master_mode);
                }
 
-               /* Process pkt_filter_add */
+               /* Process pkt_filter_add:\r
+                * All pkt: pkt_filter_add=99 0 0 0 0x000000000000 0x000000000000\r
+                */\r
                memset(pick, 0, MAXSZ_BUF);
                len_val = process_config_vars(bufp, len, pick, "pkt_filter_add=");
                pick_tmp = pick;
@@ -1768,7 +1770,7 @@ dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path)
                        printf("%s: ampdu_ba_wsize = %d\n", __FUNCTION__, conf->ampdu_ba_wsize);
                }
 
-               /* Process kso parameters */
+               /* Process kso_enable parameters */\r
                memset(pick, 0, MAXSZ_BUF);
                len_val = process_config_vars(bufp, len, pick, "kso_enable=");
                if (len_val) {
@@ -1939,7 +1941,8 @@ dhd_conf_preinit(dhd_pub_t *dhd)
                strcpy(conf->cspec.ccode, "ALL");
                conf->cspec.rev = 0;
        } else if (conf->chip == BCM4335_CHIP_ID || conf->chip == BCM4339_CHIP_ID ||
-                       conf->chip == BCM4354_CHIP_ID) {
+                       conf->chip == BCM4354_CHIP_ID || conf->chip == BCM4356_CHIP_ID ||\r
+                       conf->chip == BCM4345_CHIP_ID) {\r
                strcpy(conf->cspec.country_abbrev, "CN");
                strcpy(conf->cspec.ccode, "CN");
                conf->cspec.rev = 38;
@@ -2001,6 +2004,10 @@ dhd_conf_preinit(dhd_pub_t *dhd)
        conf->pm = -1;
        if ((conf->chip == BCM43362_CHIP_ID) || (conf->chip == BCM4330_CHIP_ID)) {
                conf->disable_proptx = 1;
+               conf->use_rxchain = 0;\r
+       }
+       if (conf->chip == BCM43430_CHIP_ID) {\r
+               conf->bus_rxglom = FALSE;\r
                conf->use_rxchain = 0;
        }
        if (conf->chip == BCM4339_CHIP_ID) {
index a4063e5ced7a656edb3c1b9106ca91f507b8602a..1071b7278951e8b33ca4cd0db1bf060d52d14029 100644 (file)
@@ -53,7 +53,9 @@ extern struct wifi_platform_data dhd_wlan_control;
 #else
 static bool dts_enabled = FALSE;
 struct resource dhd_wlan_resources = {0};
+#ifdef CUSTOMER_HW
 struct wifi_platform_data dhd_wlan_control = {0};
+#endif
 #endif /* !defind(DHD_OF_SUPPORT) */
 #endif /* !defind(CONFIG_DTS) */
 
@@ -432,8 +434,8 @@ static int wifi_ctrlfunc_register_drv(void)
 
 #if !defined(CONFIG_DTS)
        if (dts_enabled) {
-               adapter->wifi_plat_data = (void *)&dhd_wlan_control;
 #ifdef CUSTOMER_HW
+               adapter->wifi_plat_data = (void *)&dhd_wlan_control;
                bcm_wlan_set_plat_data();
 #ifdef CUSTOMER_OOB
                adapter->irq_num = bcm_wlan_get_oob_irq();
index 625dd353b6cd4aa02eb62485f7cdcf14ab6e6b0e..7b4476cce021ee5c2ad52940e98ae1c9e24d9253 100644 (file)
@@ -718,6 +718,7 @@ dhdsdio_sr_cap(dhd_bus_t *bus)
                (bus->sih->chip == BCM4354_CHIP_ID) ||
                (bus->sih->chip == BCM4356_CHIP_ID) ||
                (bus->sih->chip == BCM4358_CHIP_ID) ||
+               (bus->sih->chip == BCM4371_CHIP_ID) ||
                (BCM4349_CHIP(bus->sih->chip))          ||
                (bus->sih->chip == BCM4350_CHIP_ID)) {
                core_capext = TRUE;
@@ -738,6 +739,7 @@ dhdsdio_sr_cap(dhd_bus_t *bus)
                (bus->sih->chip == BCM4354_CHIP_ID) ||
                (bus->sih->chip == BCM4356_CHIP_ID) ||
                (bus->sih->chip == BCM4358_CHIP_ID) ||
+               (bus->sih->chip == BCM4371_CHIP_ID) ||
                (bus->sih->chip == BCM4350_CHIP_ID)) {
                uint32 enabval = 0;
                addr = SI_ENUM_BASE + OFFSETOF(chipcregs_t, chipcontrol_addr);
@@ -749,7 +751,8 @@ dhdsdio_sr_cap(dhd_bus_t *bus)
                        (bus->sih->chip == BCM4345_CHIP_ID) ||
                        (bus->sih->chip == BCM4354_CHIP_ID) ||
                        (bus->sih->chip == BCM4356_CHIP_ID) ||
-                       (bus->sih->chip == BCM4358_CHIP_ID))
+                       (bus->sih->chip == BCM4358_CHIP_ID) ||
+                       (bus->sih->chip == BCM4371_CHIP_ID))
                        enabval &= CC_CHIPCTRL3_SR_ENG_ENABLE;
 
                if (enabval)
@@ -5660,6 +5663,15 @@ deliver:
                dhd_os_sdunlock(bus->dhd);
                dhd_rx_frame(bus->dhd, ifidx, pkt, pkt_count, chan);
                dhd_os_sdlock(bus->dhd);
+#if defined(SDIO_ISR_THREAD)
+               /* terence 20150615: fix for below error due to bussleep in watchdog after dhd_os_sdunlock here,
+                 * so call BUS_WAKE to wake up bus again
+                 * dhd_bcmsdh_recv_buf: Device asleep
+                 * dhdsdio_readframes: RXHEADER FAILED: -40
+                 * dhdsdio_rxfail: abort command, terminate frame, send NAK
+               */
+               BUS_WAKE(bus);
+#endif
        }
        rxcount = maxframes - rxleft;
 #ifdef DHD_DEBUG
@@ -6752,6 +6764,8 @@ dhdsdio_chipmatch(uint16 chipid)
                return TRUE;
        if (chipid == BCM4358_CHIP_ID)
                return TRUE;
+       if (chipid == BCM4371_CHIP_ID)
+               return TRUE;
        if (chipid == BCM43430_CHIP_ID)
                return TRUE;
        if (BCM4349_CHIP(chipid))
@@ -7399,6 +7413,7 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva,
                        case BCM4354_CHIP_ID:
                        case BCM4356_CHIP_ID:
                        case BCM4358_CHIP_ID:
+                       case BCM4371_CHIP_ID:
                                bus->dongle_ram_base = CR4_4350_RAM_BASE;
                                break;
                        case BCM4360_CHIP_ID:
index b7c386ef0e84866799b4a7a023331690006b5ad9..1c17045eb5be9f6290a098151d561088806414b2 100644 (file)
 #define BCM43569_CHIP_ID       0xAA31          /* 43569 chipcommon chipid */
 #define BCM43570_CHIP_ID       0xAA32          /* 43570 chipcommon chipid */
 #define BCM4358_CHIP_ID         0x4358          /* 4358 chipcommon chipid */
+#define BCM4371_CHIP_ID                0x4371          /* 4371 chipcommon chipid */
 #define BCM4350_CHIP(chipid)   ((CHIPID(chipid) == BCM4350_CHIP_ID) || \
                                (CHIPID(chipid) == BCM4354_CHIP_ID) || \
                                (CHIPID(chipid) == BCM4356_CHIP_ID) || \
old mode 100644 (file)
new mode 100755 (executable)
index d941fec4af13b9d182c90a16ed8a6d52f5f39c1b..bb1ac3a1043090b99bcdc1d9391afec99ae85a78 100644 (file)
@@ -9364,7 +9364,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)
@@ -9373,7 +9375,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);
+#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)
@@ -9382,7 +9386,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)
@@ -10545,7 +10551,9 @@ wl_notify_rx_mgmt_frame(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
        WL_DBG((" device name is ndev %s \n", ndev->name));
 #endif
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+       retval = cfg80211_rx_mgmt(cfgdev, freq, 0,  mgmt_frame, mgmt_frame_len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))\r
        retval = 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)
@@ -14255,7 +14263,10 @@ wl_tdls_event_handler(struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
                dhd_tdls_update_peer_info(ndev, TRUE, (uint8 *)&e->addr.octet[0]);
 #endif /* PCIE_FULL_DONGLE */
                if (cfg->tdls_mgmt_frame) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
+                       cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
+                               cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len, 0);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 12, 0))
                        cfg80211_rx_mgmt(cfgdev, cfg->tdls_mgmt_freq, 0,
                                cfg->tdls_mgmt_frame, cfg->tdls_mgmt_frame_len,
                                0, GFP_ATOMIC);
index 8dcaf42931257c2a43586431881af5dc3b2b477d..58235410fbb4442999a4cc86d81f3911b940cb2f 100644 (file)
@@ -57,8 +57,8 @@ int wl_cfgp2p_if_stop(struct net_device *net);
 #if defined(WL_ENABLE_P2P_IF)
 static int wl_cfgp2p_start_xmit(struct sk_buff *skb, struct net_device *ndev);
 static int wl_cfgp2p_do_ioctl(struct net_device *net, struct ifreq *ifr, int cmd);
-static int wl_cfgp2p_if_open(struct net_device *net);
-static int wl_cfgp2p_if_stop(struct net_device *net);
+int wl_cfgp2p_if_open(struct net_device *net);
+int wl_cfgp2p_if_stop(struct net_device *net);
 
 static const struct net_device_ops wl_cfgp2p_if_ops = {
        .ndo_open       = wl_cfgp2p_if_open,
@@ -2719,10 +2719,11 @@ static int wl_cfgp2p_do_ioctl(struct net_device *net, struct ifreq *ifr, int cmd
 #endif /* WL_ENABLE_P2P_IF || WL_NEWCFG_PRIVCMD_SUPPORT || defined(P2PONEINT) */
 
 #if defined(WL_ENABLE_P2P_IF) || defined(P2PONEINT)
+int
 #ifdef  P2PONEINT
-int wl_cfgp2p_if_open(struct net_device *net)
+wl_cfgp2p_if_open(struct net_device *net)
 #else
-static int wl_cfgp2p_if_open(struct net_device *net)
+wl_cfgp2p_if_open(struct net_device *net)
 #endif
 {
        struct wireless_dev *wdev = net->ieee80211_ptr;
@@ -2745,10 +2746,11 @@ static int wl_cfgp2p_if_open(struct net_device *net)
        return 0;
 }
 
+int
 #ifdef  P2PONEINT
-int wl_cfgp2p_if_stop(struct net_device *net)
+wl_cfgp2p_if_stop(struct net_device *net)
 #else
-static int wl_cfgp2p_if_stop(struct net_device *net)
+wl_cfgp2p_if_stop(struct net_device *net)
 #endif
 {
        struct wireless_dev *wdev = net->ieee80211_ptr;