Lines 35-40
Link Here
|
35 |
#include "main.h" |
35 |
#include "main.h" |
36 |
|
36 |
|
37 |
#define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ |
37 |
#define N_TX_QUEUES 4 /* #tx queues on mac80211<->driver interface */ |
|
|
38 |
#define BRCMS_FLUSH_TIMEOUT 100 /* msec */ |
38 |
|
39 |
|
39 |
/* Flags we support */ |
40 |
/* Flags we support */ |
40 |
#define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ |
41 |
#define MAC_FILTERS (FIF_PROMISC_IN_BSS | \ |
Lines 700-715
static void brcms_ops_rfkill_poll(struct ieee80211_hw *hw)
Link Here
|
700 |
wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); |
701 |
wiphy_rfkill_set_hw_state(wl->pub->ieee_hw->wiphy, blocked); |
701 |
} |
702 |
} |
702 |
|
703 |
|
|
|
704 |
static bool brcms_tx_flush_completed(struct brcms_info *wl) |
705 |
{ |
706 |
bool result; |
707 |
|
708 |
spin_lock_bh(&wl->lock); |
709 |
result = brcms_c_tx_flush_completed(wl->wlc); |
710 |
spin_unlock_bh(&wl->lock); |
711 |
return result; |
712 |
} |
713 |
|
703 |
static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) |
714 |
static void brcms_ops_flush(struct ieee80211_hw *hw, bool drop) |
704 |
{ |
715 |
{ |
705 |
struct brcms_info *wl = hw->priv; |
716 |
struct brcms_info *wl = hw->priv; |
|
|
717 |
int ret; |
706 |
|
718 |
|
707 |
no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); |
719 |
no_printk("%s: drop = %s\n", __func__, drop ? "true" : "false"); |
708 |
|
720 |
|
709 |
/* wait for packet queue and dma fifos to run empty */ |
721 |
ieee80211_stop_queues(hw); |
710 |
spin_lock_bh(&wl->lock); |
722 |
if (drop) { |
711 |
brcms_c_wait_for_tx_completion(wl->wlc, drop); |
723 |
spin_lock_bh(&wl->lock); |
712 |
spin_unlock_bh(&wl->lock); |
724 |
brcms_c_pktq_flush(wl->wlc); |
|
|
725 |
spin_unlock_bh(&wl->lock); |
726 |
} |
727 |
pr_info("%s queue size %d txpktpend %d\n", __func__, |
728 |
pktq_len(&wl->wlc->pkt_queue->q), |
729 |
wl->wlc->core->txpktpend[0] + wl->wlc->core->txpktpend[1] + |
730 |
wl->wlc->core->txpktpend[2] + wl->wlc->core->txpktpend[3]); |
731 |
brcms_c_send_q(wl->wlc); |
732 |
ret = wait_event_timeout(wl->tx_flush_wq, |
733 |
brcms_tx_flush_completed(wl), |
734 |
msecs_to_jiffies(BRCMS_FLUSH_TIMEOUT)); |
735 |
|
736 |
ieee80211_wake_queues(hw); |
737 |
WARN_ON(!ret); |
713 |
} |
738 |
} |
714 |
|
739 |
|
715 |
static const struct ieee80211_ops brcms_ops = { |
740 |
static const struct ieee80211_ops brcms_ops = { |
Lines 764-769
void brcms_dpc(unsigned long data)
Link Here
|
764 |
|
789 |
|
765 |
done: |
790 |
done: |
766 |
spin_unlock_bh(&wl->lock); |
791 |
spin_unlock_bh(&wl->lock); |
|
|
792 |
wake_up(&wl->tx_flush_wq); |
767 |
} |
793 |
} |
768 |
|
794 |
|
769 |
/* |
795 |
/* |
Lines 1015-1020
static struct brcms_info *brcms_attach(struct bcma_device *pdev)
Link Here
|
1015 |
|
1041 |
|
1016 |
atomic_set(&wl->callbacks, 0); |
1042 |
atomic_set(&wl->callbacks, 0); |
1017 |
|
1043 |
|
|
|
1044 |
init_waitqueue_head(&wl->tx_flush_wq); |
1045 |
|
1018 |
/* setup the bottom half handler */ |
1046 |
/* setup the bottom half handler */ |
1019 |
tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); |
1047 |
tasklet_init(&wl->tasklet, brcms_dpc, (unsigned long) wl); |
1020 |
|
1048 |
|
Lines 1601-1613
bool brcms_rfkill_set_hw_state(struct brcms_info *wl)
Link Here
|
1601 |
spin_lock_bh(&wl->lock); |
1629 |
spin_lock_bh(&wl->lock); |
1602 |
return blocked; |
1630 |
return blocked; |
1603 |
} |
1631 |
} |
1604 |
|
|
|
1605 |
/* |
1606 |
* precondition: perimeter lock has been acquired |
1607 |
*/ |
1608 |
void brcms_msleep(struct brcms_info *wl, uint ms) |
1609 |
{ |
1610 |
spin_unlock_bh(&wl->lock); |
1611 |
msleep(ms); |
1612 |
spin_lock_bh(&wl->lock); |
1613 |
} |