--- a/src/shared/linux_osl.c
+++ b/src/shared/linux_osl.c
@@ -932,7 +932,11 @@
 	uint cycles;
 
 #if defined(__i386__)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 3, 0)
+	cycles = (u32)rdtsc();
+#else
 	rdtscl(cycles);
+#endif
 #else
 	cycles = 0;
 #endif 
@@ -942,7 +946,7 @@
 void *
 osl_reg_map(uint32 pa, uint size)
 {
-	return (ioremap_nocache((unsigned long)pa, (unsigned long)size));
+	return (ioremap((unsigned long)pa, (unsigned long)size));
 }
 
 void
@@ -1076,7 +1080,11 @@
 	if (!image)
 		return 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0)
+	rdlen = kernel_read(fp, buf, len, &fp->f_pos);
+#else
 	rdlen = kernel_read(fp, fp->f_pos, buf, len);
+#endif
 	if (rdlen > 0)
 		fp->f_pos += rdlen;
 
--- a/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
@@ -39,6 +39,10 @@
 #include <proto/802.11.h>
 #include <wl_cfg80211_hybrid.h>
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#include <linux/sched/signal.h>
+#endif
+
 #define EVENT_TYPE(e) dtoh32((e)->event_type)
 #define EVENT_FLAGS(e) dtoh16((e)->flags)
 #define EVENT_STATUS(e) dtoh32((e)->status)
@@ -50,7 +54,11 @@
 #endif
 
 static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
-           enum nl80211_iftype type, u32 *flags, struct vif_params *params);
+           enum nl80211_iftype type, 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+           u32 *flags, 
+#endif
+           struct vif_params *params);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
 static s32
 wl_cfg80211_scan(struct wiphy *wiphy,
@@ -235,7 +243,26 @@
 };
 #endif				
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
 #define CHAN2G(_channel, _freq, _flags) {			\
+	.band			= NL80211_BAND_2GHZ,		\
+	.center_freq		= (_freq),			\
+	.hw_value		= (_channel),			\
+	.flags			= (_flags),			\
+	.max_antenna_gain	= 0,				\
+	.max_power		= 30,				\
+}
+
+#define CHAN5G(_channel, _flags) {				\
+	.band			= NL80211_BAND_5GHZ,		\
+	.center_freq		= 5000 + (5 * (_channel)),	\
+	.hw_value		= (_channel),			\
+	.flags			= (_flags),			\
+	.max_antenna_gain	= 0,				\
+	.max_power		= 30,				\
+}
+#else
+#define CHAN2G(_channel, _freq, _flags) {			\
 	.band			= IEEE80211_BAND_2GHZ,		\
 	.center_freq		= (_freq),			\
 	.hw_value		= (_channel),			\
@@ -252,6 +279,7 @@
 	.max_antenna_gain	= 0,				\
 	.max_power		= 30,				\
 }
+#endif
 
 #define RATE_TO_BASE100KBPS(rate)   (((rate) * 10) / 2)
 #define RATETAB_ENT(_rateid, _flags) \
@@ -379,7 +407,11 @@
 };
 
 static struct ieee80211_supported_band __wl_band_2ghz = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+	.band = NL80211_BAND_2GHZ,
+#else
 	.band = IEEE80211_BAND_2GHZ,
+#endif
 	.channels = __wl_2ghz_channels,
 	.n_channels = ARRAY_SIZE(__wl_2ghz_channels),
 	.bitrates = wl_g_rates,
@@ -387,7 +419,11 @@
 };
 
 static struct ieee80211_supported_band __wl_band_5ghz_a = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+	.band = NL80211_BAND_5GHZ,
+#else
 	.band = IEEE80211_BAND_5GHZ,
+#endif
 	.channels = __wl_5ghz_a_channels,
 	.n_channels = ARRAY_SIZE(__wl_5ghz_a_channels),
 	.bitrates = wl_a_rates,
@@ -395,7 +431,11 @@
 };
 
 static struct ieee80211_supported_band __wl_band_5ghz_n = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+	.band = NL80211_BAND_5GHZ,
+#else
 	.band = IEEE80211_BAND_5GHZ,
+#endif
 	.channels = __wl_5ghz_n_channels,
 	.n_channels = ARRAY_SIZE(__wl_5ghz_n_channels),
 	.bitrates = wl_a_rates,
@@ -450,7 +490,7 @@
 	ifr.ifr_data = (caddr_t)&ioc;
 
 	fs = get_fs();
-	set_fs(get_ds());
+	set_fs(KERNEL_DS);
 #if defined(WL_USE_NETDEV_OPS)
 	err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
 #else
@@ -463,8 +503,11 @@
 
 static s32
 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
-                         enum nl80211_iftype type, u32 *flags,
-   struct vif_params *params)
+                         enum nl80211_iftype type,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
+                         u32 *flags,
+#endif
+                         struct vif_params *params)
 {
 	struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
 	struct wireless_dev *wdev;
@@ -1446,7 +1489,6 @@
 
 	if (memcmp(mac, wl->profile->bssid, ETHER_ADDR_LEN)) {
 		WL_ERR(("Wrong Mac address, mac = %pM   profile =%pM\n", mac, wl->profile->bssid));
-		return -ENOENT;
 	}
 
 	err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate));
@@ -1876,8 +1918,13 @@
 	wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
 #endif
 	wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+	wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
+	wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a; 
+#else
 	wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
 	wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a; 
+#endif
 	wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
 	wdev->wiphy->cipher_suites = __wl_cipher_suites;
 	wdev->wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites);
@@ -1968,7 +2015,7 @@
 
 	if (dtoh32(bi->length) > WL_BSS_INFO_MAX) {
 		WL_DBG(("Beacon is larger than buffer. Discarding\n"));
-		return err;
+		return -E2BIG;
 	}
 	notif_bss_info = kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) +
 	                         WL_BSS_INFO_MAX, GFP_KERNEL);
@@ -1992,28 +2039,38 @@
 	beacon_proberesp->capab_info = cpu_to_le16(bi->capability);
 	wl_rst_ie(wl);
 
-	wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length);
-	wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX -
-	         offsetof(struct wl_cfg80211_bss_info, frame_buf));
+	err = wl_mrg_ie(wl, ((u8 *) bi) + bi->ie_offset, bi->ie_length);
+	if (err)
+		goto inform_single_bss_out;
+
+	err = wl_cp_ie(wl, beacon_proberesp->variable, WL_BSS_INFO_MAX -
+	               offsetof(struct wl_cfg80211_bss_info, frame_buf));
+	if (err)
+		goto inform_single_bss_out;
+
 	notif_bss_info->frame_len = offsetof(struct ieee80211_mgmt, u.beacon.variable) +
 	                            wl_get_ielen(wl);
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39)
 	freq = ieee80211_channel_to_frequency(notif_bss_info->channel,
 		(notif_bss_info->channel <= CH_MAX_2G_CHANNEL) ?
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+		NL80211_BAND_2GHZ : NL80211_BAND_5GHZ);
+#else
 		IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
+#endif
 #else
 	freq = ieee80211_channel_to_frequency(notif_bss_info->channel);
 #endif
 	if (freq == 0) {
 		WL_ERR(("Invalid channel, fail to chcnage channel to freq\n"));
-		kfree(notif_bss_info);
-		return -EINVAL;
+		err = -EINVAL;
+		goto inform_single_bss_out;
 	}
 	channel = ieee80211_get_channel(wiphy, freq);
 	if (unlikely(!channel)) {
 		WL_ERR(("ieee80211_get_channel error\n"));
-		kfree(notif_bss_info);
-		return -EINVAL;
+		err = -EINVAL;
+		goto inform_single_bss_out;
 	}
 
 	WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n",
@@ -2021,35 +2078,43 @@
 		mgmt->u.beacon.capab_info, &bi->BSSID));
 
 	signal = notif_bss_info->rssi * 100;
-	cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt,
-	    le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL);
-	if (unlikely(!cbss)) {
-		WL_ERR(("cfg80211_inform_bss_frame error\n"));
-		kfree(notif_bss_info);
-		return -EINVAL;
+	if (!wl->scan_request) {
+		cbss = cfg80211_inform_bss_frame(wiphy, channel, mgmt,
+		    le16_to_cpu(notif_bss_info->frame_len), signal, GFP_KERNEL);
+		if (unlikely(!cbss)) {
+			WL_ERR(("cfg80211_inform_bss_frame error\n"));
+			err = -ENOMEM;
+			goto inform_single_bss_out;
+		}
 	}
-
-	notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
-	notify_ielen = le32_to_cpu(bi->ie_length);
+	else {
+		notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
+		notify_ielen = le32_to_cpu(bi->ie_length);
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
-	cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet),
-		0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
-		(const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
+		cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet),
+			0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
+			(const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
 #else
-	cbss = cfg80211_inform_bss(wiphy, channel, CFG80211_BSS_FTYPE_UNKNOWN, (const u8 *)(bi->BSSID.octet),
-		0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
-		(const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
+		cbss = cfg80211_inform_bss(wiphy, channel, 
+		    wl->active_scan ? CFG80211_BSS_FTYPE_PRESP : CFG80211_BSS_FTYPE_BEACON,
+		    (const u8 *)(bi->BSSID.octet),
+		    0, beacon_proberesp->capab_info, beacon_proberesp->beacon_int,
+		    (const u8 *)notify_ie, notify_ielen, signal, GFP_KERNEL);
 #endif
+		if (unlikely(!cbss)) {
+			WL_ERR(("cfg80211_inform_bss error\n"));
+			err = -ENOMEM;
+			goto inform_single_bss_out;
+		}
+	}
 
-	if (unlikely(!cbss))
-		return -ENOMEM;
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
 	cfg80211_put_bss(wiphy, cbss);
 #else
 	cfg80211_put_bss(cbss);
 #endif
 
+inform_single_bss_out:
 	kfree(notif_bss_info);
 
 	return err;
@@ -2116,7 +2181,11 @@
 				return err;
 			}
 			chan = wf_chspec_ctlchan(chanspec);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+			band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
+#else
 			band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
+#endif
 			freq = ieee80211_channel_to_frequency(chan, band);
 			channel = ieee80211_get_channel(wiphy, freq);
 			cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
@@ -2250,10 +2319,18 @@
 		join_params->params.chanspec_list[0] =
 		    ieee80211_frequency_to_channel(chan->center_freq);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+		if (chan->band == NL80211_BAND_2GHZ) {
+#else
 		if (chan->band == IEEE80211_BAND_2GHZ) {
+#endif
 			chanspec |= WL_CHANSPEC_BAND_2G;
 		}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+		else if (chan->band == NL80211_BAND_5GHZ) {
+#else
 		else if (chan->band == IEEE80211_BAND_5GHZ) {
+#endif
 			chanspec |= WL_CHANSPEC_BAND_5G;
 		}
 		else {
@@ -2316,6 +2393,9 @@
 		if (err)
 			goto update_bss_info_out;
 
+		bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
+		      ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+
 		ie = ((u8 *)bi) + bi->ie_offset;
 		ie_len = bi->ie_length;
 	} else {
@@ -2328,12 +2408,20 @@
 		ie_len = bss->len_information_elements;
 #endif
 		wl->conf->channel = *bss->channel;
+	}
+
+	if (bss) {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)
 		cfg80211_put_bss(wiphy, bss);
 #else
 		cfg80211_put_bss(bss);
 #endif
 	}
+	else {
+		WL_DBG(("Could not update BSS\n"));
+		err = -EINVAL;
+		goto update_bss_info_out;
+	}
 
 	tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
 	if (tim) {
@@ -2358,19 +2446,44 @@
                     const wl_event_msg_t *e, void *data)
 {
 	struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+	struct cfg80211_roam_info roam_info = {};
+#endif
 	s32 err = 0;
 
-	wl_get_assoc_ies(wl);
+	err = wl_get_assoc_ies(wl);
+	if (err)
+		return err;
+
 	memcpy(wl->profile->bssid, &e->addr, ETHER_ADDR_LEN);
 	memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
-	wl_update_bss_info(wl);
+
+	err = wl_update_bss_info(wl);
+	if (err)
+		return err;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+	roam_info.channel = &wl->conf->channel;
+	roam_info.bssid = (u8*)&wl->bssid;
+	roam_info.req_ie = conn_info->req_ie;
+	roam_info.req_ie_len = conn_info->req_ie_len;
+	roam_info.resp_ie = conn_info->resp_ie;
+	roam_info.resp_ie_len = conn_info->resp_ie_len;
+#endif
+
 	cfg80211_roamed(ndev,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)
 			&wl->conf->channel,	 
 #endif
 			(u8 *)&wl->bssid,
 			conn_info->req_ie, conn_info->req_ie_len,
-			conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
+			conn_info->resp_ie, conn_info->resp_ie_len, 
+#else
+			&roam_info,
+#endif
+			GFP_KERNEL);
+
 	WL_DBG(("Report roaming result\n"));
 
 	set_bit(WL_STATUS_CONNECTED, &wl->status);
@@ -2386,8 +2499,17 @@
 	s32 err = 0;
 
 	if (wl->scan_request) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		struct cfg80211_scan_info info = {
+			.aborted = true,
+		};
+#endif
 		WL_DBG(("%s: Aborting scan\n", __FUNCTION__));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		cfg80211_scan_done(wl->scan_request, &info);     
+#else
 		cfg80211_scan_done(wl->scan_request, true);     
+#endif
 		wl->scan_request = NULL;
 	}
 
@@ -2488,7 +2610,14 @@
 
 scan_done_out:
 	if (wl->scan_request) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		struct cfg80211_scan_info info = {
+			.aborted = false,
+		};
+		cfg80211_scan_done(wl->scan_request, &info);
+#else
 		cfg80211_scan_done(wl->scan_request, false);
+#endif
 		wl->scan_request = NULL;
 	}
 	rtnl_unlock();
@@ -2885,7 +3014,11 @@
 
 	if (phy == 'n' || phy == 'a' || phy == 'v') {
 		wiphy = wl_to_wiphy(wl);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+		wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n;
+#else
 		wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
+#endif
 	}
 
 	return err;
@@ -2913,7 +3046,14 @@
 	s32 err = 0;
 
 	if (wl->scan_request) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
+		struct cfg80211_scan_info info = {
+			.aborted = true,
+		};
+		cfg80211_scan_done(wl->scan_request, &info);
+#else
 		cfg80211_scan_done(wl->scan_request, true);	
+#endif
 		wl->scan_request = NULL;
 	}
 
--- a/src/wl/sys/wl_linux.c
+++ b/src/wl/sys/wl_linux.c
@@ -93,7 +93,11 @@
 
 #include <wlc_wowl.h>
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+static void wl_timer(struct timer_list *tl);
+#else
 static void wl_timer(ulong data);
+#endif
 static void _wl_timer(wl_timer_t *t);
 static struct net_device *wl_alloc_linux_if(wl_if_t *wlif);
 
@@ -207,6 +211,7 @@
 
 static int nompc = 0;
 module_param(nompc, int, 0);
+MODULE_LICENSE("Mixed/Proprietary");
 
 #ifdef quote_str
 #undef quote_str
@@ -582,7 +587,7 @@
 	}
 	wl->bcm_bustype = bustype;
 
-	if ((wl->regsva = ioremap_nocache(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
+	if ((wl->regsva = ioremap(dev->base_addr, PCI_BAR0_WINSZ)) == NULL) {
 		WL_ERROR(("wl%d: ioremap() failed\n", unit));
 		goto fail;
 	}
@@ -724,8 +729,12 @@
 		WL_ALL_PASSIVE_ENAB(wl) ?  ", Passive Mode" : "", EPI_VERSION_STR);
 
 #ifdef BCMDBG
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
 	printf(" (Compiled in " SRCBASE " at " __TIME__ " on " __DATE__ ")");
+#else 
+	printf(" (Compiled in " SRCBASE ")");
 #endif 
+#endif 
 	printf("\n");
 
 	wl_found++;
@@ -771,9 +780,9 @@
 	pci_read_config_dword(pdev, 0x40, &val);
 	if ((val & 0x0000ff00) != 0)
 		pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
-		bar1_size = pci_resource_len(pdev, 2);
-		bar1_addr = (uchar *)ioremap_nocache(pci_resource_start(pdev, 2),
-			bar1_size);
+	bar1_size = pci_resource_len(pdev, 2);
+	bar1_addr = (uchar *)ioremap(pci_resource_start(pdev, 2),
+		bar1_size);
 	wl = wl_attach(pdev->vendor, pdev->device, pci_resource_start(pdev, 0), PCI_BUS, pdev,
 		pdev->irq, bar1_addr, bar1_size);
 
@@ -2053,8 +2062,13 @@
 void
 wl_dump_ver(wl_info_t *wl, struct bcmstrbuf *b)
 {
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9)
 	bcm_bprintf(b, "wl%d: %s %s version %s\n", wl->pub->unit,
 		__DATE__, __TIME__, EPI_VERSION_STR);
+#else
+	bcm_bprintf(b, "wl%d: version %s\n", wl->pub->unit,
+		EPI_VERSION_STR);
+#endif
 }
 
 #if defined(BCMDBG)
@@ -2165,8 +2179,13 @@
 	wlif = WL_DEV_IF(dev);
 	wl = WL_INFO(dev);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+	skb->prev = NULL;
+#endif
 	if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
 		skb->prev = NULL;
+#endif
 
 		TXQ_LOCK(wl);
 
@@ -2297,10 +2316,17 @@
 	atomic_dec(&t->wl->callbacks);
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
 static void
+wl_timer(struct timer_list *tl)
+{
+	wl_timer_t *t = (wl_timer_t *)tl;
+#else
+static void
 wl_timer(ulong data)
 {
 	wl_timer_t *t = (wl_timer_t *)data;
+#endif
 
 	if (!WL_ALL_PASSIVE_ENAB(t->wl))
 		_wl_timer(t);
@@ -2352,9 +2378,13 @@
 
 	bzero(t, sizeof(wl_timer_t));
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
+	timer_setup(&t->timer, wl_timer, 0);
+#else
 	init_timer(&t->timer);
 	t->timer.data = (ulong) t;
 	t->timer.function = wl_timer;
+#endif
 	t->wl = wl;
 	t->fn = fn;
 	t->arg = arg;
@@ -2915,7 +2945,9 @@
 	if (skb == NULL) return;
 
 	skb->dev = wl->monitor_dev;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 10, 0)
 	skb->dev->last_rx = jiffies;
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
 	skb_reset_mac_header(skb);
 #else
@@ -3335,11 +3367,18 @@
 }
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
+static struct proc_ops wl_fops = {
+        .proc_read     = wl_proc_read,
+        .proc_write    = wl_proc_write,
+};
+#else
 static const struct file_operations wl_fops = {
 	.owner	= THIS_MODULE,
 	.read	= wl_proc_read,
 	.write	= wl_proc_write,
 };
+#endif
 #endif
 
 static int
