Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 166270
b: refs/heads/master
c: 3dbba8e
h: refs/heads/master
v: v3
  • Loading branch information
Albert Herranz authored and John W. Linville committed Sep 23, 2009
1 parent 78c3801 commit 7463be6
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a78b3bb2f3ab9afcf78dbcff18fd7bf900c7c27e
refs/heads/master: 3dbba8e281552da640080f08a0f127d48456669f
21 changes: 19 additions & 2 deletions trunk/drivers/net/wireless/b43/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,28 @@ config B43_PCMCIA

If unsure, say N.

config B43_SDIO
bool "Broadcom 43xx SDIO device support (EXPERIMENTAL)"
depends on B43 && SSB_SDIOHOST_POSSIBLE && EXPERIMENTAL && BROKEN
select SSB_SDIOHOST
---help---
Broadcom 43xx device support for Soft-MAC SDIO devices.

With this config option you can drive Soft-MAC b43 cards with a
Secure Digital I/O interface.
This includes the WLAN daughter card found on the Nintendo Wii
video game console.
Note that this does not support Broadcom 43xx Full-MAC devices.

It's safe to select Y here, even if you don't have a B43 SDIO device.

If unsure, say N.

# Data transfers to the device via PIO
# This is only needed on PCMCIA devices. All others can do DMA properly.
# This is only needed on PCMCIA and SDIO devices. All others can do DMA properly.
config B43_PIO
bool
depends on B43 && (B43_PCMCIA || B43_FORCE_PIO)
depends on B43 && (B43_SDIO || B43_PCMCIA || B43_FORCE_PIO)
select SSB_BLOCKIO
default y

Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/b43/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ b43-$(CONFIG_B43_PIO) += pio.o
b43-y += rfkill.o
b43-$(CONFIG_B43_LEDS) += leds.o
b43-$(CONFIG_B43_PCMCIA) += pcmcia.o
b43-$(CONFIG_B43_SDIO) += sdio.o
b43-$(CONFIG_B43_DEBUG) += debugfs.o

obj-$(CONFIG_B43) += b43.o
76 changes: 62 additions & 14 deletions trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
Copyright (c) 2005 Danny van Dyk <kugelfang@gentoo.org>
Copyright (c) 2005 Andreas Jaggi <andreas.jaggi@waterwave.ch>
SDIO support
Copyright (c) 2009 Albert Herranz <albert_herranz@yahoo.es>
Some parts of the code in this file are derived from the ipw2200
driver Copyright(c) 2003 - 2004 Intel Corporation.
Expand Down Expand Up @@ -53,6 +56,8 @@
#include "xmit.h"
#include "lo.h"
#include "pcmcia.h"
#include "sdio.h"
#include <linux/mmc/sdio_func.h>

MODULE_DESCRIPTION("Broadcom B43 wireless driver");
MODULE_AUTHOR("Martin Langer");
Expand Down Expand Up @@ -1587,7 +1592,7 @@ static void b43_beacon_update_trigger_work(struct work_struct *work)
mutex_lock(&wl->mutex);
dev = wl->current_dev;
if (likely(dev && (b43_status(dev) >= B43_STAT_INITIALIZED))) {
if (0 /*FIXME dev->dev->bus->bustype == SSB_BUSTYPE_SDIO*/) {
if (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) {
/* wl->mutex is enough. */
b43_do_beacon_update_trigger_work(dev);
mmiowb();
Expand Down Expand Up @@ -1905,6 +1910,27 @@ static irqreturn_t b43_interrupt_handler(int irq, void *dev_id)
return ret;
}

/* SDIO interrupt handler. This runs in process context. */
static void b43_sdio_interrupt_handler(struct b43_wldev *dev)
{
struct b43_wl *wl = dev->wl;
struct sdio_func *func = dev->dev->bus->host_sdio;
irqreturn_t ret;

if (unlikely(b43_status(dev) < B43_STAT_STARTED))
return;

mutex_lock(&wl->mutex);
sdio_release_host(func);

ret = b43_do_interrupt(dev);
if (ret == IRQ_WAKE_THREAD)
b43_do_interrupt_thread(dev);

sdio_claim_host(func);
mutex_unlock(&wl->mutex);
}

void b43_do_release_fw(struct b43_firmware_file *fw)
{
release_firmware(fw->data);
Expand Down Expand Up @@ -3824,7 +3850,7 @@ static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev)

/* Disable interrupts on the device. */
b43_set_status(dev, B43_STAT_INITIALIZED);
if (0 /*FIXME dev->dev->bus->bustype == SSB_BUSTYPE_SDIO*/) {
if (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) {
/* wl->mutex is locked. That is enough. */
b43_write32(dev, B43_MMIO_GEN_IRQ_MASK, 0);
b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* Flush */
Expand Down Expand Up @@ -3854,7 +3880,10 @@ static struct b43_wldev * b43_wireless_core_stop(struct b43_wldev *dev)
dev_kfree_skb(skb_dequeue(&wl->tx_queue));

b43_mac_suspend(dev);
free_irq(dev->dev->irq, dev);
if (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO)
b43_sdio_free_irq(dev);
else
free_irq(dev->dev->irq, dev);
b43_leds_exit(dev);
b43dbg(wl, "Wireless interface stopped\n");

Expand All @@ -3869,12 +3898,20 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
B43_WARN_ON(b43_status(dev) != B43_STAT_INITIALIZED);

drain_txstatus_queue(dev);
err = request_threaded_irq(dev->dev->irq, b43_interrupt_handler,
b43_interrupt_thread_handler,
IRQF_SHARED, KBUILD_MODNAME, dev);
if (err) {
b43err(dev->wl, "Cannot request IRQ-%d\n", dev->dev->irq);
goto out;
if (dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) {
err = b43_sdio_request_irq(dev, b43_sdio_interrupt_handler);
if (err) {
b43err(dev->wl, "Cannot request SDIO IRQ\n");
goto out;
}
} else {
err = request_threaded_irq(dev->dev->irq, b43_interrupt_handler,
b43_interrupt_thread_handler,
IRQF_SHARED, KBUILD_MODNAME, dev);
if (err) {
b43err(dev->wl, "Cannot request IRQ-%d\n", dev->dev->irq);
goto out;
}
}

/* We are ready to run. */
Expand Down Expand Up @@ -4266,7 +4303,9 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
/* Maximum Contention Window */
b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_MAXCONT, 0x3FF);

if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) || B43_FORCE_PIO) {
if ((dev->dev->bus->bustype == SSB_BUSTYPE_PCMCIA) ||
(dev->dev->bus->bustype == SSB_BUSTYPE_SDIO) ||
B43_FORCE_PIO) {
dev->__using_pio_transfers = 1;
err = b43_pio_init(dev);
} else {
Expand Down Expand Up @@ -4942,7 +4981,7 @@ static struct ssb_driver b43_ssb_driver = {
static void b43_print_driverinfo(void)
{
const char *feat_pci = "", *feat_pcmcia = "", *feat_nphy = "",
*feat_leds = "";
*feat_leds = "", *feat_sdio = "";

#ifdef CONFIG_B43_PCI_AUTOSELECT
feat_pci = "P";
Expand All @@ -4955,12 +4994,15 @@ static void b43_print_driverinfo(void)
#endif
#ifdef CONFIG_B43_LEDS
feat_leds = "L";
#endif
#ifdef CONFIG_B43_SDIO
feat_sdio = "S";
#endif
printk(KERN_INFO "Broadcom 43xx driver loaded "
"[ Features: %s%s%s%s, Firmware-ID: "
"[ Features: %s%s%s%s%s, Firmware-ID: "
B43_SUPPORTED_FIRMWARE_ID " ]\n",
feat_pci, feat_pcmcia, feat_nphy,
feat_leds);
feat_leds, feat_sdio);
}

static int __init b43_init(void)
Expand All @@ -4971,13 +5013,18 @@ static int __init b43_init(void)
err = b43_pcmcia_init();
if (err)
goto err_dfs_exit;
err = ssb_driver_register(&b43_ssb_driver);
err = b43_sdio_init();
if (err)
goto err_pcmcia_exit;
err = ssb_driver_register(&b43_ssb_driver);
if (err)
goto err_sdio_exit;
b43_print_driverinfo();

return err;

err_sdio_exit:
b43_sdio_exit();
err_pcmcia_exit:
b43_pcmcia_exit();
err_dfs_exit:
Expand All @@ -4988,6 +5035,7 @@ static int __init b43_init(void)
static void __exit b43_exit(void)
{
ssb_driver_unregister(&b43_ssb_driver);
b43_sdio_exit();
b43_pcmcia_exit();
b43_debugfs_exit();
}
Expand Down
Loading

0 comments on commit 7463be6

Please sign in to comment.