Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/linville/wireless

Conflicts:
	drivers/net/wireless/iwlwifi/pcie/drv.c
  • Loading branch information
John W. Linville committed Nov 4, 2013
2 parents a1b13b9 + 8ce9bea commit 01925ef
Show file tree
Hide file tree
Showing 54 changed files with 415 additions and 209 deletions.
49 changes: 26 additions & 23 deletions drivers/bcma/driver_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,25 +210,6 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc)
}
}

static void bcma_core_pci_power_save(struct bcma_drv_pci *pc, bool up)
{
u16 data;

if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
data = up ? 0x74 : 0x7C;
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64);
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
} else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) {
data = up ? 0x75 : 0x7D;
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65);
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
}
}

/**************************************************
* Init.
**************************************************/
Expand All @@ -255,6 +236,32 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc)
bcma_core_pci_clientmode_init(pc);
}

void bcma_core_pci_power_save(struct bcma_bus *bus, bool up)
{
struct bcma_drv_pci *pc;
u16 data;

if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;

pc = &bus->drv_pci[0];

if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) {
data = up ? 0x74 : 0x7C;
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64);
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
} else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) {
data = up ? 0x75 : 0x7D;
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65);
bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1,
BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data);
}
}
EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);

int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
bool enable)
{
Expand Down Expand Up @@ -310,8 +317,6 @@ void bcma_core_pci_up(struct bcma_bus *bus)

pc = &bus->drv_pci[0];

bcma_core_pci_power_save(pc, true);

bcma_core_pci_extend_L1timer(pc, true);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_up);
Expand All @@ -326,7 +331,5 @@ void bcma_core_pci_down(struct bcma_bus *bus)
pc = &bus->drv_pci[0];

bcma_core_pci_extend_L1timer(pc, false);

bcma_core_pci_power_save(pc, false);
}
EXPORT_SYMBOL_GPL(bcma_core_pci_down);
6 changes: 3 additions & 3 deletions drivers/net/wireless/ath/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,15 +1663,15 @@ ath5k_tx_frame_completed(struct ath5k_hw *ah, struct sk_buff *skb,
ah->stats.tx_bytes_count += skb->len;
info = IEEE80211_SKB_CB(skb);

size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
memcpy(info->status.rates, bf->rates, size);

tries[0] = info->status.rates[0].count;
tries[1] = info->status.rates[1].count;
tries[2] = info->status.rates[2].count;

ieee80211_tx_info_clear_status(info);

size = min_t(int, sizeof(info->status.rates), sizeof(bf->rates));
memcpy(info->status.rates, bf->rates, size);

for (i = 0; i < ts->ts_final_idx; i++) {
struct ieee80211_tx_rate *r =
&info->status.rates[i];
Expand Down
23 changes: 11 additions & 12 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
unsigned long flags;
int i;

if (ath_startrecv(sc) != 0) {
ath_err(common, "Unable to restart recv logic\n");
Expand Down Expand Up @@ -235,6 +236,15 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
}
work:
ath_restart_work(sc);

for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
if (!ATH_TXQ_SETUP(sc, i))
continue;

spin_lock_bh(&sc->tx.txq[i].axq_lock);
ath_txq_schedule(sc, &sc->tx.txq[i]);
spin_unlock_bh(&sc->tx.txq[i].axq_lock);
}
}

ieee80211_wake_queues(sc->hw);
Expand Down Expand Up @@ -619,21 +629,10 @@ irqreturn_t ath_isr(int irq, void *dev)

static int ath_reset(struct ath_softc *sc)
{
int i, r;
int r;

ath9k_ps_wakeup(sc);

r = ath_reset_internal(sc, NULL);

for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) {
if (!ATH_TXQ_SETUP(sc, i))
continue;

spin_lock_bh(&sc->tx.txq[i].axq_lock);
ath_txq_schedule(sc, &sc->tx.txq[i]);
spin_unlock_bh(&sc->tx.txq[i].axq_lock);
}

ath9k_ps_restore(sc);

return r;
Expand Down
7 changes: 0 additions & 7 deletions drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,13 +1342,6 @@ static void ath9k_antenna_check(struct ath_softc *sc,
if (!(ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB))
return;

/*
* All MPDUs in an aggregate will use the same LNA
* as the first MPDU.
*/
if (rs->rs_isaggr && !rs->rs_firstaggr)
return;

/*
* Change the default rx antenna if rx diversity
* chooses the other antenna 3 times in a row.
Expand Down
26 changes: 20 additions & 6 deletions drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf)
tbf->bf_buf_addr = bf->bf_buf_addr;
memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
tbf->bf_state = bf->bf_state;
tbf->bf_state.stale = false;

return tbf;
}
Expand Down Expand Up @@ -1390,11 +1391,15 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
u16 tid, u16 *ssn)
{
struct ath_atx_tid *txtid;
struct ath_txq *txq;
struct ath_node *an;
u8 density;

an = (struct ath_node *)sta->drv_priv;
txtid = ATH_AN_2_TID(an, tid);
txq = txtid->ac->txq;

ath_txq_lock(sc, txq);

/* update ampdu factor/density, they may have changed. This may happen
* in HT IBSS when a beacon with HT-info is received after the station
Expand All @@ -1418,6 +1423,8 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf));
txtid->baw_head = txtid->baw_tail = 0;

ath_txq_unlock_complete(sc, txq);

return 0;
}

Expand Down Expand Up @@ -1556,8 +1563,10 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw,
__skb_unlink(bf->bf_mpdu, tid_q);
list_add_tail(&bf->list, &bf_q);
ath_set_rates(tid->an->vif, tid->an->sta, bf);
ath_tx_addto_baw(sc, tid, bf);
bf->bf_state.bf_type &= ~BUF_AGGR;
if (bf_isampdu(bf)) {
ath_tx_addto_baw(sc, tid, bf);
bf->bf_state.bf_type &= ~BUF_AGGR;
}
if (bf_tail)
bf_tail->bf_next = bf;

Expand Down Expand Up @@ -1944,23 +1953,28 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
if (bf_is_ampdu_not_probing(bf))
txq->axq_ampdu_depth++;

bf = bf->bf_lastbf->bf_next;
bf_last = bf->bf_lastbf;
bf = bf_last->bf_next;
bf_last->bf_next = NULL;
}
}
}

static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
struct ath_atx_tid *tid, struct sk_buff *skb)
{
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ath_frame_info *fi = get_frame_info(skb);
struct list_head bf_head;
struct ath_buf *bf;

bf = fi->bf;
struct ath_buf *bf = fi->bf;

INIT_LIST_HEAD(&bf_head);
list_add_tail(&bf->list, &bf_head);
bf->bf_state.bf_type = 0;
if (tid && (tx_info->flags & IEEE80211_TX_CTL_AMPDU)) {
bf->bf_state.bf_type = BUF_AMPDU;
ath_tx_addto_baw(sc, tid, bf);
}

bf->bf_next = NULL;
bf->bf_lastbf = bf;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/b43/phy_n.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ static void b43_nphy_rf_ctl_override_rev7(struct b43_wldev *dev, u16 field,
}
en_addr = en_addrs[override][i];

val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;
if (e)
val_addr = (i == 0) ? e->val_addr_core0 : e->val_addr_core1;

if (off) {
b43_phy_mask(dev, en_addr, ~en_mask);
Expand Down
28 changes: 13 additions & 15 deletions drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,14 @@ static struct sdio_driver brcmf_sdmmc_driver = {

static int brcmf_sdio_pd_probe(struct platform_device *pdev)
{
int ret;

brcmf_dbg(SDIO, "Enter\n");

brcmfmac_sdio_pdata = dev_get_platdata(&pdev->dev);

if (brcmfmac_sdio_pdata->power_on)
brcmfmac_sdio_pdata->power_on();

ret = sdio_register_driver(&brcmf_sdmmc_driver);
if (ret)
brcmf_err("sdio_register_driver failed: %d\n", ret);

return ret;
return 0;
}

static int brcmf_sdio_pd_remove(struct platform_device *pdev)
Expand All @@ -512,6 +506,15 @@ static struct platform_driver brcmf_sdio_pd = {
}
};

void brcmf_sdio_register(void)
{
int ret;

ret = sdio_register_driver(&brcmf_sdmmc_driver);
if (ret)
brcmf_err("sdio_register_driver failed: %d\n", ret);
}

void brcmf_sdio_exit(void)
{
brcmf_dbg(SDIO, "Enter\n");
Expand All @@ -522,18 +525,13 @@ void brcmf_sdio_exit(void)
sdio_unregister_driver(&brcmf_sdmmc_driver);
}

void brcmf_sdio_init(void)
void __init brcmf_sdio_init(void)
{
int ret;

brcmf_dbg(SDIO, "Enter\n");

ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe);
if (ret == -ENODEV) {
brcmf_dbg(SDIO, "No platform data available, registering without.\n");
ret = sdio_register_driver(&brcmf_sdmmc_driver);
}

if (ret)
brcmf_err("driver registration failed: %d\n", ret);
if (ret == -ENODEV)
brcmf_dbg(SDIO, "No platform data available.\n");
}
3 changes: 2 additions & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,11 @@ extern int brcmf_bus_start(struct device *dev);
#ifdef CONFIG_BRCMFMAC_SDIO
extern void brcmf_sdio_exit(void);
extern void brcmf_sdio_init(void);
extern void brcmf_sdio_register(void);
#endif
#ifdef CONFIG_BRCMFMAC_USB
extern void brcmf_usb_exit(void);
extern void brcmf_usb_init(void);
extern void brcmf_usb_register(void);
#endif

#endif /* _BRCMF_BUS_H_ */
14 changes: 8 additions & 6 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1225,21 +1225,23 @@ u32 brcmf_get_chip_info(struct brcmf_if *ifp)
return bus->chip << 4 | bus->chiprev;
}

static void brcmf_driver_init(struct work_struct *work)
static void brcmf_driver_register(struct work_struct *work)
{
brcmf_debugfs_init();

#ifdef CONFIG_BRCMFMAC_SDIO
brcmf_sdio_init();
brcmf_sdio_register();
#endif
#ifdef CONFIG_BRCMFMAC_USB
brcmf_usb_init();
brcmf_usb_register();
#endif
}
static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init);
static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register);

static int __init brcmfmac_module_init(void)
{
brcmf_debugfs_init();
#ifdef CONFIG_BRCMFMAC_SDIO
brcmf_sdio_init();
#endif
if (!schedule_work(&brcmf_driver_work))
return -EBUSY;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/brcm80211/brcmfmac/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ void brcmf_usb_exit(void)
brcmf_release_fw(&fw_image_list);
}

void brcmf_usb_init(void)
void brcmf_usb_register(void)
{
brcmf_dbg(USB, "Enter\n");
INIT_LIST_HEAD(&fw_image_list);
Expand Down
4 changes: 4 additions & 0 deletions drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ static int brcms_ops_start(struct ieee80211_hw *hw)
if (err != 0)
brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n",
__func__, err);

bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, true);
return err;
}

Expand All @@ -479,6 +481,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw)
return;
}

bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, false);

/* put driver in down state */
spin_lock_bh(&wl->lock);
brcms_down(wl);
Expand Down
Loading

0 comments on commit 01925ef

Please sign in to comment.