if_ath.c (119147) | if_ath.c (119150) |
---|---|
1/*- 2 * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting 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 --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGES. 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting 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 --- 21 unchanged lines hidden (view full) --- 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 32 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 * THE POSSIBILITY OF SUCH DAMAGES. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 119147 2003-08-19 21:35:08Z sam $"); | 38__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath.c 119150 2003-08-19 22:17:04Z sam $"); |
39 40/* 41 * Driver for the Atheros Wireless LAN controller. 42 * 43 * This software is derived from work of Atsushi Onoe; his contribution 44 * is greatly appreciated. 45 */ 46 --- 639 unchanged lines hidden (view full) --- 686 mtx_unlock(&sc->sc_txbuflock); 687 break; 688 } 689 ifp->if_opackets++; 690 BPF_MTAP(ifp, m); 691 /* 692 * Encapsulate the packet in prep for transmission. 693 */ | 39 40/* 41 * Driver for the Atheros Wireless LAN controller. 42 * 43 * This software is derived from work of Atsushi Onoe; his contribution 44 * is greatly appreciated. 45 */ 46 --- 639 unchanged lines hidden (view full) --- 686 mtx_unlock(&sc->sc_txbuflock); 687 break; 688 } 689 ifp->if_opackets++; 690 BPF_MTAP(ifp, m); 691 /* 692 * Encapsulate the packet in prep for transmission. 693 */ |
694 m = ieee80211_encap(ifp, m); | 694 m = ieee80211_encap(ifp, m, &ni); |
695 if (m == NULL) { 696 DPRINTF(("ath_start: encapsulation failure\n")); 697 sc->sc_stats.ast_tx_encap++; 698 goto bad; 699 } 700 wh = mtod(m, struct ieee80211_frame *); 701 if (ic->ic_flags & IEEE80211_F_WEPON) 702 wh->i_fc[1] |= IEEE80211_FC1_WEP; 703 } else { | 695 if (m == NULL) { 696 DPRINTF(("ath_start: encapsulation failure\n")); 697 sc->sc_stats.ast_tx_encap++; 698 goto bad; 699 } 700 wh = mtod(m, struct ieee80211_frame *); 701 if (ic->ic_flags & IEEE80211_F_WEPON) 702 wh->i_fc[1] |= IEEE80211_FC1_WEP; 703 } else { |
704 /* 705 * Hack! The referenced node pointer is in the 706 * rcvif field of the packet header. This is 707 * placed there by ieee80211_mgmt_output because 708 * we need to hold the reference with the frame 709 * and there's no other way (other than packet 710 * tags which we consider too expensive to use) 711 * to pass it along. 712 */ 713 ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; 714 m->m_pkthdr.rcvif = NULL; 715 |
|
704 wh = mtod(m, struct ieee80211_frame *); 705 if ((wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == 706 IEEE80211_FC0_SUBTYPE_PROBE_RESP) { 707 /* fill time stamp */ 708 u_int64_t tsf; 709 u_int32_t *tstamp; 710 711 tsf = ath_hal_gettsf64(ah); 712 /* XXX: adjust 100us delay to xmit */ 713 tsf += 100; 714 tstamp = (u_int32_t *)&wh[1]; 715 tstamp[0] = htole32(tsf & 0xffffffff); 716 tstamp[1] = htole32(tsf >> 32); 717 } 718 sc->sc_stats.ast_tx_mgmt++; 719 } 720 if (ic->ic_rawbpf) 721 bpf_mtap(ic->ic_rawbpf, m); 722 | 716 wh = mtod(m, struct ieee80211_frame *); 717 if ((wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) == 718 IEEE80211_FC0_SUBTYPE_PROBE_RESP) { 719 /* fill time stamp */ 720 u_int64_t tsf; 721 u_int32_t *tstamp; 722 723 tsf = ath_hal_gettsf64(ah); 724 /* XXX: adjust 100us delay to xmit */ 725 tsf += 100; 726 tstamp = (u_int32_t *)&wh[1]; 727 tstamp[0] = htole32(tsf & 0xffffffff); 728 tstamp[1] = htole32(tsf >> 32); 729 } 730 sc->sc_stats.ast_tx_mgmt++; 731 } 732 if (ic->ic_rawbpf) 733 bpf_mtap(ic->ic_rawbpf, m); 734 |
723 if (ic->ic_opmode != IEEE80211_M_STA) { 724 ni = ieee80211_find_node(ic, wh->i_addr1); 725 if (ni == NULL) { 726 /* 727 * When not in station mode the destination 728 * address should always be in the node table 729 * unless this is a multicast/broadcast frame. 730 */ 731 if (!IEEE80211_IS_MULTICAST(wh->i_addr1) && 732 (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == 733 IEEE80211_FC0_TYPE_DATA) { 734 m_freem(m); 735 sc->sc_stats.ast_tx_nonode++; 736 goto bad; 737 } 738 ni = ic->ic_bss; 739 } 740 } else 741 ni = ic->ic_bss; 742 | |
743 /* 744 * TODO: 745 * The duration field of 802.11 header should be filled. 746 * XXX This may be done in the ieee80211 layer, but the upper 747 * doesn't know the detail of parameters such as IFS 748 * for now.. 749 */ 750 751 if (IFF_DUMPPKTS(ifp)) 752 ieee80211_dump_pkt(mtod(m, u_int8_t *), m->m_len, 753 ni->ni_rates.rs_rates[ni->ni_txrate] & IEEE80211_RATE_VAL, 754 -1); 755 756 if (ath_tx_start(sc, ni, bf, m)) { 757 bad: 758 mtx_lock(&sc->sc_txbuflock); 759 TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); 760 mtx_unlock(&sc->sc_txbuflock); 761 ifp->if_oerrors++; | 735 /* 736 * TODO: 737 * The duration field of 802.11 header should be filled. 738 * XXX This may be done in the ieee80211 layer, but the upper 739 * doesn't know the detail of parameters such as IFS 740 * for now.. 741 */ 742 743 if (IFF_DUMPPKTS(ifp)) 744 ieee80211_dump_pkt(mtod(m, u_int8_t *), m->m_len, 745 ni->ni_rates.rs_rates[ni->ni_txrate] & IEEE80211_RATE_VAL, 746 -1); 747 748 if (ath_tx_start(sc, ni, bf, m)) { 749 bad: 750 mtx_lock(&sc->sc_txbuflock); 751 TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); 752 mtx_unlock(&sc->sc_txbuflock); 753 ifp->if_oerrors++; |
754 if (ni && ni != ic->ic_bss) 755 ieee80211_free_node(ic, ni); |
|
762 continue; 763 } 764 765 sc->sc_tx_timer = 5; 766 ifp->if_timer = 1; 767 } 768} 769 --- 337 unchanged lines hidden (view full) --- 1107ath_beacon_proc(void *arg, int pending) 1108{ 1109 struct ath_softc *sc = arg; 1110 struct ieee80211com *ic = &sc->sc_ic; 1111 struct ath_buf *bf = sc->sc_bcbuf; 1112 struct ath_hal *ah = sc->sc_ah; 1113 1114 DPRINTF2(("%s: pending %u\n", __func__, pending)); | 756 continue; 757 } 758 759 sc->sc_tx_timer = 5; 760 ifp->if_timer = 1; 761 } 762} 763 --- 337 unchanged lines hidden (view full) --- 1101ath_beacon_proc(void *arg, int pending) 1102{ 1103 struct ath_softc *sc = arg; 1104 struct ieee80211com *ic = &sc->sc_ic; 1105 struct ath_buf *bf = sc->sc_bcbuf; 1106 struct ath_hal *ah = sc->sc_ah; 1107 1108 DPRINTF2(("%s: pending %u\n", __func__, pending)); |
1115 if (ic->ic_opmode == IEEE80211_M_STA || bf == NULL || bf->bf_m == NULL) { | 1109 if (ic->ic_opmode == IEEE80211_M_STA || 1110 bf == NULL || bf->bf_m == NULL) { |
1116 DPRINTF(("%s: ic_flags=%x bf=%p bf_m=%p\n", 1117 __func__, ic->ic_flags, bf, bf ? bf->bf_m : NULL)); 1118 return; 1119 } | 1111 DPRINTF(("%s: ic_flags=%x bf=%p bf_m=%p\n", 1112 __func__, ic->ic_flags, bf, bf ? bf->bf_m : NULL)); 1113 return; 1114 } |
1120 /* update beacon to reflect PS poll state */ | 1115 /* TODO: update beacon to reflect PS poll state */ |
1121 if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { 1122 DPRINTF(("%s: beacon queue %u did not stop?", 1123 __func__, sc->sc_bhalq)); 1124 return; /* busy, XXX is this right? */ 1125 } 1126 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); 1127 1128 ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); --- 237 unchanged lines hidden (view full) --- 1366 sc->sc_bufptr = NULL; 1367} 1368 1369static struct ieee80211_node * 1370ath_node_alloc(struct ieee80211com *ic) 1371{ 1372 struct ath_node *an = 1373 malloc(sizeof(struct ath_node), M_DEVBUF, M_NOWAIT | M_ZERO); | 1116 if (!ath_hal_stoptxdma(ah, sc->sc_bhalq)) { 1117 DPRINTF(("%s: beacon queue %u did not stop?", 1118 __func__, sc->sc_bhalq)); 1119 return; /* busy, XXX is this right? */ 1120 } 1121 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); 1122 1123 ath_hal_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); --- 237 unchanged lines hidden (view full) --- 1361 sc->sc_bufptr = NULL; 1362} 1363 1364static struct ieee80211_node * 1365ath_node_alloc(struct ieee80211com *ic) 1366{ 1367 struct ath_node *an = 1368 malloc(sizeof(struct ath_node), M_DEVBUF, M_NOWAIT | M_ZERO); |
1374 return an ? &an->st_node : NULL; | 1369 return an ? &an->an_node : NULL; |
1375} 1376 1377static void 1378ath_node_free(struct ieee80211com *ic, struct ieee80211_node *ni) 1379{ 1380 struct ath_softc *sc = ic->ic_if.if_softc; 1381 struct ath_buf *bf; 1382 --- 73 unchanged lines hidden (view full) --- 1456 struct ath_softc *sc = arg; 1457 struct ath_buf *bf; 1458 struct ieee80211com *ic = &sc->sc_ic; 1459 struct ifnet *ifp = &ic->ic_if; 1460 struct ath_hal *ah = sc->sc_ah; 1461 struct ath_desc *ds; 1462 struct mbuf *m; 1463 struct ieee80211_frame *wh, whbuf; | 1370} 1371 1372static void 1373ath_node_free(struct ieee80211com *ic, struct ieee80211_node *ni) 1374{ 1375 struct ath_softc *sc = ic->ic_if.if_softc; 1376 struct ath_buf *bf; 1377 --- 73 unchanged lines hidden (view full) --- 1451 struct ath_softc *sc = arg; 1452 struct ath_buf *bf; 1453 struct ieee80211com *ic = &sc->sc_ic; 1454 struct ifnet *ifp = &ic->ic_if; 1455 struct ath_hal *ah = sc->sc_ah; 1456 struct ath_desc *ds; 1457 struct mbuf *m; 1458 struct ieee80211_frame *wh, whbuf; |
1459 struct ieee80211_node *ni; |
|
1464 int len; 1465 u_int phyerr; 1466 HAL_STATUS status; 1467 1468 DPRINTF2(("ath_rx_proc: pending %u\n", npending)); 1469 do { 1470 bf = TAILQ_FIRST(&sc->sc_rxbuf); 1471 if (bf == NULL) { /* NB: shouldn't happen */ --- 28 unchanged lines hidden (view full) --- 1500 sc->sc_stats.ast_rx_phy[phyerr]++; 1501 } 1502 goto rx_next; 1503 } 1504 1505 len = ds->ds_rxstat.rs_datalen; 1506 if (len < sizeof(struct ieee80211_frame)) { 1507 DPRINTF(("ath_rx_proc: short packet %d\n", len)); | 1460 int len; 1461 u_int phyerr; 1462 HAL_STATUS status; 1463 1464 DPRINTF2(("ath_rx_proc: pending %u\n", npending)); 1465 do { 1466 bf = TAILQ_FIRST(&sc->sc_rxbuf); 1467 if (bf == NULL) { /* NB: shouldn't happen */ --- 28 unchanged lines hidden (view full) --- 1496 sc->sc_stats.ast_rx_phy[phyerr]++; 1497 } 1498 goto rx_next; 1499 } 1500 1501 len = ds->ds_rxstat.rs_datalen; 1502 if (len < sizeof(struct ieee80211_frame)) { 1503 DPRINTF(("ath_rx_proc: short packet %d\n", len)); |
1504 sc->sc_stats.ast_rx_tooshort++; |
|
1508 goto rx_next; 1509 } 1510 1511 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, 1512 BUS_DMASYNC_POSTREAD); 1513 1514 wh = mtod(m, struct ieee80211_frame *); 1515 if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == 1516 IEEE80211_FC0_TYPE_CTL && 1517 ic->ic_opmode != IEEE80211_M_MONITOR) { 1518 /* | 1505 goto rx_next; 1506 } 1507 1508 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, 1509 BUS_DMASYNC_POSTREAD); 1510 1511 wh = mtod(m, struct ieee80211_frame *); 1512 if ((wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) == 1513 IEEE80211_FC0_TYPE_CTL && 1514 ic->ic_opmode != IEEE80211_M_MONITOR) { 1515 /* |
1519 * Ignore control frame received in promisc mode. | 1516 * Discard control frame when not in monitor mode. |
1520 */ 1521 DPRINTF(("ath_rx_proc: control frame\n")); 1522 sc->sc_stats.ast_rx_ctl++; 1523 goto rx_next; 1524 } 1525 1526 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); 1527 bf->bf_m = NULL; 1528 m->m_pkthdr.rcvif = ifp; 1529 m->m_pkthdr.len = m->m_len = len; 1530 if (IFF_DUMPPKTS(ifp)) { 1531 ieee80211_dump_pkt(mtod(m, u_int8_t *), len, 1532 sc->sc_hwmap[ds->ds_rxstat.rs_rate] & 1533 IEEE80211_RATE_VAL, 1534 ds->ds_rxstat.rs_rssi); 1535 } | 1517 */ 1518 DPRINTF(("ath_rx_proc: control frame\n")); 1519 sc->sc_stats.ast_rx_ctl++; 1520 goto rx_next; 1521 } 1522 1523 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); 1524 bf->bf_m = NULL; 1525 m->m_pkthdr.rcvif = ifp; 1526 m->m_pkthdr.len = m->m_len = len; 1527 if (IFF_DUMPPKTS(ifp)) { 1528 ieee80211_dump_pkt(mtod(m, u_int8_t *), len, 1529 sc->sc_hwmap[ds->ds_rxstat.rs_rate] & 1530 IEEE80211_RATE_VAL, 1531 ds->ds_rxstat.rs_rssi); 1532 } |
1533 |
|
1536 m_adj(m, -IEEE80211_CRC_LEN); 1537 if (wh->i_fc[1] & IEEE80211_FC1_WEP) { 1538 /* 1539 * WEP is decrypted by hardware. Clear WEP bit 1540 * and trim WEP header for ieee80211_input(). 1541 */ 1542 wh->i_fc[1] &= ~IEEE80211_FC1_WEP; 1543 memcpy(&whbuf, wh, sizeof(whbuf)); 1544 m_adj(m, IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN); 1545 memcpy(mtod(m, caddr_t), &whbuf, sizeof(whbuf)); 1546 /* 1547 * Also trim WEP ICV from the tail. 1548 */ 1549 m_adj(m, -IEEE80211_WEP_CRCLEN); 1550 } | 1534 m_adj(m, -IEEE80211_CRC_LEN); 1535 if (wh->i_fc[1] & IEEE80211_FC1_WEP) { 1536 /* 1537 * WEP is decrypted by hardware. Clear WEP bit 1538 * and trim WEP header for ieee80211_input(). 1539 */ 1540 wh->i_fc[1] &= ~IEEE80211_FC1_WEP; 1541 memcpy(&whbuf, wh, sizeof(whbuf)); 1542 m_adj(m, IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN); 1543 memcpy(mtod(m, caddr_t), &whbuf, sizeof(whbuf)); 1544 /* 1545 * Also trim WEP ICV from the tail. 1546 */ 1547 m_adj(m, -IEEE80211_WEP_CRCLEN); 1548 } |
1551 ieee80211_input(ifp, m, 1552 ds->ds_rxstat.rs_rssi, 1553 ds->ds_rxstat.rs_tstamp, 1554 ds->ds_rxstat.rs_antenna); | 1549 1550 /* 1551 * Locate the node for sender, track state, and 1552 * then pass this node (referenced) up to the 802.11 1553 * layer for its use. We are required to pass 1554 * something so we fall back to ic_bss when this frame 1555 * is from an unknown sender. 1556 */ 1557 if (ic->ic_opmode != IEEE80211_M_STA) { 1558 ni = ieee80211_find_node(ic, wh->i_addr2); 1559 if (ni == NULL) 1560 ni = ieee80211_ref_node(ic->ic_bss); 1561 } else 1562 ni = ieee80211_ref_node(ic->ic_bss); 1563 ATH_NODE(ni)->an_rx_antenna = ds->ds_rxstat.rs_antenna; 1564 /* 1565 * Send frame up for processing. 1566 */ 1567 ieee80211_input(ifp, m, ni, 1568 ds->ds_rxstat.rs_rssi, ds->ds_rxstat.rs_tstamp); 1569 /* 1570 * The frame may have caused the node to be marked for 1571 * reclamation (e.g. in response to a DEAUTH message) 1572 * so use free_node here instead of unref_node. 1573 */ 1574 if (ni == ic->ic_bss) 1575 ieee80211_unref_node(&ni); 1576 else 1577 ieee80211_free_node(ic, ni); |
1555 rx_next: 1556 TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); 1557 } while (ath_rxbuf_init(sc, bf) == 0); 1558 1559 ath_hal_rxmonitor(ah); /* rx signal state monitoring */ 1560 ath_hal_rxena(ah); /* in case of RXEOL */ 1561} 1562 --- 113 unchanged lines hidden (view full) --- 1676 } else if (bf->bf_nseg == 0) { /* null packet, discard */ 1677 sc->sc_stats.ast_tx_nodata++; 1678 m_freem(m0); 1679 return EIO; 1680 } 1681 DPRINTF2(("ath_tx_start: m %p len %u\n", m0, pktlen)); 1682 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); 1683 bf->bf_m = m0; | 1578 rx_next: 1579 TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); 1580 } while (ath_rxbuf_init(sc, bf) == 0); 1581 1582 ath_hal_rxmonitor(ah); /* rx signal state monitoring */ 1583 ath_hal_rxena(ah); /* in case of RXEOL */ 1584} 1585 --- 113 unchanged lines hidden (view full) --- 1699 } else if (bf->bf_nseg == 0) { /* null packet, discard */ 1700 sc->sc_stats.ast_tx_nodata++; 1701 m_freem(m0); 1702 return EIO; 1703 } 1704 DPRINTF2(("ath_tx_start: m %p len %u\n", m0, pktlen)); 1705 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); 1706 bf->bf_m = m0; |
1684 bf->bf_node = ni; | 1707 bf->bf_node = ni; /* NB: held reference */ |
1685 1686 /* setup descriptors */ 1687 ds = bf->bf_desc; 1688 rt = sc->sc_currates; 1689 KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); 1690 1691 /* 1692 * Calculate Atheros packet type from IEEE80211 packet header --- 94 unchanged lines hidden (view full) --- 1787 * frame was received on. We assume this field is 1788 * initialized to 0 which gives us ``auto'' or the 1789 * ``default'' antenna. 1790 */ 1791 an = (struct ath_node *) ni; 1792 if (an->an_tx_antenna) 1793 antenna = an->an_tx_antenna; 1794 else | 1708 1709 /* setup descriptors */ 1710 ds = bf->bf_desc; 1711 rt = sc->sc_currates; 1712 KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); 1713 1714 /* 1715 * Calculate Atheros packet type from IEEE80211 packet header --- 94 unchanged lines hidden (view full) --- 1810 * frame was received on. We assume this field is 1811 * initialized to 0 which gives us ``auto'' or the 1812 * ``default'' antenna. 1813 */ 1814 an = (struct ath_node *) ni; 1815 if (an->an_tx_antenna) 1816 antenna = an->an_tx_antenna; 1817 else |
1795 antenna = ni->ni_rantenna; | 1818 antenna = an->an_rx_antenna; |
1796 1797 /* 1798 * Formulate first tx descriptor with tx controls. 1799 */ 1800 /* XXX check return value? */ 1801 ath_hal_setuptxdesc(ah, ds 1802 , pktlen /* packet length */ 1803 , hdrlen /* header length */ --- 56 unchanged lines hidden (view full) --- 1860} 1861 1862static void 1863ath_tx_proc(void *arg, int npending) 1864{ 1865 struct ath_softc *sc = arg; 1866 struct ath_hal *ah = sc->sc_ah; 1867 struct ath_buf *bf; | 1819 1820 /* 1821 * Formulate first tx descriptor with tx controls. 1822 */ 1823 /* XXX check return value? */ 1824 ath_hal_setuptxdesc(ah, ds 1825 , pktlen /* packet length */ 1826 , hdrlen /* header length */ --- 56 unchanged lines hidden (view full) --- 1883} 1884 1885static void 1886ath_tx_proc(void *arg, int npending) 1887{ 1888 struct ath_softc *sc = arg; 1889 struct ath_hal *ah = sc->sc_ah; 1890 struct ath_buf *bf; |
1868 struct ifnet *ifp = &sc->sc_ic.ic_if; | 1891 struct ieee80211com *ic = &sc->sc_ic; 1892 struct ifnet *ifp = &ic->ic_if; |
1869 struct ath_desc *ds; 1870 struct ieee80211_node *ni; 1871 struct ath_node *an; 1872 int sr, lr; 1873 HAL_STATUS status; 1874 1875 DPRINTF2(("ath_tx_proc: pending %u tx queue %p, link %p\n", 1876 npending, (caddr_t) ath_hal_gettxbuf(sc->sc_ah, sc->sc_txhalq), --- 38 unchanged lines hidden (view full) --- 1915 an->an_tx_antenna = 0; /* invalidate */ 1916 } 1917 sr = ds->ds_txstat.ts_shortretry; 1918 lr = ds->ds_txstat.ts_longretry; 1919 sc->sc_stats.ast_tx_shortretry += sr; 1920 sc->sc_stats.ast_tx_longretry += lr; 1921 if (sr + lr) 1922 an->an_tx_retr++; | 1893 struct ath_desc *ds; 1894 struct ieee80211_node *ni; 1895 struct ath_node *an; 1896 int sr, lr; 1897 HAL_STATUS status; 1898 1899 DPRINTF2(("ath_tx_proc: pending %u tx queue %p, link %p\n", 1900 npending, (caddr_t) ath_hal_gettxbuf(sc->sc_ah, sc->sc_txhalq), --- 38 unchanged lines hidden (view full) --- 1939 an->an_tx_antenna = 0; /* invalidate */ 1940 } 1941 sr = ds->ds_txstat.ts_shortretry; 1942 lr = ds->ds_txstat.ts_longretry; 1943 sc->sc_stats.ast_tx_shortretry += sr; 1944 sc->sc_stats.ast_tx_longretry += lr; 1945 if (sr + lr) 1946 an->an_tx_retr++; |
1947 /* 1948 * Reclaim reference to node. 1949 * 1950 * NB: the node may be reclaimed here if, for example 1951 * this is a DEAUTH message that was sent and the 1952 * node was timed out due to inactivity. 1953 */ 1954 if (ni != ic->ic_bss) 1955 ieee80211_free_node(ic, ni); |
|
1923 } 1924 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, 1925 BUS_DMASYNC_POSTWRITE); 1926 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); 1927 m_freem(bf->bf_m); 1928 bf->bf_m = NULL; 1929 bf->bf_node = NULL; 1930 --- 157 unchanged lines hidden (view full) --- 2088 */ 2089 if (ath_startrecv(sc) != 0) { 2090 if_printf(&ic->ic_if, 2091 "ath_chan_set: unable to restart recv logic\n"); 2092 return EIO; 2093 } 2094 2095 /* | 1956 } 1957 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, 1958 BUS_DMASYNC_POSTWRITE); 1959 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); 1960 m_freem(bf->bf_m); 1961 bf->bf_m = NULL; 1962 bf->bf_node = NULL; 1963 --- 157 unchanged lines hidden (view full) --- 2121 */ 2122 if (ath_startrecv(sc) != 0) { 2123 if_printf(&ic->ic_if, 2124 "ath_chan_set: unable to restart recv logic\n"); 2125 return EIO; 2126 } 2127 2128 /* |
2096 * Re-enable interrupts. 2097 */ 2098 ath_hal_intrset(ah, sc->sc_imask); 2099 2100 /* | |
2101 * Change channels and update the h/w rate map 2102 * if we're switching; e.g. 11a to 11b/g. 2103 */ 2104 ic->ic_ibss_chan = chan; 2105 mode = ieee80211_chan2mode(ic, chan); 2106 if (mode != sc->sc_curmode) 2107 ath_setcurmode(sc, mode); | 2129 * Change channels and update the h/w rate map 2130 * if we're switching; e.g. 11a to 11b/g. 2131 */ 2132 ic->ic_ibss_chan = chan; 2133 mode = ieee80211_chan2mode(ic, chan); 2134 if (mode != sc->sc_curmode) 2135 ath_setcurmode(sc, mode); |
2136 2137 /* 2138 * Re-enable interrupts. 2139 */ 2140 ath_hal_intrset(ah, sc->sc_imask); |
|
2108 } 2109 return 0; 2110} 2111 2112static void 2113ath_next_scan(void *arg) 2114{ 2115 struct ath_softc *sc = arg; --- 459 unchanged lines hidden --- | 2141 } 2142 return 0; 2143} 2144 2145static void 2146ath_next_scan(void *arg) 2147{ 2148 struct ath_softc *sc = arg; --- 459 unchanged lines hidden --- |