module-broadcom-wl fix build

This commit is contained in:
Ertuğrul Erata
2016-07-27 19:25:45 +03:00
parent a593a3aba4
commit a8b6b933a5
9 changed files with 115 additions and 191 deletions
@@ -1,29 +0,0 @@
From b14ac6e4b871b5e15f63389ba63d1fc23a54c58b Mon Sep 17 00:00:00 2001
From: Tim Gardner <tim.gardner@canonical.com>
Date: Tue, 4 Aug 2015 09:02:10 -0600
Subject: [PATCH] cfg80211_disconnected
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
bcmwl-6.30.223.248+bdcom/src/src/wl/sys/wl_cfg80211_hybrid.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
index ea0726f..0131f01 100644
--- a/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
@@ -2047,7 +2047,11 @@ wl_notify_connect_status(struct wl_cfg80211_priv *wl, struct net_device *ndev,
}
else if ((event == WLC_E_LINK && ~(flags & WLC_EVENT_MSG_LINK)) ||
event == WLC_E_DEAUTH_IND || event == WLC_E_DISASSOC_IND) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
cfg80211_disconnected(ndev, 0, NULL, 0, GFP_KERNEL);
+#else
+ cfg80211_disconnected(ndev, 0, NULL, 0, false, GFP_KERNEL);
+#endif
clear_bit(WL_STATUS_CONNECTED, &wl->status);
wl_link_down(wl);
wl_init_prof(wl->profile);
--
2.5.0
@@ -1,27 +0,0 @@
Description: Fixing null pointer crash
Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773713
Bug-Ubuntu: https://launchpad.net/bugs/1415880
Last-Update: 2015-08-18
---
src/wl/sys/wl_linux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
index 860b935..295156f 100644
--- a/src/wl/sys/wl_linux.c
+++ b/src/wl/sys/wl_linux.c
@@ -2157,8 +2157,8 @@ wl_start(struct sk_buff *skb, struct net_device *dev)
wlif = WL_DEV_IF(dev);
wl = WL_INFO(dev);
+ skb->prev = NULL;
if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) {
- skb->prev = NULL;
TXQ_LOCK(wl);
--
1.9.1
@@ -1,12 +0,0 @@
diff -urN a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
--- a/src/wl/sys/wl_linux.c 2015-01-06 12:33:42.981659618 +0100
+++ b/src/wl/sys/wl_linux.c 2015-01-06 12:34:05.647395418 +0100
@@ -2157,8 +2157,8 @@
wlif = WL_DEV_IF(dev);
wl = WL_INFO(dev);
+ skb->prev = NULL;
if (WL_ALL_PASSIVE_ENAB(wl) || (WL_RTR() && WL_CONFIG_SMP())) {
- skb->prev = NULL;
TXQ_LOCK(wl);
@@ -1,11 +0,0 @@
--- a/Makefile 2014-06-26 10:42:08.000000000 +0000
+++ b/Makefile 2014-07-17 22:44:01.662297228 +0000
@@ -126,6 +126,8 @@
EXTRA_CFLAGS += -I$(src)/src/shared/bcmwifi/include
#EXTRA_CFLAGS += -DBCMDBG_ASSERT -DBCMDBG_ERR
+EXTRA_CFLAGS += -Wno-date-time
+
EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
KBASE ?= /lib/modules/`uname -r`
@@ -1,26 +0,0 @@
--- a/src/wl/sys/wl_cfg80211_hybrid.c 2015-03-16 14:39:29.899350026 +0100
+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2015-03-16 14:39:06.732682365 +0100
@@ -1452,7 +1452,11 @@
WL_DBG(("Could not get rate (%d)\n", err));
} else {
rate = dtoh32(rate);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
+ #else
sinfo->filled |= STATION_INFO_TX_BITRATE;
+ #endif
sinfo->txrate.legacy = rate * 5;
WL_DBG(("Rate %d Mbps\n", (rate / 2)));
}
@@ -1465,7 +1469,11 @@
return err;
}
rssi = dtoh32(scb_val.val);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
+ #else
sinfo->filled |= STATION_INFO_SIGNAL;
+ #endif
sinfo->signal = rssi;
WL_DBG(("RSSI %d dBm\n", rssi));
}
@@ -1,60 +0,0 @@
--- a/src/wl/sys/wl_cfg80211_hybrid.c 2014-06-26 12:42:08.000000000 +0200
+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2014-10-08 18:47:07.549476082 +0200
@@ -2071,7 +2071,22 @@
wl_get_assoc_ies(wl);
memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
wl_update_bss_info(wl);
- cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
+ {
+ struct wl_bss_info *bi;
+ u16 bss_info_channel;
+ struct ieee80211_channel *channel;
+ u32 freq;
+
+ bi = (struct wl_bss_info *)(wl->extra_buf + 4);
+ bss_info_channel = bi->ctl_ch ? bi->ctl_ch : CHSPEC_CHANNEL(bi->chanspec);
+
+ freq = ieee80211_channel_to_frequency(bss_info_channel,
+ (bss_info_channel <= CH_MAX_2G_CHANNEL) ?
+ IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
+
+ channel = ieee80211_get_channel(wl_to_wiphy(wl), freq);
+ cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, channel, GFP_KERNEL);
+ }
set_bit(WL_STATUS_CONNECTED, &wl->status);
wl->profile->active = true;
}
--- a/src/wl/sys/wl_linux.c 2014-06-26 12:42:08.000000000 +0200
+++ b/src/wl/sys/wl_linux.c 2014-10-08 18:47:19.526693719 +0200
@@ -878,7 +878,7 @@
static SIMPLE_DEV_PM_OPS(wl_pm_ops, wl_suspend, wl_resume);
#endif
-static struct pci_driver wl_pci_driver = {
+static struct pci_driver wl_pci_driver __refdata = {
.name = "wl",
.probe = wl_pci_probe,
.remove = __devexit_p(wl_remove),
@@ -1307,7 +1307,12 @@
dev->priv = priv_link;
#else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0))
dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
+#else
+ dev = alloc_netdev(sizeof(priv_link_t), intf_name, NET_NAME_UNKNOWN,
+ ether_setup);
+#endif
if (!dev) {
WL_ERROR(("wl%d: %s: alloc_netdev failed\n",
(wl->pub)?wl->pub->unit:wlif->subunit, __FUNCTION__));
--- a/src/wl/sys/wl_cfg80211_hybrid.c 2014-12-10 03:43:11.145810000 +0000
+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2014-12-10 03:44:37.700680960 +0000
@@ -2010,7 +2010,7 @@
notify_ie = (u8 *)bi + le16_to_cpu(bi->ie_offset);
notify_ielen = le32_to_cpu(bi->ie_length);
- cbss = cfg80211_inform_bss(wiphy, channel, (const u8 *)(bi->BSSID.octet),
+ 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);
@@ -0,0 +1,109 @@
Since Linux 4.7, the enum ieee80211_band is no longer used
This shall cause no problem's since both enums ieee80211_band
and nl80211_band were added in the same commit:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=13ae75b103e07304a34ab40c9136e9f53e06475c
This patch refactors the references of IEEE80211_BAND_* to NL80211_BAND_*
Reference:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=57fbcce37be7c1d2622b56587c10ade00e96afa3
--- a/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:57:36.159340297 -0500
+++ b/src/wl/sys/wl_cfg80211_hybrid.c 2016-06-13 11:58:18.442323435 -0500
@@ -236,7 +236,7 @@
#endif
#define CHAN2G(_channel, _freq, _flags) { \
- .band = IEEE80211_BAND_2GHZ, \
+ .band = NL80211_BAND_2GHZ, \
.center_freq = (_freq), \
.hw_value = (_channel), \
.flags = (_flags), \
@@ -245,7 +245,7 @@
}
#define CHAN5G(_channel, _flags) { \
- .band = IEEE80211_BAND_5GHZ, \
+ .band = NL80211_BAND_5GHZ, \
.center_freq = 5000 + (5 * (_channel)), \
.hw_value = (_channel), \
.flags = (_flags), \
@@ -379,7 +379,7 @@
};
static struct ieee80211_supported_band __wl_band_2ghz = {
- .band = IEEE80211_BAND_2GHZ,
+ .band = NL80211_BAND_2GHZ,
.channels = __wl_2ghz_channels,
.n_channels = ARRAY_SIZE(__wl_2ghz_channels),
.bitrates = wl_g_rates,
@@ -387,7 +387,7 @@
};
static struct ieee80211_supported_band __wl_band_5ghz_a = {
- .band = IEEE80211_BAND_5GHZ,
+ .band = NL80211_BAND_5GHZ,
.channels = __wl_5ghz_a_channels,
.n_channels = ARRAY_SIZE(__wl_5ghz_a_channels),
.bitrates = wl_a_rates,
@@ -395,7 +395,7 @@
};
static struct ieee80211_supported_band __wl_band_5ghz_n = {
- .band = IEEE80211_BAND_5GHZ,
+ .band = NL80211_BAND_5GHZ,
.channels = __wl_5ghz_n_channels,
.n_channels = ARRAY_SIZE(__wl_5ghz_n_channels),
.bitrates = wl_a_rates,
@@ -1876,8 +1876,8 @@
wdev->wiphy->max_num_pmkids = WL_NUM_PMKIDS_MAX;
#endif
wdev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | BIT(NL80211_IFTYPE_ADHOC);
- wdev->wiphy->bands[IEEE80211_BAND_2GHZ] = &__wl_band_2ghz;
- wdev->wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_a;
+ wdev->wiphy->bands[NL80211_BAND_2GHZ] = &__wl_band_2ghz;
+ wdev->wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_a;
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);
@@ -2000,7 +2000,7 @@
#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) ?
- IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ);
+ NL80211_BAND_2GHZ : NL80211_BAND_5GHZ);
#else
freq = ieee80211_channel_to_frequency(notif_bss_info->channel);
#endif
@@ -2116,7 +2116,7 @@
return err;
}
chan = wf_chspec_ctlchan(chanspec);
- band = (chan <= CH_MAX_2G_CHANNEL) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
+ band = (chan <= CH_MAX_2G_CHANNEL) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ;
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 +2250,10 @@
join_params->params.chanspec_list[0] =
ieee80211_frequency_to_channel(chan->center_freq);
- if (chan->band == IEEE80211_BAND_2GHZ) {
+ if (chan->band == NL80211_BAND_2GHZ) {
chanspec |= WL_CHANSPEC_BAND_2G;
}
- else if (chan->band == IEEE80211_BAND_5GHZ) {
+ else if (chan->band == NL80211_BAND_5GHZ) {
chanspec |= WL_CHANSPEC_BAND_5G;
}
else {
@@ -2885,7 +2885,7 @@
if (phy == 'n' || phy == 'a' || phy == 'v') {
wiphy = wl_to_wiphy(wl);
- wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
+ wiphy->bands[NL80211_BAND_5GHZ] = &__wl_band_5ghz_n;
}
return err;
@@ -1,11 +0,0 @@
diff -urN a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
--- a/src/wl/sys/wl_linux.c 2013-08-01 09:52:22.000000000 +0300
+++ b/src/wl/sys/wl_linux.c 2013-09-27 09:20:11.495023471 +0300
@@ -235,7 +235,7 @@
#define to_str(s) #s
#define quote_str(s) to_str(s)
-#define BRCM_WLAN_IFNAME eth%d
+#define BRCM_WLAN_IFNAME wlan%d
static char intf_name[IFNAMSIZ] = quote_str(BRCM_WLAN_IFNAME);
+6 -15
View File
@@ -5,8 +5,8 @@
<Name>module-broadcom-wl</Name>
<Homepage>http://www.broadcom.com/support/802.11/linux_sta.php</Homepage>
<Packager>
<Name>Serdar Soytetir</Name>
<Email>kaptan@pisilinux.org</Email>
<Name>PisiLinux Community</Name>
<Email>admin@pisilinux.org</Email>
</Packager>
<License>freedist</License>
<IsA>driver</IsA>
@@ -15,30 +15,21 @@
<Archive sha1sum="8acbdbb4ab4ab4123d1773b616904798fbef9277" type="targz" target="i686">http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_271.tar.gz</Archive>
<Archive sha1sum="1f568bb989d175813c5631c6629d9479eae6f3be" type="targz" target="x86_64">http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_271.tar.gz</Archive>
<BuildDependencies>
<Dependency version="4.6.3">kernel-module-headers</Dependency>
<Dependency version="4.7.0">kernel-module-headers</Dependency>
</BuildDependencies>
<Patches>
<!-- <Patch level="1">patch/linux-40.patch</Patch> -->
<!-- <Patch level="1">patch/linux-recent.patch</Patch> -->
<Patch level="1">patch/license.patch</Patch>
<Patch level="1">patch/wl_linux.c.patch</Patch>
<Patch level="1">patch/gcc.patch</Patch>
<Patch level="1">patch/wlan.patch</Patch>
<!-- <Patch level="1">patch/broadcom-sta-6.30.223.248-linux-3.18-null-pointer-crash.patch</Patch> -->
<!-- <Patch>patch/0018-cfg80211_disconnected.patch</Patch> -->
<!--Patch>patch/0019-broadcom-sta-6.30.223.248-3.18-null-pointer-fix.patch</Patch-->
<Patch level="1">patch/linux47.patch</Patch>
</Patches>
</Source>
<Package>
<Name>module-broadcom-wl</Name>
<RuntimeDependencies>
<Dependency version="4.6.3">kernel</Dependency>
<Dependency version="4.7.0">kernel</Dependency>
<Dependency release="current">module-broadcom-wl-userspace</Dependency>
</RuntimeDependencies>
<Replaces>
<Package>broadcom-wl</Package>
</Replaces>
<Files>
<Path fileType="library" permanent="true">/lib/modules</Path>
</Files>
@@ -66,7 +57,7 @@
<History>
<Update release="3">
<Date>2016-06-28</Date>
<Date>2016-07-27</Date>
<Version>6.30.223.271</Version>
<Comment>Rebuild for new kernel.</Comment>
<Name>PisiLinux Community</Name>