From: Rongjun Chen Date: Wed, 8 Jul 2015 05:50:18 +0000 (+0800) Subject: pd#108773 add ap6356 wifi support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a41b1c82e16237c68417d9fa59178df827f75373;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_dhd-driver.git pd#108773 add ap6356 wifi support Change-Id: I696771a2a49f3247c1a6aec6be21a1fa269dd6ad --- diff --git a/bcmdhd_1_201_59_x/dhd_config.c b/bcmdhd_1_201_59_x/dhd_config.c index 4e8113e..075d60b 100644 --- a/bcmdhd_1_201_59_x/dhd_config.c +++ b/bcmdhd_1_201_59_x/dhd_config.c @@ -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: + * All pkt: pkt_filter_add=99 0 0 0 0x000000000000 0x000000000000 + */ 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 */ 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 || + conf->chip == BCM4345_CHIP_ID) { 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; + } + if (conf->chip == BCM43430_CHIP_ID) { + conf->bus_rxglom = FALSE; conf->use_rxchain = 0; } if (conf->chip == BCM4339_CHIP_ID) { diff --git a/bcmdhd_1_201_59_x/dhd_linux_platdev.c b/bcmdhd_1_201_59_x/dhd_linux_platdev.c index a4063e5..1071b72 100644 --- a/bcmdhd_1_201_59_x/dhd_linux_platdev.c +++ b/bcmdhd_1_201_59_x/dhd_linux_platdev.c @@ -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(); diff --git a/bcmdhd_1_201_59_x/dhd_sdio.c b/bcmdhd_1_201_59_x/dhd_sdio.c index 625dd35..7b4476c 100644 --- a/bcmdhd_1_201_59_x/dhd_sdio.c +++ b/bcmdhd_1_201_59_x/dhd_sdio.c @@ -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: diff --git a/bcmdhd_1_201_59_x/include/bcmdevs.h b/bcmdhd_1_201_59_x/include/bcmdevs.h index b7c386e..1c17045 100644 --- a/bcmdhd_1_201_59_x/include/bcmdevs.h +++ b/bcmdhd_1_201_59_x/include/bcmdevs.h @@ -352,6 +352,7 @@ #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) || \ diff --git a/bcmdhd_1_201_59_x/include/epivers.sh b/bcmdhd_1_201_59_x/include/epivers.sh old mode 100644 new mode 100755 diff --git a/bcmdhd_1_201_59_x/wl_cfg80211.c b/bcmdhd_1_201_59_x/wl_cfg80211.c index d941fec..bb1ac3a 100644 --- a/bcmdhd_1_201_59_x/wl_cfg80211.c +++ b/bcmdhd_1_201_59_x/wl_cfg80211.c @@ -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)) 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); diff --git a/bcmdhd_1_201_59_x/wl_cfgp2p.c b/bcmdhd_1_201_59_x/wl_cfgp2p.c index 8dcaf42..5823541 100644 --- a/bcmdhd_1_201_59_x/wl_cfgp2p.c +++ b/bcmdhd_1_201_59_x/wl_cfgp2p.c @@ -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;