diff options
Diffstat (limited to 'drivers/net/wireless/ath5k/base.c')
-rw-r--r-- | drivers/net/wireless/ath5k/base.c | 147 |
1 files changed, 94 insertions, 53 deletions
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 393b5f3c25a7..b5c0a0d7a81c 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -118,6 +118,8 @@ static struct ath5k_srev_name srev_names[] = { | |||
118 | { "5212", AR5K_VERSION_VER, AR5K_SREV_VER_AR5212 }, | 118 | { "5212", AR5K_VERSION_VER, AR5K_SREV_VER_AR5212 }, |
119 | { "5213", AR5K_VERSION_VER, AR5K_SREV_VER_AR5213 }, | 119 | { "5213", AR5K_VERSION_VER, AR5K_SREV_VER_AR5213 }, |
120 | { "5213A", AR5K_VERSION_VER, AR5K_SREV_VER_AR5213A }, | 120 | { "5213A", AR5K_VERSION_VER, AR5K_SREV_VER_AR5213A }, |
121 | { "2413", AR5K_VERSION_VER, AR5K_SREV_VER_AR2413 }, | ||
122 | { "2414", AR5K_VERSION_VER, AR5K_SREV_VER_AR2414 }, | ||
121 | { "2424", AR5K_VERSION_VER, AR5K_SREV_VER_AR2424 }, | 123 | { "2424", AR5K_VERSION_VER, AR5K_SREV_VER_AR2424 }, |
122 | { "5424", AR5K_VERSION_VER, AR5K_SREV_VER_AR5424 }, | 124 | { "5424", AR5K_VERSION_VER, AR5K_SREV_VER_AR5424 }, |
123 | { "5413", AR5K_VERSION_VER, AR5K_SREV_VER_AR5413 }, | 125 | { "5413", AR5K_VERSION_VER, AR5K_SREV_VER_AR5413 }, |
@@ -132,6 +134,7 @@ static struct ath5k_srev_name srev_names[] = { | |||
132 | { "5112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112A }, | 134 | { "5112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_5112A }, |
133 | { "2112", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112 }, | 135 | { "2112", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112 }, |
134 | { "2112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112A }, | 136 | { "2112A", AR5K_VERSION_RAD, AR5K_SREV_RAD_2112A }, |
137 | { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC0 }, | ||
135 | { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC1 }, | 138 | { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC1 }, |
136 | { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC2 }, | 139 | { "SChip", AR5K_VERSION_RAD, AR5K_SREV_RAD_SC2 }, |
137 | { "5133", AR5K_VERSION_RAD, AR5K_SREV_RAD_5133 }, | 140 | { "5133", AR5K_VERSION_RAD, AR5K_SREV_RAD_5133 }, |
@@ -280,7 +283,8 @@ static int ath5k_rx_start(struct ath5k_softc *sc); | |||
280 | static void ath5k_rx_stop(struct ath5k_softc *sc); | 283 | static void ath5k_rx_stop(struct ath5k_softc *sc); |
281 | static unsigned int ath5k_rx_decrypted(struct ath5k_softc *sc, | 284 | static unsigned int ath5k_rx_decrypted(struct ath5k_softc *sc, |
282 | struct ath5k_desc *ds, | 285 | struct ath5k_desc *ds, |
283 | struct sk_buff *skb); | 286 | struct sk_buff *skb, |
287 | struct ath5k_rx_status *rs); | ||
284 | static void ath5k_tasklet_rx(unsigned long data); | 288 | static void ath5k_tasklet_rx(unsigned long data); |
285 | /* Tx handling */ | 289 | /* Tx handling */ |
286 | static void ath5k_tx_processq(struct ath5k_softc *sc, | 290 | static void ath5k_tx_processq(struct ath5k_softc *sc, |
@@ -1560,8 +1564,7 @@ ath5k_txq_drainq(struct ath5k_softc *sc, struct ath5k_txq *txq) | |||
1560 | */ | 1564 | */ |
1561 | spin_lock_bh(&txq->lock); | 1565 | spin_lock_bh(&txq->lock); |
1562 | list_for_each_entry_safe(bf, bf0, &txq->q, list) { | 1566 | list_for_each_entry_safe(bf, bf0, &txq->q, list) { |
1563 | ath5k_debug_printtxbuf(sc, bf, !sc->ah->ah_proc_tx_desc(sc->ah, | 1567 | ath5k_debug_printtxbuf(sc, bf); |
1564 | bf->desc)); | ||
1565 | 1568 | ||
1566 | ath5k_txbuf_free(sc, bf); | 1569 | ath5k_txbuf_free(sc, bf); |
1567 | 1570 | ||
@@ -1686,20 +1689,20 @@ ath5k_rx_stop(struct ath5k_softc *sc) | |||
1686 | 1689 | ||
1687 | static unsigned int | 1690 | static unsigned int |
1688 | ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds, | 1691 | ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds, |
1689 | struct sk_buff *skb) | 1692 | struct sk_buff *skb, struct ath5k_rx_status *rs) |
1690 | { | 1693 | { |
1691 | struct ieee80211_hdr *hdr = (void *)skb->data; | 1694 | struct ieee80211_hdr *hdr = (void *)skb->data; |
1692 | unsigned int keyix, hlen = ieee80211_get_hdrlen_from_skb(skb); | 1695 | unsigned int keyix, hlen = ieee80211_get_hdrlen_from_skb(skb); |
1693 | 1696 | ||
1694 | if (!(ds->ds_rxstat.rs_status & AR5K_RXERR_DECRYPT) && | 1697 | if (!(rs->rs_status & AR5K_RXERR_DECRYPT) && |
1695 | ds->ds_rxstat.rs_keyix != AR5K_RXKEYIX_INVALID) | 1698 | rs->rs_keyix != AR5K_RXKEYIX_INVALID) |
1696 | return RX_FLAG_DECRYPTED; | 1699 | return RX_FLAG_DECRYPTED; |
1697 | 1700 | ||
1698 | /* Apparently when a default key is used to decrypt the packet | 1701 | /* Apparently when a default key is used to decrypt the packet |
1699 | the hw does not set the index used to decrypt. In such cases | 1702 | the hw does not set the index used to decrypt. In such cases |
1700 | get the index from the packet. */ | 1703 | get the index from the packet. */ |
1701 | if ((le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_PROTECTED) && | 1704 | if ((le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_PROTECTED) && |
1702 | !(ds->ds_rxstat.rs_status & AR5K_RXERR_DECRYPT) && | 1705 | !(rs->rs_status & AR5K_RXERR_DECRYPT) && |
1703 | skb->len >= hlen + 4) { | 1706 | skb->len >= hlen + 4) { |
1704 | keyix = skb->data[hlen + 3] >> 6; | 1707 | keyix = skb->data[hlen + 3] >> 6; |
1705 | 1708 | ||
@@ -1712,8 +1715,10 @@ ath5k_rx_decrypted(struct ath5k_softc *sc, struct ath5k_desc *ds, | |||
1712 | 1715 | ||
1713 | 1716 | ||
1714 | static void | 1717 | static void |
1715 | ath5k_check_ibss_hw_merge(struct ath5k_softc *sc, struct sk_buff *skb) | 1718 | ath5k_check_ibss_tsf(struct ath5k_softc *sc, struct sk_buff *skb, |
1719 | struct ieee80211_rx_status *rxs) | ||
1716 | { | 1720 | { |
1721 | u64 tsf, bc_tstamp; | ||
1717 | u32 hw_tu; | 1722 | u32 hw_tu; |
1718 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; | 1723 | struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; |
1719 | 1724 | ||
@@ -1724,16 +1729,45 @@ ath5k_check_ibss_hw_merge(struct ath5k_softc *sc, struct sk_buff *skb) | |||
1724 | le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && | 1729 | le16_to_cpu(mgmt->u.beacon.capab_info) & WLAN_CAPABILITY_IBSS && |
1725 | memcmp(mgmt->bssid, sc->ah->ah_bssid, ETH_ALEN) == 0) { | 1730 | memcmp(mgmt->bssid, sc->ah->ah_bssid, ETH_ALEN) == 0) { |
1726 | /* | 1731 | /* |
1727 | * Received an IBSS beacon with the same BSSID. Hardware might | 1732 | * Received an IBSS beacon with the same BSSID. Hardware *must* |
1728 | * have updated the TSF, check if we need to update timers. | 1733 | * have updated the local TSF. We have to work around various |
1734 | * hardware bugs, though... | ||
1729 | */ | 1735 | */ |
1730 | hw_tu = TSF_TO_TU(ath5k_hw_get_tsf64(sc->ah)); | 1736 | tsf = ath5k_hw_get_tsf64(sc->ah); |
1731 | if (hw_tu >= sc->nexttbtt) { | 1737 | bc_tstamp = le64_to_cpu(mgmt->u.beacon.timestamp); |
1732 | ath5k_beacon_update_timers(sc, | 1738 | hw_tu = TSF_TO_TU(tsf); |
1733 | le64_to_cpu(mgmt->u.beacon.timestamp)); | 1739 | |
1740 | ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, | ||
1741 | "beacon %llx mactime %llx (diff %lld) tsf now %llx\n", | ||
1742 | bc_tstamp, rxs->mactime, | ||
1743 | (rxs->mactime - bc_tstamp), tsf); | ||
1744 | |||
1745 | /* | ||
1746 | * Sometimes the HW will give us a wrong tstamp in the rx | ||
1747 | * status, causing the timestamp extension to go wrong. | ||
1748 | * (This seems to happen especially with beacon frames bigger | ||
1749 | * than 78 byte (incl. FCS)) | ||
1750 | * But we know that the receive timestamp must be later than the | ||
1751 | * timestamp of the beacon since HW must have synced to that. | ||
1752 | * | ||
1753 | * NOTE: here we assume mactime to be after the frame was | ||
1754 | * received, not like mac80211 which defines it at the start. | ||
1755 | */ | ||
1756 | if (bc_tstamp > rxs->mactime) { | ||
1734 | ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, | 1757 | ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, |
1735 | "detected HW merge from received beacon\n"); | 1758 | "fixing mactime from %llx to %llx\n", |
1759 | rxs->mactime, tsf); | ||
1760 | rxs->mactime = tsf; | ||
1736 | } | 1761 | } |
1762 | |||
1763 | /* | ||
1764 | * Local TSF might have moved higher than our beacon timers, | ||
1765 | * in that case we have to update them to continue sending | ||
1766 | * beacons. This also takes care of synchronizing beacon sending | ||
1767 | * times with other stations. | ||
1768 | */ | ||
1769 | if (hw_tu >= sc->nexttbtt) | ||
1770 | ath5k_beacon_update_timers(sc, bc_tstamp); | ||
1737 | } | 1771 | } |
1738 | } | 1772 | } |
1739 | 1773 | ||
@@ -1742,12 +1776,11 @@ static void | |||
1742 | ath5k_tasklet_rx(unsigned long data) | 1776 | ath5k_tasklet_rx(unsigned long data) |
1743 | { | 1777 | { |
1744 | struct ieee80211_rx_status rxs = {}; | 1778 | struct ieee80211_rx_status rxs = {}; |
1779 | struct ath5k_rx_status rs = {}; | ||
1745 | struct sk_buff *skb; | 1780 | struct sk_buff *skb; |
1746 | struct ath5k_softc *sc = (void *)data; | 1781 | struct ath5k_softc *sc = (void *)data; |
1747 | struct ath5k_buf *bf; | 1782 | struct ath5k_buf *bf; |
1748 | struct ath5k_desc *ds; | 1783 | struct ath5k_desc *ds; |
1749 | u16 len; | ||
1750 | u8 stat; | ||
1751 | int ret; | 1784 | int ret; |
1752 | int hdrlen; | 1785 | int hdrlen; |
1753 | int pad; | 1786 | int pad; |
@@ -1770,7 +1803,7 @@ ath5k_tasklet_rx(unsigned long data) | |||
1770 | if (unlikely(ds->ds_link == bf->daddr)) /* this is the end */ | 1803 | if (unlikely(ds->ds_link == bf->daddr)) /* this is the end */ |
1771 | break; | 1804 | break; |
1772 | 1805 | ||
1773 | ret = sc->ah->ah_proc_rx_desc(sc->ah, ds); | 1806 | ret = sc->ah->ah_proc_rx_desc(sc->ah, ds, &rs); |
1774 | if (unlikely(ret == -EINPROGRESS)) | 1807 | if (unlikely(ret == -EINPROGRESS)) |
1775 | break; | 1808 | break; |
1776 | else if (unlikely(ret)) { | 1809 | else if (unlikely(ret)) { |
@@ -1779,16 +1812,15 @@ ath5k_tasklet_rx(unsigned long data) | |||
1779 | return; | 1812 | return; |
1780 | } | 1813 | } |
1781 | 1814 | ||
1782 | if (unlikely(ds->ds_rxstat.rs_more)) { | 1815 | if (unlikely(rs.rs_more)) { |
1783 | ATH5K_WARN(sc, "unsupported jumbo\n"); | 1816 | ATH5K_WARN(sc, "unsupported jumbo\n"); |
1784 | goto next; | 1817 | goto next; |
1785 | } | 1818 | } |
1786 | 1819 | ||
1787 | stat = ds->ds_rxstat.rs_status; | 1820 | if (unlikely(rs.rs_status)) { |
1788 | if (unlikely(stat)) { | 1821 | if (rs.rs_status & AR5K_RXERR_PHY) |
1789 | if (stat & AR5K_RXERR_PHY) | ||
1790 | goto next; | 1822 | goto next; |
1791 | if (stat & AR5K_RXERR_DECRYPT) { | 1823 | if (rs.rs_status & AR5K_RXERR_DECRYPT) { |
1792 | /* | 1824 | /* |
1793 | * Decrypt error. If the error occurred | 1825 | * Decrypt error. If the error occurred |
1794 | * because there was no hardware key, then | 1826 | * because there was no hardware key, then |
@@ -1799,30 +1831,29 @@ ath5k_tasklet_rx(unsigned long data) | |||
1799 | * | 1831 | * |
1800 | * XXX do key cache faulting | 1832 | * XXX do key cache faulting |
1801 | */ | 1833 | */ |
1802 | if (ds->ds_rxstat.rs_keyix == | 1834 | if (rs.rs_keyix == AR5K_RXKEYIX_INVALID && |
1803 | AR5K_RXKEYIX_INVALID && | 1835 | !(rs.rs_status & AR5K_RXERR_CRC)) |
1804 | !(stat & AR5K_RXERR_CRC)) | ||
1805 | goto accept; | 1836 | goto accept; |
1806 | } | 1837 | } |
1807 | if (stat & AR5K_RXERR_MIC) { | 1838 | if (rs.rs_status & AR5K_RXERR_MIC) { |
1808 | rxs.flag |= RX_FLAG_MMIC_ERROR; | 1839 | rxs.flag |= RX_FLAG_MMIC_ERROR; |
1809 | goto accept; | 1840 | goto accept; |
1810 | } | 1841 | } |
1811 | 1842 | ||
1812 | /* let crypto-error packets fall through in MNTR */ | 1843 | /* let crypto-error packets fall through in MNTR */ |
1813 | if ((stat & ~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) || | 1844 | if ((rs.rs_status & |
1845 | ~(AR5K_RXERR_DECRYPT|AR5K_RXERR_MIC)) || | ||
1814 | sc->opmode != IEEE80211_IF_TYPE_MNTR) | 1846 | sc->opmode != IEEE80211_IF_TYPE_MNTR) |
1815 | goto next; | 1847 | goto next; |
1816 | } | 1848 | } |
1817 | accept: | 1849 | accept: |
1818 | len = ds->ds_rxstat.rs_datalen; | 1850 | pci_dma_sync_single_for_cpu(sc->pdev, bf->skbaddr, |
1819 | pci_dma_sync_single_for_cpu(sc->pdev, bf->skbaddr, len, | 1851 | rs.rs_datalen, PCI_DMA_FROMDEVICE); |
1820 | PCI_DMA_FROMDEVICE); | ||
1821 | pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize, | 1852 | pci_unmap_single(sc->pdev, bf->skbaddr, sc->rxbufsize, |
1822 | PCI_DMA_FROMDEVICE); | 1853 | PCI_DMA_FROMDEVICE); |
1823 | bf->skb = NULL; | 1854 | bf->skb = NULL; |
1824 | 1855 | ||
1825 | skb_put(skb, len); | 1856 | skb_put(skb, rs.rs_datalen); |
1826 | 1857 | ||
1827 | /* | 1858 | /* |
1828 | * the hardware adds a padding to 4 byte boundaries between | 1859 | * the hardware adds a padding to 4 byte boundaries between |
@@ -1844,8 +1875,19 @@ accept: | |||
1844 | * 15bit only. that means TSF extension has to be done within | 1875 | * 15bit only. that means TSF extension has to be done within |
1845 | * 32768usec (about 32ms). it might be necessary to move this to | 1876 | * 32768usec (about 32ms). it might be necessary to move this to |
1846 | * the interrupt handler, like it is done in madwifi. | 1877 | * the interrupt handler, like it is done in madwifi. |
1878 | * | ||
1879 | * Unfortunately we don't know when the hardware takes the rx | ||
1880 | * timestamp (beginning of phy frame, data frame, end of rx?). | ||
1881 | * The only thing we know is that it is hardware specific... | ||
1882 | * On AR5213 it seems the rx timestamp is at the end of the | ||
1883 | * frame, but i'm not sure. | ||
1884 | * | ||
1885 | * NOTE: mac80211 defines mactime at the beginning of the first | ||
1886 | * data symbol. Since we don't have any time references it's | ||
1887 | * impossible to comply to that. This affects IBSS merge only | ||
1888 | * right now, so it's not too bad... | ||
1847 | */ | 1889 | */ |
1848 | rxs.mactime = ath5k_extend_tsf(sc->ah, ds->ds_rxstat.rs_tstamp); | 1890 | rxs.mactime = ath5k_extend_tsf(sc->ah, rs.rs_tstamp); |
1849 | rxs.flag |= RX_FLAG_TSFT; | 1891 | rxs.flag |= RX_FLAG_TSFT; |
1850 | 1892 | ||
1851 | rxs.freq = sc->curchan->center_freq; | 1893 | rxs.freq = sc->curchan->center_freq; |
@@ -1859,26 +1901,25 @@ accept: | |||
1859 | /* noise floor in dBm, from the last noise calibration */ | 1901 | /* noise floor in dBm, from the last noise calibration */ |
1860 | rxs.noise = sc->ah->ah_noise_floor; | 1902 | rxs.noise = sc->ah->ah_noise_floor; |
1861 | /* signal level in dBm */ | 1903 | /* signal level in dBm */ |
1862 | rxs.ssi = rxs.noise + ds->ds_rxstat.rs_rssi; | 1904 | rxs.ssi = rxs.noise + rs.rs_rssi; |
1863 | /* | 1905 | /* |
1864 | * "signal" is actually displayed as Link Quality by iwconfig | 1906 | * "signal" is actually displayed as Link Quality by iwconfig |
1865 | * we provide a percentage based on rssi (assuming max rssi 64) | 1907 | * we provide a percentage based on rssi (assuming max rssi 64) |
1866 | */ | 1908 | */ |
1867 | rxs.signal = ds->ds_rxstat.rs_rssi * 100 / 64; | 1909 | rxs.signal = rs.rs_rssi * 100 / 64; |
1868 | 1910 | ||
1869 | rxs.antenna = ds->ds_rxstat.rs_antenna; | 1911 | rxs.antenna = rs.rs_antenna; |
1870 | rxs.rate_idx = ath5k_hw_to_driver_rix(sc, | 1912 | rxs.rate_idx = ath5k_hw_to_driver_rix(sc, rs.rs_rate); |
1871 | ds->ds_rxstat.rs_rate); | 1913 | rxs.flag |= ath5k_rx_decrypted(sc, ds, skb, &rs); |
1872 | rxs.flag |= ath5k_rx_decrypted(sc, ds, skb); | ||
1873 | 1914 | ||
1874 | ath5k_debug_dump_skb(sc, skb, "RX ", 0); | 1915 | ath5k_debug_dump_skb(sc, skb, "RX ", 0); |
1875 | 1916 | ||
1876 | /* check beacons in IBSS mode */ | 1917 | /* check beacons in IBSS mode */ |
1877 | if (sc->opmode == IEEE80211_IF_TYPE_IBSS) | 1918 | if (sc->opmode == IEEE80211_IF_TYPE_IBSS) |
1878 | ath5k_check_ibss_hw_merge(sc, skb); | 1919 | ath5k_check_ibss_tsf(sc, skb, &rxs); |
1879 | 1920 | ||
1880 | __ieee80211_rx(sc->hw, skb, &rxs); | 1921 | __ieee80211_rx(sc->hw, skb, &rxs); |
1881 | sc->led_rxrate = ds->ds_rxstat.rs_rate; | 1922 | sc->led_rxrate = rs.rs_rate; |
1882 | ath5k_led_event(sc, ATH_LED_RX); | 1923 | ath5k_led_event(sc, ATH_LED_RX); |
1883 | next: | 1924 | next: |
1884 | list_move_tail(&bf->list, &sc->rxbuf); | 1925 | list_move_tail(&bf->list, &sc->rxbuf); |
@@ -1897,6 +1938,7 @@ static void | |||
1897 | ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | 1938 | ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) |
1898 | { | 1939 | { |
1899 | struct ieee80211_tx_status txs = {}; | 1940 | struct ieee80211_tx_status txs = {}; |
1941 | struct ath5k_tx_status ts = {}; | ||
1900 | struct ath5k_buf *bf, *bf0; | 1942 | struct ath5k_buf *bf, *bf0; |
1901 | struct ath5k_desc *ds; | 1943 | struct ath5k_desc *ds; |
1902 | struct sk_buff *skb; | 1944 | struct sk_buff *skb; |
@@ -1909,7 +1951,7 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | |||
1909 | /* TODO only one segment */ | 1951 | /* TODO only one segment */ |
1910 | pci_dma_sync_single_for_cpu(sc->pdev, sc->desc_daddr, | 1952 | pci_dma_sync_single_for_cpu(sc->pdev, sc->desc_daddr, |
1911 | sc->desc_len, PCI_DMA_FROMDEVICE); | 1953 | sc->desc_len, PCI_DMA_FROMDEVICE); |
1912 | ret = sc->ah->ah_proc_tx_desc(sc->ah, ds); | 1954 | ret = sc->ah->ah_proc_tx_desc(sc->ah, ds, &ts); |
1913 | if (unlikely(ret == -EINPROGRESS)) | 1955 | if (unlikely(ret == -EINPROGRESS)) |
1914 | break; | 1956 | break; |
1915 | else if (unlikely(ret)) { | 1957 | else if (unlikely(ret)) { |
@@ -1924,17 +1966,16 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq) | |||
1924 | PCI_DMA_TODEVICE); | 1966 | PCI_DMA_TODEVICE); |
1925 | 1967 | ||
1926 | txs.control = bf->ctl; | 1968 | txs.control = bf->ctl; |
1927 | txs.retry_count = ds->ds_txstat.ts_shortretry + | 1969 | txs.retry_count = ts.ts_shortretry + ts.ts_longretry / 6; |
1928 | ds->ds_txstat.ts_longretry / 6; | 1970 | if (unlikely(ts.ts_status)) { |
1929 | if (unlikely(ds->ds_txstat.ts_status)) { | ||
1930 | sc->ll_stats.dot11ACKFailureCount++; | 1971 | sc->ll_stats.dot11ACKFailureCount++; |
1931 | if (ds->ds_txstat.ts_status & AR5K_TXERR_XRETRY) | 1972 | if (ts.ts_status & AR5K_TXERR_XRETRY) |
1932 | txs.excessive_retries = 1; | 1973 | txs.excessive_retries = 1; |
1933 | else if (ds->ds_txstat.ts_status & AR5K_TXERR_FILT) | 1974 | else if (ts.ts_status & AR5K_TXERR_FILT) |
1934 | txs.flags |= IEEE80211_TX_STATUS_TX_FILTERED; | 1975 | txs.flags |= IEEE80211_TX_STATUS_TX_FILTERED; |
1935 | } else { | 1976 | } else { |
1936 | txs.flags |= IEEE80211_TX_STATUS_ACK; | 1977 | txs.flags |= IEEE80211_TX_STATUS_ACK; |
1937 | txs.ack_signal = ds->ds_txstat.ts_rssi; | 1978 | txs.ack_signal = ts.ts_rssi; |
1938 | } | 1979 | } |
1939 | 1980 | ||
1940 | ieee80211_tx_status(sc->hw, skb, &txs); | 1981 | ieee80211_tx_status(sc->hw, skb, &txs); |
@@ -2108,7 +2149,7 @@ ath5k_beacon_send(struct ath5k_softc *sc) | |||
2108 | * beacon timer registers. | 2149 | * beacon timer registers. |
2109 | * | 2150 | * |
2110 | * This is called in a variety of situations, e.g. when a beacon is received, | 2151 | * This is called in a variety of situations, e.g. when a beacon is received, |
2111 | * when a HW merge has been detected, but also when an new IBSS is created or | 2152 | * when a TSF update has been detected, but also when an new IBSS is created or |
2112 | * when we otherwise know we have to update the timers, but we keep it in this | 2153 | * when we otherwise know we have to update the timers, but we keep it in this |
2113 | * function to have it all together in one place. | 2154 | * function to have it all together in one place. |
2114 | */ | 2155 | */ |
@@ -2208,7 +2249,7 @@ ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf) | |||
2208 | * another AP to associate with. | 2249 | * another AP to associate with. |
2209 | * | 2250 | * |
2210 | * In IBSS mode we use a self-linked tx descriptor if possible. We enable SWBA | 2251 | * In IBSS mode we use a self-linked tx descriptor if possible. We enable SWBA |
2211 | * interrupts to detect HW merges only. | 2252 | * interrupts to detect TSF updates only. |
2212 | * | 2253 | * |
2213 | * AP mode is missing. | 2254 | * AP mode is missing. |
2214 | */ | 2255 | */ |
@@ -2228,7 +2269,7 @@ ath5k_beacon_config(struct ath5k_softc *sc) | |||
2228 | * hardware send the beacons automatically. We have to load it | 2269 | * hardware send the beacons automatically. We have to load it |
2229 | * only once here. | 2270 | * only once here. |
2230 | * We use the SWBA interrupt only to keep track of the beacon | 2271 | * We use the SWBA interrupt only to keep track of the beacon |
2231 | * timers in order to detect HW merges (automatic TSF updates). | 2272 | * timers in order to detect automatic TSF updates. |
2232 | */ | 2273 | */ |
2233 | ath5k_beaconq_config(sc); | 2274 | ath5k_beaconq_config(sc); |
2234 | 2275 | ||
@@ -2441,8 +2482,8 @@ ath5k_intr(int irq, void *dev_id) | |||
2441 | * | 2482 | * |
2442 | * In IBSS mode we use this interrupt just to | 2483 | * In IBSS mode we use this interrupt just to |
2443 | * keep track of the next TBTT (target beacon | 2484 | * keep track of the next TBTT (target beacon |
2444 | * transmission time) in order to detect hardware | 2485 | * transmission time) in order to detect wether |
2445 | * merges (TSF updates). | 2486 | * automatic TSF updates happened. |
2446 | */ | 2487 | */ |
2447 | if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { | 2488 | if (sc->opmode == IEEE80211_IF_TYPE_IBSS) { |
2448 | /* XXX: only if VEOL suppported */ | 2489 | /* XXX: only if VEOL suppported */ |