mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
bcm_sta: update to 6.30.223.248
update driver and revise patches needed for 3.17 kernel bcm_sta: fix typo
This commit is contained in:
parent
d558d993cf
commit
4474a9f432
@ -20,7 +20,7 @@
|
||||
# http://www.broadcom.com/support/802.11/linux_sta.php
|
||||
|
||||
PKG_NAME="bcm_sta"
|
||||
PKG_VERSION="6.20.155.1"
|
||||
PKG_VERSION="6.30.223.248"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="i386 x86_64"
|
||||
PKG_LICENSE="nonfree"
|
||||
|
@ -1,26 +0,0 @@
|
||||
diff --git a/x86-32/Makefile b/x86-32/Makefile
|
||||
index bf30b03..d835350 100644
|
||||
--- a/x86-32/Makefile
|
||||
+++ b/x86-32/Makefile
|
||||
@@ -125,7 +125,7 @@ EXTRA_CFLAGS += -I$(src)/src/include
|
||||
EXTRA_CFLAGS += -I$(src)/src/wl/sys -I$(src)/src/wl/clm/api -I$(src)/src/wl/phy
|
||||
#EXTRA_CFLAGS += -DBCMDBG_ASSERT
|
||||
|
||||
-EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
|
||||
+EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped_$(BINARCH)
|
||||
|
||||
KBASE ?= /lib/modules/`uname -r`
|
||||
KBUILD_DIR ?= $(KBASE)/build
|
||||
diff --git a/x86-64/Makefile b/x86-64/Makefile
|
||||
index bf30b03..d835350 100644
|
||||
--- a/x86-64/Makefile
|
||||
+++ b/x86-64/Makefile
|
||||
@@ -125,7 +125,7 @@ EXTRA_CFLAGS += -I$(src)/src/include
|
||||
EXTRA_CFLAGS += -I$(src)/src/wl/sys -I$(src)/src/wl/clm/api -I$(src)/src/wl/phy
|
||||
#EXTRA_CFLAGS += -DBCMDBG_ASSERT
|
||||
|
||||
-EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped
|
||||
+EXTRA_LDFLAGS := $(src)/lib/wlc_hybrid.o_shipped_$(BINARCH)
|
||||
|
||||
KBASE ?= /lib/modules/`uname -r`
|
||||
KBUILD_DIR ?= $(KBASE)/build
|
@ -1,28 +0,0 @@
|
||||
--- a/x86-32/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-32/src/wl/sys/wl_linux.c
|
||||
@@ -99,6 +99,10 @@ static void wl_dpc_rxwork(struct wl_task *task);
|
||||
|
||||
#endif
|
||||
|
||||
+#ifndef init_MUTEX
|
||||
+#define init_MUTEX(sem) sema_init(sem, 1)
|
||||
+#endif
|
||||
+
|
||||
static int wl_linux_watchdog(void *ctx);
|
||||
static
|
||||
int wl_found = 0;
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-64/src/wl/sys/wl_linux.c
|
||||
@@ -99,6 +99,10 @@ static void wl_dpc_rxwork(struct wl_task *task);
|
||||
|
||||
#endif
|
||||
|
||||
+#ifndef init_MUTEX
|
||||
+#define init_MUTEX(sem) sema_init(sem, 1)
|
||||
+#endif
|
||||
+
|
||||
static int wl_linux_watchdog(void *ctx);
|
||||
static
|
||||
int wl_found = 0;
|
||||
|
@ -1,27 +0,0 @@
|
||||
--- a/x86-32/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-32/src/wl/sys/wl_linux.c
|
||||
@@ -385,7 +385,11 @@ static const struct net_device_ops wl_netdev_ops =
|
||||
#endif
|
||||
.ndo_get_stats = wl_get_stats,
|
||||
.ndo_set_mac_address = wl_set_mac_address,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
|
||||
.ndo_set_multicast_list = wl_set_multicast_list,
|
||||
+#else
|
||||
+ .ndo_set_rx_mode = wl_set_multicast_list,
|
||||
+#endif
|
||||
.ndo_do_ioctl = wl_ioctl
|
||||
};
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-64/src/wl/sys/wl_linux.c
|
||||
@@ -385,7 +385,11 @@ static const struct net_device_ops wl_netdev_ops =
|
||||
#endif
|
||||
.ndo_get_stats = wl_get_stats,
|
||||
.ndo_set_mac_address = wl_set_mac_address,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
|
||||
.ndo_set_multicast_list = wl_set_multicast_list,
|
||||
+#else
|
||||
+ .ndo_set_rx_mode = wl_set_multicast_list,
|
||||
+#endif
|
||||
.ndo_do_ioctl = wl_ioctl
|
||||
};
|
@ -1,25 +0,0 @@
|
||||
--- a/x86-32/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-32/src/wl/sys/wl_linux.c
|
||||
@@ -40,7 +40,9 @@
|
||||
#include <linux/pci_ids.h>
|
||||
#define WLC_MAXBSSCFG 1
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
|
||||
#include <asm/system.h>
|
||||
+#endif
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/pgtable.h>
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-64/src/wl/sys/wl_linux.c
|
||||
@@ -40,7 +40,9 @@
|
||||
#include <linux/pci_ids.h>
|
||||
#define WLC_MAXBSSCFG 1
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
|
||||
#include <asm/system.h>
|
||||
+#endif
|
||||
#include <asm/io.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/pgtable.h>
|
@ -1,133 +0,0 @@
|
||||
--- a/x86-32/src/include/bcmutils.h
|
||||
+++ b/x86-32/src/include/bcmutils.h
|
||||
@@ -214,7 +214,11 @@ typedef struct bcm_tlv {
|
||||
extern int bcm_format_flags(const bcm_bit_desc_t *bd, uint32 flags, char* buf, int len);
|
||||
extern int bcm_format_hex(char *str, const void *bytes, int len);
|
||||
#endif
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(void *buf, int buflen, uint key);
|
||||
+#else
|
||||
+extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(const void *buf, int buflen, uint key);
|
||||
+#endif
|
||||
|
||||
typedef uint32 mbool;
|
||||
|
||||
--- a/x86-32/src/wl/sys/wl_cfg80211.c
|
||||
+++ b/x86-32/src/wl/sys/wl_cfg80211.c
|
||||
@@ -702,7 +702,11 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
|
||||
else
|
||||
memset(&join_params.params.bssid, 0, ETHER_ADDR_LEN);
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
wl_ch_to_chanspec(params->channel, &join_params, &join_params_size);
|
||||
+#else
|
||||
+ wl_ch_to_chanspec(params->chandef.chan, &join_params, &join_params_size);
|
||||
+#endif
|
||||
|
||||
err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
|
||||
if (err) {
|
||||
@@ -1957,9 +1961,14 @@ static s32 wl_update_bss_info(struct wl_cfg80211_priv *wl)
|
||||
struct wlc_ssid *ssid;
|
||||
struct bcm_tlv *tim;
|
||||
s32 dtim_period;
|
||||
+ s32 err = 0;
|
||||
size_t ie_len;
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
u8 *ie;
|
||||
- s32 err = 0;
|
||||
+#else
|
||||
+ const u8 *ie;
|
||||
+ const struct cfg80211_bss_ies *ies;
|
||||
+#endif
|
||||
|
||||
ssid = &wl->profile->ssid;
|
||||
bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
|
||||
@@ -1988,8 +1997,22 @@ static s32 wl_update_bss_info(struct wl_cfg80211_priv *wl)
|
||||
ie_len = bi->ie_length;
|
||||
} else {
|
||||
WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid));
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
ie = bss->information_elements;
|
||||
ie_len = bss->len_information_elements;
|
||||
+#else
|
||||
+ rcu_read_lock();
|
||||
+ ies = (const struct cfg80211_bss_ies*)rcu_dereference(bss->ies);
|
||||
+ if (!ies) {
|
||||
+ /* This should never happen */
|
||||
+ rcu_read_unlock();
|
||||
+ err = -EIO;
|
||||
+ goto update_bss_info_out;
|
||||
+ }
|
||||
+ ie = ies->data;
|
||||
+ ie_len = (size_t)(ies->len);
|
||||
+ rcu_read_unlock();
|
||||
+#endif
|
||||
cfg80211_put_bss(bss);
|
||||
}
|
||||
|
||||
--- a/x86-64/src/include/bcmutils.h
|
||||
+++ b/x86-64/src/include/bcmutils.h
|
||||
@@ -214,7 +214,11 @@ typedef struct bcm_tlv {
|
||||
extern int bcm_format_flags(const bcm_bit_desc_t *bd, uint32 flags, char* buf, int len);
|
||||
extern int bcm_format_hex(char *str, const void *bytes, int len);
|
||||
#endif
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(void *buf, int buflen, uint key);
|
||||
+#else
|
||||
+extern bcm_tlv_t *BCMROMFN(bcm_parse_tlvs)(const void *buf, int buflen, uint key);
|
||||
+#endif
|
||||
|
||||
typedef uint32 mbool;
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_cfg80211.c
|
||||
+++ b/x86-64/src/wl/sys/wl_cfg80211.c
|
||||
@@ -702,7 +702,11 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
|
||||
else
|
||||
memset(&join_params.params.bssid, 0, ETHER_ADDR_LEN);
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
wl_ch_to_chanspec(params->channel, &join_params, &join_params_size);
|
||||
+#else
|
||||
+ wl_ch_to_chanspec(params->chandef.chan, &join_params, &join_params_size);
|
||||
+#endif
|
||||
|
||||
err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
|
||||
if (err) {
|
||||
@@ -1957,9 +1961,14 @@ static s32 wl_update_bss_info(struct wl_cfg80211_priv *wl)
|
||||
struct wlc_ssid *ssid;
|
||||
struct bcm_tlv *tim;
|
||||
s32 dtim_period;
|
||||
+ s32 err = 0;
|
||||
size_t ie_len;
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
u8 *ie;
|
||||
- s32 err = 0;
|
||||
+#else
|
||||
+ const u8 *ie;
|
||||
+ const struct cfg80211_bss_ies *ies;
|
||||
+#endif
|
||||
|
||||
ssid = &wl->profile->ssid;
|
||||
bss = cfg80211_get_bss(wl_to_wiphy(wl), NULL, (s8 *)&wl->bssid,
|
||||
@@ -1988,8 +1997,22 @@ static s32 wl_update_bss_info(struct wl_cfg80211_priv *wl)
|
||||
ie_len = bi->ie_length;
|
||||
} else {
|
||||
WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid));
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 8, 0)
|
||||
ie = bss->information_elements;
|
||||
ie_len = bss->len_information_elements;
|
||||
+#else
|
||||
+ rcu_read_lock();
|
||||
+ ies = (const struct cfg80211_bss_ies*)rcu_dereference(bss->ies);
|
||||
+ if (!ies) {
|
||||
+ /* This should never happen */
|
||||
+ rcu_read_unlock();
|
||||
+ err = -EIO;
|
||||
+ goto update_bss_info_out;
|
||||
+ }
|
||||
+ ie = ies->data;
|
||||
+ ie_len = (size_t)(ies->len);
|
||||
+ rcu_read_unlock();
|
||||
+#endif
|
||||
cfg80211_put_bss(bss);
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
--- a/x86-32/src/wl/sys/wl_cfg80211.c 2013-03-29 18:12:43.447176381 +0100
|
||||
+++ b/x86-32/src/wl/sys/wl_cfg80211.c 2013-03-29 18:12:56.595176453 +0100
|
||||
@@ -2013,8 +2013,12 @@
|
||||
ie_len = (size_t)(ies->len);
|
||||
rcu_read_unlock();
|
||||
#endif
|
||||
- cfg80211_put_bss(bss);
|
||||
- }
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
|
||||
+ cfg80211_put_bss(bss);
|
||||
+#else
|
||||
+ cfg80211_put_bss(wl_to_wiphy(wl), bss);
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
|
||||
if (tim) {
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_cfg80211.c 2013-03-29 18:12:43.447176381 +0100
|
||||
+++ a/x86-64/src/wl/sys/wl_cfg80211.c 2013-03-29 18:12:56.595176453 +0100
|
||||
@@ -2013,8 +2013,12 @@
|
||||
ie_len = (size_t)(ies->len);
|
||||
rcu_read_unlock();
|
||||
#endif
|
||||
- cfg80211_put_bss(bss);
|
||||
- }
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
|
||||
+ cfg80211_put_bss(bss);
|
||||
+#else
|
||||
+ cfg80211_put_bss(wl_to_wiphy(wl), bss);
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
tim = bcm_parse_tlvs(ie, ie_len, WLAN_EID_TIM);
|
||||
if (tim) {
|
@ -1,64 +0,0 @@
|
||||
--- a/x86-32/src/wl/sys/wl_cfg80211.c
|
||||
+++ b/x86-32/src/wl/sys/wl_cfg80211.c
|
||||
@@ -46,7 +46,10 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO;
|
||||
|
||||
static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
|
||||
enum nl80211_iftype type, u32 *flags, struct vif_params *params);
|
||||
-static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
|
||||
+static s32 wl_cfg80211_scan(struct wiphy *wiphy,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
|
||||
+ struct net_device *ndev,
|
||||
+#endif
|
||||
struct cfg80211_scan_request *request);
|
||||
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,
|
||||
@@ -482,9 +485,15 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
|
||||
}
|
||||
|
||||
static s32
|
||||
-wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
|
||||
+wl_cfg80211_scan(struct wiphy *wiphy,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
|
||||
+ struct net_device *ndev,
|
||||
+#endif
|
||||
struct cfg80211_scan_request *request)
|
||||
{
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
|
||||
+ struct net_device *ndev = request->wdev->netdev;
|
||||
+#endif
|
||||
struct wl_cfg80211_priv *wl = ndev_to_wl(ndev);
|
||||
struct cfg80211_ssid *ssids;
|
||||
struct wl_cfg80211_scan_req *sr = wl_to_sr(wl);
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_cfg80211.c
|
||||
+++ b/x86-64/src/wl/sys/wl_cfg80211.c
|
||||
@@ -46,7 +46,10 @@ u32 wl_dbg_level = WL_DBG_ERR | WL_DBG_INFO;
|
||||
|
||||
static s32 wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
|
||||
enum nl80211_iftype type, u32 *flags, struct vif_params *params);
|
||||
-static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
|
||||
+static s32 wl_cfg80211_scan(struct wiphy *wiphy,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
|
||||
+ struct net_device *ndev,
|
||||
+#endif
|
||||
struct cfg80211_scan_request *request);
|
||||
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,
|
||||
@@ -482,9 +485,15 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
|
||||
}
|
||||
|
||||
static s32
|
||||
-wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
|
||||
+wl_cfg80211_scan(struct wiphy *wiphy,
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 0)
|
||||
+ struct net_device *ndev,
|
||||
+#endif
|
||||
struct cfg80211_scan_request *request)
|
||||
{
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
|
||||
+ struct net_device *ndev = request->wdev->netdev;
|
||||
+#endif
|
||||
struct wl_cfg80211_priv *wl = ndev_to_wl(ndev);
|
||||
struct cfg80211_ssid *ssids;
|
||||
struct wl_cfg80211_scan_req *sr = wl_to_sr(wl);
|
||||
|
@ -1,22 +0,0 @@
|
||||
--- a/x86-32/src/wl/sys/wl_linux.c 2010-12-15 02:58:07.000000000 +0100
|
||||
+++ b/x86-32/src/wl/sys/wl_linux.c 2010-12-27 22:14:38.679428984 +0100
|
||||
@@ -251,7 +251,7 @@
|
||||
#define quote_str(s) to_str(s)
|
||||
|
||||
#ifndef BRCM_WLAN_IFNAME
|
||||
-#define BRCM_WLAN_IFNAME eth%d
|
||||
+#define BRCM_WLAN_IFNAME wlan%d
|
||||
#endif
|
||||
|
||||
static char name[IFNAMSIZ] = quote_str(BRCM_WLAN_IFNAME);
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c 2010-12-15 03:01:09.000000000 +0100
|
||||
+++ b/x86-64/src/wl/sys/wl_linux.c 2010-12-27 22:15:18.273865927 +0100
|
||||
@@ -251,7 +251,7 @@
|
||||
#define quote_str(s) to_str(s)
|
||||
|
||||
#ifndef BRCM_WLAN_IFNAME
|
||||
-#define BRCM_WLAN_IFNAME eth%d
|
||||
+#define BRCM_WLAN_IFNAME wlan%d
|
||||
#endif
|
||||
|
||||
static char name[IFNAMSIZ] = quote_str(BRCM_WLAN_IFNAME);
|
@ -1,228 +0,0 @@
|
||||
diff -Naur bcm_sta-6.20.155.1/x86-32/src/wl/sys/wl_linux.c bcm_sta-6.20.155.1.patch/x86-32/src/wl/sys/wl_linux.c
|
||||
--- bcm_sta-6.20.155.1/x86-32/src/wl/sys/wl_linux.c 2013-04-14 23:10:38.000000000 +0200
|
||||
+++ bcm_sta-6.20.155.1.patch/x86-32/src/wl/sys/wl_linux.c 2014-05-14 21:47:59.249976234 +0200
|
||||
@@ -2681,7 +2681,7 @@
|
||||
void
|
||||
wl_tkip_printstats(wl_info_t *wl, bool group_key)
|
||||
{
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
||||
char debug_buf[512];
|
||||
int idx;
|
||||
if (wl->tkipmodops) {
|
||||
@@ -2843,6 +2843,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#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)
|
||||
{
|
||||
@@ -2897,18 +2898,89 @@
|
||||
return length;
|
||||
}
|
||||
|
||||
+#else
|
||||
+
|
||||
+static int
|
||||
+wl_proc_read(struct seq_file *seq, void *offset)
|
||||
+{
|
||||
+ wl_info_t * wl = (wl_info_t *)seq->private;
|
||||
+ int bcmerror, to_user;
|
||||
+
|
||||
+ WL_LOCK(wl);
|
||||
+ bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
|
||||
+ WL_UNLOCK(wl);
|
||||
+
|
||||
+ seq_printf(seq, "%d\n", to_user);
|
||||
+ return bcmerror;
|
||||
+}
|
||||
+
|
||||
+static ssize_t wl_proc_write(struct file *file, const char __user *buff,
|
||||
+ size_t length, loff_t *ppos)
|
||||
+{
|
||||
+ struct seq_file *seq = file->private_data;
|
||||
+ wl_info_t * wl = (wl_info_t *)seq->private;
|
||||
+ int bcmerror, from_user = 0;
|
||||
+
|
||||
+ if (length != 1) {
|
||||
+ WL_ERROR(("%s: Invalid data length\n", __FUNCTION__));
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+
|
||||
+ if (copy_from_user(&from_user, buff, 1)) {
|
||||
+ WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
|
||||
+ return -EFAULT;
|
||||
+ }
|
||||
+
|
||||
+ if (from_user >= 0x30)
|
||||
+ from_user -= 0x30;
|
||||
+
|
||||
+ WL_LOCK(wl);
|
||||
+ bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
|
||||
+ WL_UNLOCK(wl);
|
||||
+
|
||||
+ if (bcmerror < 0) {
|
||||
+ WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ *ppos += length;
|
||||
+ return length;
|
||||
+}
|
||||
+
|
||||
+static int wl_proc_open(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ return single_open(file, wl_proc_read, PDE_DATA(inode));
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations wl_proc_fops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .open = wl_proc_open,
|
||||
+ .read = seq_read,
|
||||
+ .write = wl_proc_write,
|
||||
+ .llseek = seq_lseek,
|
||||
+ .release = single_release,
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
static int
|
||||
wl_reg_proc_entry(wl_info_t *wl)
|
||||
{
|
||||
char tmp[32];
|
||||
sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
|
||||
- if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
|
||||
+
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
||||
+ wl->proc_entry = create_proc_entry(tmp, 0644, NULL);
|
||||
+ if (wl->proc_entry) {
|
||||
+ wl->proc_entry->read_proc = wl_proc_read;
|
||||
+ wl->proc_entry->write_proc = wl_proc_write;
|
||||
+ wl->proc_entry->data = wl;
|
||||
+ }
|
||||
+#else
|
||||
+ wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_proc_fops, wl);
|
||||
+#endif
|
||||
+ if (!wl->proc_entry) {
|
||||
WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
- wl->proc_entry->read_proc = wl_proc_read;
|
||||
- wl->proc_entry->write_proc = wl_proc_write;
|
||||
- wl->proc_entry->data = wl;
|
||||
return 0;
|
||||
}
|
||||
diff -Naur bcm_sta-6.20.155.1/x86-64/src/wl/sys/wl_linux.c bcm_sta-6.20.155.1.patch/x86-64/src/wl/sys/wl_linux.c
|
||||
--- bcm_sta-6.20.155.1/x86-64/src/wl/sys/wl_linux.c 2013-04-14 23:10:38.000000000 +0200
|
||||
+++ bcm_sta-6.20.155.1.patch/x86-64/src/wl/sys/wl_linux.c 2014-05-14 21:48:16.002975186 +0200
|
||||
@@ -2681,7 +2681,7 @@
|
||||
void
|
||||
wl_tkip_printstats(wl_info_t *wl, bool group_key)
|
||||
{
|
||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
||||
char debug_buf[512];
|
||||
int idx;
|
||||
if (wl->tkipmodops) {
|
||||
@@ -2843,6 +2843,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#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)
|
||||
{
|
||||
@@ -2897,18 +2898,89 @@
|
||||
return length;
|
||||
}
|
||||
|
||||
+#else
|
||||
+
|
||||
+static int
|
||||
+wl_proc_read(struct seq_file *seq, void *offset)
|
||||
+{
|
||||
+ wl_info_t * wl = (wl_info_t *)seq->private;
|
||||
+ int bcmerror, to_user;
|
||||
+
|
||||
+ WL_LOCK(wl);
|
||||
+ bcmerror = wlc_ioctl(wl->wlc, WLC_GET_MONITOR, &to_user, sizeof(int), NULL);
|
||||
+ WL_UNLOCK(wl);
|
||||
+
|
||||
+ seq_printf(seq, "%d\n", to_user);
|
||||
+ return bcmerror;
|
||||
+}
|
||||
+
|
||||
+static ssize_t wl_proc_write(struct file *file, const char __user *buff,
|
||||
+ size_t length, loff_t *ppos)
|
||||
+{
|
||||
+ struct seq_file *seq = file->private_data;
|
||||
+ wl_info_t * wl = (wl_info_t *)seq->private;
|
||||
+ int bcmerror, from_user = 0;
|
||||
+
|
||||
+ if (length != 1) {
|
||||
+ WL_ERROR(("%s: Invalid data length\n", __FUNCTION__));
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+
|
||||
+ if (copy_from_user(&from_user, buff, 1)) {
|
||||
+ WL_ERROR(("%s: copy from user failed\n", __FUNCTION__));
|
||||
+ return -EFAULT;
|
||||
+ }
|
||||
+
|
||||
+ if (from_user >= 0x30)
|
||||
+ from_user -= 0x30;
|
||||
+
|
||||
+ WL_LOCK(wl);
|
||||
+ bcmerror = wlc_ioctl(wl->wlc, WLC_SET_MONITOR, &from_user, sizeof(int), NULL);
|
||||
+ WL_UNLOCK(wl);
|
||||
+
|
||||
+ if (bcmerror < 0) {
|
||||
+ WL_ERROR(("%s: SET_MONITOR failed with %d\n", __FUNCTION__, bcmerror));
|
||||
+ return -EIO;
|
||||
+ }
|
||||
+ *ppos += length;
|
||||
+ return length;
|
||||
+}
|
||||
+
|
||||
+static int wl_proc_open(struct inode *inode, struct file *file)
|
||||
+{
|
||||
+ return single_open(file, wl_proc_read, PDE_DATA(inode));
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations wl_proc_fops = {
|
||||
+ .owner = THIS_MODULE,
|
||||
+ .open = wl_proc_open,
|
||||
+ .read = seq_read,
|
||||
+ .write = wl_proc_write,
|
||||
+ .llseek = seq_lseek,
|
||||
+ .release = single_release,
|
||||
+};
|
||||
+#endif
|
||||
+
|
||||
static int
|
||||
wl_reg_proc_entry(wl_info_t *wl)
|
||||
{
|
||||
char tmp[32];
|
||||
sprintf(tmp, "%s%d", HYBRID_PROC, wl->pub->unit);
|
||||
- if ((wl->proc_entry = create_proc_entry(tmp, 0644, NULL)) == NULL) {
|
||||
+
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
|
||||
+ wl->proc_entry = create_proc_entry(tmp, 0644, NULL);
|
||||
+ if (wl->proc_entry) {
|
||||
+ wl->proc_entry->read_proc = wl_proc_read;
|
||||
+ wl->proc_entry->write_proc = wl_proc_write;
|
||||
+ wl->proc_entry->data = wl;
|
||||
+ }
|
||||
+#else
|
||||
+ wl->proc_entry = proc_create_data(tmp, 0644, NULL, &wl_proc_fops, wl);
|
||||
+#endif
|
||||
+ if (!wl->proc_entry) {
|
||||
WL_ERROR(("%s: create_proc_entry %s failed\n", __FUNCTION__, tmp));
|
||||
ASSERT(0);
|
||||
return -1;
|
||||
}
|
||||
- wl->proc_entry->read_proc = wl_proc_read;
|
||||
- wl->proc_entry->write_proc = wl_proc_write;
|
||||
- wl->proc_entry->data = wl;
|
||||
return 0;
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
--- a/x86-32/src/wl/sys/wl_linux.c
|
||||
+++ b/x86-32/src/wl/sys/wl_linux.c
|
||||
@@ -1773,8 +1773,8 @@
|
||||
void
|
||||
wl_dump_ver(wl_info_t *wl, struct bcmstrbuf *b)
|
||||
{
|
||||
- bcm_bprintf(b, "wl%d: %s %s version %s\n", wl->pub->unit,
|
||||
- __DATE__, __TIME__, EPI_VERSION_STR);
|
||||
+ bcm_bprintf(b, "wl%d: version %s\n", wl->pub->unit,
|
||||
+ EPI_VERSION_STR);
|
||||
}
|
||||
|
||||
#if defined(BCMDBG)
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c
|
||||
+++b/x86-64/src/wl/sys/wl_linux.c
|
||||
@@ -1773,8 +1773,8 @@
|
||||
void
|
||||
wl_dump_ver(wl_info_t *wl, struct bcmstrbuf *b)
|
||||
{
|
||||
- bcm_bprintf(b, "wl%d: %s %s version %s\n", wl->pub->unit,
|
||||
- __DATE__, __TIME__, EPI_VERSION_STR);
|
||||
+ bcm_bprintf(b, "wl%d: version %s\n", wl->pub->unit,
|
||||
+ EPI_VERSION_STR);
|
||||
}
|
||||
|
||||
#if defined(BCMDBG)
|
@ -1,60 +0,0 @@
|
||||
diff -Naur bcm_sta-6.20.155.1/x86-32/src/wl/sys/wl_cfg80211.c bcm_sta-6.20.155.1.patch/x86-32/src/wl/sys/wl_cfg80211.c
|
||||
--- bcm_sta-6.20.155.1/x86-32/src/wl/sys/wl_cfg80211.c 2013-04-14 23:10:38.000000000 +0200
|
||||
+++ bcm_sta-6.20.155.1.patch/x86-32/src/wl/sys/wl_cfg80211.c 2014-05-14 21:50:23.219067311 +0200
|
||||
@@ -1792,7 +1792,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;
|
||||
}
|
||||
diff -Naur bcm_sta-6.20.155.1/x86-64/src/wl/sys/wl_cfg80211.c bcm_sta-6.20.155.1.patch/x86-64/src/wl/sys/wl_cfg80211.c
|
||||
--- bcm_sta-6.20.155.1/x86-64/src/wl/sys/wl_cfg80211.c 2013-04-14 23:10:38.000000000 +0200
|
||||
+++ bcm_sta-6.20.155.1.patch/x86-64/src/wl/sys/wl_cfg80211.c 2014-05-14 21:50:45.102092217 +0200
|
||||
@@ -1792,7 +1792,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;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
--- a/x86-32/Makefile 2014-06-26 10:42:08.000000000 +0000
|
||||
+++ b/x86-32/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`
|
||||
--- a/x86-64/Makefile 2014-06-26 10:42:08.000000000 +0000
|
||||
+++ b/x86-64/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`
|
||||
|
@ -0,0 +1,21 @@
|
||||
--- a/x86-32/src/wl/sys/wl_linux.c 2014-06-26 14:42:08.000000000 +0400
|
||||
+++ b/x86-32/src/wl/sys/wl_linux.c 2014-10-23 06:28:36.987479544 +0400
|
||||
@@ -215,7 +217,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);
|
||||
|
||||
--- a/x86-64/src/wl/sys/wl_linux.c 2014-06-26 14:42:08.000000000 +0400
|
||||
+++ b/x86-64/src/wl/sys/wl_linux.c 2014-10-23 06:28:36.987479544 +0400
|
||||
@@ -215,7 +217,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);
|
@ -0,0 +1,102 @@
|
||||
--- a/x86-32/src/wl/sys/wl_cfg80211_hybrid.c 2014-06-26 12:42:08.000000000 +0200
|
||||
+++ b/x86-32/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/x86-32/src/wl/sys/wl_linux.c 2014-06-26 12:42:08.000000000 +0200
|
||||
+++ b/x86-32/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/x86-64/src/wl/sys/wl_cfg80211_hybrid.c 2014-06-26 12:42:08.000000000 +0200
|
||||
+++ b/x86-64/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/x86-64/src/wl/sys/wl_linux.c 2014-06-26 12:42:08.000000000 +0200
|
||||
+++ b/x86-64/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__));
|
||||
|
Loading…
x
Reference in New Issue
Block a user