recv.c (7fc00a3054b70b1794c2d64db703eb467ad0365c) recv.c (4b883f021b9ccf2df3d14425e6e610281fb6a35e)
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 458 unchanged lines hidden (view full) ---

467 ath_opmode_init(sc);
468 ath9k_hw_startpcureceive(ah, !!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL));
469
470 spin_unlock_bh(&sc->rx.rxbuflock);
471
472 return 0;
473}
474
1/*
2 * Copyright (c) 2008-2011 Atheros Communications Inc.
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 458 unchanged lines hidden (view full) ---

467 ath_opmode_init(sc);
468 ath9k_hw_startpcureceive(ah, !!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL));
469
470 spin_unlock_bh(&sc->rx.rxbuflock);
471
472 return 0;
473}
474
475static void ath_flushrecv(struct ath_softc *sc)
476{
477 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
478 ath_rx_tasklet(sc, 1, true);
479 ath_rx_tasklet(sc, 1, false);
480}
481
475bool ath_stoprecv(struct ath_softc *sc)
476{
477 struct ath_hw *ah = sc->sc_ah;
478 bool stopped, reset = false;
479
480 spin_lock_bh(&sc->rx.rxbuflock);
481 ath9k_hw_abortpcurecv(ah);
482 ath9k_hw_setrxfilter(ah, 0);
483 stopped = ath9k_hw_stopdmarecv(ah, &reset);
484
482bool ath_stoprecv(struct ath_softc *sc)
483{
484 struct ath_hw *ah = sc->sc_ah;
485 bool stopped, reset = false;
486
487 spin_lock_bh(&sc->rx.rxbuflock);
488 ath9k_hw_abortpcurecv(ah);
489 ath9k_hw_setrxfilter(ah, 0);
490 stopped = ath9k_hw_stopdmarecv(ah, &reset);
491
492 ath_flushrecv(sc);
493
485 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
486 ath_edma_stop_recv(sc);
487 else
488 sc->rx.rxlink = NULL;
489 spin_unlock_bh(&sc->rx.rxbuflock);
490
491 if (!(ah->ah_flags & AH_UNPLUGGED) &&
492 unlikely(!stopped)) {
493 ath_err(ath9k_hw_common(sc->sc_ah),
494 "Could not stop RX, we could be "
495 "confusing the DMA engine when we start RX up\n");
496 ATH_DBG_WARN_ON_ONCE(!stopped);
497 }
498 return stopped && !reset;
499}
500
494 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
495 ath_edma_stop_recv(sc);
496 else
497 sc->rx.rxlink = NULL;
498 spin_unlock_bh(&sc->rx.rxbuflock);
499
500 if (!(ah->ah_flags & AH_UNPLUGGED) &&
501 unlikely(!stopped)) {
502 ath_err(ath9k_hw_common(sc->sc_ah),
503 "Could not stop RX, we could be "
504 "confusing the DMA engine when we start RX up\n");
505 ATH_DBG_WARN_ON_ONCE(!stopped);
506 }
507 return stopped && !reset;
508}
509
501void ath_flushrecv(struct ath_softc *sc)
502{
503 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
504 ath_rx_tasklet(sc, 1, true);
505 ath_rx_tasklet(sc, 1, false);
506}
507
508static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb)
509{
510 /* Check whether the Beacon frame has DTIM indicating buffered bc/mc */
511 struct ieee80211_mgmt *mgmt;
512 u8 *pos, *end, id, elen;
513 struct ieee80211_tim_ie *tim;
514
515 mgmt = (struct ieee80211_mgmt *)skb->data;

--- 748 unchanged lines hidden ---
510static bool ath_beacon_dtim_pending_cab(struct sk_buff *skb)
511{
512 /* Check whether the Beacon frame has DTIM indicating buffered bc/mc */
513 struct ieee80211_mgmt *mgmt;
514 u8 *pos, *end, id, elen;
515 struct ieee80211_tim_ie *tim;
516
517 mgmt = (struct ieee80211_mgmt *)skb->data;

--- 748 unchanged lines hidden ---