summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Wang <wangroger@google.com>2020-08-14 10:20:10 +0800
committerAhmed ElArabawy <arabawy@google.com>2020-09-02 16:12:43 -0700
commit2277032b379e01f8b55e98c481909d8ad566c6ae (patch)
tree93208f4b9114192bb0c9084da6f3cffb18504f2e
parent2d9f191ede4c6bb03be4f6d5fa148c20e851f788 (diff)
downloadbcm43752-2277032b379e01f8b55e98c481909d8ad566c6ae.tar.gz
bcmdhd43752: Build bcmdhd43752 with kernel 5.4
In this commit we add changes to solve build break and build warning in kernel 5.4 when building bcmdhd43752. - Check GS101 definition first - Fix function name to avoid duplicate naming - Fix wiphy register failed - Fix chi_check failure on start_xmit - Fix chi_check failure on dhd_mem_dump - Adjust order of sscd registr - Remove DHD_NOTIFY_MAC_CHANGED Bug: 163302778 Test: Build bcmdhd43752 with kernel 5.4 successfully. Test: Device can boot into home even no WiFi cards. Test: WiFi is workable when 43752/4389 card is plugged Change-Id: Idf471ab9f2214c785381acdc3cebc58a7e36a27c Signed-off-by: Roger Wang <wangroger@google.com> Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
-rwxr-xr-xKbuild13
-rw-r--r--dhd_bus.h6
-rwxr-xr-xdhd_custom_google.c45
-rw-r--r--dhd_custom_memprealloc.c12
-rwxr-xr-xdhd_linux.c50
-rwxr-xr-xdhd_linux_exportfs.c4
-rw-r--r--dhd_linux_platdev.c16
-rwxr-xr-xdhd_pcie_linux.c14
-rw-r--r--include/linuxver.h16
-rwxr-xr-xwl_android.c2
-rwxr-xr-xwl_cfg80211.c2
-rwxr-xr-xwl_cfgp2p.c6
-rwxr-xr-xwl_cfgvendor.c21
-rw-r--r--wl_linux_mon.c6
14 files changed, 114 insertions, 99 deletions
diff --git a/Kbuild b/Kbuild
index 684a39e..8825c25 100755
--- a/Kbuild
+++ b/Kbuild
@@ -128,9 +128,6 @@ endif
DHDCFLAGS += -DDEBUGABILITY
-# Notify the MAC changed to wpa_supplicant
-DHDCFLAGS += -DDHD_NOTIFY_MAC_CHANGED
-
# Random ANQP source address
DHDCFLAGS += -DANQP_RANDOM_SA
@@ -794,6 +791,12 @@ ifeq ($(DRIVER_TYPE),m)
DHDCFLAGS += -DBCMDHD_MODULAR
endif
+# Temporary fix : Kernel 5.4 does not define CONFIG_ARCH_EXYNOS,
+# so we add here first.
+ifneq ($(filter y, $(CONFIG_SOC_GS101) $(CONFIG_SOC_EXYNOS9820)),)
+ DHDCFLAGS += -DCONFIG_ARCH_EXYNOS
+endif
+
EXTRA_CFLAGS += $(DHDCFLAGS) -DDHD_DEBUG
EXTRA_CFLAGS += -DDHD_COMPILED=\"$(BCMDHD_ROOT)\"
EXTRA_CFLAGS += -I$(BCMDHD_ROOT)/include/ -I$(BCMDHD_ROOT)/
@@ -835,9 +838,7 @@ endif
ifneq ($(filter y, $(CONFIG_SOC_GS101) $(CONFIG_SOC_EXYNOS9820)),)
DHDOFILES += dhd_custom_google.o
-endif
-
-ifneq ($(CONFIG_ARCH_HISI),)
+else ifneq ($(CONFIG_ARCH_HISI),)
DHDOFILES += dhd_custom_hikey.o
endif
diff --git a/dhd_bus.h b/dhd_bus.h
index 4618e5b..eb3b595 100644
--- a/dhd_bus.h
+++ b/dhd_bus.h
@@ -239,7 +239,7 @@ extern int dhdpcie_cto_cfg_init(struct dhd_bus *bus, bool enable);
extern void dhdpcie_ssreset_dis_enum_rst(struct dhd_bus *bus);
#ifdef DHD_FW_COREDUMP
-extern int dhd_dongle_mem_dump(void);
+extern int dhd_dongle_mem_dump_43752(void);
#endif /* DHD_FW_COREDUMP */
#ifdef IDLE_TX_FLOW_MGMT
@@ -275,7 +275,7 @@ extern void dhd_bus_dump_console_buffer(struct dhd_bus *bus);
extern void dhd_bus_intr_count_dump(dhd_pub_t *dhdp);
extern bool dhd_bus_query_dpc_sched_errors(dhd_pub_t *dhdp);
extern int dhd_bus_dmaxfer_lpbk(dhd_pub_t *dhdp, uint32 type);
-extern bool dhd_bus_check_driver_up(void);
+extern bool dhd_bus_check_driver_up_43752(void);
extern int dhd_bus_get_cto(dhd_pub_t *dhdp);
extern void dhd_bus_set_linkdown(dhd_pub_t *dhdp, bool val);
extern int dhd_bus_get_linkdown(dhd_pub_t *dhdp);
@@ -284,7 +284,7 @@ extern int dhd_bus_get_linkdown(dhd_pub_t *dhdp);
static INLINE void dhd_bus_intr_count_dump(dhd_pub_t *dhdp) { UNUSED_PARAMETER(dhdp); }
static INLINE bool dhd_bus_query_dpc_sched_errors(dhd_pub_t *dhdp) { return 0; }
static INLINE int dhd_bus_dmaxfer_lpbk(dhd_pub_t *dhdp, uint32 type) { return 0; }
-static INLINE bool dhd_bus_check_driver_up(void) { return FALSE; }
+static INLINE bool dhd_bus_check_driver_up_43752(void) { return FALSE; }
extern INLINE void dhd_bus_set_linkdown(dhd_pub_t *dhdp, bool val) { }
extern INLINE int dhd_bus_get_linkdown(dhd_pub_t *dhdp) { return 0; }
static INLINE int dhd_bus_get_cto(dhd_pub_t *dhdp) { return 0; }
diff --git a/dhd_custom_google.c b/dhd_custom_google.c
index 1031b0c..d2c6dc9 100755
--- a/dhd_custom_google.c
+++ b/dhd_custom_google.c
@@ -34,7 +34,11 @@
#include <linux/err.h>
#include <linux/gpio.h>
#include <linux/skbuff.h>
+#if defined(CONFIG_WIFI_CONTROL_FUNC)
#include <linux/wlan_plat.h>
+#else
+#include <dhd_linux.h>
+#endif
#include <linux/fcntl.h>
#include <linux/fs.h>
#include <linux/of_gpio.h>
@@ -46,8 +50,8 @@
#endif /* DHD_COREDUMP */
#ifdef CONFIG_BROADCOM_WIFI_RESERVED_MEM
-extern int dhd_init_wlan_mem(void);
-extern void *dhd_wlan_mem_prealloc(int section, unsigned long size);
+extern int dhd_init_wlan_mem_43752(void);
+extern void *dhd_wlan_mem_prealloc_43752(int section, unsigned long size);
#endif /* CONFIG_BROADCOM_WIFI_RESERVED_MEM */
#define WLAN_REG_ON_GPIO 491
@@ -72,7 +76,7 @@ extern void exynos_pcie_pm_suspend(int);
#endif /* CONFIG_SOC_EXYNOS9810 || CONFIG_SOC_EXYNOS9820 || CONFIG_SOC_GS101 */
#ifdef DHD_COREDUMP
-#define DEVICE_NAME "wlan"
+#define DEVICE_NAME "wlan_43752"
static void sscd_release(struct device *dev);
static struct sscd_platform_data sscd_pdata;
@@ -271,7 +275,7 @@ dhd_wifi_init_gpio(void)
}
int
-dhd_wlan_power(int onoff)
+dhd_wlan_power_43752(int onoff)
{
DHD_INFO(("------------------------------------------------\n"));
DHD_INFO(("------------------------------------------------\n"));
@@ -310,7 +314,7 @@ dhd_wlan_power(int onoff)
}
return 0;
}
-EXPORT_SYMBOL(dhd_wlan_power);
+EXPORT_SYMBOL(dhd_wlan_power_43752);
static int
dhd_wlan_reset(int onoff)
@@ -333,32 +337,32 @@ static int dhd_wlan_get_wake_irq(void)
#if defined(CONFIG_BCMDHD_OOB_HOST_WAKE) && defined(CONFIG_BCMDHD_GET_OOB_STATE)
int
-dhd_get_wlan_oob_gpio(void)
+dhd_get_wlan_oob_gpio_43752(void)
{
return gpio_is_valid(wlan_host_wake_up) ?
gpio_get_value(wlan_host_wake_up) : -1;
}
-EXPORT_SYMBOL(dhd_get_wlan_oob_gpio);
+EXPORT_SYMBOL(dhd_get_wlan_oob_gpio_43752);
#endif /* CONFIG_BCMDHD_OOB_HOST_WAKE && CONFIG_BCMDHD_GET_OOB_STATE */
-struct resource dhd_wlan_resources = {
+struct resource dhd_wlan_resources_43752 = {
.name = "bcmdhd_wlan_irq",
.start = 0, /* Dummy */
.end = 0, /* Dummy */
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE |
IORESOURCE_IRQ_HIGHEDGE,
};
-EXPORT_SYMBOL(dhd_wlan_resources);
+EXPORT_SYMBOL(dhd_wlan_resources_43752);
-struct wifi_platform_data dhd_wlan_control = {
- .set_power = dhd_wlan_power,
+struct wifi_platform_data dhd_wlan_control_43752 = {
+ .set_power = dhd_wlan_power_43752,
.set_reset = dhd_wlan_reset,
.set_carddetect = dhd_wlan_set_carddetect,
#ifdef DHD_COREDUMP
.set_coredump = dhd_set_coredump,
#endif /* DHD_COREDUMP */
#ifdef CONFIG_BROADCOM_WIFI_RESERVED_MEM
- .mem_prealloc = dhd_wlan_mem_prealloc,
+ .mem_prealloc = dhd_wlan_mem_prealloc_43752,
#endif /* CONFIG_BROADCOM_WIFI_RESERVED_MEM */
#ifdef GET_CUSTOM_MAC_ENABLE
.get_mac_addr = dhd_wlan_get_mac_addr,
@@ -367,7 +371,7 @@ struct wifi_platform_data dhd_wlan_control = {
.get_wake_irq = dhd_wlan_get_wake_irq,
#endif // endif
};
-EXPORT_SYMBOL(dhd_wlan_control);
+EXPORT_SYMBOL(dhd_wlan_control_43752);
int
dhd_wlan_init(void)
@@ -375,6 +379,11 @@ dhd_wlan_init(void)
int ret;
DHD_INFO(("%s: START.......\n", __FUNCTION__));
+
+#ifdef DHD_COREDUMP
+ platform_device_register(&sscd_dev);
+#endif /* DHD_COREDUMP */
+
ret = dhd_wifi_init_gpio();
if (ret < 0) {
DHD_ERROR(("%s: failed to initiate GPIO, ret=%d\n",
@@ -382,12 +391,12 @@ dhd_wlan_init(void)
goto fail;
}
#ifdef CONFIG_BCMDHD_OOB_HOST_WAKE
- dhd_wlan_resources.start = wlan_host_wake_irq;
- dhd_wlan_resources.end = wlan_host_wake_irq;
+ dhd_wlan_resources_43752.start = wlan_host_wake_irq;
+ dhd_wlan_resources_43752.end = wlan_host_wake_irq;
#endif /* CONFIG_BCMDHD_OOB_HOST_WAKE */
#ifdef CONFIG_BROADCOM_WIFI_RESERVED_MEM
- ret = dhd_init_wlan_mem();
+ ret = dhd_init_wlan_mem_43752();
if (ret < 0) {
DHD_ERROR(("%s: failed to alloc reserved memory,"
" ret=%d\n", __FUNCTION__, ret));
@@ -398,10 +407,6 @@ dhd_wlan_init(void)
dhd_wlan_init_mac_addr();
#endif /* GET_CUSTOM_MAC_ENABLE */
-#ifdef DHD_COREDUMP
- platform_device_register(&sscd_dev);
-#endif /* DHD_COREDUMP */
-
fail:
DHD_ERROR(("%s: FINISH.......\n", __FUNCTION__));
return ret;
diff --git a/dhd_custom_memprealloc.c b/dhd_custom_memprealloc.c
index 7825c03..8bad151 100644
--- a/dhd_custom_memprealloc.c
+++ b/dhd_custom_memprealloc.c
@@ -149,7 +149,7 @@ static void *wlan_static_dhd_log_dump_buf_ex = NULL;
static void *wlan_static_dhd_pktlog_dump_buf = NULL;
void
-*dhd_wlan_mem_prealloc(int section, unsigned long size)
+*dhd_wlan_mem_prealloc_43752(int section, unsigned long size)
{
if (section == PREALLOC_WLAN_SEC_NUM) {
return wlan_static_skb;
@@ -273,10 +273,10 @@ void
return wlan_mem_array[section].mem_ptr;
}
-EXPORT_SYMBOL(dhd_wlan_mem_prealloc);
+EXPORT_SYMBOL(dhd_wlan_mem_prealloc_43752);
int
-dhd_init_wlan_mem(void)
+dhd_init_wlan_mem_43752(void)
{
int i;
int j;
@@ -472,10 +472,10 @@ err_skb_alloc:
return -ENOMEM;
}
-EXPORT_SYMBOL(dhd_init_wlan_mem);
+EXPORT_SYMBOL(dhd_init_wlan_mem_43752);
void
-dhd_exit_wlan_mem(void)
+dhd_exit_wlan_mem_43752(void)
{
int i = 0;
@@ -548,5 +548,5 @@ dhd_exit_wlan_mem(void)
return;
}
-EXPORT_SYMBOL(dhd_exit_wlan_mem);
+EXPORT_SYMBOL(dhd_exit_wlan_mem_43752);
#endif /* CONFIG_BROADCOM_WIFI_RESERVED_MEM */
diff --git a/dhd_linux.c b/dhd_linux.c
index 153d890..337f6e3 100755
--- a/dhd_linux.c
+++ b/dhd_linux.c
@@ -335,7 +335,7 @@ static int __dhd_apf_delete_filter(struct net_device *ndev, uint32 filter_id);
#endif /* PKT_FILTER_SUPPORT && APF */
#ifdef DHD_FW_COREDUMP
-static int dhd_mem_dump(void *dhd_info, void *event_info, u8 event);
+static void dhd_mem_dump(void *dhd_info, void *event_info, u8 event);
#endif /* DHD_FW_COREDUMP */
#ifdef DHD_LOG_DUMP
@@ -481,8 +481,6 @@ int host_edl_support = TRUE;
module_param(host_edl_support, int, 0644);
#endif
-static bool dhd_allow_stop = TRUE;
-
/* deferred handlers */
static void dhd_ifadd_event_handler(void *handle, void *event_info, u8 event);
static void dhd_ifdel_event_handler(void *handle, void *event_info, u8 event);
@@ -1926,7 +1924,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
#ifdef PASS_ALL_MCAST_PKTS
allmulti = 0;
for (i = 0; i < DHD_MAX_IFS; i++) {
- if (dhdinfo->iflist[i] && dhdinfo->iflist[i]->net)
+ if (dhdinfo->iflist[i] && dhdinfo->iflist[i]->net) {
ret = dhd_iovar(dhd, i, "allmulti",
(char *)&allmulti,
sizeof(allmulti),
@@ -1935,6 +1933,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
DHD_ERROR(("%s allmulti failed %d\n",
__FUNCTION__, ret));
}
+ }
}
#endif /* PASS_ALL_MCAST_PKTS */
@@ -2663,32 +2662,16 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, uint8 *addr)
{
int ret;
-#ifdef DHD_NOTIFY_MAC_CHANGED
- DHD_ERROR(("%s: close dev for mac changing\n", __func__));
- dhd_allow_stop = FALSE;
- dev_close(dhd->iflist[ifidx]->net);
-#endif /* DHD_NOTIFY_MAC_CHANGED */
-
ret = dhd_iovar(&dhd->pub, ifidx, "cur_etheraddr", (char *)addr,
ETHER_ADDR_LEN, NULL, 0, TRUE);
if (ret < 0) {
DHD_ERROR(("%s: set cur_etheraddr failed\n", dhd_ifname(&dhd->pub, ifidx)));
-#ifdef DHD_NOTIFY_MAC_CHANGED
- dhd_allow_stop = TRUE;
- return ret;
-#endif /* DHD_NOTIFY_MAC_CHANGED */
} else {
memcpy(dhd->iflist[ifidx]->net->dev_addr, addr, ETHER_ADDR_LEN);
if (ifidx == 0)
memcpy(dhd->pub.mac.octet, addr, ETHER_ADDR_LEN);
}
-#ifdef DHD_NOTIFY_MAC_CHANGED
- dev_open(dhd->iflist[ifidx]->net);
- dhd_allow_stop = TRUE;
- DHD_ERROR(("%s: notify mac changed done\n", __func__));
-#endif /* DHD_NOTIFY_MAC_CHANGED */
-
return ret;
}
@@ -2985,19 +2968,11 @@ dhd_set_mac_addr_handler(void *handle, void *event_info, u8 event)
DHD_ERROR(("%s: MACID is overwritten\n", __FUNCTION__));
ifp->set_macaddress = FALSE;
-#ifdef DHD_NOTIFY_MAC_CHANGED
- rtnl_lock();
-#endif /* DHD_NOTIFY_MAC_CHANGED */
-
if (_dhd_set_mac_address(dhd, ifp->idx, ifp->mac_addr) == 0)
DHD_INFO(("%s: MACID is overwritten\n", __FUNCTION__));
else
DHD_ERROR(("%s: _dhd_set_mac_address() failed\n", __FUNCTION__));
-#ifdef DHD_NOTIFY_MAC_CHANGED
- rtnl_unlock();
-#endif /* DHD_NOTIFY_MAC_CHANGED */
-
done:
DHD_OS_WAKE_UNLOCK(&dhd->pub);
dhd_net_if_unlock_local(dhd);
@@ -7050,7 +7025,7 @@ dhd_stop(struct net_device *net)
#if defined(WL_STATIC_IF) && defined(WL_CFG80211)
/* If static if is operational, don't reset the chip */
- if (IS_CFG80211_STATIC_IF_ACTIVE(cfg) || !dhd_allow_stop) {
+ if (IS_CFG80211_STATIC_IF_ACTIVE(cfg)) {
DHD_ERROR(("static if operational. skip chip reset.\n"));
skip_reset = true;
wl_cfg80211_sta_ifdown(net);
@@ -7748,7 +7723,7 @@ dhd_static_if_stop(struct net_device *net)
DHD_INFO(("[%s][STATIC_IF] Enter \n", net->name));
cfg = wl_get_cfg(net);
- if (!IS_CFG80211_STATIC_IF(cfg, net) || !dhd_allow_stop) {
+ if (!IS_CFG80211_STATIC_IF(cfg, net)) {
DHD_TRACE(("non-static interface (%s)..do nothing \n", net->name));
return BCME_OK;
}
@@ -16627,14 +16602,14 @@ static void dhd_hang_process(struct work_struct *work_data)
#ifdef CONFIG_ARCH_EXYNOS
extern dhd_pub_t *link_recovery;
-void dhd_host_recover_link(void)
+void dhd_host_recover_link_43752(void)
{
DHD_ERROR(("****** %s ******\n", __FUNCTION__));
link_recovery->hang_reason = HANG_REASON_PCIE_LINK_DOWN_RC_DETECT;
dhd_bus_set_linkdown(link_recovery, TRUE);
dhd_os_send_hang_message(link_recovery);
}
-EXPORT_SYMBOL(dhd_host_recover_link);
+EXPORT_SYMBOL(dhd_host_recover_link_43752);
#endif /* CONFIG_ARCH_EXYNOS */
#ifdef DHD_DETECT_CONSECUTIVE_MFG_HANG
@@ -18640,13 +18615,12 @@ void dhd_schedule_memdump(dhd_pub_t *dhdp, uint8 *buf, uint32 size)
#if defined(WL_CFGVENDOR_SEND_HANG_EVENT)
char hang_reason_str[DHD_MEMDUMP_TYPE_LONGSTR_LEN];
#endif
-static int
+static void
dhd_mem_dump(void *handle, void *event_info, u8 event)
{
dhd_info_t *dhd = handle;
dhd_pub_t *dhdp = NULL;
unsigned long flags = 0;
- int ret = 0;
dhd_dump_t *dump = NULL;
#ifdef DHD_COREDUMP
char memdump_type[DHD_MEMDUMP_TYPE_LONGSTR_LEN];
@@ -18660,20 +18634,19 @@ dhd_mem_dump(void *handle, void *event_info, u8 event)
if (!dhd) {
DHD_ERROR(("%s: dhd is NULL\n", __FUNCTION__));
- return -ENODEV;
+ return;
}
dhdp = &dhd->pub;
if (!dhdp) {
DHD_ERROR(("%s: dhdp is NULL\n", __FUNCTION__));
- return -ENODEV;
+ return;
}
DHD_GENERAL_LOCK(dhdp, flags);
if (DHD_BUS_CHECK_DOWN_OR_DOWN_IN_PROGRESS(dhdp)) {
DHD_GENERAL_UNLOCK(dhdp, flags);
DHD_ERROR(("%s: bus is down! can't collect mem dump. \n", __FUNCTION__));
- ret = -ENODEV;
goto exit;
}
DHD_GENERAL_UNLOCK(dhdp, flags);
@@ -18711,7 +18684,6 @@ dhd_mem_dump(void *handle, void *event_info, u8 event)
dump = (dhd_dump_t *)event_info;
if (!dump) {
DHD_ERROR(("%s: dump is NULL\n", __FUNCTION__));
- ret = -EINVAL;
goto exit;
}
@@ -18858,7 +18830,7 @@ exit:
}
DHD_ERROR(("%s: EXIT \n", __FUNCTION__));
- return ret;
+ return;
}
#endif /* DHD_FW_COREDUMP */
diff --git a/dhd_linux_exportfs.c b/dhd_linux_exportfs.c
index fc187fc..36eed8b 100755
--- a/dhd_linux_exportfs.c
+++ b/dhd_linux_exportfs.c
@@ -2136,9 +2136,7 @@ void dhd_sysfs_exit(dhd_info_t *dhd)
}
#ifdef DHD_LB
- if (&dhd->dhd_lb_kobj != NULL) {
- kobject_put(&dhd->dhd_lb_kobj);
- }
+ kobject_put(&dhd->dhd_lb_kobj);
#endif /* DHD_LB */
/* Releae the kobject */
diff --git a/dhd_linux_platdev.c b/dhd_linux_platdev.c
index fb95cd4..3427951 100644
--- a/dhd_linux_platdev.c
+++ b/dhd_linux_platdev.c
@@ -66,16 +66,16 @@ static bool is_power_on = FALSE;
#if !defined(CONFIG_DTS)
#if defined(DHD_OF_SUPPORT)
static bool dts_enabled = TRUE;
-extern struct resource dhd_wlan_resources;
-extern struct wifi_platform_data dhd_wlan_control;
+extern struct resource dhd_wlan_resources_43752;
+extern struct wifi_platform_data dhd_wlan_control_43752;
#else
static bool dts_enabled = FALSE;
#if defined(STRICT_GCC_WARNINGS) && defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
-struct resource dhd_wlan_resources = {0};
-struct wifi_platform_data dhd_wlan_control = {0};
+struct resource dhd_wlan_resources_43752 = {0};
+struct wifi_platform_data dhd_wlan_control_43752 = {0};
#if defined(STRICT_GCC_WARNINGS) && defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
@@ -435,7 +435,11 @@ static struct platform_driver wifi_platform_dev_driver_legacy = {
}
};
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0)
+static int wifi_platdev_match(struct device *dev, const void *data)
+#else
static int wifi_platdev_match(struct device *dev, void *data)
+#endif /* LINUX_VER >= 5.3.0 */
{
char *name = (char*)data;
const struct platform_device *pdev;
@@ -511,8 +515,8 @@ static int wifi_ctrlfunc_register_drv(void)
#if !defined(CONFIG_DTS)
if (dts_enabled) {
struct resource *resource;
- adapter->wifi_plat_data = (void *)&dhd_wlan_control;
- resource = &dhd_wlan_resources;
+ adapter->wifi_plat_data = (void *)&dhd_wlan_control_43752;
+ resource = &dhd_wlan_resources_43752;
adapter->irq_num = resource->start;
adapter->intr_flags = resource->flags & IRQF_TRIGGER_MASK;
#ifdef DHD_ISR_NO_SUSPEND
diff --git a/dhd_pcie_linux.c b/dhd_pcie_linux.c
index 110f164..30d46d4 100755
--- a/dhd_pcie_linux.c
+++ b/dhd_pcie_linux.c
@@ -234,7 +234,7 @@ static const struct dev_pm_ops dhdpcie_pm_ops = {
static struct pci_driver dhdpcie_driver = {
node: {&dhdpcie_driver.node, &dhdpcie_driver.node},
- name: "pcieh",
+ name: "pcieh_43752",
id_table: dhdpcie_pci_devid,
probe: dhdpcie_pci_probe,
remove: dhdpcie_pci_remove,
@@ -2490,7 +2490,7 @@ dhdpcie_bus_request_irq(struct dhd_bus *bus)
#ifdef BCMPCIE_OOB_HOST_WAKE
#ifdef CONFIG_BCMDHD_GET_OOB_STATE
-extern int dhd_get_wlan_oob_gpio(void);
+extern int dhd_get_wlan_oob_gpio_43752(void);
#endif /* CONFIG_BCMDHD_GET_OOB_STATE */
int dhdpcie_get_oob_irq_level(void)
@@ -2498,7 +2498,7 @@ int dhdpcie_get_oob_irq_level(void)
int gpio_level;
#ifdef CONFIG_BCMDHD_GET_OOB_STATE
- gpio_level = dhd_get_wlan_oob_gpio();
+ gpio_level = dhd_get_wlan_oob_gpio_43752();
#else
gpio_level = BCME_UNSUPPORTED;
#endif /* CONFIG_BCMDHD_GET_OOB_STATE */
@@ -2955,7 +2955,7 @@ struct device * dhd_bus_to_dev(dhd_bus_t *bus)
#ifdef DHD_FW_COREDUMP
int
-dhd_dongle_mem_dump(void)
+dhd_dongle_mem_dump_43752(void)
{
if (!g_dhd_bus) {
DHD_ERROR(("%s: Bus is NULL\n", __FUNCTION__));
@@ -2975,11 +2975,11 @@ dhd_dongle_mem_dump(void)
dhd_bus_mem_dump(g_dhd_bus->dhd);
return 0;
}
-EXPORT_SYMBOL(dhd_dongle_mem_dump);
+EXPORT_SYMBOL(dhd_dongle_mem_dump_43752);
#endif /* DHD_FW_COREDUMP */
bool
-dhd_bus_check_driver_up(void)
+dhd_bus_check_driver_up_43752(void)
{
dhd_bus_t *bus;
dhd_pub_t *dhdp;
@@ -2998,4 +2998,4 @@ dhd_bus_check_driver_up(void)
return isup;
}
-EXPORT_SYMBOL(dhd_bus_check_driver_up);
+EXPORT_SYMBOL(dhd_bus_check_driver_up_43752);
diff --git a/include/linuxver.h b/include/linuxver.h
index 0e0aeb8..9ea9ad5 100644
--- a/include/linuxver.h
+++ b/include/linuxver.h
@@ -87,6 +87,7 @@
#include <linux/interrupt.h>
#include <linux/kthread.h>
#include <linux/netdevice.h>
+#include <linux/rtc.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27))
#include <linux/semaphore.h>
#else
@@ -184,6 +185,9 @@ typedef irqreturn_t(*FN_ISR) (int irq, void *dev_id, struct pt_regs *ptregs);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0))
#include <linux/sched/rt.h>
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#include <uapi/linux/sched/types.h>
+#endif /* LINUX_VERS >= 4.11.0 */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
#include <net/lib80211.h>
@@ -389,6 +393,18 @@ extern void timer_cb_compat(struct timer_list *tl);
#define mod_timer(t, j) mod_timer(&((t)->timer), j)
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
+#define rtc_time_to_tm(a, b) rtc_time64_to_tm(a, b)
+#else
+#define rtc_time_to_tm(a, b) rtc_time_to_tm(a, b)
+#endif /* LINUX_VER >= 3.19.0 */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 20, 0)
+#define time_to_tm(a, b, c) time64_to_tm(a, b, c)
+#else
+#define time_to_tm(a, b, c) time_to_tm(a, b, c)
+#endif /* LINUX_VER >= 4.20.0 */
+
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 43))
#define dev_kfree_skb_any(a) dev_kfree_skb(a)
diff --git a/wl_android.c b/wl_android.c
index 47b05fc..be00e28 100755
--- a/wl_android.c
+++ b/wl_android.c
@@ -9362,7 +9362,7 @@ wl_android_set_adps_mode(struct net_device *dev, const char* string_num)
adps_mode = bcm_atoi(string_num);
WL_ERR(("%s: SET_ADPS %d\n", __FUNCTION__, adps_mode));
- if ((adps_mode < 0) && (1 < adps_mode)) {
+ if (!(adps_mode == 0 || adps_mode == 1)) {
WL_ERR(("wl_android_set_adps_mode: Invalid value %d.\n", adps_mode));
return -EINVAL;
}
diff --git a/wl_cfg80211.c b/wl_cfg80211.c
index c444857..6123d69 100755
--- a/wl_cfg80211.c
+++ b/wl_cfg80211.c
@@ -869,7 +869,7 @@ int dhd_add_monitor(const char *name, struct net_device **new_ndev);
int dhd_del_monitor(struct net_device *ndev);
int dhd_monitor_init(void *dhd_pub);
int dhd_monitor_uninit(void);
-int dhd_start_xmit(struct sk_buff *skb, struct net_device *net);
+netdev_tx_t dhd_start_xmit(struct sk_buff *skb, struct net_device *net);
#ifdef ROAM_CHANNEL_CACHE
int init_roam_cache(struct bcm_cfg80211 *cfg, int ioctl_ver);
diff --git a/wl_cfgp2p.c b/wl_cfgp2p.c
index a4cd14d..62262cd 100755
--- a/wl_cfgp2p.c
+++ b/wl_cfgp2p.c
@@ -67,7 +67,7 @@ static s32 wl_cfgp2p_cancel_listen(struct bcm_cfg80211 *cfg, struct net_device *
struct wireless_dev *wdev, bool notify);
#if defined(WL_ENABLE_P2P_IF)
-static int wl_cfgp2p_start_xmit(struct sk_buff *skb, struct net_device *ndev);
+static netdev_tx_t 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);
@@ -81,7 +81,7 @@ static const struct net_device_ops wl_cfgp2p_if_ops = {
#endif /* WL_ENABLE_P2P_IF */
#if defined(WL_NEWCFG_PRIVCMD_SUPPORT)
-static int wl_cfgp2p_start_xmit(struct sk_buff *skb, struct net_device *ndev);
+static netdev_tx_t 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_dummy(struct net_device *net)
@@ -2449,7 +2449,7 @@ wl_cfgp2p_unregister_ndev(struct bcm_cfg80211 *cfg)
return 0;
}
-static int wl_cfgp2p_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t wl_cfgp2p_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
if (skb)
diff --git a/wl_cfgvendor.c b/wl_cfgvendor.c
index 6d6646e..ed5d850 100755
--- a/wl_cfgvendor.c
+++ b/wl_cfgvendor.c
@@ -9579,7 +9579,7 @@ exit:
}
#endif /* WL_SAR_TX_POWER */
-static const struct wiphy_vendor_command wl_vendor_cmds [] = {
+static struct wiphy_vendor_command wl_vendor_cmds [] = {
{
{
.vendor_id = OUI_BRCM,
@@ -10323,6 +10323,20 @@ static const struct nl80211_vendor_cmd_info wl_vendor_events [] = {
{ OUI_BRCM, BRCM_VENDOR_EVENT_ACS}
};
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
+static void
+wl_cfgvendor_apply_cmd_policy(struct wiphy *wiphy)
+{
+ int i;
+ u32 n_cmds = wiphy->n_vendor_commands;
+
+ WL_INFORM(("Apply CMD_RAW_DATA policy\n"));
+ for (i = 0; i < n_cmds; i++) {
+ wl_vendor_cmds[i].policy = VENDOR_CMD_RAW_DATA;
+ }
+}
+#endif /* LINUX VER >= 5.3 */
+
int wl_cfgvendor_attach(struct wiphy *wiphy, dhd_pub_t *dhd)
{
@@ -10331,6 +10345,11 @@ int wl_cfgvendor_attach(struct wiphy *wiphy, dhd_pub_t *dhd)
wiphy->vendor_commands = wl_vendor_cmds;
wiphy->n_vendor_commands = ARRAY_SIZE(wl_vendor_cmds);
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 3, 0))
+ wl_cfgvendor_apply_cmd_policy(wiphy);
+#endif /* LINUX VER >= 5.3 */
+
wiphy->vendor_events = wl_vendor_events;
wiphy->n_vendor_events = ARRAY_SIZE(wl_vendor_events);
diff --git a/wl_linux_mon.c b/wl_linux_mon.c
index aa9b0f2..bda8216 100644
--- a/wl_linux_mon.c
+++ b/wl_linux_mon.c
@@ -51,7 +51,7 @@ typedef enum monitor_states
* Some external functions, TODO: move them to dhd_linux.h
*/
int dhd_add_monitor(const char *name, struct net_device **new_ndev);
-extern int dhd_start_xmit(struct sk_buff *skb, struct net_device *net);
+extern netdev_tx_t dhd_start_xmit(struct sk_buff *skb, struct net_device *net);
int dhd_del_monitor(struct net_device *ndev);
int dhd_monitor_init(void *dhd_pub);
int dhd_monitor_uninit(void);
@@ -84,7 +84,7 @@ static struct net_device* lookup_real_netdev(const char *name);
static monitor_interface* ndev_to_monif(struct net_device *ndev);
static int dhd_mon_if_open(struct net_device *ndev);
static int dhd_mon_if_stop(struct net_device *ndev);
-static int dhd_mon_if_subif_start_xmit(struct sk_buff *skb, struct net_device *ndev);
+static netdev_tx_t dhd_mon_if_subif_start_xmit(struct sk_buff *skb, struct net_device *ndev);
static void dhd_mon_if_set_multicast_list(struct net_device *ndev);
static int dhd_mon_if_change_mac(struct net_device *ndev, void *addr);
@@ -173,7 +173,7 @@ static int dhd_mon_if_stop(struct net_device *ndev)
return ret;
}
-static int dhd_mon_if_subif_start_xmit(struct sk_buff *skb, struct net_device *ndev)
+static netdev_tx_t dhd_mon_if_subif_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{
int ret = 0;
int rtap_len;