#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
-#
+#
# $Id: Makefile 7440 2007-06-02 02:22:01Z nbd $
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/package.mk
+PKG_FWV4_NAME:=broadcom-wl
+PKG_FWV4_VERSION=4.80.53.0
+PKG_FWV4_OBJECT:=kmod/wl_apsta.o
+
+PKG_FWV4_SOURCE:=$(PKG_FWV4_NAME)-$(PKG_FWV4_VERSION).tar.bz2
+PKG_FWV4_SOURCE_URL:=http://downloads.openwrt.org/sources/
+PKG_FWV4_MD5SUM:=a7d8dde3ce474c361143b83e1d9890b1
+
+PKG_FWCUTTER_NAME:=b43-fwcutter
+PKG_FWCUTTER_VERSION=008
+
+PKG_FWCUTTER_SOURCE:=$(PKG_FWCUTTER_NAME)-$(PKG_FWCUTTER_VERSION).tar.bz2
+PKG_FWCUTTER_SOURCE_URL:=http://download.berlios.de/bcm43xx/
+PKG_FWCUTTER_MD5SUM:=3f7fbf4f8dcd296c6d1b0d42eab0f9ac
+
define KernelPackage/b43
SUBMENU:=Wireless Drivers
TITLE:=Broadcom 43xx wireless support
- DEPENDS:=@TARGET_brcm47xx +kmod-mac80211 @BROKEN
+ DEPENDS:=@TARGET_brcm47xx +kmod-mac80211
FILES:=$(PKG_BUILD_DIR)/b43.$(LINUX_KMOD_SUFFIX)
-# AUTOLOAD:=$(call AutoLoad,30,b43)
+ AUTOLOAD:=$(call AutoLoad,30,b43)
endef
define KernelPackage/b43/description
LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211 -I$(LINUX_DIR)/include -include linux/autoconf.h" \
$(EXTRA_KCONFIG)
+$(STAMP_PREPARED): $(DL_DIR)/$(PKG_FWV4_SOURCE) $(DL_DIR)/$(PKG_FWCUTTER_SOURCE)
+
+$(DL_DIR)/$(PKG_FWV4_SOURCE):
+ $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FWV4_SOURCE)" "$(PKG_FWV4_MD5SUM)" $(PKG_FWV4_SOURCE_URL)
+
+$(DL_DIR)/$(PKG_FWCUTTER_SOURCE):
+ $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_FWCUTTER_SOURCE)" "$(PKG_FWCUTTER_MD5SUM)" $(PKG_FWCUTTER_SOURCE_URL)
+
+
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
+ tar xjf "$(DL_DIR)/$(PKG_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
+ tar xjf "$(DL_DIR)/$(PKG_FWCUTTER_SOURCE)" -C "$(PKG_BUILD_DIR)"
endef
define Build/Configure
$(MAKE) -C "$(LINUX_DIR)" \
$(MAKE_OPTS) \
modules
+
+ $(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_FWCUTTER_NAME)-$(PKG_FWCUTTER_VERSION)"
+endef
+
+define KernelPackage/b43/install
+ $(INSTALL_DIR) $(1)/lib/firmware/
+
+ $(PKG_BUILD_DIR)/$(PKG_FWCUTTER_NAME)-$(PKG_FWCUTTER_VERSION)/b43-fwcutter \
+ -w $(1)/lib/firmware/ \
+ $(PKG_BUILD_DIR)/$(PKG_FWV4_NAME)-$(PKG_FWV4_VERSION)/$(PKG_FWV4_OBJECT)
endef
$(eval $(call KernelPackage,b43))
/* The root directory. */
-struct dentry *rootdir;
+static struct dentry *rootdir;
struct b43_debugfs_fops {
ssize_t (*read)(struct b43_wldev *dev, char *buf, size_t bufsize);
/* wl->irq_lock is locked */
-ssize_t tsf_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
+static ssize_t tsf_read_file(struct b43_wldev *dev,
+ char *buf, size_t bufsize)
{
ssize_t count = 0;
u64 tsf;
}
/* wl->irq_lock is locked */
-int tsf_write_file(struct b43_wldev *dev, const char *buf, size_t count)
+static int tsf_write_file(struct b43_wldev *dev,
+ const char *buf, size_t count)
{
u64 tsf;
}
/* wl->irq_lock is locked */
-ssize_t ucode_regs_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
+static ssize_t ucode_regs_read_file(struct b43_wldev *dev,
+ char *buf, size_t bufsize)
{
ssize_t count = 0;
int i;
}
/* wl->irq_lock is locked */
-ssize_t shm_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
+static ssize_t shm_read_file(struct b43_wldev *dev,
+ char *buf, size_t bufsize)
{
ssize_t count = 0;
int i;
return count;
}
-ssize_t txstat_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
+static ssize_t txstat_read_file(struct b43_wldev *dev,
+ char *buf, size_t bufsize)
{
struct b43_txstatus_log *log = &dev->dfsentry->txstatlog;
ssize_t count = 0;
return count;
}
-ssize_t txpower_g_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
+static ssize_t txpower_g_read_file(struct b43_wldev *dev,
+ char *buf, size_t bufsize)
{
ssize_t count = 0;
return count;
}
-int txpower_g_write_file(struct b43_wldev *dev, const char *buf, size_t count)
+static int txpower_g_write_file(struct b43_wldev *dev,
+ const char *buf, size_t count)
{
unsigned long phy_flags;
}
/* wl->irq_lock is locked */
-int restart_write_file(struct b43_wldev *dev, const char *buf, size_t count)
+static int restart_write_file(struct b43_wldev *dev,
+ const char *buf, size_t count)
{
int err = 0;
return count;
}
-ssize_t loctls_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
+static ssize_t loctls_read_file(struct b43_wldev *dev,
+ char *buf, size_t bufsize)
{
ssize_t count = 0;
struct b43_txpower_lo_control *lo;
err = -ENOMEM;
goto out_unlock;
}
+ /* Sparse warns about the following memset, because it has a big
+ * size value. That warning is bogus, so I will ignore it. --mb */
memset(buf, 0, bufsize);
if (dfops->take_irqlock) {
spin_lock_irq(&dev->wl->irq_lock);
#include "b43.h"
#include "leds.h"
+
static void b43_led_turn_on(struct b43_wldev *dev, u8 led_index,
bool activelow)
{
/* The unique name string for this LED device. */
char name[B43_LED_MAX_NAME_LEN + 1];
};
-#define b43_led_index(led) ((int)((led) - (led)->dev->leds))
#define B43_LED_BEHAVIOUR 0x7F
#define B43_LED_ACTIVELOW 0x80
#include "pio.h"
#include "sysfs.h"
#include "xmit.h"
-#include "sysfs.h"
#include "lo.h"
#include "pcmcia.h"
MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl);
+static const struct pci_device_id b43_pci_bridge_tbl[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4311) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4312) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4318) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4319) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4320) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4321) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4325) },
+ { 0, },
+};
+MODULE_DEVICE_TABLE(pci, b43_pci_bridge_tbl);
+
+static struct pci_driver b43_pci_bridge_driver = {
+ .name = "b43-pci-bridge",
+ .id_table = b43_pci_bridge_tbl,
+};
/* Channel and ratetables are shared for all devices.
* They can't be const, because ieee80211 puts some precalculated
* data in there. This data is the same for all devices, so we don't
B43_WARN_ON(!dev->noisecalc.calculation_running);
if (dev->noisecalc.channel_at_start != phy->channel)
goto drop_calculation;
- *((u32 *) noise) = cpu_to_le32(b43_jssi_read(dev));
+ *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev));
if (noise[0] == 0x7F || noise[1] == 0x7F ||
noise[2] == 0x7F || noise[3] == 0x7F)
goto generate_new;
const char *name,
const struct firmware **fw)
{
- const size_t plen = sizeof(modparam_fwpostfix) + 32;
- char path[plen];
+ char path[sizeof(modparam_fwpostfix) + 32];
struct b43_fw_header *hdr;
u32 size;
int err;
if (b43_debug(dev, B43_DBG_PWORK_FAST))
delay = msecs_to_jiffies(50);
else
- delay = round_jiffies(HZ * 15);
+ delay = round_jiffies_relative(HZ * 15);
queue_delayed_work(wl->hw->workqueue, &dev->periodic_work, delay);
out:
mutex_unlock(&wl->mutex);
struct b43_wl *wl = hw_to_b43_wl(hw);
struct b43_wldev *dev = wl->current_dev;
int did_init = 0;
- int err;
+ int err = 0;
mutex_lock(&wl->mutex);
return err;
}
-void b43_stop(struct ieee80211_hw *hw)
+static void b43_stop(struct ieee80211_hw *hw)
{
struct b43_wl *wl = hw_to_b43_wl(hw);
struct b43_wldev *dev = wl->current_dev;
.resume = b43_resume,
};
+inline int b43_pci_ssb_bridge_init(void)
+{
+ return ssb_pcihost_register(&b43_pci_bridge_driver);
+}
+
+inline void b43_pci_ssb_bridge_exit(void)
+{
+ ssb_pcihost_unregister(&b43_pci_bridge_driver);
+}
+
static int __init b43_init(void)
{
int err;
err = b43_pcmcia_init();
if (err)
goto err_dfs_exit;
- err = ssb_driver_register(&b43_ssb_driver);
+
+ err = b43_pci_ssb_bridge_init();
if (err)
goto err_pcmcia_exit;
+ err = ssb_driver_register(&b43_ssb_driver);
+ if (err)
+ goto err_pci_exit;
+
return err;
+err_pci_exit:
+ b43_pci_ssb_bridge_exit();
err_pcmcia_exit:
b43_pcmcia_exit();
err_dfs_exit:
static void __exit b43_exit(void)
{
ssb_driver_unregister(&b43_ssb_driver);
+ b43_pci_ssb_bridge_exit();
b43_pcmcia_exit();
b43_debugfs_exit();
}
*/
+#include "pcmcia.h"
+
#include <linux/ssb/ssb.h>
#include <pcmcia/cs_types.h>
#include <pcmcia/ds.h>
#include <pcmcia/cisreg.h>
+
static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = {
PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448),
PCMCIA_DEVICE_NULL,
*/
#include <linux/delay.h>
+#include <linux/io.h>
#include <linux/types.h>
#include "b43.h"
source = packet;
i -= txhdr_size;
}
- ret = le16_to_cpu(*((u16 *) (source + i)));
+ ret = le16_to_cpu(*((__le16 *)(source + i)));
*pos += 2;
return ret;
struct b43_pio_txpacket *packet)
{
u16 cookie = 0x0000;
- int packetindex;
+ u16 packetindex;
/* We use the upper 4 bits for the PIO
* controller ID and the lower 12 bits
default:
B43_WARN_ON(1);
}
- packetindex = pio_txpacket_getindex(packet);
+ packetindex = packet->index;
B43_WARN_ON(packetindex & ~0x0FFF);
cookie |= (u16) packetindex;
packet->queue = queue;
INIT_LIST_HEAD(&packet->list);
+ packet->index = i;
list_add(&packet->list, &queue->txfree);
}
void b43_pio_rx(struct b43_pioqueue *queue)
{
- u16 preamble[21] = { 0 };
+ __le16 preamble[21] = { 0 };
struct b43_rxhdr_fw4 *rxhdr;
- u16 tmp, len, macstat;
+ u16 tmp, len;
+ u32 macstat;
int i, preamble_readwords;
struct sk_buff *skb;
}
b43dbg(queue->dev->wl, "PIO RX timed out\n");
return;
- data_ready:
+data_ready:
len = b43_pio_read(queue, B43_PIO_RXDATA);
if (unlikely(len > 0x700)) {
preamble[i + 1] = cpu_to_le16(tmp);
}
rxhdr = (struct b43_rxhdr_fw4 *)preamble;
- macstat = le16_to_cpu(rxhdr->mac_status);
+ macstat = le32_to_cpu(rxhdr->mac_status);
if (macstat & B43_RX_MAC_FCSERR) {
pio_rx_error(queue,
(queue->mmio_base == B43_MMIO_PIO1_BASE),
skb_put(skb, len);
for (i = 0; i < len - 1; i += 2) {
tmp = b43_pio_read(queue, B43_PIO_RXDATA);
- *((u16 *) (skb->data + i)) = cpu_to_le16(tmp);
+ *((__le16 *)(skb->data + i)) = cpu_to_le16(tmp);
}
if (len % 2) {
tmp = b43_pio_read(queue, B43_PIO_RXDATA);
#include "b43.h"
#include <linux/interrupt.h>
+#include <linux/io.h>
#include <linux/list.h>
#include <linux/skbuff.h>
struct sk_buff *skb;
struct ieee80211_tx_status txstat;
struct list_head list;
+ u16 index; /* Index in the tx_packets_cache */
};
-#define pio_txpacket_getindex(packet) ((int)((packet) - (packet)->queue->tx_packets_cache))
-
struct b43_pioqueue {
struct b43_wldev *dev;
u16 mmio_base;
*/
+#include <linux/capability.h>
+#include <linux/io.h>
+
#include "b43.h"
#include "sysfs.h"
#include "main.h"
#include "phy.h"
-#include <linux/capability.h>
-
#define GENERIC_FILESIZE 64
static int get_integer(const char *buf, size_t count)
__u8 *raw = plcp->raw;
if (b43_is_ofdm_rate(bitrate)) {
- *data = b43_plcp_get_ratecode_ofdm(bitrate);
+ u32 d;
+
+ d = b43_plcp_get_ratecode_ofdm(bitrate);
B43_WARN_ON(octets & 0xF000);
- *data |= (octets << 5);
- *data = cpu_to_le32(*data);
+ d |= (octets << 5);
+ *data = cpu_to_le32(d);
} else {
u32 plen;
define KernelPackage/mac80211
SUBMENU:=Wireless Drivers
TITLE:=Linux 802.11 Wireless Networking Stack
- DEPENDS:=@LINUX_2_6_23 +kmod-crypto-arc4 +kmod-crypto-aes
+ DEPENDS:=@LINUX_2_6_23 +kmod-crypto-arc4 +kmod-crypto-aes +wireless-tools
FILES:= \
$(PKG_BUILD_DIR)/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
$(PKG_BUILD_DIR)/mac80211/rc80211_simple.$(LINUX_KMOD_SUFFIX) \
--- /dev/null
+diff -Naur linux-2.6.23.1.orig/drivers/ssb/b43_pci_bridge.c linux-2.6.23.1/drivers/ssb/b43_pci_bridge.c
+--- linux-2.6.23.1.orig/drivers/ssb/b43_pci_bridge.c 2007-11-09 16:48:55.000000000 +0100
++++ linux-2.6.23.1/drivers/ssb/b43_pci_bridge.c 1970-01-01 01:00:00.000000000 +0100
+@@ -1,48 +0,0 @@
+-/*
+- * Broadcom 43xx PCI-SSB bridge module
+- *
+- * This technically is a seperate PCI driver module, but
+- * because of its small size we include it in the SSB core
+- * instead of creating a standalone module.
+- *
+- * Copyright 2007 Michael Buesch <mb@bu3sch.de>
+- *
+- * Licensed under the GNU/GPL. See COPYING for details.
+- */
+-
+-#include <linux/pci.h>
+-#include <linux/ssb/ssb.h>
+-
+-#include "ssb_private.h"
+-
+-
+-static const struct pci_device_id b43_pci_bridge_tbl[] = {
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4301) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4307) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4311) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4312) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4318) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4319) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4320) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4321) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
+- { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4325) },
+- { 0, },
+-};
+-MODULE_DEVICE_TABLE(pci, b43_pci_bridge_tbl);
+-
+-static struct pci_driver b43_pci_bridge_driver = {
+- .name = "b43-pci-bridge",
+- .id_table = b43_pci_bridge_tbl,
+-};
+-
+-
+-int __init b43_pci_ssb_bridge_init(void)
+-{
+- return ssb_pcihost_register(&b43_pci_bridge_driver);
+-}
+-
+-void __exit b43_pci_ssb_bridge_exit(void)
+-{
+- ssb_pcihost_unregister(&b43_pci_bridge_driver);
+-}
+diff -Naur linux-2.6.23.1.orig/drivers/ssb/main.c linux-2.6.23.1/drivers/ssb/main.c
+--- linux-2.6.23.1.orig/drivers/ssb/main.c 2007-11-09 16:48:55.000000000 +0100
++++ linux-2.6.23.1/drivers/ssb/main.c 2007-11-09 22:11:32.000000000 +0100
+@@ -1142,21 +1142,12 @@
+ if (err)
+ bus_unregister(&ssb_bustype);
+
+- err = b43_pci_ssb_bridge_init();
+- if (err) {
+- ssb_printk(KERN_ERR "Broadcom 43xx PCI-SSB-bridge "
+- "initialization failed");
+- /* don't fail SSB init because of this */
+- err = 0;
+- }
+-
+ return err;
+ }
+ subsys_initcall(ssb_modinit);
+
+ static void __exit ssb_modexit(void)
+ {
+- b43_pci_ssb_bridge_exit();
+ bus_unregister(&ssb_bustype);
+ }
+ module_exit(ssb_modexit)
+diff -Naur linux-2.6.23.1.orig/drivers/ssb/Makefile linux-2.6.23.1/drivers/ssb/Makefile
+--- linux-2.6.23.1.orig/drivers/ssb/Makefile 2007-11-09 16:48:55.000000000 +0100
++++ linux-2.6.23.1/drivers/ssb/Makefile 2007-11-09 22:30:32.000000000 +0100
+@@ -11,8 +11,4 @@
+ ssb-$(CONFIG_SSB_DRIVER_EXTIF) += driver_extif.o
+ ssb-$(CONFIG_SSB_DRIVER_PCICORE) += driver_pcicore.o
+
+-# b43 pci-ssb-bridge driver
+-# Not strictly a part of SSB, but kept here for convenience
+-ssb-$(CONFIG_SSB_PCIHOST) += b43_pci_bridge.o
+-
+ obj-$(CONFIG_SSB) += ssb.o
+diff -Naur linux-2.6.23.1.orig/drivers/ssb/ssb_private.h linux-2.6.23.1/drivers/ssb/ssb_private.h
+--- linux-2.6.23.1.orig/drivers/ssb/ssb_private.h 2007-11-09 16:48:55.000000000 +0100
++++ linux-2.6.23.1/drivers/ssb/ssb_private.h 2007-11-09 22:11:11.000000000 +0100
+@@ -119,18 +119,4 @@
+ extern int ssb_devices_thaw(struct ssb_bus *bus);
+ extern struct ssb_bus *ssb_pci_dev_to_bus(struct pci_dev *pdev);
+
+-/* b43_pci_bridge.c */
+-#ifdef CONFIG_SSB_PCIHOST
+-extern int __init b43_pci_ssb_bridge_init(void);
+-extern void __exit b43_pci_ssb_bridge_exit(void);
+-#else /* CONFIG_SSB_PCIHOST */
+-static inline int b43_pci_ssb_bridge_init(void)
+-{
+- return 0;
+-}
+-static inline void b43_pci_ssb_bridge_exit(void)
+-{
+-}
+-#endif /* CONFIG_SSB_PCIHOST */
+-
+ #endif /* LINUX_SSB_PRIVATE_H_ */
--- /dev/null
+#
+# Copyright (C) 2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Broadcom-b43
+ NAME:=Broadcom BCM43xx WiFi
+ PACKAGES:=kmod-b43
+endef
+
+define Profile/Broadcom-b43/Description
+ Package set compatible with hardware using Broadcom BCM43xx cards
+endef
+$(eval $(call Profile,Broadcom-b43))
+