Skip to content

Commit

Permalink
- Add support for Linux 4.0
Browse files Browse the repository at this point in the history
  Credit for the patch goes to Krzysztof Kolasa.
- Fixed make warnings
  Credit for the patch goes to Krzysztof Kolasa.
  • Loading branch information
longsleep committed Mar 14, 2015
1 parent fcd1406 commit 8be1d3c
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
12 changes: 12 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
bcmwl (6.30.223.248+bdcom-1longsleep0) utopic; urgency=medium

* debian/dkms.conf.in
debian/patches/0016-repair-make-warnings.patch
debian/patches/0017-add-support-for-Linux-4.0.patch
- Fixed make warnings
Credit for the patch goes to Krzysztof Kolasa.
- Add support for Linux 4.0
Credit for the patch goes to Krzysztof Kolasa.

-- Simon Eisenmann <simon@longsleep.org> Sat, 14 Mar 2015 15:28:46 +0100

bcmwl (6.30.223.248+bdcom-0ubuntu2) vivid; urgency=medium

* debian/dkms.conf.in,
Expand Down
2 changes: 2 additions & 0 deletions debian/dkms.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@ PATCH[5]="0012-add-support-for-Linux-3.15.patch"
PATCH[6]="0013-gcc.patch"
PATCH[7]="0014-add-support-for-Linux-3.17.patch"
PATCH[8]="0015-add-support-for-Linux-3.18.patch"
PATCH[9]="0016-repair-make-warnings.patch"
PATCH[10]="0017-add-support-for-Linux-4.0.patch"
#PATCH_MATCH[6]="^3.[10-11]"
AUTOINSTALL="yes"
57 changes: 57 additions & 0 deletions debian/patches/0016-repair-make-warnings.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
From 92fc12028553831a87cfa87ffa8d676ab0f60522 Mon Sep 17 00:00:00 2001
From: Simon Eisenmann <simon@longsleep.org>
Date: Sat, 14 Mar 2015 15:02:08 +0100
Subject: [PATCH] Repair make warnings

Orginal author: Krzysztof Kolasa
Source: https://raw.githubusercontent.com/kolasa/bcmwl-6.30.223.248/9fafc1faa6dc410bf8aba340a7929f404c73d30e/patches/0016-repair-make-warnings.patch
---
src/wl/sys/wl_cfg80211_hybrid.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
index ea0726f..b265e25 100644
--- a/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
@@ -63,8 +63,13 @@ static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
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 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
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 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
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;
--
2.1.0

40 changes: 40 additions & 0 deletions debian/patches/0017-add-support-for-Linux-4.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
From a97b0a39f016589e38706d7d32f902847dcbbf27 Mon Sep 17 00:00:00 2001
From: Simon Eisenmann <simon@longsleep.org>
Date: Sat, 14 Mar 2015 15:10:48 +0100
Subject: [PATCH] Add support for Linux 4.0

---
src/wl/sys/wl_cfg80211_hybrid.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
index b265e25..425c7c5 100644
--- a/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
@@ -1452,7 +1452,11 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
WL_DBG(("Could not get rate (%d)\n", err));
} else {
rate = dtoh32(rate);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
sinfo->filled |= STATION_INFO_TX_BITRATE;
+#else
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
+#endif
sinfo->txrate.legacy = rate * 5;
WL_DBG(("Rate %d Mbps\n", (rate / 2)));
}
@@ -1465,7 +1469,11 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
return err;
}
rssi = dtoh32(scb_val.val);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
sinfo->filled |= STATION_INFO_SIGNAL;
+#else
+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
+#endif
sinfo->signal = rssi;
WL_DBG(("RSSI %d dBm\n", rssi));
}
--
2.1.0

0 comments on commit 8be1d3c

Please sign in to comment.