mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-28 19:47:00 +00:00
parent
1bca0cc517
commit
1eb35dd1c8
@ -14,12 +14,27 @@ PKG_RELEASE:=1
|
|||||||
|
|
||||||
include $(INCLUDE_DIR)/package.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
|
define KernelPackage/b43
|
||||||
SUBMENU:=Wireless Drivers
|
SUBMENU:=Wireless Drivers
|
||||||
TITLE:=Broadcom 43xx wireless support
|
TITLE:=Broadcom 43xx wireless support
|
||||||
DEPENDS:=@TARGET_brcm47xx +kmod-mac80211 @BROKEN
|
DEPENDS:=@TARGET_brcm47xx +kmod-mac80211
|
||||||
FILES:=$(PKG_BUILD_DIR)/b43.$(LINUX_KMOD_SUFFIX)
|
FILES:=$(PKG_BUILD_DIR)/b43.$(LINUX_KMOD_SUFFIX)
|
||||||
# AUTOLOAD:=$(call AutoLoad,30,b43)
|
AUTOLOAD:=$(call AutoLoad,30,b43)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define KernelPackage/b43/description
|
define KernelPackage/b43/description
|
||||||
@ -44,9 +59,20 @@ MAKE_OPTS:= \
|
|||||||
LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211 -I$(LINUX_DIR)/include -include linux/autoconf.h" \
|
LINUXINCLUDE="-I$(STAGING_DIR)/usr/include/mac80211 -I$(LINUX_DIR)/include -include linux/autoconf.h" \
|
||||||
$(EXTRA_KCONFIG)
|
$(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
|
define Build/Prepare
|
||||||
mkdir -p $(PKG_BUILD_DIR)
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
$(CP) ./src/* $(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
|
endef
|
||||||
|
|
||||||
define Build/Configure
|
define Build/Configure
|
||||||
@ -56,6 +82,16 @@ define Build/Compile
|
|||||||
$(MAKE) -C "$(LINUX_DIR)" \
|
$(MAKE) -C "$(LINUX_DIR)" \
|
||||||
$(MAKE_OPTS) \
|
$(MAKE_OPTS) \
|
||||||
modules
|
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
|
endef
|
||||||
|
|
||||||
$(eval $(call KernelPackage,b43))
|
$(eval $(call KernelPackage,b43))
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* The root directory. */
|
/* The root directory. */
|
||||||
struct dentry *rootdir;
|
static struct dentry *rootdir;
|
||||||
|
|
||||||
struct b43_debugfs_fops {
|
struct b43_debugfs_fops {
|
||||||
ssize_t (*read)(struct b43_wldev *dev, char *buf, size_t bufsize);
|
ssize_t (*read)(struct b43_wldev *dev, char *buf, size_t bufsize);
|
||||||
@ -76,7 +76,8 @@ struct b43_dfs_file * fops_to_dfs_file(struct b43_wldev *dev,
|
|||||||
|
|
||||||
|
|
||||||
/* wl->irq_lock is locked */
|
/* 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;
|
ssize_t count = 0;
|
||||||
u64 tsf;
|
u64 tsf;
|
||||||
@ -90,7 +91,8 @@ ssize_t tsf_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* wl->irq_lock is locked */
|
/* 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;
|
u64 tsf;
|
||||||
|
|
||||||
@ -102,7 +104,8 @@ int tsf_write_file(struct b43_wldev *dev, const char *buf, size_t count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* wl->irq_lock is locked */
|
/* 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;
|
ssize_t count = 0;
|
||||||
int i;
|
int i;
|
||||||
@ -116,7 +119,8 @@ ssize_t ucode_regs_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* wl->irq_lock is locked */
|
/* 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;
|
ssize_t count = 0;
|
||||||
int i;
|
int i;
|
||||||
@ -135,7 +139,8 @@ ssize_t shm_read_file(struct b43_wldev *dev, char *buf, size_t bufsize)
|
|||||||
return count;
|
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;
|
struct b43_txstatus_log *log = &dev->dfsentry->txstatlog;
|
||||||
ssize_t count = 0;
|
ssize_t count = 0;
|
||||||
@ -182,7 +187,8 @@ out_unlock:
|
|||||||
return count;
|
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;
|
ssize_t count = 0;
|
||||||
|
|
||||||
@ -214,7 +220,8 @@ out:
|
|||||||
return count;
|
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;
|
unsigned long phy_flags;
|
||||||
|
|
||||||
@ -253,7 +260,8 @@ int txpower_g_write_file(struct b43_wldev *dev, const char *buf, size_t count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* wl->irq_lock is locked */
|
/* 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;
|
int err = 0;
|
||||||
|
|
||||||
@ -285,7 +293,8 @@ static ssize_t append_lo_table(ssize_t count, char *buf, const size_t bufsize,
|
|||||||
return count;
|
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;
|
ssize_t count = 0;
|
||||||
struct b43_txpower_lo_control *lo;
|
struct b43_txpower_lo_control *lo;
|
||||||
@ -374,6 +383,8 @@ static ssize_t b43_debugfs_read(struct file *file, char __user *userbuf,
|
|||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
goto out_unlock;
|
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);
|
memset(buf, 0, bufsize);
|
||||||
if (dfops->take_irqlock) {
|
if (dfops->take_irqlock) {
|
||||||
spin_lock_irq(&dev->wl->irq_lock);
|
spin_lock_irq(&dev->wl->irq_lock);
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "b43.h"
|
#include "b43.h"
|
||||||
#include "leds.h"
|
#include "leds.h"
|
||||||
|
|
||||||
|
|
||||||
static void b43_led_turn_on(struct b43_wldev *dev, u8 led_index,
|
static void b43_led_turn_on(struct b43_wldev *dev, u8 led_index,
|
||||||
bool activelow)
|
bool activelow)
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,6 @@ struct b43_led {
|
|||||||
/* The unique name string for this LED device. */
|
/* The unique name string for this LED device. */
|
||||||
char name[B43_LED_MAX_NAME_LEN + 1];
|
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_BEHAVIOUR 0x7F
|
||||||
#define B43_LED_ACTIVELOW 0x80
|
#define B43_LED_ACTIVELOW 0x80
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
#include "pio.h"
|
#include "pio.h"
|
||||||
#include "sysfs.h"
|
#include "sysfs.h"
|
||||||
#include "xmit.h"
|
#include "xmit.h"
|
||||||
#include "sysfs.h"
|
|
||||||
#include "lo.h"
|
#include "lo.h"
|
||||||
#include "pcmcia.h"
|
#include "pcmcia.h"
|
||||||
|
|
||||||
@ -107,6 +106,23 @@ static const struct ssb_device_id b43_ssb_tbl[] = {
|
|||||||
|
|
||||||
MODULE_DEVICE_TABLE(ssb, b43_ssb_tbl);
|
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.
|
/* Channel and ratetables are shared for all devices.
|
||||||
* They can't be const, because ieee80211 puts some precalculated
|
* 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
|
* data in there. This data is the same for all devices, so we don't
|
||||||
@ -1045,7 +1061,7 @@ static void handle_irq_noise(struct b43_wldev *dev)
|
|||||||
B43_WARN_ON(!dev->noisecalc.calculation_running);
|
B43_WARN_ON(!dev->noisecalc.calculation_running);
|
||||||
if (dev->noisecalc.channel_at_start != phy->channel)
|
if (dev->noisecalc.channel_at_start != phy->channel)
|
||||||
goto drop_calculation;
|
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 ||
|
if (noise[0] == 0x7F || noise[1] == 0x7F ||
|
||||||
noise[2] == 0x7F || noise[3] == 0x7F)
|
noise[2] == 0x7F || noise[3] == 0x7F)
|
||||||
goto generate_new;
|
goto generate_new;
|
||||||
@ -1575,8 +1591,7 @@ static int do_request_fw(struct b43_wldev *dev,
|
|||||||
const char *name,
|
const char *name,
|
||||||
const struct firmware **fw)
|
const struct firmware **fw)
|
||||||
{
|
{
|
||||||
const size_t plen = sizeof(modparam_fwpostfix) + 32;
|
char path[sizeof(modparam_fwpostfix) + 32];
|
||||||
char path[plen];
|
|
||||||
struct b43_fw_header *hdr;
|
struct b43_fw_header *hdr;
|
||||||
u32 size;
|
u32 size;
|
||||||
int err;
|
int err;
|
||||||
@ -2393,7 +2408,7 @@ out_requeue:
|
|||||||
if (b43_debug(dev, B43_DBG_PWORK_FAST))
|
if (b43_debug(dev, B43_DBG_PWORK_FAST))
|
||||||
delay = msecs_to_jiffies(50);
|
delay = msecs_to_jiffies(50);
|
||||||
else
|
else
|
||||||
delay = round_jiffies(HZ * 15);
|
delay = round_jiffies_relative(HZ * 15);
|
||||||
queue_delayed_work(wl->hw->workqueue, &dev->periodic_work, delay);
|
queue_delayed_work(wl->hw->workqueue, &dev->periodic_work, delay);
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&wl->mutex);
|
mutex_unlock(&wl->mutex);
|
||||||
@ -3495,7 +3510,7 @@ static int b43_start(struct ieee80211_hw *hw)
|
|||||||
struct b43_wl *wl = hw_to_b43_wl(hw);
|
struct b43_wl *wl = hw_to_b43_wl(hw);
|
||||||
struct b43_wldev *dev = wl->current_dev;
|
struct b43_wldev *dev = wl->current_dev;
|
||||||
int did_init = 0;
|
int did_init = 0;
|
||||||
int err;
|
int err = 0;
|
||||||
|
|
||||||
mutex_lock(&wl->mutex);
|
mutex_lock(&wl->mutex);
|
||||||
|
|
||||||
@ -3521,7 +3536,7 @@ static int b43_start(struct ieee80211_hw *hw)
|
|||||||
return err;
|
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_wl *wl = hw_to_b43_wl(hw);
|
||||||
struct b43_wldev *dev = wl->current_dev;
|
struct b43_wldev *dev = wl->current_dev;
|
||||||
@ -4038,6 +4053,16 @@ static struct ssb_driver b43_ssb_driver = {
|
|||||||
.resume = b43_resume,
|
.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)
|
static int __init b43_init(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
@ -4046,12 +4071,19 @@ static int __init b43_init(void)
|
|||||||
err = b43_pcmcia_init();
|
err = b43_pcmcia_init();
|
||||||
if (err)
|
if (err)
|
||||||
goto err_dfs_exit;
|
goto err_dfs_exit;
|
||||||
err = ssb_driver_register(&b43_ssb_driver);
|
|
||||||
|
err = b43_pci_ssb_bridge_init();
|
||||||
if (err)
|
if (err)
|
||||||
goto err_pcmcia_exit;
|
goto err_pcmcia_exit;
|
||||||
|
|
||||||
|
err = ssb_driver_register(&b43_ssb_driver);
|
||||||
|
if (err)
|
||||||
|
goto err_pci_exit;
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
err_pci_exit:
|
||||||
|
b43_pci_ssb_bridge_exit();
|
||||||
err_pcmcia_exit:
|
err_pcmcia_exit:
|
||||||
b43_pcmcia_exit();
|
b43_pcmcia_exit();
|
||||||
err_dfs_exit:
|
err_dfs_exit:
|
||||||
@ -4062,6 +4094,7 @@ err_dfs_exit:
|
|||||||
static void __exit b43_exit(void)
|
static void __exit b43_exit(void)
|
||||||
{
|
{
|
||||||
ssb_driver_unregister(&b43_ssb_driver);
|
ssb_driver_unregister(&b43_ssb_driver);
|
||||||
|
b43_pci_ssb_bridge_exit();
|
||||||
b43_pcmcia_exit();
|
b43_pcmcia_exit();
|
||||||
b43_debugfs_exit();
|
b43_debugfs_exit();
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "pcmcia.h"
|
||||||
|
|
||||||
#include <linux/ssb/ssb.h>
|
#include <linux/ssb/ssb.h>
|
||||||
|
|
||||||
#include <pcmcia/cs_types.h>
|
#include <pcmcia/cs_types.h>
|
||||||
@ -30,6 +32,7 @@
|
|||||||
#include <pcmcia/ds.h>
|
#include <pcmcia/ds.h>
|
||||||
#include <pcmcia/cisreg.h>
|
#include <pcmcia/cisreg.h>
|
||||||
|
|
||||||
|
|
||||||
static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = {
|
static /*const */ struct pcmcia_device_id b43_pcmcia_tbl[] = {
|
||||||
PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448),
|
PCMCIA_DEVICE_MANF_CARD(0x2D0, 0x448),
|
||||||
PCMCIA_DEVICE_NULL,
|
PCMCIA_DEVICE_NULL,
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
#include <linux/io.h>
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
|
||||||
#include "b43.h"
|
#include "b43.h"
|
||||||
|
@ -60,7 +60,7 @@ static u16 tx_get_next_word(const u8 * txhdr,
|
|||||||
source = packet;
|
source = packet;
|
||||||
i -= txhdr_size;
|
i -= txhdr_size;
|
||||||
}
|
}
|
||||||
ret = le16_to_cpu(*((u16 *) (source + i)));
|
ret = le16_to_cpu(*((__le16 *)(source + i)));
|
||||||
*pos += 2;
|
*pos += 2;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -104,7 +104,7 @@ static u16 generate_cookie(struct b43_pioqueue *queue,
|
|||||||
struct b43_pio_txpacket *packet)
|
struct b43_pio_txpacket *packet)
|
||||||
{
|
{
|
||||||
u16 cookie = 0x0000;
|
u16 cookie = 0x0000;
|
||||||
int packetindex;
|
u16 packetindex;
|
||||||
|
|
||||||
/* We use the upper 4 bits for the PIO
|
/* We use the upper 4 bits for the PIO
|
||||||
* controller ID and the lower 12 bits
|
* controller ID and the lower 12 bits
|
||||||
@ -125,7 +125,7 @@ static u16 generate_cookie(struct b43_pioqueue *queue,
|
|||||||
default:
|
default:
|
||||||
B43_WARN_ON(1);
|
B43_WARN_ON(1);
|
||||||
}
|
}
|
||||||
packetindex = pio_txpacket_getindex(packet);
|
packetindex = packet->index;
|
||||||
B43_WARN_ON(packetindex & ~0x0FFF);
|
B43_WARN_ON(packetindex & ~0x0FFF);
|
||||||
cookie |= (u16) packetindex;
|
cookie |= (u16) packetindex;
|
||||||
|
|
||||||
@ -286,6 +286,7 @@ static void setup_txqueues(struct b43_pioqueue *queue)
|
|||||||
|
|
||||||
packet->queue = queue;
|
packet->queue = queue;
|
||||||
INIT_LIST_HEAD(&packet->list);
|
INIT_LIST_HEAD(&packet->list);
|
||||||
|
packet->index = i;
|
||||||
|
|
||||||
list_add(&packet->list, &queue->txfree);
|
list_add(&packet->list, &queue->txfree);
|
||||||
}
|
}
|
||||||
@ -518,9 +519,10 @@ static void pio_rx_error(struct b43_pioqueue *queue,
|
|||||||
|
|
||||||
void b43_pio_rx(struct b43_pioqueue *queue)
|
void b43_pio_rx(struct b43_pioqueue *queue)
|
||||||
{
|
{
|
||||||
u16 preamble[21] = { 0 };
|
__le16 preamble[21] = { 0 };
|
||||||
struct b43_rxhdr_fw4 *rxhdr;
|
struct b43_rxhdr_fw4 *rxhdr;
|
||||||
u16 tmp, len, macstat;
|
u16 tmp, len;
|
||||||
|
u32 macstat;
|
||||||
int i, preamble_readwords;
|
int i, preamble_readwords;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
|
|
||||||
@ -537,7 +539,7 @@ void b43_pio_rx(struct b43_pioqueue *queue)
|
|||||||
}
|
}
|
||||||
b43dbg(queue->dev->wl, "PIO RX timed out\n");
|
b43dbg(queue->dev->wl, "PIO RX timed out\n");
|
||||||
return;
|
return;
|
||||||
data_ready:
|
data_ready:
|
||||||
|
|
||||||
len = b43_pio_read(queue, B43_PIO_RXDATA);
|
len = b43_pio_read(queue, B43_PIO_RXDATA);
|
||||||
if (unlikely(len > 0x700)) {
|
if (unlikely(len > 0x700)) {
|
||||||
@ -558,7 +560,7 @@ void b43_pio_rx(struct b43_pioqueue *queue)
|
|||||||
preamble[i + 1] = cpu_to_le16(tmp);
|
preamble[i + 1] = cpu_to_le16(tmp);
|
||||||
}
|
}
|
||||||
rxhdr = (struct b43_rxhdr_fw4 *)preamble;
|
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) {
|
if (macstat & B43_RX_MAC_FCSERR) {
|
||||||
pio_rx_error(queue,
|
pio_rx_error(queue,
|
||||||
(queue->mmio_base == B43_MMIO_PIO1_BASE),
|
(queue->mmio_base == B43_MMIO_PIO1_BASE),
|
||||||
@ -583,7 +585,7 @@ void b43_pio_rx(struct b43_pioqueue *queue)
|
|||||||
skb_put(skb, len);
|
skb_put(skb, len);
|
||||||
for (i = 0; i < len - 1; i += 2) {
|
for (i = 0; i < len - 1; i += 2) {
|
||||||
tmp = b43_pio_read(queue, B43_PIO_RXDATA);
|
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) {
|
if (len % 2) {
|
||||||
tmp = b43_pio_read(queue, B43_PIO_RXDATA);
|
tmp = b43_pio_read(queue, B43_PIO_RXDATA);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "b43.h"
|
#include "b43.h"
|
||||||
|
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/io.h>
|
||||||
#include <linux/list.h>
|
#include <linux/list.h>
|
||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
|
|
||||||
@ -39,10 +40,9 @@ struct b43_pio_txpacket {
|
|||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct ieee80211_tx_status txstat;
|
struct ieee80211_tx_status txstat;
|
||||||
struct list_head list;
|
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_pioqueue {
|
||||||
struct b43_wldev *dev;
|
struct b43_wldev *dev;
|
||||||
u16 mmio_base;
|
u16 mmio_base;
|
||||||
|
@ -23,13 +23,14 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/capability.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
|
||||||
#include "b43.h"
|
#include "b43.h"
|
||||||
#include "sysfs.h"
|
#include "sysfs.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "phy.h"
|
#include "phy.h"
|
||||||
|
|
||||||
#include <linux/capability.h>
|
|
||||||
|
|
||||||
#define GENERIC_FILESIZE 64
|
#define GENERIC_FILESIZE 64
|
||||||
|
|
||||||
static int get_integer(const char *buf, size_t count)
|
static int get_integer(const char *buf, size_t count)
|
||||||
|
@ -121,10 +121,12 @@ void b43_generate_plcp_hdr(struct b43_plcp_hdr4 *plcp,
|
|||||||
__u8 *raw = plcp->raw;
|
__u8 *raw = plcp->raw;
|
||||||
|
|
||||||
if (b43_is_ofdm_rate(bitrate)) {
|
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);
|
B43_WARN_ON(octets & 0xF000);
|
||||||
*data |= (octets << 5);
|
d |= (octets << 5);
|
||||||
*data = cpu_to_le32(*data);
|
*data = cpu_to_le32(d);
|
||||||
} else {
|
} else {
|
||||||
u32 plen;
|
u32 plen;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk
|
|||||||
define KernelPackage/mac80211
|
define KernelPackage/mac80211
|
||||||
SUBMENU:=Wireless Drivers
|
SUBMENU:=Wireless Drivers
|
||||||
TITLE:=Linux 802.11 Wireless Networking Stack
|
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:= \
|
FILES:= \
|
||||||
$(PKG_BUILD_DIR)/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
|
$(PKG_BUILD_DIR)/mac80211/mac80211.$(LINUX_KMOD_SUFFIX) \
|
||||||
$(PKG_BUILD_DIR)/mac80211/rc80211_simple.$(LINUX_KMOD_SUFFIX) \
|
$(PKG_BUILD_DIR)/mac80211/rc80211_simple.$(LINUX_KMOD_SUFFIX) \
|
||||||
|
@ -0,0 +1,111 @@
|
|||||||
|
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_ */
|
17
target/linux/brcm47xx/profiles/105-Broadcom-b43.mk
Normal file
17
target/linux/brcm47xx/profiles/105-Broadcom-b43.mk
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#
|
||||||
|
# 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))
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user