diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2011-05-19 09:11:27 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-01 15:12:27 -0400 |
commit | 505fb019d4924e425bb1024eb603a7bc7fe7fe63 (patch) | |
tree | e729d7c6de06bece5e68585563984e24c98ee21d | |
parent | d48ae5c826f9af7d8b39867887d48e2a6f47af1f (diff) |
b43: bus: add helpers for checking host type
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/b43/bus.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/b43/main.c | 12 |
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/net/wireless/b43/bus.h b/drivers/net/wireless/b43/bus.h index fd88e2b121a0..79a5ab4270c3 100644 --- a/drivers/net/wireless/b43/bus.h +++ b/drivers/net/wireless/b43/bus.h | |||
@@ -46,6 +46,17 @@ struct b43_bus_dev { | |||
46 | u8 core_rev; | 46 | u8 core_rev; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static inline bool b43_bus_host_is_pcmcia(struct b43_bus_dev *dev) | ||
50 | { | ||
51 | return (dev->bus_type == B43_BUS_SSB && | ||
52 | dev->sdev->bus->bustype == SSB_BUSTYPE_PCMCIA); | ||
53 | } | ||
54 | static inline bool b43_bus_host_is_sdio(struct b43_bus_dev *dev) | ||
55 | { | ||
56 | return (dev->bus_type == B43_BUS_SSB && | ||
57 | dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO); | ||
58 | } | ||
59 | |||
49 | struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev); | 60 | struct b43_bus_dev *b43_bus_dev_ssb_init(struct ssb_device *sdev); |
50 | 61 | ||
51 | #endif /* B43_BUS_H_ */ | 62 | #endif /* B43_BUS_H_ */ |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 99411dadd100..659bc3169a4e 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1645,7 +1645,7 @@ static void b43_beacon_update_trigger_work(struct work_struct *work) | |||
1645 | mutex_lock(&wl->mutex); | 1645 | mutex_lock(&wl->mutex); |
1646 | dev = wl->current_dev; | 1646 | dev = wl->current_dev; |
1647 | if (likely(dev && (b43_status(dev) >= B43_STAT_INITIALIZED))) { | 1647 | if (likely(dev && (b43_status(dev) >= B43_STAT_INITIALIZED))) { |
1648 | if (dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO) { | 1648 | if (b43_bus_host_is_sdio(dev->dev)) { |
1649 | /* wl->mutex is enough. */ | 1649 | /* wl->mutex is enough. */ |
1650 | b43_do_beacon_update_trigger_work(dev); | 1650 | b43_do_beacon_update_trigger_work(dev); |
1651 | mmiowb(); | 1651 | mmiowb(); |
@@ -3955,7 +3955,7 @@ redo: | |||
3955 | 3955 | ||
3956 | /* Disable interrupts on the device. */ | 3956 | /* Disable interrupts on the device. */ |
3957 | b43_set_status(dev, B43_STAT_INITIALIZED); | 3957 | b43_set_status(dev, B43_STAT_INITIALIZED); |
3958 | if (dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO) { | 3958 | if (b43_bus_host_is_sdio(dev->dev)) { |
3959 | /* wl->mutex is locked. That is enough. */ | 3959 | /* wl->mutex is locked. That is enough. */ |
3960 | b43_write32(dev, B43_MMIO_GEN_IRQ_MASK, 0); | 3960 | b43_write32(dev, B43_MMIO_GEN_IRQ_MASK, 0); |
3961 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* Flush */ | 3961 | b43_read32(dev, B43_MMIO_GEN_IRQ_MASK); /* Flush */ |
@@ -3968,7 +3968,7 @@ redo: | |||
3968 | /* Synchronize and free the interrupt handlers. Unlock to avoid deadlocks. */ | 3968 | /* Synchronize and free the interrupt handlers. Unlock to avoid deadlocks. */ |
3969 | orig_dev = dev; | 3969 | orig_dev = dev; |
3970 | mutex_unlock(&wl->mutex); | 3970 | mutex_unlock(&wl->mutex); |
3971 | if (dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO) { | 3971 | if (b43_bus_host_is_sdio(dev->dev)) { |
3972 | b43_sdio_free_irq(dev); | 3972 | b43_sdio_free_irq(dev); |
3973 | } else { | 3973 | } else { |
3974 | synchronize_irq(dev->dev->irq); | 3974 | synchronize_irq(dev->dev->irq); |
@@ -4005,7 +4005,7 @@ static int b43_wireless_core_start(struct b43_wldev *dev) | |||
4005 | B43_WARN_ON(b43_status(dev) != B43_STAT_INITIALIZED); | 4005 | B43_WARN_ON(b43_status(dev) != B43_STAT_INITIALIZED); |
4006 | 4006 | ||
4007 | drain_txstatus_queue(dev); | 4007 | drain_txstatus_queue(dev); |
4008 | if (dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO) { | 4008 | if (b43_bus_host_is_sdio(dev->dev)) { |
4009 | err = b43_sdio_request_irq(dev, b43_sdio_interrupt_handler); | 4009 | err = b43_sdio_request_irq(dev, b43_sdio_interrupt_handler); |
4010 | if (err) { | 4010 | if (err) { |
4011 | b43err(dev->wl, "Cannot request SDIO IRQ\n"); | 4011 | b43err(dev->wl, "Cannot request SDIO IRQ\n"); |
@@ -4405,8 +4405,8 @@ static int b43_wireless_core_init(struct b43_wldev *dev) | |||
4405 | /* Maximum Contention Window */ | 4405 | /* Maximum Contention Window */ |
4406 | b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_MAXCONT, 0x3FF); | 4406 | b43_shm_write16(dev, B43_SHM_SCRATCH, B43_SHM_SC_MAXCONT, 0x3FF); |
4407 | 4407 | ||
4408 | if ((dev->sdev->bus->bustype == SSB_BUSTYPE_PCMCIA) || | 4408 | if (b43_bus_host_is_pcmcia(dev->dev) || |
4409 | (dev->sdev->bus->bustype == SSB_BUSTYPE_SDIO) || | 4409 | b43_bus_host_is_sdio(dev->dev) || |
4410 | dev->use_pio) { | 4410 | dev->use_pio) { |
4411 | dev->__using_pio_transfers = 1; | 4411 | dev->__using_pio_transfers = 1; |
4412 | err = b43_pio_init(dev); | 4412 | err = b43_pio_init(dev); |