if_bwn.c (299780) | if_bwn.c (299782) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 Weongyo Jeong <weongyo@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/bwn/if_bwn.c 299780 2016-05-14 23:23:50Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/bwn/if_bwn.c 299782 2016-05-14 23:27:55Z adrian $"); |
32 33/* 34 * The Broadcom Wireless LAN controller driver. 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> --- 5052 unchanged lines hidden (view full) --- 5092 stat.framecnt = ((tmp & 0xf000) >> 12); 5093 stat.rtscnt = ((tmp & 0x0f00) >> 8); 5094 stat.sreason = ((tmp & 0x001c) >> 2); 5095 stat.pm = (tmp & 0x0080) ? 1 : 0; 5096 stat.im = (tmp & 0x0040) ? 1 : 0; 5097 stat.ampdu = (tmp & 0x0020) ? 1 : 0; 5098 stat.ack = (tmp & 0x0002) ? 1 : 0; 5099 | 32 33/* 34 * The Broadcom Wireless LAN controller driver. 35 */ 36 37#include <sys/param.h> 38#include <sys/systm.h> 39#include <sys/kernel.h> --- 5052 unchanged lines hidden (view full) --- 5092 stat.framecnt = ((tmp & 0xf000) >> 12); 5093 stat.rtscnt = ((tmp & 0x0f00) >> 8); 5094 stat.sreason = ((tmp & 0x001c) >> 2); 5095 stat.pm = (tmp & 0x0080) ? 1 : 0; 5096 stat.im = (tmp & 0x0040) ? 1 : 0; 5097 stat.ampdu = (tmp & 0x0020) ? 1 : 0; 5098 stat.ack = (tmp & 0x0002) ? 1 : 0; 5099 |
5100 DPRINTF(mac->mac_sc, BWN_DEBUG_XMIT, 5101 "%s: cookie=%d, seq=%d, phystat=0x%02x, framecnt=%d, " 5102 "rtscnt=%d, sreason=%d, pm=%d, im=%d, ampdu=%d, ack=%d\n", 5103 __func__, 5104 stat.cookie, 5105 stat.seq, 5106 stat.phy_stat, 5107 stat.framecnt, 5108 stat.rtscnt, 5109 stat.sreason, 5110 stat.pm, 5111 stat.im, 5112 stat.ampdu, 5113 stat.ack); 5114 |
|
5100 bwn_handle_txeof(mac, &stat); 5101 } 5102} 5103 5104static void 5105bwn_hwreset(void *arg, int npending) 5106{ 5107 struct bwn_mac *mac = arg; --- 620 unchanged lines hidden (view full) --- 5728 bus_dmamap_unload(dr->dr_txring_dtag, meta->mt_dmap); 5729 else if (meta->mt_txtype == BWN_DMADESC_METATYPE_BODY) 5730 bus_dmamap_unload(dma->txbuf_dtag, meta->mt_dmap); 5731 5732 if (meta->mt_islast) { 5733 KASSERT(meta->mt_m != NULL, 5734 ("%s:%d: fail", __func__, __LINE__)); 5735 | 5115 bwn_handle_txeof(mac, &stat); 5116 } 5117} 5118 5119static void 5120bwn_hwreset(void *arg, int npending) 5121{ 5122 struct bwn_mac *mac = arg; --- 620 unchanged lines hidden (view full) --- 5743 bus_dmamap_unload(dr->dr_txring_dtag, meta->mt_dmap); 5744 else if (meta->mt_txtype == BWN_DMADESC_METATYPE_BODY) 5745 bus_dmamap_unload(dma->txbuf_dtag, meta->mt_dmap); 5746 5747 if (meta->mt_islast) { 5748 KASSERT(meta->mt_m != NULL, 5749 ("%s:%d: fail", __func__, __LINE__)); 5750 |
5736 /* Just count full frame retries for now */ 5737 retrycnt = status->framecnt - 1; | 5751 /* 5752 * If we don't get an ACK, then we should log the 5753 * full framecnt. That may be 0 if it's a PHY 5754 * failure, so ensure that gets logged as some 5755 * retry attempt. 5756 */ 5757 if (status->ack) { 5758 retrycnt = status->framecnt - 1; 5759 } else { 5760 retrycnt = status->framecnt; 5761 if (retrycnt == 0) 5762 retrycnt = 1; 5763 } |
5738 ieee80211_ratectl_tx_complete(meta->mt_ni->ni_vap, meta->mt_ni, 5739 status->ack ? 5740 IEEE80211_RATECTL_TX_SUCCESS : 5741 IEEE80211_RATECTL_TX_FAILURE, 5742 &retrycnt, 0); 5743 ieee80211_tx_complete(meta->mt_ni, meta->mt_m, 0); 5744 meta->mt_ni = NULL; 5745 meta->mt_m = NULL; --- 33 unchanged lines hidden (view full) --- 5779 tq->tq_free++; 5780 5781 if (tp->tp_ni != NULL) { 5782 /* 5783 * Do any tx complete callback. Note this must 5784 * be done before releasing the node reference. 5785 */ 5786 | 5764 ieee80211_ratectl_tx_complete(meta->mt_ni->ni_vap, meta->mt_ni, 5765 status->ack ? 5766 IEEE80211_RATECTL_TX_SUCCESS : 5767 IEEE80211_RATECTL_TX_FAILURE, 5768 &retrycnt, 0); 5769 ieee80211_tx_complete(meta->mt_ni, meta->mt_m, 0); 5770 meta->mt_ni = NULL; 5771 meta->mt_m = NULL; --- 33 unchanged lines hidden (view full) --- 5805 tq->tq_free++; 5806 5807 if (tp->tp_ni != NULL) { 5808 /* 5809 * Do any tx complete callback. Note this must 5810 * be done before releasing the node reference. 5811 */ 5812 |
5787 /* Just count full frame retries for now */ 5788 retrycnt = status->framecnt - 1; | 5813 /* 5814 * If we don't get an ACK, then we should log the 5815 * full framecnt. That may be 0 if it's a PHY 5816 * failure, so ensure that gets logged as some 5817 * retry attempt. 5818 */ 5819 if (status->ack) { 5820 retrycnt = status->framecnt - 1; 5821 } else { 5822 retrycnt = status->framecnt; 5823 if (retrycnt == 0) 5824 retrycnt = 1; 5825 } |
5789 ieee80211_ratectl_tx_complete(tp->tp_ni->ni_vap, tp->tp_ni, 5790 status->ack ? 5791 IEEE80211_RATECTL_TX_SUCCESS : 5792 IEEE80211_RATECTL_TX_FAILURE, 5793 &retrycnt, 0); 5794 5795 if (tp->tp_m->m_flags & M_TXCB) 5796 ieee80211_process_callback(tp->tp_ni, tp->tp_m, 0); --- 1296 unchanged lines hidden --- | 5826 ieee80211_ratectl_tx_complete(tp->tp_ni->ni_vap, tp->tp_ni, 5827 status->ack ? 5828 IEEE80211_RATECTL_TX_SUCCESS : 5829 IEEE80211_RATECTL_TX_FAILURE, 5830 &retrycnt, 0); 5831 5832 if (tp->tp_m->m_flags & M_TXCB) 5833 ieee80211_process_callback(tp->tp_ni, tp->tp_m, 0); --- 1296 unchanged lines hidden --- |