diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-04-12 16:18:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-04-12 16:18:44 -0400 |
commit | 252f4bf400df1712408fe83ba199a66a1b57ab1d (patch) | |
tree | e07fa00abdd55b31e22567786c78635f32c6a66c /drivers/net/wireless/rt2x00 | |
parent | 6ba1037c3d871ab70e342631516dbf841c35b086 (diff) | |
parent | b37e3b6d64358604960b35e8ecbb7aed22e0926e (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts:
drivers/net/wireless/ath/ar9170/main.c
drivers/net/wireless/ath/ar9170/phy.c
drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
Diffstat (limited to 'drivers/net/wireless/rt2x00')
20 files changed, 400 insertions, 98 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 329f3283697b..137a24e520da 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c | |||
@@ -1368,8 +1368,10 @@ static void rt2400pci_tbtt_tasklet(unsigned long data) | |||
1368 | static void rt2400pci_rxdone_tasklet(unsigned long data) | 1368 | static void rt2400pci_rxdone_tasklet(unsigned long data) |
1369 | { | 1369 | { |
1370 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; | 1370 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; |
1371 | rt2x00pci_rxdone(rt2x00dev); | 1371 | if (rt2x00pci_rxdone(rt2x00dev)) |
1372 | rt2400pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); | 1372 | tasklet_schedule(&rt2x00dev->rxdone_tasklet); |
1373 | else | ||
1374 | rt2400pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); | ||
1373 | } | 1375 | } |
1374 | 1376 | ||
1375 | static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance) | 1377 | static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance) |
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 58277878889e..198fc0a0d77c 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c | |||
@@ -1500,8 +1500,10 @@ static void rt2500pci_tbtt_tasklet(unsigned long data) | |||
1500 | static void rt2500pci_rxdone_tasklet(unsigned long data) | 1500 | static void rt2500pci_rxdone_tasklet(unsigned long data) |
1501 | { | 1501 | { |
1502 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; | 1502 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; |
1503 | rt2x00pci_rxdone(rt2x00dev); | 1503 | if (rt2x00pci_rxdone(rt2x00dev)) |
1504 | rt2500pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); | 1504 | tasklet_schedule(&rt2x00dev->rxdone_tasklet); |
1505 | else | ||
1506 | rt2500pci_enable_interrupt(rt2x00dev, CSR8_RXDONE); | ||
1505 | } | 1507 | } |
1506 | 1508 | ||
1507 | static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance) | 1509 | static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance) |
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 979fe6596a2d..eac788160f55 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -1796,7 +1796,6 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1796 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); | 1796 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); |
1797 | __set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags); | 1797 | __set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags); |
1798 | } | 1798 | } |
1799 | __set_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags); | ||
1800 | __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags); | 1799 | __set_bit(DRIVER_REQUIRE_SW_SEQNO, &rt2x00dev->flags); |
1801 | 1800 | ||
1802 | /* | 1801 | /* |
@@ -1910,13 +1909,10 @@ static struct usb_device_id rt2500usb_device_table[] = { | |||
1910 | /* Belkin */ | 1909 | /* Belkin */ |
1911 | { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1910 | { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1912 | { USB_DEVICE(0x050d, 0x7051), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1911 | { USB_DEVICE(0x050d, 0x7051), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1913 | { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt2500usb_ops) }, | ||
1914 | /* Cisco Systems */ | 1912 | /* Cisco Systems */ |
1915 | { USB_DEVICE(0x13b1, 0x000d), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1913 | { USB_DEVICE(0x13b1, 0x000d), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1916 | { USB_DEVICE(0x13b1, 0x0011), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1914 | { USB_DEVICE(0x13b1, 0x0011), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1917 | { USB_DEVICE(0x13b1, 0x001a), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1915 | { USB_DEVICE(0x13b1, 0x001a), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1918 | /* CNet */ | ||
1919 | { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt2500usb_ops) }, | ||
1920 | /* Conceptronic */ | 1916 | /* Conceptronic */ |
1921 | { USB_DEVICE(0x14b2, 0x3c02), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1917 | { USB_DEVICE(0x14b2, 0x3c02), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1922 | /* D-LINK */ | 1918 | /* D-LINK */ |
@@ -1939,7 +1935,6 @@ static struct usb_device_id rt2500usb_device_table[] = { | |||
1939 | /* Ralink */ | 1935 | /* Ralink */ |
1940 | { USB_DEVICE(0x148f, 0x1706), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1936 | { USB_DEVICE(0x148f, 0x1706), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1941 | { USB_DEVICE(0x148f, 0x2570), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1937 | { USB_DEVICE(0x148f, 0x2570), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1942 | { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt2500usb_ops) }, | ||
1943 | { USB_DEVICE(0x148f, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1938 | { USB_DEVICE(0x148f, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) }, |
1944 | /* Sagem */ | 1939 | /* Sagem */ |
1945 | { USB_DEVICE(0x079b, 0x004b), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1940 | { USB_DEVICE(0x079b, 0x004b), USB_DEVICE_DATA(&rt2500usb_ops) }, |
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h index 8fbc5fa965e0..ce2010952886 100644 --- a/drivers/net/wireless/rt2x00/rt2800.h +++ b/drivers/net/wireless/rt2x00/rt2800.h | |||
@@ -2104,6 +2104,59 @@ struct mac_iveiv_entry { | |||
2104 | #define EEPROM_TXPOWER_BG_2 FIELD16(0xff00) | 2104 | #define EEPROM_TXPOWER_BG_2 FIELD16(0xff00) |
2105 | 2105 | ||
2106 | /* | 2106 | /* |
2107 | * EEPROM temperature compensation boundaries 802.11BG | ||
2108 | * MINUS4: If the actual TSSI is below this boundary, tx power needs to be | ||
2109 | * reduced by (agc_step * -4) | ||
2110 | * MINUS3: If the actual TSSI is below this boundary, tx power needs to be | ||
2111 | * reduced by (agc_step * -3) | ||
2112 | */ | ||
2113 | #define EEPROM_TSSI_BOUND_BG1 0x0037 | ||
2114 | #define EEPROM_TSSI_BOUND_BG1_MINUS4 FIELD16(0x00ff) | ||
2115 | #define EEPROM_TSSI_BOUND_BG1_MINUS3 FIELD16(0xff00) | ||
2116 | |||
2117 | /* | ||
2118 | * EEPROM temperature compensation boundaries 802.11BG | ||
2119 | * MINUS2: If the actual TSSI is below this boundary, tx power needs to be | ||
2120 | * reduced by (agc_step * -2) | ||
2121 | * MINUS1: If the actual TSSI is below this boundary, tx power needs to be | ||
2122 | * reduced by (agc_step * -1) | ||
2123 | */ | ||
2124 | #define EEPROM_TSSI_BOUND_BG2 0x0038 | ||
2125 | #define EEPROM_TSSI_BOUND_BG2_MINUS2 FIELD16(0x00ff) | ||
2126 | #define EEPROM_TSSI_BOUND_BG2_MINUS1 FIELD16(0xff00) | ||
2127 | |||
2128 | /* | ||
2129 | * EEPROM temperature compensation boundaries 802.11BG | ||
2130 | * REF: Reference TSSI value, no tx power changes needed | ||
2131 | * PLUS1: If the actual TSSI is above this boundary, tx power needs to be | ||
2132 | * increased by (agc_step * 1) | ||
2133 | */ | ||
2134 | #define EEPROM_TSSI_BOUND_BG3 0x0039 | ||
2135 | #define EEPROM_TSSI_BOUND_BG3_REF FIELD16(0x00ff) | ||
2136 | #define EEPROM_TSSI_BOUND_BG3_PLUS1 FIELD16(0xff00) | ||
2137 | |||
2138 | /* | ||
2139 | * EEPROM temperature compensation boundaries 802.11BG | ||
2140 | * PLUS2: If the actual TSSI is above this boundary, tx power needs to be | ||
2141 | * increased by (agc_step * 2) | ||
2142 | * PLUS3: If the actual TSSI is above this boundary, tx power needs to be | ||
2143 | * increased by (agc_step * 3) | ||
2144 | */ | ||
2145 | #define EEPROM_TSSI_BOUND_BG4 0x003a | ||
2146 | #define EEPROM_TSSI_BOUND_BG4_PLUS2 FIELD16(0x00ff) | ||
2147 | #define EEPROM_TSSI_BOUND_BG4_PLUS3 FIELD16(0xff00) | ||
2148 | |||
2149 | /* | ||
2150 | * EEPROM temperature compensation boundaries 802.11BG | ||
2151 | * PLUS4: If the actual TSSI is above this boundary, tx power needs to be | ||
2152 | * increased by (agc_step * 4) | ||
2153 | * AGC_STEP: Temperature compensation step. | ||
2154 | */ | ||
2155 | #define EEPROM_TSSI_BOUND_BG5 0x003b | ||
2156 | #define EEPROM_TSSI_BOUND_BG5_PLUS4 FIELD16(0x00ff) | ||
2157 | #define EEPROM_TSSI_BOUND_BG5_AGC_STEP FIELD16(0xff00) | ||
2158 | |||
2159 | /* | ||
2107 | * EEPROM TXPOWER 802.11A | 2160 | * EEPROM TXPOWER 802.11A |
2108 | */ | 2161 | */ |
2109 | #define EEPROM_TXPOWER_A1 0x003c | 2162 | #define EEPROM_TXPOWER_A1 0x003c |
@@ -2113,6 +2166,59 @@ struct mac_iveiv_entry { | |||
2113 | #define EEPROM_TXPOWER_A_2 FIELD16(0xff00) | 2166 | #define EEPROM_TXPOWER_A_2 FIELD16(0xff00) |
2114 | 2167 | ||
2115 | /* | 2168 | /* |
2169 | * EEPROM temperature compensation boundaries 802.11A | ||
2170 | * MINUS4: If the actual TSSI is below this boundary, tx power needs to be | ||
2171 | * reduced by (agc_step * -4) | ||
2172 | * MINUS3: If the actual TSSI is below this boundary, tx power needs to be | ||
2173 | * reduced by (agc_step * -3) | ||
2174 | */ | ||
2175 | #define EEPROM_TSSI_BOUND_A1 0x006a | ||
2176 | #define EEPROM_TSSI_BOUND_A1_MINUS4 FIELD16(0x00ff) | ||
2177 | #define EEPROM_TSSI_BOUND_A1_MINUS3 FIELD16(0xff00) | ||
2178 | |||
2179 | /* | ||
2180 | * EEPROM temperature compensation boundaries 802.11A | ||
2181 | * MINUS2: If the actual TSSI is below this boundary, tx power needs to be | ||
2182 | * reduced by (agc_step * -2) | ||
2183 | * MINUS1: If the actual TSSI is below this boundary, tx power needs to be | ||
2184 | * reduced by (agc_step * -1) | ||
2185 | */ | ||
2186 | #define EEPROM_TSSI_BOUND_A2 0x006b | ||
2187 | #define EEPROM_TSSI_BOUND_A2_MINUS2 FIELD16(0x00ff) | ||
2188 | #define EEPROM_TSSI_BOUND_A2_MINUS1 FIELD16(0xff00) | ||
2189 | |||
2190 | /* | ||
2191 | * EEPROM temperature compensation boundaries 802.11A | ||
2192 | * REF: Reference TSSI value, no tx power changes needed | ||
2193 | * PLUS1: If the actual TSSI is above this boundary, tx power needs to be | ||
2194 | * increased by (agc_step * 1) | ||
2195 | */ | ||
2196 | #define EEPROM_TSSI_BOUND_A3 0x006c | ||
2197 | #define EEPROM_TSSI_BOUND_A3_REF FIELD16(0x00ff) | ||
2198 | #define EEPROM_TSSI_BOUND_A3_PLUS1 FIELD16(0xff00) | ||
2199 | |||
2200 | /* | ||
2201 | * EEPROM temperature compensation boundaries 802.11A | ||
2202 | * PLUS2: If the actual TSSI is above this boundary, tx power needs to be | ||
2203 | * increased by (agc_step * 2) | ||
2204 | * PLUS3: If the actual TSSI is above this boundary, tx power needs to be | ||
2205 | * increased by (agc_step * 3) | ||
2206 | */ | ||
2207 | #define EEPROM_TSSI_BOUND_A4 0x006d | ||
2208 | #define EEPROM_TSSI_BOUND_A4_PLUS2 FIELD16(0x00ff) | ||
2209 | #define EEPROM_TSSI_BOUND_A4_PLUS3 FIELD16(0xff00) | ||
2210 | |||
2211 | /* | ||
2212 | * EEPROM temperature compensation boundaries 802.11A | ||
2213 | * PLUS4: If the actual TSSI is above this boundary, tx power needs to be | ||
2214 | * increased by (agc_step * 4) | ||
2215 | * AGC_STEP: Temperature compensation step. | ||
2216 | */ | ||
2217 | #define EEPROM_TSSI_BOUND_A5 0x006e | ||
2218 | #define EEPROM_TSSI_BOUND_A5_PLUS4 FIELD16(0x00ff) | ||
2219 | #define EEPROM_TSSI_BOUND_A5_AGC_STEP FIELD16(0xff00) | ||
2220 | |||
2221 | /* | ||
2116 | * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode | 2222 | * EEPROM TXPOWER by rate: tx power per tx rate for HT20 mode |
2117 | */ | 2223 | */ |
2118 | #define EEPROM_TXPOWER_BYRATE 0x006f | 2224 | #define EEPROM_TXPOWER_BYRATE 0x006f |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index dbf74d07d947..6331c61957a3 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -687,6 +687,9 @@ void rt2800_txdone_entry(struct queue_entry *entry, u32 status) | |||
687 | mcs = real_mcs; | 687 | mcs = real_mcs; |
688 | } | 688 | } |
689 | 689 | ||
690 | if (aggr == 1 || ampdu == 1) | ||
691 | __set_bit(TXDONE_AMPDU, &txdesc.flags); | ||
692 | |||
690 | /* | 693 | /* |
691 | * Ralink has a retry mechanism using a global fallback | 694 | * Ralink has a retry mechanism using a global fallback |
692 | * table. We setup this fallback table to try the immediate | 695 | * table. We setup this fallback table to try the immediate |
@@ -1813,17 +1816,131 @@ static void rt2800_config_channel(struct rt2x00_dev *rt2x00dev, | |||
1813 | rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC, ®); | 1816 | rt2800_register_read(rt2x00dev, CH_BUSY_STA_SEC, ®); |
1814 | } | 1817 | } |
1815 | 1818 | ||
1819 | static int rt2800_get_gain_calibration_delta(struct rt2x00_dev *rt2x00dev) | ||
1820 | { | ||
1821 | u8 tssi_bounds[9]; | ||
1822 | u8 current_tssi; | ||
1823 | u16 eeprom; | ||
1824 | u8 step; | ||
1825 | int i; | ||
1826 | |||
1827 | /* | ||
1828 | * Read TSSI boundaries for temperature compensation from | ||
1829 | * the EEPROM. | ||
1830 | * | ||
1831 | * Array idx 0 1 2 3 4 5 6 7 8 | ||
1832 | * Matching Delta value -4 -3 -2 -1 0 +1 +2 +3 +4 | ||
1833 | * Example TSSI bounds 0xF0 0xD0 0xB5 0xA0 0x88 0x45 0x25 0x15 0x00 | ||
1834 | */ | ||
1835 | if (rt2x00dev->curr_band == IEEE80211_BAND_2GHZ) { | ||
1836 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_BG1, &eeprom); | ||
1837 | tssi_bounds[0] = rt2x00_get_field16(eeprom, | ||
1838 | EEPROM_TSSI_BOUND_BG1_MINUS4); | ||
1839 | tssi_bounds[1] = rt2x00_get_field16(eeprom, | ||
1840 | EEPROM_TSSI_BOUND_BG1_MINUS3); | ||
1841 | |||
1842 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_BG2, &eeprom); | ||
1843 | tssi_bounds[2] = rt2x00_get_field16(eeprom, | ||
1844 | EEPROM_TSSI_BOUND_BG2_MINUS2); | ||
1845 | tssi_bounds[3] = rt2x00_get_field16(eeprom, | ||
1846 | EEPROM_TSSI_BOUND_BG2_MINUS1); | ||
1847 | |||
1848 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_BG3, &eeprom); | ||
1849 | tssi_bounds[4] = rt2x00_get_field16(eeprom, | ||
1850 | EEPROM_TSSI_BOUND_BG3_REF); | ||
1851 | tssi_bounds[5] = rt2x00_get_field16(eeprom, | ||
1852 | EEPROM_TSSI_BOUND_BG3_PLUS1); | ||
1853 | |||
1854 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_BG4, &eeprom); | ||
1855 | tssi_bounds[6] = rt2x00_get_field16(eeprom, | ||
1856 | EEPROM_TSSI_BOUND_BG4_PLUS2); | ||
1857 | tssi_bounds[7] = rt2x00_get_field16(eeprom, | ||
1858 | EEPROM_TSSI_BOUND_BG4_PLUS3); | ||
1859 | |||
1860 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_BG5, &eeprom); | ||
1861 | tssi_bounds[8] = rt2x00_get_field16(eeprom, | ||
1862 | EEPROM_TSSI_BOUND_BG5_PLUS4); | ||
1863 | |||
1864 | step = rt2x00_get_field16(eeprom, | ||
1865 | EEPROM_TSSI_BOUND_BG5_AGC_STEP); | ||
1866 | } else { | ||
1867 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_A1, &eeprom); | ||
1868 | tssi_bounds[0] = rt2x00_get_field16(eeprom, | ||
1869 | EEPROM_TSSI_BOUND_A1_MINUS4); | ||
1870 | tssi_bounds[1] = rt2x00_get_field16(eeprom, | ||
1871 | EEPROM_TSSI_BOUND_A1_MINUS3); | ||
1872 | |||
1873 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_A2, &eeprom); | ||
1874 | tssi_bounds[2] = rt2x00_get_field16(eeprom, | ||
1875 | EEPROM_TSSI_BOUND_A2_MINUS2); | ||
1876 | tssi_bounds[3] = rt2x00_get_field16(eeprom, | ||
1877 | EEPROM_TSSI_BOUND_A2_MINUS1); | ||
1878 | |||
1879 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_A3, &eeprom); | ||
1880 | tssi_bounds[4] = rt2x00_get_field16(eeprom, | ||
1881 | EEPROM_TSSI_BOUND_A3_REF); | ||
1882 | tssi_bounds[5] = rt2x00_get_field16(eeprom, | ||
1883 | EEPROM_TSSI_BOUND_A3_PLUS1); | ||
1884 | |||
1885 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_A4, &eeprom); | ||
1886 | tssi_bounds[6] = rt2x00_get_field16(eeprom, | ||
1887 | EEPROM_TSSI_BOUND_A4_PLUS2); | ||
1888 | tssi_bounds[7] = rt2x00_get_field16(eeprom, | ||
1889 | EEPROM_TSSI_BOUND_A4_PLUS3); | ||
1890 | |||
1891 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TSSI_BOUND_A5, &eeprom); | ||
1892 | tssi_bounds[8] = rt2x00_get_field16(eeprom, | ||
1893 | EEPROM_TSSI_BOUND_A5_PLUS4); | ||
1894 | |||
1895 | step = rt2x00_get_field16(eeprom, | ||
1896 | EEPROM_TSSI_BOUND_A5_AGC_STEP); | ||
1897 | } | ||
1898 | |||
1899 | /* | ||
1900 | * Check if temperature compensation is supported. | ||
1901 | */ | ||
1902 | if (tssi_bounds[4] == 0xff) | ||
1903 | return 0; | ||
1904 | |||
1905 | /* | ||
1906 | * Read current TSSI (BBP 49). | ||
1907 | */ | ||
1908 | rt2800_bbp_read(rt2x00dev, 49, ¤t_tssi); | ||
1909 | |||
1910 | /* | ||
1911 | * Compare TSSI value (BBP49) with the compensation boundaries | ||
1912 | * from the EEPROM and increase or decrease tx power. | ||
1913 | */ | ||
1914 | for (i = 0; i <= 3; i++) { | ||
1915 | if (current_tssi > tssi_bounds[i]) | ||
1916 | break; | ||
1917 | } | ||
1918 | |||
1919 | if (i == 4) { | ||
1920 | for (i = 8; i >= 5; i--) { | ||
1921 | if (current_tssi < tssi_bounds[i]) | ||
1922 | break; | ||
1923 | } | ||
1924 | } | ||
1925 | |||
1926 | return (i - 4) * step; | ||
1927 | } | ||
1928 | |||
1816 | static int rt2800_get_txpower_bw_comp(struct rt2x00_dev *rt2x00dev, | 1929 | static int rt2800_get_txpower_bw_comp(struct rt2x00_dev *rt2x00dev, |
1817 | enum ieee80211_band band) | 1930 | enum ieee80211_band band) |
1818 | { | 1931 | { |
1819 | u16 eeprom; | 1932 | u16 eeprom; |
1820 | u8 comp_en; | 1933 | u8 comp_en; |
1821 | u8 comp_type; | 1934 | u8 comp_type; |
1822 | int comp_value; | 1935 | int comp_value = 0; |
1823 | 1936 | ||
1824 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TXPOWER_DELTA, &eeprom); | 1937 | rt2x00_eeprom_read(rt2x00dev, EEPROM_TXPOWER_DELTA, &eeprom); |
1825 | 1938 | ||
1826 | if (eeprom == 0xffff) | 1939 | /* |
1940 | * HT40 compensation not required. | ||
1941 | */ | ||
1942 | if (eeprom == 0xffff || | ||
1943 | !test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)) | ||
1827 | return 0; | 1944 | return 0; |
1828 | 1945 | ||
1829 | if (band == IEEE80211_BAND_2GHZ) { | 1946 | if (band == IEEE80211_BAND_2GHZ) { |
@@ -1853,11 +1970,9 @@ static int rt2800_get_txpower_bw_comp(struct rt2x00_dev *rt2x00dev, | |||
1853 | return comp_value; | 1970 | return comp_value; |
1854 | } | 1971 | } |
1855 | 1972 | ||
1856 | static u8 rt2800_compesate_txpower(struct rt2x00_dev *rt2x00dev, | 1973 | static u8 rt2800_compensate_txpower(struct rt2x00_dev *rt2x00dev, int is_rate_b, |
1857 | int is_rate_b, | 1974 | enum ieee80211_band band, int power_level, |
1858 | enum ieee80211_band band, | 1975 | u8 txpower, int delta) |
1859 | int power_level, | ||
1860 | u8 txpower) | ||
1861 | { | 1976 | { |
1862 | u32 reg; | 1977 | u32 reg; |
1863 | u16 eeprom; | 1978 | u16 eeprom; |
@@ -1865,14 +1980,10 @@ static u8 rt2800_compesate_txpower(struct rt2x00_dev *rt2x00dev, | |||
1865 | u8 eirp_txpower; | 1980 | u8 eirp_txpower; |
1866 | u8 eirp_txpower_criterion; | 1981 | u8 eirp_txpower_criterion; |
1867 | u8 reg_limit; | 1982 | u8 reg_limit; |
1868 | int bw_comp = 0; | ||
1869 | 1983 | ||
1870 | if (!((band == IEEE80211_BAND_5GHZ) && is_rate_b)) | 1984 | if (!((band == IEEE80211_BAND_5GHZ) && is_rate_b)) |
1871 | return txpower; | 1985 | return txpower; |
1872 | 1986 | ||
1873 | if (test_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags)) | ||
1874 | bw_comp = rt2800_get_txpower_bw_comp(rt2x00dev, band); | ||
1875 | |||
1876 | if (test_bit(CONFIG_SUPPORT_POWER_LIMIT, &rt2x00dev->flags)) { | 1987 | if (test_bit(CONFIG_SUPPORT_POWER_LIMIT, &rt2x00dev->flags)) { |
1877 | /* | 1988 | /* |
1878 | * Check if eirp txpower exceed txpower_limit. | 1989 | * Check if eirp txpower exceed txpower_limit. |
@@ -1895,18 +2006,19 @@ static u8 rt2800_compesate_txpower(struct rt2x00_dev *rt2x00dev, | |||
1895 | EEPROM_EIRP_MAX_TX_POWER_5GHZ); | 2006 | EEPROM_EIRP_MAX_TX_POWER_5GHZ); |
1896 | 2007 | ||
1897 | eirp_txpower = eirp_txpower_criterion + (txpower - criterion) + | 2008 | eirp_txpower = eirp_txpower_criterion + (txpower - criterion) + |
1898 | (is_rate_b ? 4 : 0) + bw_comp; | 2009 | (is_rate_b ? 4 : 0) + delta; |
1899 | 2010 | ||
1900 | reg_limit = (eirp_txpower > power_level) ? | 2011 | reg_limit = (eirp_txpower > power_level) ? |
1901 | (eirp_txpower - power_level) : 0; | 2012 | (eirp_txpower - power_level) : 0; |
1902 | } else | 2013 | } else |
1903 | reg_limit = 0; | 2014 | reg_limit = 0; |
1904 | 2015 | ||
1905 | return txpower + bw_comp - reg_limit; | 2016 | return txpower + delta - reg_limit; |
1906 | } | 2017 | } |
1907 | 2018 | ||
1908 | static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | 2019 | static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, |
1909 | struct ieee80211_conf *conf) | 2020 | enum ieee80211_band band, |
2021 | int power_level) | ||
1910 | { | 2022 | { |
1911 | u8 txpower; | 2023 | u8 txpower; |
1912 | u16 eeprom; | 2024 | u16 eeprom; |
@@ -1914,8 +2026,17 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
1914 | u32 reg; | 2026 | u32 reg; |
1915 | u8 r1; | 2027 | u8 r1; |
1916 | u32 offset; | 2028 | u32 offset; |
1917 | enum ieee80211_band band = conf->channel->band; | 2029 | int delta; |
1918 | int power_level = conf->power_level; | 2030 | |
2031 | /* | ||
2032 | * Calculate HT40 compensation delta | ||
2033 | */ | ||
2034 | delta = rt2800_get_txpower_bw_comp(rt2x00dev, band); | ||
2035 | |||
2036 | /* | ||
2037 | * calculate temperature compensation delta | ||
2038 | */ | ||
2039 | delta += rt2800_get_gain_calibration_delta(rt2x00dev); | ||
1919 | 2040 | ||
1920 | /* | 2041 | /* |
1921 | * set to normal bbp tx power control mode: +/- 0dBm | 2042 | * set to normal bbp tx power control mode: +/- 0dBm |
@@ -1944,8 +2065,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
1944 | */ | 2065 | */ |
1945 | txpower = rt2x00_get_field16(eeprom, | 2066 | txpower = rt2x00_get_field16(eeprom, |
1946 | EEPROM_TXPOWER_BYRATE_RATE0); | 2067 | EEPROM_TXPOWER_BYRATE_RATE0); |
1947 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2068 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
1948 | power_level, txpower); | 2069 | power_level, txpower, delta); |
1949 | rt2x00_set_field32(®, TX_PWR_CFG_RATE0, txpower); | 2070 | rt2x00_set_field32(®, TX_PWR_CFG_RATE0, txpower); |
1950 | 2071 | ||
1951 | /* | 2072 | /* |
@@ -1955,8 +2076,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
1955 | */ | 2076 | */ |
1956 | txpower = rt2x00_get_field16(eeprom, | 2077 | txpower = rt2x00_get_field16(eeprom, |
1957 | EEPROM_TXPOWER_BYRATE_RATE1); | 2078 | EEPROM_TXPOWER_BYRATE_RATE1); |
1958 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2079 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
1959 | power_level, txpower); | 2080 | power_level, txpower, delta); |
1960 | rt2x00_set_field32(®, TX_PWR_CFG_RATE1, txpower); | 2081 | rt2x00_set_field32(®, TX_PWR_CFG_RATE1, txpower); |
1961 | 2082 | ||
1962 | /* | 2083 | /* |
@@ -1966,8 +2087,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
1966 | */ | 2087 | */ |
1967 | txpower = rt2x00_get_field16(eeprom, | 2088 | txpower = rt2x00_get_field16(eeprom, |
1968 | EEPROM_TXPOWER_BYRATE_RATE2); | 2089 | EEPROM_TXPOWER_BYRATE_RATE2); |
1969 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2090 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
1970 | power_level, txpower); | 2091 | power_level, txpower, delta); |
1971 | rt2x00_set_field32(®, TX_PWR_CFG_RATE2, txpower); | 2092 | rt2x00_set_field32(®, TX_PWR_CFG_RATE2, txpower); |
1972 | 2093 | ||
1973 | /* | 2094 | /* |
@@ -1977,8 +2098,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
1977 | */ | 2098 | */ |
1978 | txpower = rt2x00_get_field16(eeprom, | 2099 | txpower = rt2x00_get_field16(eeprom, |
1979 | EEPROM_TXPOWER_BYRATE_RATE3); | 2100 | EEPROM_TXPOWER_BYRATE_RATE3); |
1980 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2101 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
1981 | power_level, txpower); | 2102 | power_level, txpower, delta); |
1982 | rt2x00_set_field32(®, TX_PWR_CFG_RATE3, txpower); | 2103 | rt2x00_set_field32(®, TX_PWR_CFG_RATE3, txpower); |
1983 | 2104 | ||
1984 | /* read the next four txpower values */ | 2105 | /* read the next four txpower values */ |
@@ -1993,8 +2114,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
1993 | */ | 2114 | */ |
1994 | txpower = rt2x00_get_field16(eeprom, | 2115 | txpower = rt2x00_get_field16(eeprom, |
1995 | EEPROM_TXPOWER_BYRATE_RATE0); | 2116 | EEPROM_TXPOWER_BYRATE_RATE0); |
1996 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2117 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
1997 | power_level, txpower); | 2118 | power_level, txpower, delta); |
1998 | rt2x00_set_field32(®, TX_PWR_CFG_RATE4, txpower); | 2119 | rt2x00_set_field32(®, TX_PWR_CFG_RATE4, txpower); |
1999 | 2120 | ||
2000 | /* | 2121 | /* |
@@ -2004,8 +2125,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
2004 | */ | 2125 | */ |
2005 | txpower = rt2x00_get_field16(eeprom, | 2126 | txpower = rt2x00_get_field16(eeprom, |
2006 | EEPROM_TXPOWER_BYRATE_RATE1); | 2127 | EEPROM_TXPOWER_BYRATE_RATE1); |
2007 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2128 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
2008 | power_level, txpower); | 2129 | power_level, txpower, delta); |
2009 | rt2x00_set_field32(®, TX_PWR_CFG_RATE5, txpower); | 2130 | rt2x00_set_field32(®, TX_PWR_CFG_RATE5, txpower); |
2010 | 2131 | ||
2011 | /* | 2132 | /* |
@@ -2015,8 +2136,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
2015 | */ | 2136 | */ |
2016 | txpower = rt2x00_get_field16(eeprom, | 2137 | txpower = rt2x00_get_field16(eeprom, |
2017 | EEPROM_TXPOWER_BYRATE_RATE2); | 2138 | EEPROM_TXPOWER_BYRATE_RATE2); |
2018 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2139 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
2019 | power_level, txpower); | 2140 | power_level, txpower, delta); |
2020 | rt2x00_set_field32(®, TX_PWR_CFG_RATE6, txpower); | 2141 | rt2x00_set_field32(®, TX_PWR_CFG_RATE6, txpower); |
2021 | 2142 | ||
2022 | /* | 2143 | /* |
@@ -2026,8 +2147,8 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
2026 | */ | 2147 | */ |
2027 | txpower = rt2x00_get_field16(eeprom, | 2148 | txpower = rt2x00_get_field16(eeprom, |
2028 | EEPROM_TXPOWER_BYRATE_RATE3); | 2149 | EEPROM_TXPOWER_BYRATE_RATE3); |
2029 | txpower = rt2800_compesate_txpower(rt2x00dev, is_rate_b, band, | 2150 | txpower = rt2800_compensate_txpower(rt2x00dev, is_rate_b, band, |
2030 | power_level, txpower); | 2151 | power_level, txpower, delta); |
2031 | rt2x00_set_field32(®, TX_PWR_CFG_RATE7, txpower); | 2152 | rt2x00_set_field32(®, TX_PWR_CFG_RATE7, txpower); |
2032 | 2153 | ||
2033 | rt2800_register_write(rt2x00dev, offset, reg); | 2154 | rt2800_register_write(rt2x00dev, offset, reg); |
@@ -2037,6 +2158,13 @@ static void rt2800_config_txpower(struct rt2x00_dev *rt2x00dev, | |||
2037 | } | 2158 | } |
2038 | } | 2159 | } |
2039 | 2160 | ||
2161 | void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev) | ||
2162 | { | ||
2163 | rt2800_config_txpower(rt2x00dev, rt2x00dev->curr_band, | ||
2164 | rt2x00dev->tx_power); | ||
2165 | } | ||
2166 | EXPORT_SYMBOL_GPL(rt2800_gain_calibration); | ||
2167 | |||
2040 | static void rt2800_config_retry_limit(struct rt2x00_dev *rt2x00dev, | 2168 | static void rt2800_config_retry_limit(struct rt2x00_dev *rt2x00dev, |
2041 | struct rt2x00lib_conf *libconf) | 2169 | struct rt2x00lib_conf *libconf) |
2042 | { | 2170 | { |
@@ -2090,10 +2218,12 @@ void rt2800_config(struct rt2x00_dev *rt2x00dev, | |||
2090 | if (flags & IEEE80211_CONF_CHANGE_CHANNEL) { | 2218 | if (flags & IEEE80211_CONF_CHANGE_CHANNEL) { |
2091 | rt2800_config_channel(rt2x00dev, libconf->conf, | 2219 | rt2800_config_channel(rt2x00dev, libconf->conf, |
2092 | &libconf->rf, &libconf->channel); | 2220 | &libconf->rf, &libconf->channel); |
2093 | rt2800_config_txpower(rt2x00dev, libconf->conf); | 2221 | rt2800_config_txpower(rt2x00dev, libconf->conf->channel->band, |
2222 | libconf->conf->power_level); | ||
2094 | } | 2223 | } |
2095 | if (flags & IEEE80211_CONF_CHANGE_POWER) | 2224 | if (flags & IEEE80211_CONF_CHANGE_POWER) |
2096 | rt2800_config_txpower(rt2x00dev, libconf->conf); | 2225 | rt2800_config_txpower(rt2x00dev, libconf->conf->channel->band, |
2226 | libconf->conf->power_level); | ||
2097 | if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) | 2227 | if (flags & IEEE80211_CONF_CHANGE_RETRY_LIMITS) |
2098 | rt2800_config_retry_limit(rt2x00dev, libconf); | 2228 | rt2800_config_retry_limit(rt2x00dev, libconf); |
2099 | if (flags & IEEE80211_CONF_CHANGE_PS) | 2229 | if (flags & IEEE80211_CONF_CHANGE_PS) |
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.h b/drivers/net/wireless/rt2x00/rt2800lib.h index 0c92d86a36f4..f2d15941c71a 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.h +++ b/drivers/net/wireless/rt2x00/rt2800lib.h | |||
@@ -181,6 +181,7 @@ void rt2800_link_stats(struct rt2x00_dev *rt2x00dev, struct link_qual *qual); | |||
181 | void rt2800_reset_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual); | 181 | void rt2800_reset_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual); |
182 | void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, | 182 | void rt2800_link_tuner(struct rt2x00_dev *rt2x00dev, struct link_qual *qual, |
183 | const u32 count); | 183 | const u32 count); |
184 | void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev); | ||
184 | 185 | ||
185 | int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev); | 186 | int rt2800_enable_radio(struct rt2x00_dev *rt2x00dev); |
186 | void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev); | 187 | void rt2800_disable_radio(struct rt2x00_dev *rt2x00dev); |
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 808073aa9dcc..adc3534254df 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c | |||
@@ -717,12 +717,13 @@ static void rt2800pci_wakeup(struct rt2x00_dev *rt2x00dev) | |||
717 | rt2800_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS); | 717 | rt2800_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS); |
718 | } | 718 | } |
719 | 719 | ||
720 | static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) | 720 | static bool rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) |
721 | { | 721 | { |
722 | struct data_queue *queue; | 722 | struct data_queue *queue; |
723 | struct queue_entry *entry; | 723 | struct queue_entry *entry; |
724 | u32 status; | 724 | u32 status; |
725 | u8 qid; | 725 | u8 qid; |
726 | int max_tx_done = 16; | ||
726 | 727 | ||
727 | while (kfifo_get(&rt2x00dev->txstatus_fifo, &status)) { | 728 | while (kfifo_get(&rt2x00dev->txstatus_fifo, &status)) { |
728 | qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_QUEUE); | 729 | qid = rt2x00_get_field32(status, TX_STA_FIFO_PID_QUEUE); |
@@ -759,7 +760,12 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) | |||
759 | 760 | ||
760 | entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); | 761 | entry = rt2x00queue_get_entry(queue, Q_INDEX_DONE); |
761 | rt2800_txdone_entry(entry, status); | 762 | rt2800_txdone_entry(entry, status); |
763 | |||
764 | if (--max_tx_done == 0) | ||
765 | break; | ||
762 | } | 766 | } |
767 | |||
768 | return !max_tx_done; | ||
763 | } | 769 | } |
764 | 770 | ||
765 | static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, | 771 | static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, |
@@ -780,7 +786,9 @@ static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, | |||
780 | 786 | ||
781 | static void rt2800pci_txstatus_tasklet(unsigned long data) | 787 | static void rt2800pci_txstatus_tasklet(unsigned long data) |
782 | { | 788 | { |
783 | rt2800pci_txdone((struct rt2x00_dev *)data); | 789 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; |
790 | if (rt2800pci_txdone(rt2x00dev)) | ||
791 | tasklet_schedule(&rt2x00dev->txstatus_tasklet); | ||
784 | 792 | ||
785 | /* | 793 | /* |
786 | * No need to enable the tx status interrupt here as we always | 794 | * No need to enable the tx status interrupt here as we always |
@@ -806,8 +814,10 @@ static void rt2800pci_tbtt_tasklet(unsigned long data) | |||
806 | static void rt2800pci_rxdone_tasklet(unsigned long data) | 814 | static void rt2800pci_rxdone_tasklet(unsigned long data) |
807 | { | 815 | { |
808 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; | 816 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; |
809 | rt2x00pci_rxdone(rt2x00dev); | 817 | if (rt2x00pci_rxdone(rt2x00dev)) |
810 | rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE); | 818 | tasklet_schedule(&rt2x00dev->rxdone_tasklet); |
819 | else | ||
820 | rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE); | ||
811 | } | 821 | } |
812 | 822 | ||
813 | static void rt2800pci_autowake_tasklet(unsigned long data) | 823 | static void rt2800pci_autowake_tasklet(unsigned long data) |
@@ -1043,6 +1053,7 @@ static const struct rt2x00lib_ops rt2800pci_rt2x00_ops = { | |||
1043 | .link_stats = rt2800_link_stats, | 1053 | .link_stats = rt2800_link_stats, |
1044 | .reset_tuner = rt2800_reset_tuner, | 1054 | .reset_tuner = rt2800_reset_tuner, |
1045 | .link_tuner = rt2800_link_tuner, | 1055 | .link_tuner = rt2800_link_tuner, |
1056 | .gain_calibration = rt2800_gain_calibration, | ||
1046 | .start_queue = rt2800pci_start_queue, | 1057 | .start_queue = rt2800pci_start_queue, |
1047 | .kick_queue = rt2800pci_kick_queue, | 1058 | .kick_queue = rt2800pci_kick_queue, |
1048 | .stop_queue = rt2800pci_stop_queue, | 1059 | .stop_queue = rt2800pci_stop_queue, |
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c index 37509d019910..6ba31a0e8f78 100644 --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c | |||
@@ -564,7 +564,6 @@ static int rt2800usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
564 | if (!modparam_nohwcrypt) | 564 | if (!modparam_nohwcrypt) |
565 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); | 565 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); |
566 | __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); | 566 | __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); |
567 | __set_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags); | ||
568 | __set_bit(DRIVER_REQUIRE_HT_TX_DESC, &rt2x00dev->flags); | 567 | __set_bit(DRIVER_REQUIRE_HT_TX_DESC, &rt2x00dev->flags); |
569 | 568 | ||
570 | /* | 569 | /* |
@@ -630,6 +629,7 @@ static const struct rt2x00lib_ops rt2800usb_rt2x00_ops = { | |||
630 | .link_stats = rt2800_link_stats, | 629 | .link_stats = rt2800_link_stats, |
631 | .reset_tuner = rt2800_reset_tuner, | 630 | .reset_tuner = rt2800_reset_tuner, |
632 | .link_tuner = rt2800_link_tuner, | 631 | .link_tuner = rt2800_link_tuner, |
632 | .gain_calibration = rt2800_gain_calibration, | ||
633 | .watchdog = rt2800usb_watchdog, | 633 | .watchdog = rt2800usb_watchdog, |
634 | .start_queue = rt2800usb_start_queue, | 634 | .start_queue = rt2800usb_start_queue, |
635 | .kick_queue = rt2x00usb_kick_queue, | 635 | .kick_queue = rt2x00usb_kick_queue, |
@@ -882,6 +882,7 @@ static struct usb_device_id rt2800usb_device_table[] = { | |||
882 | { USB_DEVICE(0x5a57, 0x5257), USB_DEVICE_DATA(&rt2800usb_ops) }, | 882 | { USB_DEVICE(0x5a57, 0x5257), USB_DEVICE_DATA(&rt2800usb_ops) }, |
883 | /* Zyxel */ | 883 | /* Zyxel */ |
884 | { USB_DEVICE(0x0586, 0x3416), USB_DEVICE_DATA(&rt2800usb_ops) }, | 884 | { USB_DEVICE(0x0586, 0x3416), USB_DEVICE_DATA(&rt2800usb_ops) }, |
885 | { USB_DEVICE(0x0586, 0x3418), USB_DEVICE_DATA(&rt2800usb_ops) }, | ||
885 | #ifdef CONFIG_RT2800USB_RT33XX | 886 | #ifdef CONFIG_RT2800USB_RT33XX |
886 | /* Ralink */ | 887 | /* Ralink */ |
887 | { USB_DEVICE(0x148f, 0x3370), USB_DEVICE_DATA(&rt2800usb_ops) }, | 888 | { USB_DEVICE(0x148f, 0x3370), USB_DEVICE_DATA(&rt2800usb_ops) }, |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 7f10239f56a8..a2bd5feb9d5c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -348,6 +348,11 @@ struct link { | |||
348 | * to bring the device/driver back into the desired state. | 348 | * to bring the device/driver back into the desired state. |
349 | */ | 349 | */ |
350 | struct delayed_work watchdog_work; | 350 | struct delayed_work watchdog_work; |
351 | |||
352 | /* | ||
353 | * Work structure for scheduling periodic AGC adjustments. | ||
354 | */ | ||
355 | struct delayed_work agc_work; | ||
351 | }; | 356 | }; |
352 | 357 | ||
353 | enum rt2x00_delayed_flags { | 358 | enum rt2x00_delayed_flags { |
@@ -556,6 +561,7 @@ struct rt2x00lib_ops { | |||
556 | struct link_qual *qual); | 561 | struct link_qual *qual); |
557 | void (*link_tuner) (struct rt2x00_dev *rt2x00dev, | 562 | void (*link_tuner) (struct rt2x00_dev *rt2x00dev, |
558 | struct link_qual *qual, const u32 count); | 563 | struct link_qual *qual, const u32 count); |
564 | void (*gain_calibration) (struct rt2x00_dev *rt2x00dev); | ||
559 | 565 | ||
560 | /* | 566 | /* |
561 | * Data queue handlers. | 567 | * Data queue handlers. |
@@ -674,7 +680,6 @@ enum rt2x00_flags { | |||
674 | DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, | 680 | DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, |
675 | DRIVER_SUPPORT_PRE_TBTT_INTERRUPT, | 681 | DRIVER_SUPPORT_PRE_TBTT_INTERRUPT, |
676 | DRIVER_SUPPORT_LINK_TUNING, | 682 | DRIVER_SUPPORT_LINK_TUNING, |
677 | DRIVER_SUPPORT_WATCHDOG, | ||
678 | 683 | ||
679 | /* | 684 | /* |
680 | * Driver configuration | 685 | * Driver configuration |
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c index c92db3264741..66166ef037f5 100644 --- a/drivers/net/wireless/rt2x00/rt2x00debug.c +++ b/drivers/net/wireless/rt2x00/rt2x00debug.c | |||
@@ -568,7 +568,6 @@ static struct dentry *rt2x00debug_create_file_driver(const char *name, | |||
568 | blob->data = data; | 568 | blob->data = data; |
569 | data += sprintf(data, "driver:\t%s\n", intf->rt2x00dev->ops->name); | 569 | data += sprintf(data, "driver:\t%s\n", intf->rt2x00dev->ops->name); |
570 | data += sprintf(data, "version:\t%s\n", DRV_VERSION); | 570 | data += sprintf(data, "version:\t%s\n", DRV_VERSION); |
571 | data += sprintf(data, "compiled:\t%s %s\n", __DATE__, __TIME__); | ||
572 | blob->size = strlen(blob->data); | 571 | blob->size = strlen(blob->data); |
573 | 572 | ||
574 | return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob); | 573 | return debugfs_create_blob(name, S_IRUSR, intf->driver_folder, blob); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 84eb6ad36377..9bffe8438d1f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
30 | #include <linux/log2.h> | ||
30 | 31 | ||
31 | #include "rt2x00.h" | 32 | #include "rt2x00.h" |
32 | #include "rt2x00lib.h" | 33 | #include "rt2x00lib.h" |
@@ -70,6 +71,7 @@ int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev) | |||
70 | */ | 71 | */ |
71 | rt2x00queue_start_queues(rt2x00dev); | 72 | rt2x00queue_start_queues(rt2x00dev); |
72 | rt2x00link_start_tuner(rt2x00dev); | 73 | rt2x00link_start_tuner(rt2x00dev); |
74 | rt2x00link_start_agc(rt2x00dev); | ||
73 | 75 | ||
74 | /* | 76 | /* |
75 | * Start watchdog monitoring. | 77 | * Start watchdog monitoring. |
@@ -92,6 +94,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev) | |||
92 | /* | 94 | /* |
93 | * Stop all queues | 95 | * Stop all queues |
94 | */ | 96 | */ |
97 | rt2x00link_stop_agc(rt2x00dev); | ||
95 | rt2x00link_stop_tuner(rt2x00dev); | 98 | rt2x00link_stop_tuner(rt2x00dev); |
96 | rt2x00queue_stop_queues(rt2x00dev); | 99 | rt2x00queue_stop_queues(rt2x00dev); |
97 | rt2x00queue_flush_queues(rt2x00dev, true); | 100 | rt2x00queue_flush_queues(rt2x00dev, true); |
@@ -350,10 +353,14 @@ void rt2x00lib_txdone(struct queue_entry *entry, | |||
350 | * which would allow the rc algorithm to better decide on | 353 | * which would allow the rc algorithm to better decide on |
351 | * which rates are suitable. | 354 | * which rates are suitable. |
352 | */ | 355 | */ |
353 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { | 356 | if (test_bit(TXDONE_AMPDU, &txdesc->flags) || |
357 | tx_info->flags & IEEE80211_TX_CTL_AMPDU) { | ||
354 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU; | 358 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU; |
355 | tx_info->status.ampdu_len = 1; | 359 | tx_info->status.ampdu_len = 1; |
356 | tx_info->status.ampdu_ack_len = success ? 1 : 0; | 360 | tx_info->status.ampdu_ack_len = success ? 1 : 0; |
361 | |||
362 | if (!success) | ||
363 | tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; | ||
357 | } | 364 | } |
358 | 365 | ||
359 | if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) { | 366 | if (rate_flags & IEEE80211_TX_RC_USE_RTS_CTS) { |
@@ -511,8 +518,6 @@ void rt2x00lib_rxdone(struct queue_entry *entry) | |||
511 | (rxdesc.size > header_length) && | 518 | (rxdesc.size > header_length) && |
512 | (rxdesc.dev_flags & RXDONE_L2PAD)) | 519 | (rxdesc.dev_flags & RXDONE_L2PAD)) |
513 | rt2x00queue_remove_l2pad(entry->skb, header_length); | 520 | rt2x00queue_remove_l2pad(entry->skb, header_length); |
514 | else | ||
515 | rt2x00queue_align_payload(entry->skb, header_length); | ||
516 | 521 | ||
517 | /* Trim buffer to correct size */ | 522 | /* Trim buffer to correct size */ |
518 | skb_trim(entry->skb, rxdesc.size); | 523 | skb_trim(entry->skb, rxdesc.size); |
@@ -811,13 +816,18 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
811 | */ | 816 | */ |
812 | if (test_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags)) { | 817 | if (test_bit(DRIVER_REQUIRE_TXSTATUS_FIFO, &rt2x00dev->flags)) { |
813 | /* | 818 | /* |
814 | * Allocate txstatus fifo and tasklet, we use a size of 512 | 819 | * Allocate the txstatus fifo. In the worst case the tx |
815 | * for the kfifo which is big enough to store 512/4=128 tx | 820 | * status fifo has to hold the tx status of all entries |
816 | * status reports. In the worst case (tx status for all tx | 821 | * in all tx queues. Hence, calculate the kfifo size as |
817 | * queues gets reported before we've got a chance to handle | 822 | * tx_queues * entry_num and round up to the nearest |
818 | * them) 24*4=384 tx status reports need to be cached. | 823 | * power of 2. |
819 | */ | 824 | */ |
820 | status = kfifo_alloc(&rt2x00dev->txstatus_fifo, 512, | 825 | int kfifo_size = |
826 | roundup_pow_of_two(rt2x00dev->ops->tx_queues * | ||
827 | rt2x00dev->ops->tx->entry_num * | ||
828 | sizeof(u32)); | ||
829 | |||
830 | status = kfifo_alloc(&rt2x00dev->txstatus_fifo, kfifo_size, | ||
821 | GFP_KERNEL); | 831 | GFP_KERNEL); |
822 | if (status) | 832 | if (status) |
823 | return status; | 833 | return status; |
diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c index ae1219dffaae..e8c0c3e92c2f 100644 --- a/drivers/net/wireless/rt2x00/rt2x00ht.c +++ b/drivers/net/wireless/rt2x00/rt2x00ht.c | |||
@@ -43,8 +43,11 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
43 | 43 | ||
44 | txdesc->u.ht.ba_size = 7; /* FIXME: What value is needed? */ | 44 | txdesc->u.ht.ba_size = 7; /* FIXME: What value is needed? */ |
45 | 45 | ||
46 | txdesc->u.ht.stbc = | 46 | /* |
47 | (tx_info->flags & IEEE80211_TX_CTL_STBC) >> IEEE80211_TX_CTL_STBC_SHIFT; | 47 | * Only one STBC stream is supported for now. |
48 | */ | ||
49 | if (tx_info->flags & IEEE80211_TX_CTL_STBC) | ||
50 | txdesc->u.ht.stbc = 1; | ||
48 | 51 | ||
49 | /* | 52 | /* |
50 | * If IEEE80211_TX_RC_MCS is set txrate->idx just contains the | 53 | * If IEEE80211_TX_RC_MCS is set txrate->idx just contains the |
diff --git a/drivers/net/wireless/rt2x00/rt2x00lib.h b/drivers/net/wireless/rt2x00/rt2x00lib.h index 2d94cbaf5f4a..88f2f9275528 100644 --- a/drivers/net/wireless/rt2x00/rt2x00lib.h +++ b/drivers/net/wireless/rt2x00/rt2x00lib.h | |||
@@ -32,6 +32,7 @@ | |||
32 | */ | 32 | */ |
33 | #define WATCHDOG_INTERVAL round_jiffies_relative(HZ) | 33 | #define WATCHDOG_INTERVAL round_jiffies_relative(HZ) |
34 | #define LINK_TUNE_INTERVAL round_jiffies_relative(HZ) | 34 | #define LINK_TUNE_INTERVAL round_jiffies_relative(HZ) |
35 | #define AGC_INTERVAL round_jiffies_relative(4 * HZ) | ||
35 | 36 | ||
36 | /* | 37 | /* |
37 | * rt2x00_rate: Per rate device information | 38 | * rt2x00_rate: Per rate device information |
@@ -119,16 +120,6 @@ void rt2x00queue_free_skb(struct queue_entry *entry); | |||
119 | void rt2x00queue_align_frame(struct sk_buff *skb); | 120 | void rt2x00queue_align_frame(struct sk_buff *skb); |
120 | 121 | ||
121 | /** | 122 | /** |
122 | * rt2x00queue_align_payload - Align 802.11 payload to 4-byte boundary | ||
123 | * @skb: The skb to align | ||
124 | * @header_length: Length of 802.11 header | ||
125 | * | ||
126 | * Align the 802.11 payload to a 4-byte boundary, this could | ||
127 | * mean the header is not aligned properly though. | ||
128 | */ | ||
129 | void rt2x00queue_align_payload(struct sk_buff *skb, unsigned int header_length); | ||
130 | |||
131 | /** | ||
132 | * rt2x00queue_insert_l2pad - Align 802.11 header & payload to 4-byte boundary | 123 | * rt2x00queue_insert_l2pad - Align 802.11 header & payload to 4-byte boundary |
133 | * @skb: The skb to align | 124 | * @skb: The skb to align |
134 | * @header_length: Length of 802.11 header | 125 | * @header_length: Length of 802.11 header |
@@ -281,6 +272,18 @@ void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev); | |||
281 | void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev); | 272 | void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev); |
282 | 273 | ||
283 | /** | 274 | /** |
275 | * rt2x00link_start_agc - Start periodic gain calibration | ||
276 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
277 | */ | ||
278 | void rt2x00link_start_agc(struct rt2x00_dev *rt2x00dev); | ||
279 | |||
280 | /** | ||
281 | * rt2x00link_stop_agc - Stop periodic gain calibration | ||
282 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | ||
283 | */ | ||
284 | void rt2x00link_stop_agc(struct rt2x00_dev *rt2x00dev); | ||
285 | |||
286 | /** | ||
284 | * rt2x00link_register - Initialize link tuning & watchdog functionality | 287 | * rt2x00link_register - Initialize link tuning & watchdog functionality |
285 | * @rt2x00dev: Pointer to &struct rt2x00_dev. | 288 | * @rt2x00dev: Pointer to &struct rt2x00_dev. |
286 | * | 289 | * |
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c index 29abfdeb0b65..1435976b8779 100644 --- a/drivers/net/wireless/rt2x00/rt2x00link.c +++ b/drivers/net/wireless/rt2x00/rt2x00link.c | |||
@@ -413,12 +413,11 @@ void rt2x00link_start_watchdog(struct rt2x00_dev *rt2x00dev) | |||
413 | { | 413 | { |
414 | struct link *link = &rt2x00dev->link; | 414 | struct link *link = &rt2x00dev->link; |
415 | 415 | ||
416 | if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) || | 416 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) && |
417 | !test_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags)) | 417 | rt2x00dev->ops->lib->watchdog) |
418 | return; | 418 | ieee80211_queue_delayed_work(rt2x00dev->hw, |
419 | 419 | &link->watchdog_work, | |
420 | ieee80211_queue_delayed_work(rt2x00dev->hw, | 420 | WATCHDOG_INTERVAL); |
421 | &link->watchdog_work, WATCHDOG_INTERVAL); | ||
422 | } | 421 | } |
423 | 422 | ||
424 | void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev) | 423 | void rt2x00link_stop_watchdog(struct rt2x00_dev *rt2x00dev) |
@@ -447,8 +446,46 @@ static void rt2x00link_watchdog(struct work_struct *work) | |||
447 | WATCHDOG_INTERVAL); | 446 | WATCHDOG_INTERVAL); |
448 | } | 447 | } |
449 | 448 | ||
449 | void rt2x00link_start_agc(struct rt2x00_dev *rt2x00dev) | ||
450 | { | ||
451 | struct link *link = &rt2x00dev->link; | ||
452 | |||
453 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags) && | ||
454 | rt2x00dev->ops->lib->gain_calibration) | ||
455 | ieee80211_queue_delayed_work(rt2x00dev->hw, | ||
456 | &link->agc_work, | ||
457 | AGC_INTERVAL); | ||
458 | } | ||
459 | |||
460 | void rt2x00link_stop_agc(struct rt2x00_dev *rt2x00dev) | ||
461 | { | ||
462 | cancel_delayed_work_sync(&rt2x00dev->link.agc_work); | ||
463 | } | ||
464 | |||
465 | static void rt2x00link_agc(struct work_struct *work) | ||
466 | { | ||
467 | struct rt2x00_dev *rt2x00dev = | ||
468 | container_of(work, struct rt2x00_dev, link.agc_work.work); | ||
469 | struct link *link = &rt2x00dev->link; | ||
470 | |||
471 | /* | ||
472 | * When the radio is shutting down we should | ||
473 | * immediately cease the watchdog monitoring. | ||
474 | */ | ||
475 | if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) | ||
476 | return; | ||
477 | |||
478 | rt2x00dev->ops->lib->gain_calibration(rt2x00dev); | ||
479 | |||
480 | if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags)) | ||
481 | ieee80211_queue_delayed_work(rt2x00dev->hw, | ||
482 | &link->agc_work, | ||
483 | AGC_INTERVAL); | ||
484 | } | ||
485 | |||
450 | void rt2x00link_register(struct rt2x00_dev *rt2x00dev) | 486 | void rt2x00link_register(struct rt2x00_dev *rt2x00dev) |
451 | { | 487 | { |
488 | INIT_DELAYED_WORK(&rt2x00dev->link.agc_work, rt2x00link_agc); | ||
452 | INIT_DELAYED_WORK(&rt2x00dev->link.watchdog_work, rt2x00link_watchdog); | 489 | INIT_DELAYED_WORK(&rt2x00dev->link.watchdog_work, rt2x00link_watchdog); |
453 | INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00link_tuner); | 490 | INIT_DELAYED_WORK(&rt2x00dev->link.work, rt2x00link_tuner); |
454 | } | 491 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 4dd82b0b0520..9649bd0cd718 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -60,14 +60,15 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev, | |||
60 | } | 60 | } |
61 | EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read); | 61 | EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read); |
62 | 62 | ||
63 | void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) | 63 | bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) |
64 | { | 64 | { |
65 | struct data_queue *queue = rt2x00dev->rx; | 65 | struct data_queue *queue = rt2x00dev->rx; |
66 | struct queue_entry *entry; | 66 | struct queue_entry *entry; |
67 | struct queue_entry_priv_pci *entry_priv; | 67 | struct queue_entry_priv_pci *entry_priv; |
68 | struct skb_frame_desc *skbdesc; | 68 | struct skb_frame_desc *skbdesc; |
69 | int max_rx = 16; | ||
69 | 70 | ||
70 | while (1) { | 71 | while (--max_rx) { |
71 | entry = rt2x00queue_get_entry(queue, Q_INDEX); | 72 | entry = rt2x00queue_get_entry(queue, Q_INDEX); |
72 | entry_priv = entry->priv_data; | 73 | entry_priv = entry->priv_data; |
73 | 74 | ||
@@ -93,6 +94,8 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev) | |||
93 | */ | 94 | */ |
94 | rt2x00lib_rxdone(entry); | 95 | rt2x00lib_rxdone(entry); |
95 | } | 96 | } |
97 | |||
98 | return !max_rx; | ||
96 | } | 99 | } |
97 | EXPORT_SYMBOL_GPL(rt2x00pci_rxdone); | 100 | EXPORT_SYMBOL_GPL(rt2x00pci_rxdone); |
98 | 101 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.h b/drivers/net/wireless/rt2x00/rt2x00pci.h index 746ce8fe8cf4..07961b8b369a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.h +++ b/drivers/net/wireless/rt2x00/rt2x00pci.h | |||
@@ -101,8 +101,11 @@ struct queue_entry_priv_pci { | |||
101 | /** | 101 | /** |
102 | * rt2x00pci_rxdone - Handle RX done events | 102 | * rt2x00pci_rxdone - Handle RX done events |
103 | * @rt2x00dev: Device pointer, see &struct rt2x00_dev. | 103 | * @rt2x00dev: Device pointer, see &struct rt2x00_dev. |
104 | * | ||
105 | * Returns true if there are still rx frames pending and false if all | ||
106 | * pending rx frames were processed. | ||
104 | */ | 107 | */ |
105 | void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev); | 108 | bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev); |
106 | 109 | ||
107 | /* | 110 | /* |
108 | * Device initialization handlers. | 111 | * Device initialization handlers. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 4358051bfe1a..94b8bbb7ad80 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -148,19 +148,6 @@ void rt2x00queue_align_frame(struct sk_buff *skb) | |||
148 | skb_trim(skb, frame_length); | 148 | skb_trim(skb, frame_length); |
149 | } | 149 | } |
150 | 150 | ||
151 | void rt2x00queue_align_payload(struct sk_buff *skb, unsigned int header_length) | ||
152 | { | ||
153 | unsigned int frame_length = skb->len; | ||
154 | unsigned int align = ALIGN_SIZE(skb, header_length); | ||
155 | |||
156 | if (!align) | ||
157 | return; | ||
158 | |||
159 | skb_push(skb, align); | ||
160 | memmove(skb->data, skb->data + align, frame_length); | ||
161 | skb_trim(skb, frame_length); | ||
162 | } | ||
163 | |||
164 | void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length) | 151 | void rt2x00queue_insert_l2pad(struct sk_buff *skb, unsigned int header_length) |
165 | { | 152 | { |
166 | unsigned int payload_length = skb->len - header_length; | 153 | unsigned int payload_length = skb->len - header_length; |
@@ -495,8 +482,11 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb, | |||
495 | struct skb_frame_desc *skbdesc; | 482 | struct skb_frame_desc *skbdesc; |
496 | u8 rate_idx, rate_flags; | 483 | u8 rate_idx, rate_flags; |
497 | 484 | ||
498 | if (unlikely(rt2x00queue_full(queue))) | 485 | if (unlikely(rt2x00queue_full(queue))) { |
486 | ERROR(queue->rt2x00dev, | ||
487 | "Dropping frame due to full tx queue %d.\n", queue->qid); | ||
499 | return -ENOBUFS; | 488 | return -ENOBUFS; |
489 | } | ||
500 | 490 | ||
501 | if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA, | 491 | if (unlikely(test_and_set_bit(ENTRY_OWNER_DEVICE_DATA, |
502 | &entry->flags))) { | 492 | &entry->flags))) { |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index 217861f8d95f..5db6a99fce7d 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -217,6 +217,7 @@ enum txdone_entry_desc_flags { | |||
217 | TXDONE_FALLBACK, | 217 | TXDONE_FALLBACK, |
218 | TXDONE_FAILURE, | 218 | TXDONE_FAILURE, |
219 | TXDONE_EXCESSIVE_RETRY, | 219 | TXDONE_EXCESSIVE_RETRY, |
220 | TXDONE_AMPDU, | ||
220 | }; | 221 | }; |
221 | 222 | ||
222 | /** | 223 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 77e8113b91e1..8ee1514a7943 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c | |||
@@ -2313,8 +2313,10 @@ static void rt61pci_tbtt_tasklet(unsigned long data) | |||
2313 | static void rt61pci_rxdone_tasklet(unsigned long data) | 2313 | static void rt61pci_rxdone_tasklet(unsigned long data) |
2314 | { | 2314 | { |
2315 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; | 2315 | struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; |
2316 | rt2x00pci_rxdone(rt2x00dev); | 2316 | if (rt2x00pci_rxdone(rt2x00dev)) |
2317 | rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RXDONE); | 2317 | rt2x00pci_rxdone(rt2x00dev); |
2318 | else | ||
2319 | rt61pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RXDONE); | ||
2318 | } | 2320 | } |
2319 | 2321 | ||
2320 | static void rt61pci_autowake_tasklet(unsigned long data) | 2322 | static void rt61pci_autowake_tasklet(unsigned long data) |
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index 02f1148c577e..6593059f9c7e 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -2209,7 +2209,6 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
2209 | if (!modparam_nohwcrypt) | 2209 | if (!modparam_nohwcrypt) |
2210 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); | 2210 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); |
2211 | __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); | 2211 | __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); |
2212 | __set_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags); | ||
2213 | 2212 | ||
2214 | /* | 2213 | /* |
2215 | * Set the rssi offset. | 2214 | * Set the rssi offset. |
@@ -2407,7 +2406,6 @@ static struct usb_device_id rt73usb_device_table[] = { | |||
2407 | { USB_DEVICE(0x0b05, 0x1723), USB_DEVICE_DATA(&rt73usb_ops) }, | 2406 | { USB_DEVICE(0x0b05, 0x1723), USB_DEVICE_DATA(&rt73usb_ops) }, |
2408 | { USB_DEVICE(0x0b05, 0x1724), USB_DEVICE_DATA(&rt73usb_ops) }, | 2407 | { USB_DEVICE(0x0b05, 0x1724), USB_DEVICE_DATA(&rt73usb_ops) }, |
2409 | /* Belkin */ | 2408 | /* Belkin */ |
2410 | { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2411 | { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) }, | 2409 | { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) }, |
2412 | { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) }, | 2410 | { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) }, |
2413 | { USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) }, | 2411 | { USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) }, |