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 into for-davem
  • Loading branch information
John W. Linville committed Feb 27, 2014
2 parents 724b9e1 + b7b146c commit 8e2a89c
Show file tree
Hide file tree
Showing 21 changed files with 178 additions and 140 deletions.
4 changes: 2 additions & 2 deletions drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
{0x00009e14, 0x37b95d5e, 0x37b9605e, 0x3236605e, 0x32365a5e},
{0x00009e18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x00009e1c, 0x0001cf9c, 0x0001cf9c, 0x00021f9c, 0x00021f9c},
{0x00009e20, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce},
{0x00009e20, 0x000003a5, 0x000003a5, 0x000003a5, 0x000003a5},
{0x00009e2c, 0x0000001c, 0x0000001c, 0x00000021, 0x00000021},
{0x00009e3c, 0xcf946220, 0xcf946220, 0xcfd5c782, 0xcfd5c282},
{0x00009e44, 0x62321e27, 0x62321e27, 0xfe291e27, 0xfe291e27},
Expand Down Expand Up @@ -96,7 +96,7 @@ static const u32 ar9462_2p0_baseband_postamble[][5] = {
{0x0000ae04, 0x001c0000, 0x001c0000, 0x001c0000, 0x00100000},
{0x0000ae18, 0x00000000, 0x00000000, 0x00000000, 0x00000000},
{0x0000ae1c, 0x0000019c, 0x0000019c, 0x0000019c, 0x0000019c},
{0x0000ae20, 0x000001b5, 0x000001b5, 0x000001ce, 0x000001ce},
{0x0000ae20, 0x000001a6, 0x000001a6, 0x000001aa, 0x000001aa},
{0x0000b284, 0x00000000, 0x00000000, 0x00000550, 0x00000550},
};

Expand Down
8 changes: 7 additions & 1 deletion drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1534,17 +1534,21 @@ EXPORT_SYMBOL(ath9k_hw_check_nav);
bool ath9k_hw_check_alive(struct ath_hw *ah)
{
int count = 50;
u32 reg;
u32 reg, last_val;

if (AR_SREV_9300(ah))
return !ath9k_hw_detect_mac_hang(ah);

if (AR_SREV_9285_12_OR_LATER(ah))
return true;

last_val = REG_READ(ah, AR_OBS_BUS_1);
do {
reg = REG_READ(ah, AR_OBS_BUS_1);
if (reg != last_val)
return true;

last_val = reg;
if ((reg & 0x7E7FFFEF) == 0x00702400)
continue;

Expand All @@ -1556,6 +1560,8 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)
default:
return true;
}

udelay(1);
} while (count-- > 0);

return false;
Expand Down
70 changes: 35 additions & 35 deletions drivers/net/wireless/ath/ath9k/recv.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,11 +732,18 @@ static struct ath_rxbuf *ath_get_next_rx_buf(struct ath_softc *sc,
return NULL;

/*
* mark descriptor as zero-length and set the 'more'
* flag to ensure that both buffers get discarded
* Re-check previous descriptor, in case it has been filled
* in the mean time.
*/
rs->rs_datalen = 0;
rs->rs_more = true;
ret = ath9k_hw_rxprocdesc(ah, ds, rs);
if (ret == -EINPROGRESS) {
/*
* mark descriptor as zero-length and set the 'more'
* flag to ensure that both buffers get discarded
*/
rs->rs_datalen = 0;
rs->rs_more = true;
}
}

list_del(&bf->list);
Expand Down Expand Up @@ -985,32 +992,32 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
struct ath_common *common = ath9k_hw_common(ah);
struct ieee80211_hdr *hdr;
bool discard_current = sc->rx.discard_next;
int ret = 0;

/*
* Discard corrupt descriptors which are marked in
* ath_get_next_rx_buf().
*/
sc->rx.discard_next = rx_stats->rs_more;
if (discard_current)
return -EINVAL;
goto corrupt;

sc->rx.discard_next = false;

/*
* Discard zero-length packets.
*/
if (!rx_stats->rs_datalen) {
RX_STAT_INC(rx_len_err);
return -EINVAL;
goto corrupt;
}

/*
* rs_status follows rs_datalen so if rs_datalen is too large
* we can take a hint that hardware corrupted it, so ignore
* those frames.
*/
/*
* rs_status follows rs_datalen so if rs_datalen is too large
* we can take a hint that hardware corrupted it, so ignore
* those frames.
*/
if (rx_stats->rs_datalen > (common->rx_bufsize - ah->caps.rx_status_len)) {
RX_STAT_INC(rx_len_err);
return -EINVAL;
goto corrupt;
}

/* Only use status info from the last fragment */
Expand All @@ -1024,10 +1031,8 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
* This is different from the other corrupt descriptor
* condition handled above.
*/
if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC) {
ret = -EINVAL;
goto exit;
}
if (rx_stats->rs_status & ATH9K_RXERR_CORRUPT_DESC)
goto corrupt;

hdr = (struct ieee80211_hdr *) (skb->data + ah->caps.rx_status_len);

Expand All @@ -1043,18 +1048,15 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
if (ath_process_fft(sc, hdr, rx_stats, rx_status->mactime))
RX_STAT_INC(rx_spectral);

ret = -EINVAL;
goto exit;
return -EINVAL;
}

/*
* everything but the rate is checked here, the rate check is done
* separately to avoid doing two lookups for a rate for each frame.
*/
if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error)) {
ret = -EINVAL;
goto exit;
}
if (!ath9k_rx_accept(common, hdr, rx_status, rx_stats, decrypt_error))
return -EINVAL;

if (ath_is_mybeacon(common, hdr)) {
RX_STAT_INC(rx_beacons);
Expand All @@ -1064,15 +1066,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
/*
* This shouldn't happen, but have a safety check anyway.
*/
if (WARN_ON(!ah->curchan)) {
ret = -EINVAL;
goto exit;
}
if (WARN_ON(!ah->curchan))
return -EINVAL;

if (ath9k_process_rate(common, hw, rx_stats, rx_status)) {
ret =-EINVAL;
goto exit;
}
if (ath9k_process_rate(common, hw, rx_stats, rx_status))
return -EINVAL;

ath9k_process_rssi(common, hw, rx_stats, rx_status);

Expand All @@ -1087,9 +1085,11 @@ static int ath9k_rx_skb_preprocess(struct ath_softc *sc,
sc->rx.num_pkts++;
#endif

exit:
sc->rx.discard_next = false;
return ret;
return 0;

corrupt:
sc->rx.discard_next = rx_stats->rs_more;
return -EINVAL;
}

static void ath9k_rx_skb_postprocess(struct ath_common *common,
Expand Down
13 changes: 8 additions & 5 deletions drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1444,14 +1444,16 @@ void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
for (tidno = 0, tid = &an->tid[tidno];
tidno < IEEE80211_NUM_TIDS; tidno++, tid++) {

if (!tid->sched)
continue;

ac = tid->ac;
txq = ac->txq;

ath_txq_lock(sc, txq);

if (!tid->sched) {
ath_txq_unlock(sc, txq);
continue;
}

buffered = ath_tid_has_buffered(tid);

tid->sched = false;
Expand Down Expand Up @@ -2184,14 +2186,15 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
txq->stopped = true;
}

if (txctl->an)
tid = ath_get_skb_tid(sc, txctl->an, skb);

if (info->flags & IEEE80211_TX_CTL_PS_RESPONSE) {
ath_txq_unlock(sc, txq);
txq = sc->tx.uapsdq;
ath_txq_lock(sc, txq);
} else if (txctl->an &&
ieee80211_is_data_present(hdr->frame_control)) {
tid = ath_get_skb_tid(sc, txctl->an, skb);

WARN_ON(tid->ac->txq != txctl->txq);

if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
Expand Down
14 changes: 4 additions & 10 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ struct brcmf_sdio {

u8 tx_hdrlen; /* sdio bus header length for tx packet */
bool txglom; /* host tx glomming enable flag */
struct sk_buff *txglom_sgpad; /* scatter-gather padding buffer */
u16 head_align; /* buffer pointer alignment */
u16 sgentry_align; /* scatter-gather buffer alignment */
};
Expand Down Expand Up @@ -1944,9 +1943,8 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
if (lastfrm && chain_pad)
tail_pad += blksize - chain_pad;
if (skb_tailroom(pkt) < tail_pad && pkt->len > blksize) {
pkt_pad = bus->txglom_sgpad;
if (pkt_pad == NULL)
brcmu_pkt_buf_get_skb(tail_pad + tail_chop);
pkt_pad = brcmu_pkt_buf_get_skb(tail_pad + tail_chop +
bus->head_align);
if (pkt_pad == NULL)
return -ENOMEM;
ret = brcmf_sdio_txpkt_hdalign(bus, pkt_pad);
Expand All @@ -1957,6 +1955,7 @@ static int brcmf_sdio_txpkt_prep_sg(struct brcmf_sdio *bus,
tail_chop);
*(u32 *)(pkt_pad->cb) = ALIGN_SKB_FLAG + tail_chop;
skb_trim(pkt, pkt->len - tail_chop);
skb_trim(pkt_pad, tail_pad + tail_chop);
__skb_queue_after(pktq, pkt, pkt_pad);
} else {
ntail = pkt->data_len + tail_pad -
Expand Down Expand Up @@ -2011,7 +2010,7 @@ brcmf_sdio_txpkt_prep(struct brcmf_sdio *bus, struct sk_buff_head *pktq,
return ret;
head_pad = (u16)ret;
if (head_pad)
memset(pkt_next->data, 0, head_pad + bus->tx_hdrlen);
memset(pkt_next->data + bus->tx_hdrlen, 0, head_pad);

total_len += pkt_next->len;

Expand Down Expand Up @@ -3486,10 +3485,6 @@ static int brcmf_sdio_bus_preinit(struct device *dev)
bus->txglom = false;
value = 1;
pad_size = bus->sdiodev->func[2]->cur_blksize << 1;
bus->txglom_sgpad = brcmu_pkt_buf_get_skb(pad_size);
if (!bus->txglom_sgpad)
brcmf_err("allocating txglom padding skb failed, reduced performance\n");

err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom",
&value, sizeof(u32));
if (err < 0) {
Expand Down Expand Up @@ -4053,7 +4048,6 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
brcmf_sdio_chip_detach(&bus->ci);
}

brcmu_pkt_buf_free_skb(bus->txglom_sgpad);
kfree(bus->rxbuf);
kfree(bus->hdrbuf);
kfree(bus);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/hostap/hostap_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void ap_free_sta(struct ap_data *ap, struct sta_info *sta)

if (!sta->ap && sta->u.sta.challenge)
kfree(sta->u.sta.challenge);
del_timer(&sta->timer);
del_timer_sync(&sta->timer);
#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */

kfree(sta);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/iwlwifi/dvm/sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ void iwl_deactivate_station(struct iwl_priv *priv, const u8 sta_id,
sizeof(priv->tid_data[sta_id][tid]));

priv->stations[sta_id].used &= ~IWL_STA_DRIVER_ACTIVE;
priv->stations[sta_id].used &= ~IWL_STA_UCODE_INPROGRESS;

priv->num_stations--;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/libertas/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
id = *pos++;
elen = *pos++;
left -= 2;
if (elen > left || elen == 0) {
if (elen > left) {
lbs_deb_scan("scan response: invalid IE fmt\n");
goto done;
}
Expand Down
34 changes: 17 additions & 17 deletions drivers/net/wireless/mwifiex/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,12 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter)
rd_index = card->rxbd_rdptr & reg->rx_mask;
skb_data = card->rx_buf_list[rd_index];

/* If skb allocation was failed earlier for Rx packet,
* rx_buf_list[rd_index] would have been left with a NULL.
*/
if (!skb_data)
return -ENOMEM;

MWIFIEX_SKB_PACB(skb_data, &buf_pa);
pci_unmap_single(card->dev, buf_pa, MWIFIEX_RX_DATA_BUF_SIZE,
PCI_DMA_FROMDEVICE);
Expand Down Expand Up @@ -1525,6 +1531,14 @@ static int mwifiex_pcie_process_cmd_complete(struct mwifiex_adapter *adapter)
if (adapter->ps_state == PS_STATE_SLEEP_CFM) {
mwifiex_process_sleep_confirm_resp(adapter, skb->data,
skb->len);
mwifiex_pcie_enable_host_int(adapter);
if (mwifiex_write_reg(adapter,
PCIE_CPU_INT_EVENT,
CPU_INTR_SLEEP_CFM_DONE)) {
dev_warn(adapter->dev,
"Write register failed\n");
return -1;
}
while (reg->sleep_cookie && (count++ < 10) &&
mwifiex_pcie_ok_to_access_hw(adapter))
usleep_range(50, 60);
Expand Down Expand Up @@ -1993,23 +2007,9 @@ static void mwifiex_interrupt_status(struct mwifiex_adapter *adapter)
adapter->int_status |= pcie_ireg;
spin_unlock_irqrestore(&adapter->int_lock, flags);

if (pcie_ireg & HOST_INTR_CMD_DONE) {
if ((adapter->ps_state == PS_STATE_SLEEP_CFM) ||
(adapter->ps_state == PS_STATE_SLEEP)) {
mwifiex_pcie_enable_host_int(adapter);
if (mwifiex_write_reg(adapter,
PCIE_CPU_INT_EVENT,
CPU_INTR_SLEEP_CFM_DONE)
) {
dev_warn(adapter->dev,
"Write register failed\n");
return;

}
}
} else if (!adapter->pps_uapsd_mode &&
adapter->ps_state == PS_STATE_SLEEP &&
mwifiex_pcie_ok_to_access_hw(adapter)) {
if (!adapter->pps_uapsd_mode &&
adapter->ps_state == PS_STATE_SLEEP &&
mwifiex_pcie_ok_to_access_hw(adapter)) {
/* Potentially for PCIe we could get other
* interrupts like shared. Don't change power
* state until cookie is set */
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/wireless/mwifiex/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

#define USB_VERSION "1.0"

static const char usbdriver_name[] = "usb8xxx";

static struct mwifiex_if_ops usb_ops;
static struct semaphore add_remove_card_sem;
static struct usb_card_rec *usb_card;
Expand Down Expand Up @@ -567,7 +565,7 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf)
}

static struct usb_driver mwifiex_usb_driver = {
.name = usbdriver_name,
.name = "mwifiex_usb",
.probe = mwifiex_usb_probe,
.disconnect = mwifiex_usb_disconnect,
.id_table = mwifiex_usb_table,
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/mwifiex/wmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,8 @@ mwifiex_clean_txrx(struct mwifiex_private *priv)
mwifiex_wmm_delete_all_ralist(priv);
memcpy(tos_to_tid, ac_to_tid, sizeof(tos_to_tid));

if (priv->adapter->if_ops.clean_pcie_ring)
if (priv->adapter->if_ops.clean_pcie_ring &&
!priv->adapter->surprise_removed)
priv->adapter->if_ops.clean_pcie_ring(priv->adapter);
spin_unlock_irqrestore(&priv->wmm.ra_list_spinlock, flags);
}
Expand Down
Loading

0 comments on commit 8e2a89c

Please sign in to comment.