diff -Nru broadcom-sta-6.30.223.271/debian/changelog broadcom-sta-6.30.223.271/debian/changelog --- broadcom-sta-6.30.223.271/debian/changelog 2017-02-06 15:58:01.000000000 +0000 +++ broadcom-sta-6.30.223.271/debian/changelog 2017-10-26 18:40:15.000000000 +0000 @@ -1,3 +1,13 @@ +broadcom-sta (6.30.223.271-3~16.04.2) xenial; urgency=medium + + * Backport to xenial for kernel 4.10, 4.11 and 4.13 support. (LP: #1724865) + - 16-linux48.patch + - 17-fix-kernel-warnings.patch + - 18-linux411.patch + - 19-linux412.patch + + -- Marcelo Henrique Cerri Thu, 26 Oct 2017 16:40:15 -0200 + broadcom-sta (6.30.223.271-3~16.04.1) xenial; urgency=low * Backport to xenial for kernel 4.8 support. (LP: #1662106) diff -Nru broadcom-sta-6.30.223.271/debian/patches/16-linux48.patch broadcom-sta-6.30.223.271/debian/patches/16-linux48.patch --- broadcom-sta-6.30.223.271/debian/patches/16-linux48.patch 1970-01-01 00:00:00.000000000 +0000 +++ broadcom-sta-6.30.223.271/debian/patches/16-linux48.patch 2017-10-26 18:36:41.000000000 +0000 @@ -0,0 +1,61 @@ + +Package: broadcom-sta-source +Version: 6.30.223.271-3 + +Looking at the patch for kernel 4.8, I came up with the attached patch +(and I send this mail while running it :) + +Thanks, +Koos Vriezen + + +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -2386,8 +2386,15 @@ + s32 err = 0; + + if (wl->scan_request) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0) ++ struct cfg80211_scan_info info = { ++ .aborted = true ++ }; + WL_DBG(("%s: Aborting scan\n", __FUNCTION__)); +- cfg80211_scan_done(wl->scan_request, true); ++ cfg80211_scan_done(wl->scan_request, &info); ++#else ++ cfg80211_scan_done(wl->scan_request, true); ++#endif + wl->scan_request = NULL; + } + +@@ -2488,7 +2495,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(); +@@ -2913,7 +2927,14 @@ + s32 err = 0; + + if (wl->scan_request) { +- cfg80211_scan_done(wl->scan_request, true); ++#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; + } + diff -Nru broadcom-sta-6.30.223.271/debian/patches/17-fix-kernel-warnings.patch broadcom-sta-6.30.223.271/debian/patches/17-fix-kernel-warnings.patch --- broadcom-sta-6.30.223.271/debian/patches/17-fix-kernel-warnings.patch 1970-01-01 00:00:00.000000000 +0000 +++ broadcom-sta-6.30.223.271/debian/patches/17-fix-kernel-warnings.patch 2017-10-26 18:36:48.000000000 +0000 @@ -0,0 +1,161 @@ +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -1968,7 +1968,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,9 +1992,15 @@ + 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 - ++ 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) +@@ -2006,14 +2012,14 @@ + #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,28 +2027,37 @@ + 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; +- } + +- notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset); +- notify_ielen = le32_to_cpu(bi->ie_length); ++ 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; ++ } ++ } 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)) +- return -ENOMEM; ++ if (unlikely(!cbss)) { ++ WL_ERR(("cfg80211_inform_bss error\n")); ++ err = -ENOMEM; ++ goto inform_single_bss_out; ++ } ++ } + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) + cfg80211_put_bss(wiphy, cbss); +@@ -2050,6 +2065,7 @@ + cfg80211_put_bss(cbss); + #endif + ++inform_single_bss_out: + kfree(notif_bss_info); + + return err; +@@ -2316,6 +2332,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,11 +2347,18 @@ + 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); +@@ -2360,10 +2386,17 @@ + struct wl_cfg80211_connect_info *conn_info = wl_to_conn(wl); + 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; ++ + cfg80211_roamed(ndev, + #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39) + &wl->conf->channel, diff -Nru broadcom-sta-6.30.223.271/debian/patches/18-linux411.patch broadcom-sta-6.30.223.271/debian/patches/18-linux411.patch --- broadcom-sta-6.30.223.271/debian/patches/18-linux411.patch 1970-01-01 00:00:00.000000000 +0000 +++ broadcom-sta-6.30.223.271/debian/patches/18-linux411.patch 2017-10-26 18:37:13.000000000 +0000 @@ -0,0 +1,40 @@ +Description: Compile fix with kernel 4.11 + I use the attached patch to get this module compiled with 4.11. Works + for me since last sunday. + Apparently https://aur.archlinux.org/cgit/aur.git/tree/linux411.patch?h=broadcom-wl + has come with a different patch for the removed last_rx field in + netdevice. But judging the commit log + https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/include/linux/netdevice.h?id=4a7c972644c1151f6dd34ff4b5f7eacb239e22ee + and the fact that last_rx isn't used elsewhere I came up with just + ifdef it out. +Author: koos vriezen +Bug-Debian: http://bugs.debian.org/861807 +Origin: http://bugs.debian.org/861807 +Forwarded: no +Reviewed-By: Eduard Bloch +Last-Update: 2017-05-04 + +--- a/amd64/src/wl/sys/wl_linux.c ++++ b/amd64/src/wl/sys/wl_linux.c +@@ -2912,7 +2912,9 @@ + if (skb == NULL) return; + + skb->dev = wl->monitor_dev; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) + skb->dev->last_rx = jiffies; ++#endif + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) + skb_reset_mac_header(skb); + #else +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -30,6 +30,9 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) ++#include ++#endif + #include + #include + #include diff -Nru broadcom-sta-6.30.223.271/debian/patches/19-linux412.patch broadcom-sta-6.30.223.271/debian/patches/19-linux412.patch --- broadcom-sta-6.30.223.271/debian/patches/19-linux412.patch 1970-01-01 00:00:00.000000000 +0000 +++ broadcom-sta-6.30.223.271/debian/patches/19-linux412.patch 2017-10-26 18:40:15.000000000 +0000 @@ -0,0 +1,64 @@ +--- a/amd64/src/wl/sys/wl_cfg80211_hybrid.c ++++ b/amd64/src/wl/sys/wl_cfg80211_hybrid.c +@@ -53,7 +53,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, +@@ -466,8 +470,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; +@@ -2387,6 +2394,15 @@ + 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 = { ++ .bssid = wl->profile->bssid, ++ .req_ie = conn_info->req_ie, ++ .req_ie_len = conn_info->req_ie_len, ++ .resp_ie = conn_info->resp_ie, ++ .resp_ie_len = conn_info->resp_ie_len, ++ }; ++#endif + s32 err = 0; + + err = wl_get_assoc_ies(wl); +@@ -2401,12 +2417,17 @@ + return err; + + cfg80211_roamed(ndev, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) ++ &roam_info, ++#else + #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, ++#endif ++ GFP_KERNEL); + WL_DBG(("Report roaming result\n")); + + set_bit(WL_STATUS_CONNECTED, &wl->status); diff -Nru broadcom-sta-6.30.223.271/debian/patches/series broadcom-sta-6.30.223.271/debian/patches/series --- broadcom-sta-6.30.223.271/debian/patches/series 2016-07-02 22:51:56.000000000 +0000 +++ broadcom-sta-6.30.223.271/debian/patches/series 2017-10-26 18:40:15.000000000 +0000 @@ -7,3 +7,7 @@ 13-broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch 14-rdtscl.patch 15-linux47.patch +16-linux48.patch +17-fix-kernel-warnings.patch +18-linux411.patch +19-linux412.patch