Loading drivers/bcma/bcma_private.h +5 −0 Original line number Diff line number Diff line Loading @@ -94,11 +94,16 @@ void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc); #ifdef CONFIG_BCMA_DRIVER_GPIO /* driver_gpio.c */ int bcma_gpio_init(struct bcma_drv_cc *cc); int bcma_gpio_unregister(struct bcma_drv_cc *cc); #else static inline int bcma_gpio_init(struct bcma_drv_cc *cc) { return -ENOTSUPP; } static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc) { return 0; } #endif /* CONFIG_BCMA_DRIVER_GPIO */ #endif drivers/bcma/driver_gpio.c +5 −0 Original line number Diff line number Diff line Loading @@ -96,3 +96,8 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) return gpiochip_add(chip); } int bcma_gpio_unregister(struct bcma_drv_cc *cc) { return gpiochip_remove(&cc->gpio); } drivers/bcma/main.c +7 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,13 @@ int bcma_bus_register(struct bcma_bus *bus) void bcma_bus_unregister(struct bcma_bus *bus) { struct bcma_device *cores[3]; int err; err = bcma_gpio_unregister(&bus->drv_cc); if (err == -EBUSY) bcma_err(bus, "Some GPIOs are still in use.\n"); else if (err) bcma_err(bus, "Can not unregister GPIO driver: %i\n", err); cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); Loading drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +21 −14 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ #include "debug.h" #define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ #define BRCMS_FLUSH_TIMEOUT 500 /* msec */ /* Flags we support */ #define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ Loading Loading @@ -708,16 +709,29 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw) wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); } static bool brcms_tx_flush_completed(struct brcms_info *wl) { bool result; spin_lock_bh(&wl->lock); result = brcms_c_tx_flush_completed(wl->wlc); spin_unlock_bh(&wl->lock); return result; } static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) { struct brcms_info *wl = hw->priv; int ret; no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); /* wait for packet queue and dma fifos to run empty */ spin_lock_bh(&wl->lock); brcms_c_wait_for_tx_completion(wl->wlc, drop); spin_unlock_bh(&wl->lock); ret = wait_event_timeout(wl->tx_flush_wq, brcms_tx_flush_completed(wl), msecs_to_jiffies(BRCMS_FLUSH_TIMEOUT)); brcms_dbg_mac80211(wl->wlc->hw->d11core, "ret=%d\n", jiffies_to_msecs(ret)); } static const struct ieee80211_ops brcms_ops = { Loading Loading @@ -772,6 +786,7 @@ void brcms_dpc(unsigned long data) done: spin_unlock_bh(&wl->lock); wake_up(&wl->tx_flush_wq); } /* Loading Loading @@ -1020,6 +1035,8 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev) atomic_set(&wl->callbacks, 0); init_waitqueue_head(&wl->tx_flush_wq); /* setup the bottom half handler */ tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); Loading Loading @@ -1609,13 +1626,3 @@ bool brcms_rfkill_set_hw_state(struct brcms_info *wl) spin_lock_bh(&wl->lock); return blocked; } /* * precondition: perimeter lock has been acquired */ void brcms_msleep(struct brcms_info *wl, uint ms) { spin_unlock_bh(&wl->lock); msleep(ms); spin_lock_bh(&wl->lock); } drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h +2 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ struct brcms_info { spinlock_t lock; /* per-device perimeter lock */ spinlock_t isr_lock; /* per-device ISR synchronization lock */ /* tx flush */ wait_queue_head_t tx_flush_wq; /* timer related fields */ atomic_t callbacks; /* # outstanding callback functions */ Loading Loading @@ -100,7 +102,6 @@ extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl, extern void brcms_free_timer(struct brcms_timer *timer); extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); extern bool brcms_del_timer(struct brcms_timer *timer); extern void brcms_msleep(struct brcms_info *wl, uint ms); extern void brcms_dpc(unsigned long data); extern void brcms_timer(struct brcms_timer *t); extern void brcms_fatal_error(struct brcms_info *wl); Loading Loading
drivers/bcma/bcma_private.h +5 −0 Original line number Diff line number Diff line Loading @@ -94,11 +94,16 @@ void bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc); #ifdef CONFIG_BCMA_DRIVER_GPIO /* driver_gpio.c */ int bcma_gpio_init(struct bcma_drv_cc *cc); int bcma_gpio_unregister(struct bcma_drv_cc *cc); #else static inline int bcma_gpio_init(struct bcma_drv_cc *cc) { return -ENOTSUPP; } static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc) { return 0; } #endif /* CONFIG_BCMA_DRIVER_GPIO */ #endif
drivers/bcma/driver_gpio.c +5 −0 Original line number Diff line number Diff line Loading @@ -96,3 +96,8 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) return gpiochip_add(chip); } int bcma_gpio_unregister(struct bcma_drv_cc *cc) { return gpiochip_remove(&cc->gpio); }
drivers/bcma/main.c +7 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,13 @@ int bcma_bus_register(struct bcma_bus *bus) void bcma_bus_unregister(struct bcma_bus *bus) { struct bcma_device *cores[3]; int err; err = bcma_gpio_unregister(&bus->drv_cc); if (err == -EBUSY) bcma_err(bus, "Some GPIOs are still in use.\n"); else if (err) bcma_err(bus, "Can not unregister GPIO driver: %i\n", err); cores[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K); cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE); Loading
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +21 −14 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ #include "debug.h" #define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ #define BRCMS_FLUSH_TIMEOUT 500 /* msec */ /* Flags we support */ #define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ Loading Loading @@ -708,16 +709,29 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw) wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); } static bool brcms_tx_flush_completed(struct brcms_info *wl) { bool result; spin_lock_bh(&wl->lock); result = brcms_c_tx_flush_completed(wl->wlc); spin_unlock_bh(&wl->lock); return result; } static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) { struct brcms_info *wl = hw->priv; int ret; no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); /* wait for packet queue and dma fifos to run empty */ spin_lock_bh(&wl->lock); brcms_c_wait_for_tx_completion(wl->wlc, drop); spin_unlock_bh(&wl->lock); ret = wait_event_timeout(wl->tx_flush_wq, brcms_tx_flush_completed(wl), msecs_to_jiffies(BRCMS_FLUSH_TIMEOUT)); brcms_dbg_mac80211(wl->wlc->hw->d11core, "ret=%d\n", jiffies_to_msecs(ret)); } static const struct ieee80211_ops brcms_ops = { Loading Loading @@ -772,6 +786,7 @@ void brcms_dpc(unsigned long data) done: spin_unlock_bh(&wl->lock); wake_up(&wl->tx_flush_wq); } /* Loading Loading @@ -1020,6 +1035,8 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev) atomic_set(&wl->callbacks, 0); init_waitqueue_head(&wl->tx_flush_wq); /* setup the bottom half handler */ tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); Loading Loading @@ -1609,13 +1626,3 @@ bool brcms_rfkill_set_hw_state(struct brcms_info *wl) spin_lock_bh(&wl->lock); return blocked; } /* * precondition: perimeter lock has been acquired */ void brcms_msleep(struct brcms_info *wl, uint ms) { spin_unlock_bh(&wl->lock); msleep(ms); spin_lock_bh(&wl->lock); }
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h +2 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,8 @@ struct brcms_info { spinlock_t lock; /* per-device perimeter lock */ spinlock_t isr_lock; /* per-device ISR synchronization lock */ /* tx flush */ wait_queue_head_t tx_flush_wq; /* timer related fields */ atomic_t callbacks; /* # outstanding callback functions */ Loading Loading @@ -100,7 +102,6 @@ extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl, extern void brcms_free_timer(struct brcms_timer *timer); extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); extern bool brcms_del_timer(struct brcms_timer *timer); extern void brcms_msleep(struct brcms_info *wl, uint ms); extern void brcms_dpc(unsigned long data); extern void brcms_timer(struct brcms_timer *t); extern void brcms_fatal_error(struct brcms_info *wl); Loading