broadcom-wl
This commit is contained in:
parent
4a8041e972
commit
9b09339aec
|
@ -0,0 +1,27 @@
|
||||||
|
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
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
Since Linux 4.3, rdtscl() is no longer available and native_read_tsc()
|
||||||
|
is renamed to rdtsc(). Move the macro contents in-line and call the
|
||||||
|
new function. References:
|
||||||
|
|
||||||
|
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=fe47ae6e1a5005b2e82f7eab57b5c3820453293a
|
||||||
|
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit?id=4ea1636b04dbd66536fa387bae2eea463efc705b
|
||||||
|
|
||||||
|
diff -ru a/src/shared/linux_osl.c b/src/shared/linux_osl.c
|
||||||
|
--- a/src/shared/linux_osl.c 2015-09-19 01:47:15.000000000 +0300
|
||||||
|
+++ b/src/shared/linux_osl.c 2015-11-21 15:20:30.585902518 +0200
|
||||||
|
@@ -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
|
|
@ -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;
|
|
@ -0,0 +1,64 @@
|
||||||
|
From d3f93542326a06d920c6eb89b703384290d37b8b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alberto Milone <alberto.milone@canonical.com>
|
||||||
|
Date: Fri, 2 Sep 2016 17:35:34 +0200
|
||||||
|
Subject: [PATCH 1/1] Add support for Linux 4.8
|
||||||
|
|
||||||
|
Orginal author: Krzysztof Kolasa
|
||||||
|
---
|
||||||
|
src/wl/sys/wl_cfg80211_hybrid.c | 22 ++++++++++++++++++++++
|
||||||
|
1 file changed, 22 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
|
||||||
|
index 2fc71fe..ec5e472 100644
|
||||||
|
--- a/src/wl/sys/wl_cfg80211_hybrid.c
|
||||||
|
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
|
||||||
|
@@ -2388,8 +2388,16 @@ wl_bss_connect_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
|
||||||
|
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, &info);
|
||||||
|
+#else
|
||||||
|
WL_DBG(("%s: Aborting scan\n", __FUNCTION__));
|
||||||
|
cfg80211_scan_done(wl->scan_request, true);
|
||||||
|
+#endif
|
||||||
|
wl->scan_request = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2490,7 +2498,14 @@ wl_notify_scan_status(struct wl_cfg80211_priv *wl, struct net_device *ndev,
|
||||||
|
|
||||||
|
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();
|
||||||
|
@@ -2909,7 +2924,14 @@ s32 wl_cfg80211_down(struct net_device *ndev)
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.7.4
|
||||||
|
|
|
@ -0,0 +1,161 @@
|
||||||
|
--- a/src/wl/sys/wl_cfg80211_hybrid.c
|
||||||
|
+++ b/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,
|
|
@ -0,0 +1,27 @@
|
||||||
|
diff -u sys0/wl_cfg80211_hybrid.c sys/wl_cfg80211_hybrid.c
|
||||||
|
--- 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)
|
||||||
|
diff -u sys0/wl_linux.c sys/wl_linux.c
|
||||||
|
--- a/src/wl/sys/wl_linux.c
|
||||||
|
+++ b/src/wl/sys/wl_linux.c
|
||||||
|
@@ -2915,7 +2915,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
|
|
@ -0,0 +1,68 @@
|
||||||
|
diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
|
||||||
|
index da36405..d3741eb 100644
|
||||||
|
--- a/src/wl/sys/wl_cfg80211_hybrid.c
|
||||||
|
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
|
||||||
|
@@ -53,7 +53,11 @@ u32 wl_dbg_level = WL_DBG_ERR;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||||
|
+ enum nl80211_iftype type, struct vif_params *params);
|
||||||
|
+#else
|
||||||
|
enum nl80211_iftype type, u32 *flags, struct vif_params *params);
|
||||||
|
+#endif
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
|
||||||
|
static s32
|
||||||
|
wl_cfg80211_scan(struct wiphy *wiphy,
|
||||||
|
@@ -466,7 +470,11 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
|
||||||
|
|
||||||
|
static s32
|
||||||
|
wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
|
||||||
|
+ enum nl80211_iftype type,
|
||||||
|
+#else
|
||||||
|
enum nl80211_iftype type, u32 *flags,
|
||||||
|
+#endif
|
||||||
|
struct vif_params *params)
|
||||||
|
{
|
||||||
|
struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
|
||||||
|
@@ -2361,6 +2369,20 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
|
||||||
|
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_bss *bss;
|
||||||
|
+ struct wlc_ssid *ssid;
|
||||||
|
+ ssid = &wl->profile->ssid;
|
||||||
|
+ bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
|
||||||
|
+ ssid->SSID, ssid->SSID_len, WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
|
||||||
|
+ struct cfg80211_roam_info roam_info = {
|
||||||
|
+ .bss = bss,
|
||||||
|
+ .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;
|
||||||
|
|
||||||
|
wl_get_assoc_ies(wl);
|
||||||
|
@@ -2368,12 +2390,17 @@ wl_bss_roaming_done(struct wl_cfg80211_priv *wl, struct net_device *ndev,
|
||||||
|
memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
|
||||||
|
wl_update_bss_info(wl);
|
||||||
|
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);
|
|
@ -0,0 +1,46 @@
|
||||||
|
--- a/src/wl/sys/wl_linux.c 2017-07-17 00:11:24.000000000 +0100
|
||||||
|
+++ b/src/wl/sys/wl_linux.c 2018-01-27 09:49:47.057799596 +0000
|
||||||
|
@@ -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);
|
||||||
|
|
||||||
|
@@ -2297,10 +2301,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 +2363,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;
|
|
@ -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,5 +1,2 @@
|
||||||
. /lib/lsb/init-functions
|
depmod
|
||||||
if [ -z "`ls /var/lib/pkg/DB/ |grep kernel-lts\ `" ]; then
|
modprobe wl
|
||||||
log_failure_msg "${WARNING}kernel-lts${NORMAL} kurulu değil"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
--- a/src/wl/sys/wl_linux.c 2014-06-26 10:42:08.000000000 +0000
|
|
||||||
+++ b/src/wl/sys/wl_linux.c 2014-07-17 22:44:26.254759666 +0000
|
|
||||||
@@ -205,6 +205,7 @@
|
|
||||||
|
|
||||||
static int nompc = 0;
|
|
||||||
module_param(nompc, int, 0);
|
|
||||||
+MODULE_LICENSE("Mixed/Proprietary");
|
|
||||||
|
|
||||||
#ifdef quote_str
|
|
||||||
#undef quote_str
|
|
|
@ -1,350 +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 2015-01-22 01:43:25.378920452 +0100
|
|
||||||
@@ -63,8 +63,13 @@
|
|
||||||
static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
|
|
||||||
struct cfg80211_ibss_params *params);
|
|
||||||
static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev);
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
|
|
||||||
static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
|
|
||||||
struct net_device *dev, u8 *mac, struct station_info *sinfo);
|
|
||||||
+#else
|
|
||||||
+static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
|
|
||||||
+ struct net_device *dev, const u8 *mac, struct station_info *sinfo);
|
|
||||||
+#endif
|
|
||||||
static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
|
|
||||||
struct net_device *dev, bool enabled, s32 timeout);
|
|
||||||
static int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
|
|
||||||
@@ -1387,7 +1392,7 @@
|
|
||||||
key_endian_to_host(&key);
|
|
||||||
|
|
||||||
params.key_len = (u8) min_t(u8, DOT11_MAX_KEY_SIZE, key.len);
|
|
||||||
- memcpy(params.key, key.data, params.key_len);
|
|
||||||
+ memcpy((char *)params.key, key.data, params.key_len);
|
|
||||||
|
|
||||||
if ((err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec)))) {
|
|
||||||
return err;
|
|
||||||
@@ -1421,9 +1426,15 @@
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
|
|
||||||
static s32
|
|
||||||
wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|
||||||
u8 *mac, struct station_info *sinfo)
|
|
||||||
+#else
|
|
||||||
+static s32
|
|
||||||
+wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
|
|
||||||
+ const u8 *mac, struct station_info *sinfo)
|
|
||||||
+#endif
|
|
||||||
{
|
|
||||||
struct wl_cfg80211_priv *wl = wiphy_to_wl(wiphy);
|
|
||||||
scb_val_t scb_val;
|
|
||||||
@@ -2010,9 +2021,15 @@
|
|
||||||
|
|
||||||
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);
|
|
||||||
+#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);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
if (unlikely(!cbss))
|
|
||||||
return -ENOMEM;
|
|
||||||
@@ -2071,7 +2088,26 @@
|
|
||||||
wl_get_assoc_ies(wl);
|
|
||||||
memcpy(&wl->bssid, &e->addr, ETHER_ADDR_LEN);
|
|
||||||
wl_update_bss_info(wl);
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0)
|
|
||||||
+ {
|
|
||||||
+ 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);
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
cfg80211_ibss_joined(ndev, (u8 *)&wl->bssid, GFP_KERNEL);
|
|
||||||
+#endif
|
|
||||||
set_bit(WL_STATUS_CONNECTED, &wl->status);
|
|
||||||
wl->profile->active = true;
|
|
||||||
}
|
|
||||||
@@ -2629,7 +2665,15 @@
|
|
||||||
|
|
||||||
void wl_cfg80211_detach(struct net_device *ndev)
|
|
||||||
{
|
|
||||||
- struct wl_cfg80211_priv *wl = ndev_to_wl(ndev);
|
|
||||||
+ struct wl_cfg80211_priv *wl;
|
|
||||||
+ struct wireless_dev *wdev;
|
|
||||||
+
|
|
||||||
+ wdev = ndev->ieee80211_ptr;
|
|
||||||
+ if (wdev == NULL) {
|
|
||||||
+ printk(KERN_ERR "[%s()] in ndev=%p: IEEE80211ptr=%p\n", __FUNCTION__, ndev, wdev);
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+ wl = ndev_to_wl(ndev);
|
|
||||||
|
|
||||||
wl_deinit_cfg80211_priv(wl);
|
|
||||||
wl_free_wdev(wl);
|
|
||||||
--- a/src/wl/sys/wl_dbg.h 2014-06-26 12:42:08.000000000 +0200
|
|
||||||
+++ b/src/wl/sys/wl_dbg.h 2015-01-22 01:43:25.379920462 +0100
|
|
||||||
@@ -55,10 +55,12 @@
|
|
||||||
|
|
||||||
#define WL_NONE(args)
|
|
||||||
|
|
||||||
+#define FORCE_TRACE_LEVEL(fmt, ...) do { printk(KERN_ERR fmt, ## __VA_ARGS__); } while (0) /* ## is GCC specific syntax to remove comma when single arg */
|
|
||||||
+
|
|
||||||
#ifdef BCMDBG_ERR
|
|
||||||
#define WL_ERROR(args) WL_PRINT(args)
|
|
||||||
#else
|
|
||||||
-#define WL_ERROR(args)
|
|
||||||
+#define WL_ERROR(args) FORCE_TRACE_LEVEL args
|
|
||||||
#endif
|
|
||||||
#define WL_TRACE(args)
|
|
||||||
#define WL_APSTA_UPDN(args)
|
|
||||||
--- a/src/wl/sys/wl_linux.c 2014-06-26 12:42:08.000000000 +0200
|
|
||||||
+++ b/src/wl/sys/wl_linux.c 2015-01-22 01:44:58.580453805 +0100
|
|
||||||
@@ -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),
|
|
||||||
@@ -1270,6 +1270,7 @@
|
|
||||||
MFREE(wl->osh, wlif->dev, sizeof(struct net_device));
|
|
||||||
#else
|
|
||||||
free_netdev(wlif->dev);
|
|
||||||
+ wlif->dev = NULL;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1307,7 +1308,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__));
|
|
||||||
@@ -1651,11 +1657,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
WL_LOCK(wl);
|
|
||||||
- if (!capable(CAP_NET_ADMIN)) {
|
|
||||||
- bcmerror = BCME_EPERM;
|
|
||||||
- } else {
|
|
||||||
- bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif);
|
|
||||||
- }
|
|
||||||
+ bcmerror = wlc_ioctl(wl->wlc, ioc.cmd, buf, ioc.len, wlif->wlcif);
|
|
||||||
WL_UNLOCK(wl);
|
|
||||||
|
|
||||||
done1:
|
|
||||||
@@ -2157,8 +2159,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);
|
|
||||||
|
|
||||||
@@ -2455,8 +2457,10 @@
|
|
||||||
p80211msg_t *phdr;
|
|
||||||
|
|
||||||
len = sizeof(p80211msg_t) + oskb->len - D11_PHY_HDR_LEN;
|
|
||||||
- if ((skb = dev_alloc_skb(len)) == NULL)
|
|
||||||
+ if ((skb = dev_alloc_skb(len)) == NULL) {
|
|
||||||
+ WL_ERROR(("in %s:%d [%s()] dev_alloc_skb() failure!", __FILE__, __LINE__, __FUNCTION__));
|
|
||||||
return;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
skb_put(skb, len);
|
|
||||||
phdr = (p80211msg_t*)skb->data;
|
|
||||||
@@ -2535,8 +2539,10 @@
|
|
||||||
rtap_len = sizeof(wl_radiotap_ht_brcm_2_t);
|
|
||||||
|
|
||||||
len = rtap_len + (oskb->len - D11_PHY_HDR_LEN);
|
|
||||||
- if ((skb = dev_alloc_skb(len)) == NULL)
|
|
||||||
+ if ((skb = dev_alloc_skb(len)) == NULL) {
|
|
||||||
+ WL_ERROR(("in %s:%d [%s()] dev_alloc_skb() failure!", __FILE__, __LINE__, __FUNCTION__));
|
|
||||||
return;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
skb_put(skb, len);
|
|
||||||
|
|
||||||
@@ -2664,8 +2670,10 @@
|
|
||||||
len += amsdu_len;
|
|
||||||
}
|
|
||||||
|
|
||||||
- if ((skb = dev_alloc_skb(len)) == NULL)
|
|
||||||
+ if ((skb = dev_alloc_skb(len)) == NULL) {
|
|
||||||
+ WL_ERROR(("in %s:%d [%s()] dev_alloc_skb() failure!", __FILE__, __LINE__, __FUNCTION__));
|
|
||||||
return;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
skb_put(skb, len);
|
|
||||||
|
|
||||||
@@ -2990,7 +2998,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
-wl_set_monitor(wl_info_t *wl, int val)
|
|
||||||
+wl_set_monitor(wl_info_t *wl, int val) /* public => is called by wlc_hybrid.o_shipped */
|
|
||||||
{
|
|
||||||
const char *devname;
|
|
||||||
wl_if_t *wlif;
|
|
||||||
@@ -3224,42 +3232,75 @@
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
||||||
static int
|
|
||||||
wl_proc_read(char *buffer, char **start, off_t offset, int length, int *eof, void *data)
|
|
||||||
+{
|
|
||||||
+ wl_info_t * wl = (wl_info_t *)data;
|
|
||||||
#else
|
|
||||||
static ssize_t
|
|
||||||
-wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *data)
|
|
||||||
-#endif
|
|
||||||
+wl_proc_read(struct file *filp, char __user *buffer, size_t length, loff_t *offp)
|
|
||||||
{
|
|
||||||
- wl_info_t * wl = (wl_info_t *)data;
|
|
||||||
- int to_user;
|
|
||||||
- int len;
|
|
||||||
+ wl_info_t * wl = PDE_DATA(file_inode(filp));
|
|
||||||
+#endif
|
|
||||||
+ int bcmerror, len;
|
|
||||||
+ int to_user = 0;
|
|
||||||
+ char tmp[8];
|
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
||||||
if (offset > 0) {
|
|
||||||
*eof = 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
+#else
|
|
||||||
+ if (*offp > 0) { /* for example, stop: cat /proc/brcm_monitor0 */
|
|
||||||
+ return 0; /* 0 <=> EOF */
|
|
||||||
+ }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- if (!length) {
|
|
||||||
- WL_ERROR(("%s: Not enough return buf space\n", __FUNCTION__));
|
|
||||||
- return 0;
|
|
||||||
- }
|
|
||||||
WL_LOCK(wl);
|
|
||||||
- wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
|
|
||||||
- len = sprintf(buffer, "%d\n", to_user);
|
|
||||||
- WL_UNLOCK(wl);
|
|
||||||
- return len;
|
|
||||||
+ bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
|
|
||||||
+ WL_UNLOCK(wl);
|
|
||||||
+
|
|
||||||
+ if (bcmerror != BCME_OK) {
|
|
||||||
+ WL_ERROR(("%s: GET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
|
|
||||||
+ return -EIO;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ len = snprintf(tmp, ARRAY_SIZE(tmp), "%d\n", to_user);
|
|
||||||
+ tmp[ARRAY_SIZE(tmp) - 1] = '\0';
|
|
||||||
+ if (len >= ARRAY_SIZE(tmp)) {
|
|
||||||
+ printk(KERN_ERR "%s:%d [%s()] output would be truncated (ret=%d)!", __FILE__, __LINE__, __FUNCTION__, len);
|
|
||||||
+ return -ERANGE;
|
|
||||||
+ }
|
|
||||||
+ else if (len < 0) {
|
|
||||||
+ printk(KERN_ERR "%s:%d [%s()] unable to convert value (ret=%d)!", __FILE__, __LINE__, __FUNCTION__, len);
|
|
||||||
+ return len;
|
|
||||||
+ }
|
|
||||||
+ if (length < len) {
|
|
||||||
+ printk(KERN_ERR "%s:%d [%s()] user buffer is too small (at least=%d ; user=%d)!", __FILE__, __LINE__, __FUNCTION__, len, (int)length);
|
|
||||||
+ return -EMSGSIZE;
|
|
||||||
+ }
|
|
||||||
+ if (copy_to_user(buffer, tmp, len) != 0) {
|
|
||||||
+ printk(KERN_ERR "%s:%d [%s()] unable to copy data!", __FILE__, __LINE__, __FUNCTION__);
|
|
||||||
+ return -EFAULT;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
|
|
||||||
+ *offp += len;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ return len;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
||||||
static int
|
|
||||||
wl_proc_write(struct file *filp, const char *buff, unsigned long length, void *data)
|
|
||||||
+{
|
|
||||||
+ wl_info_t * wl = (wl_info_t *)data;
|
|
||||||
#else
|
|
||||||
static ssize_t
|
|
||||||
-wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *data)
|
|
||||||
-#endif
|
|
||||||
+wl_proc_write(struct file *filp, const char __user *buff, size_t length, loff_t *offp)
|
|
||||||
{
|
|
||||||
- wl_info_t * wl = (wl_info_t *)data;
|
|
||||||
+ wl_info_t * wl = PDE_DATA(file_inode(filp));
|
|
||||||
+#endif
|
|
||||||
int from_user = 0;
|
|
||||||
int bcmerror;
|
|
||||||
|
|
||||||
@@ -3270,7 +3311,11 @@
|
|
||||||
}
|
|
||||||
if (copy_from_user(&from_user, buff, 1)) {
|
|
||||||
WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
|
|
||||||
- return -EIO;
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
|
||||||
+ return -EIO;
|
|
||||||
+#else
|
|
||||||
+ return -EFAULT;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
if (from_user >= 0x30)
|
|
||||||
@@ -3280,10 +3325,15 @@
|
|
||||||
bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
|
|
||||||
WL_UNLOCK(wl);
|
|
||||||
|
|
||||||
- if (bcmerror < 0) {
|
|
||||||
+ if (bcmerror != BCME_OK) {
|
|
||||||
WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)) && 0 /* no need to update offset because this file should only trigger action... */
|
|
||||||
+ *offp += length;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
return length;
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -3304,8 +3354,8 @@
|
|
||||||
if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
|
|
||||||
WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
|
|
||||||
#else
|
|
||||||
- if ((wl->proc_entry = proc_create(tmp, 0644, NULL, &wl_fops)) == NULL) {
|
|
||||||
- WL_ERROR(("%s: proc_create %s failed\n", __FUNCTION__, tmp));
|
|
||||||
+ if ((wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_fops, wl)) == NULL) {
|
|
||||||
+ WL_ERROR(("%s: proc_create_data %s failed\n", __FUNCTION__, tmp));
|
|
||||||
#endif
|
|
||||||
ASSERT(0);
|
|
||||||
return -1;
|
|
|
@ -1,3 +0,0 @@
|
||||||
Install the devel of any kernel:
|
|
||||||
|
|
||||||
kernel.devel or kernel-lts.devel
|
|
|
@ -1,36 +1,39 @@
|
||||||
# Tanım: Broadcom 802.11abgn hybrid Linux networking device driver
|
# Tanım: Broadcom 802.11abgn hibrit ağ kartı sürücüleri
|
||||||
# URL: http://www.broadcom.com/support/802.11/linux_sta.php
|
# URL: http://www.broadcom.com/support/802.11/linux_sta.php
|
||||||
# Paketçi: milisarge
|
# Paketçi: milisarge
|
||||||
# Gerekler:
|
# Gerekler: kernel
|
||||||
# Grup: sürücü
|
# Grup: sürücü
|
||||||
|
|
||||||
isim=broadcom-wl
|
isim=broadcom-wl
|
||||||
surum=6.30.223.248
|
surum=6.30.223.271
|
||||||
devir=6
|
devir=1
|
||||||
kaynak=("http://www.broadcom.com/docs/linux_sta/hybrid-v35${_arch}-nodebug-pcoem-${version//./_}.tar.gz"
|
kaynak=("http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-${surum//./_}.tar.gz"
|
||||||
broadcom-wl.modprobe.dbroadcom-wl.license.patchbroadcom-wl.linux-recent.patchbroadcom-wl.gcc.patch)
|
broadcom-wl.modprobe.d
|
||||||
|
001-null-pointer-fix.patch
|
||||||
|
002-rdtscl.patch
|
||||||
|
003-linux47.patch
|
||||||
|
004-linux48.patch
|
||||||
|
005-debian-fix-kernel-warnings.patch
|
||||||
|
006-linux411.patch
|
||||||
|
007-linux412.patch
|
||||||
|
008-linux415.patch)
|
||||||
|
|
||||||
|
|
||||||
[[ "`uname -m`" == "x86_64" ]] && _arch=_64 || _arch=
|
|
||||||
derle() {
|
derle() {
|
||||||
KERNELRELEASE=`uname -r`
|
KERNELRELEASE=`uname -r`
|
||||||
patch -p1 -i broadcom-wl.linux-recent.patch
|
patch -p1 -i 001-null-pointer-fix.patch
|
||||||
patch -p1 -i broadcom-wl.license.patch
|
patch -p1 -i 002-rdtscl.patch
|
||||||
patch -p1 -i broadcom-wl.gcc.patch
|
patch -p1 -i 003-linux47.patch
|
||||||
sed -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" \
|
patch -p1 -i 004-linux48.patch
|
||||||
-i src/wl/sys/wl_linux.c
|
patch -p1 -i 005-debian-fix-kernel-warnings.patch
|
||||||
make
|
patch -p1 -i 006-linux411.patch
|
||||||
install -Dm644 wl.ko $PKG/lib/modules/$KERNELRELEASE/kernel/drivers/net/wireless/wl.ko
|
patch -p1 -i 007-linux412.patch
|
||||||
gzip $PKG/lib/modules/$KERNELRELEASE/kernel/drivers/net/wireless/wl.ko
|
patch -p1 -i 008-linux415.patch
|
||||||
install -Dm644 lib/LICENSE.txt $PKG/usr/share/licenses/$isim/LICENSE
|
|
||||||
install -Dm644 broadcom-wl.modprobe.d $PKG/etc/modprobe.d/broadcom-wl.conf
|
sed -e "/BRCM_WLAN_IFNAME/s:eth:wlan:" -i src/wl/sys/wl_linux.c
|
||||||
# post-install autogen
|
make
|
||||||
cat > $PKGMK_ROOT/$isim.post-install << "EOF"
|
install -Dm644 wl.ko "$PKG/lib/modules/$KERNELRELEASE/extra/wl.ko"
|
||||||
. lib/lsb/init-functions
|
gzip "$PKG/lib/modules/$KERNELRELEASE/extra/wl.ko"
|
||||||
log_success_msg "update modules population"
|
install -Dm644 lib/LICENSE.txt $PKG/usr/share/licenses/$isim/LICENSE
|
||||||
EOF
|
install -Dm644 broadcom-wl.modprobe.d $PKG/etc/modprobe.d/broadcom-wl.conf
|
||||||
echo "depmod $KERNELRELEASE" >> $PKGMK_ROOT/$isim.post-install
|
|
||||||
cat >> $PKGMK_ROOT/$isim.post-install << "EOF"
|
|
||||||
log_warning_msg "${WARNING}Check the file /etc/modprobe.d/broadcom-wl.conf ${NORMAL}"
|
|
||||||
log_warning_msg "${WARNING}Reboot if you want the modules being automatically loaded${NORMAL}"
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue