Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b90af3b8 authored by John W. Linville's avatar John W. Linville
Browse files
Conflicts:
	drivers/net/wireless/iwlwifi/dvm/tx.c
parents 5171f7a0 d786f67e
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -97,11 +97,16 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
#ifdef CONFIG_BCMA_DRIVER_GPIO
#ifdef CONFIG_BCMA_DRIVER_GPIO
/* driver_gpio.c */
/* driver_gpio.c */
int bcma_gpio_init(struct bcma_drv_cc *cc);
int bcma_gpio_init(struct bcma_drv_cc *cc);
int bcma_gpio_unregister(struct bcma_drv_cc *cc);
#else
#else
static inline int bcma_gpio_init(struct bcma_drv_cc *cc)
static inline int bcma_gpio_init(struct bcma_drv_cc *cc)
{
{
	return -ENOTSUPP;
	return -ENOTSUPP;
}
}
static inline int bcma_gpio_unregister(struct bcma_drv_cc *cc)
{
	return 0;
}
#endif /* CONFIG_BCMA_DRIVER_GPIO */
#endif /* CONFIG_BCMA_DRIVER_GPIO */


#endif
#endif
+1 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@ int bcma_nflash_init(struct bcma_drv_cc *cc)
	struct bcma_bus *bus = cc->core->bus;
	struct bcma_bus *bus = cc->core->bus;


	if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 &&
	if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 &&
	    cc->core->id.rev != 0x38) {
	    cc->core->id.rev != 38) {
		bcma_err(bus, "NAND flash on unsupported board!\n");
		bcma_err(bus, "NAND flash on unsupported board!\n");
		return -ENOTSUPP;
		return -ENOTSUPP;
	}
	}
+5 −0
Original line number Original line Diff line number Diff line
@@ -107,3 +107,8 @@ int bcma_gpio_init(struct bcma_drv_cc *cc)


	return gpiochip_add(chip);
	return gpiochip_add(chip);
}
}

int bcma_gpio_unregister(struct bcma_drv_cc *cc)
{
	return gpiochip_remove(&cc->gpio);
}
+7 −0
Original line number Original line Diff line number Diff line
@@ -276,6 +276,13 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
void bcma_bus_unregister(struct bcma_bus *bus)
void bcma_bus_unregister(struct bcma_bus *bus)
{
{
	struct bcma_device *cores[3];
	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[0] = bcma_find_core(bus, BCMA_CORE_MIPS_74K);
	cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE);
	cores[1] = bcma_find_core(bus, BCMA_CORE_PCIE);
+21 −14
Original line number Original line Diff line number Diff line
@@ -36,6 +36,7 @@
#include "debug.h"
#include "debug.h"


#define N_TX_QUEUES	4 /* #tx queues on mac80211<->driver interface */
#define N_TX_QUEUES	4 /* #tx queues on mac80211<->driver interface */
#define BRCMS_FLUSH_TIMEOUT	500 /* msec */


/* Flags we support */
/* Flags we support */
#define MAC_FILTERS (FIF_PROMISC_IN_BSS | \
#define MAC_FILTERS (FIF_PROMISC_IN_BSS | \
@@ -712,16 +713,29 @@ static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
	wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked);
	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)
static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop)
{
{
	struct brcms_info *wl = hw->priv;
	struct brcms_info *wl = hw->priv;
	int ret;


	no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false");
	no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false");


	/* wait for packet queue and dma fifos to run empty */
	ret = wait_event_timeout(wl->tx_flush_wq,
	spin_lock_bh(&wl->lock);
				 brcms_tx_flush_completed(wl),
	brcms_c_wait_for_tx_completion(wl->wlc, drop);
				 msecs_to_jiffies(BRCMS_FLUSH_TIMEOUT));
	spin_unlock_bh(&wl->lock);

	brcms_dbg_mac80211(wl->wlc->hw->d11core,
			   "ret=%d\n", jiffies_to_msecs(ret));
}
}


static const struct ieee80211_ops brcms_ops = {
static const struct ieee80211_ops brcms_ops = {
@@ -776,6 +790,7 @@ void brcms_dpc(unsigned long data)


 done:
 done:
	spin_unlock_bh(&wl->lock);
	spin_unlock_bh(&wl->lock);
	wake_up(&wl->tx_flush_wq);
}
}


/*
/*
@@ -1024,6 +1039,8 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev)


	atomic_set(&wl->callbacks, 0);
	atomic_set(&wl->callbacks, 0);


	init_waitqueue_head(&wl->tx_flush_wq);

	/* setup the bottom half handler */
	/* setup the bottom half handler */
	tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl);
	tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl);


@@ -1613,13 +1630,3 @@ bool brcms_rfkill_set_hw_state(struct brcms_info *wl)
	spin_lock_bh(&wl->lock);
	spin_lock_bh(&wl->lock);
	return blocked;
	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);
}
Loading