Merge pull request #2286 from chewitt/wl-update

bcm_sta: update to 6.20.155.1
This commit is contained in:
Stefan Saraev 2013-05-16 05:25:36 -07:00
commit c932e5bd9f
16 changed files with 409 additions and 2 deletions

View File

@ -19,7 +19,7 @@
################################################################################
PKG_NAME="bcm_sta"
PKG_VERSION="5.100.82.112"
PKG_VERSION="6.20.155.1"
PKG_REV="1"
PKG_ARCH="i386 x86_64"
PKG_LICENSE="nonfree"
@ -36,4 +36,4 @@ PKG_IS_ADDON="no"
PKG_AUTORECONF="no"
# Downloadlocation:
# http://www.broadcom.com/support/802.11/linux_sta.php
# http://www.broadcom.com/support/802.11/linux_sta.php

View File

@ -0,0 +1,24 @@
--- a/x86-32/src/wl/sys/wl_linux.c
+++ b/x86-32/src/wl/sys/wl_linux.c
@@ -159,6 +159,8 @@ static int wl_set_radio_block(void *data, bool blocked);
static void wl_report_radio_state(wl_info_t *wl);
#endif
+MODULE_LICENSE("MIXED/Proprietary");
+
static struct pci_device_id wl_id_table[] =
{
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
--- a/x86-64/src/wl/sys/wl_linux.c
+++ b/x86-64/src/wl/sys/wl_linux.c
@@ -159,6 +159,8 @@ static int wl_set_radio_block(void *data, bool blocked);
static void wl_report_radio_state(wl_info_t *wl);
#endif
+MODULE_LICENSE("MIXED/Proprietary");
+
static struct pci_device_id wl_id_table[] =
{
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,

View File

@ -0,0 +1,49 @@
--- a/x86-32/Makefile
+++ b/x86-32/Makefile
@@ -113,6 +113,12 @@ ifeq ($(APIFINAL),WEXT)
$(info Using Wireless Extension API)
endif
+ifeq ($(shell dpkg --print-architecture),amd64)
+BINARCH = x86_64
+else
+BINARCH = i386
+endif
+
obj-m += wl.o
wl-objs :=
@@ -125,7 +131,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
--- a/x86-64/Makefile
+++ b/x86-64/Makefile
@@ -113,6 +113,12 @@ ifeq ($(APIFINAL),WEXT)
$(info Using Wireless Extension API)
endif
+ifeq ($(shell dpkg --print-architecture),amd64)
+BINARCH = x86_64
+else
+BINARCH = i386
+endif
+
obj-m += wl.o
wl-objs :=
@@ -125,7 +131,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

View File

@ -0,0 +1,28 @@
--- 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;

View File

@ -0,0 +1,27 @@
--- 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
};

View File

@ -0,0 +1,25 @@
--- 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>

View File

@ -0,0 +1,133 @@
--- 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);
}

View File

@ -0,0 +1,35 @@
--- 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) {

View File

@ -0,0 +1,64 @@
--- 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);

View File

@ -0,0 +1,22 @@
--- 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);