aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmsmac/main.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-02-14 14:23:33 -0500
committerJohn W. Linville <linville@tuxdriver.com>2013-02-14 14:23:33 -0500
commitb90af3b8c69730fb25646c04866dfccec2f1314b (patch)
treefb4a7dd23f5d8b7803d89f1e3fb1ab075f1c06a0 /drivers/net/wireless/brcm80211/brcmsmac/main.c
parent5171f7a0b79dfbc61a6e12f20f6eef6d7dd5b2a8 (diff)
parentd786f67e5c587a4de8245336cb64cf4dd06871a7 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts: drivers/net/wireless/iwlwifi/dvm/tx.c
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac/main.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 0985925cd3f4..e80825e39c6e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -1025,7 +1025,6 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
1025static bool 1025static bool
1026brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) 1026brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
1027{ 1027{
1028 bool morepending = false;
1029 struct bcma_device *core; 1028 struct bcma_device *core;
1030 struct tx_status txstatus, *txs; 1029 struct tx_status txstatus, *txs;
1031 u32 s1, s2; 1030 u32 s1, s2;
@@ -1039,23 +1038,20 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
1039 txs = &txstatus; 1038 txs = &txstatus;
1040 core = wlc_hw->d11core; 1039 core = wlc_hw->d11core;
1041 *fatal = false; 1040 *fatal = false;
1042 s1 = bcma_read32(core, D11REGOFFS(frmtxstatus));
1043 while (!(*fatal)
1044 && (s1 & TXS_V)) {
1045 /* !give others some time to run! */
1046 if (n >= max_tx_num) {
1047 morepending = true;
1048 break;
1049 }
1050 1041
1042 while (n < max_tx_num) {
1043 s1 = bcma_read32(core, D11REGOFFS(frmtxstatus));
1051 if (s1 == 0xffffffff) { 1044 if (s1 == 0xffffffff) {
1052 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit, 1045 brcms_err(core, "wl%d: %s: dead chip\n", wlc_hw->unit,
1053 __func__); 1046 __func__);
1054 *fatal = true; 1047 *fatal = true;
1055 return false; 1048 return false;
1056 } 1049 }
1057 s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2)); 1050 /* only process when valid */
1051 if (!(s1 & TXS_V))
1052 break;
1058 1053
1054 s2 = bcma_read32(core, D11REGOFFS(frmtxstatus2));
1059 txs->status = s1 & TXS_STATUS_MASK; 1055 txs->status = s1 & TXS_STATUS_MASK;
1060 txs->frameid = (s1 & TXS_FID_MASK) >> TXS_FID_SHIFT; 1056 txs->frameid = (s1 & TXS_FID_MASK) >> TXS_FID_SHIFT;
1061 txs->sequence = s2 & TXS_SEQ_MASK; 1057 txs->sequence = s2 & TXS_SEQ_MASK;
@@ -1063,15 +1059,12 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal)
1063 txs->lasttxtime = 0; 1059 txs->lasttxtime = 0;
1064 1060
1065 *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs); 1061 *fatal = brcms_c_dotxstatus(wlc_hw->wlc, txs);
1066 1062 if (*fatal == true)
1067 s1 = bcma_read32(core, D11REGOFFS(frmtxstatus)); 1063 return false;
1068 n++; 1064 n++;
1069 } 1065 }
1070 1066
1071 if (*fatal) 1067 return n >= max_tx_num;
1072 return false;
1073
1074 return morepending;
1075} 1068}
1076 1069
1077static void brcms_c_tbtt(struct brcms_c_info *wlc) 1070static void brcms_c_tbtt(struct brcms_c_info *wlc)
@@ -7520,25 +7513,16 @@ int brcms_c_get_curband(struct brcms_c_info *wlc)
7520 return wlc->band->bandunit; 7513 return wlc->band->bandunit;
7521} 7514}
7522 7515
7523void brcms_c_wait_for_tx_completion(struct brcms_c_info *wlc, bool drop) 7516bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc)
7524{ 7517{
7525 int timeout = 20;
7526 int i; 7518 int i;
7527 7519
7528 /* Kick DMA to send any pending AMPDU */ 7520 /* Kick DMA to send any pending AMPDU */
7529 for (i = 0; i < ARRAY_SIZE(wlc->hw->di); i++) 7521 for (i = 0; i < ARRAY_SIZE(wlc->hw->di); i++)
7530 if (wlc->hw->di[i]) 7522 if (wlc->hw->di[i])
7531 dma_txflush(wlc->hw->di[i]); 7523 dma_kick_tx(wlc->hw->di[i]);
7532
7533 /* wait for queue and DMA fifos to run dry */
7534 while (brcms_txpktpendtot(wlc) > 0) {
7535 brcms_msleep(wlc->wl, 1);
7536
7537 if (--timeout == 0)
7538 break;
7539 }
7540 7524
7541 WARN_ON_ONCE(timeout == 0); 7525 return !brcms_txpktpendtot(wlc);
7542} 7526}
7543 7527
7544void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval) 7528void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval)