case RF3290:
case RF5360:
case RF5370:
-@@ -3442,17 +4487,25 @@ static int rt2800_init_registers(struct
+@@ -3442,17 +4487,25 @@ static int rt2800_init_registers(struct
return ret;
rt2800_register_read(rt2x00dev, BCN_OFFSET0, ®);
rt2800_register_write(rt2x00dev, BCN_OFFSET1, reg);
rt2800_register_write(rt2x00dev, LEGACY_BASIC_RATE, 0x0000013f);
-@@ -3528,7 +4581,8 @@ static int rt2800_init_registers(struct
+@@ -3528,7 +4581,8 @@ static int rt2800_init_registers(struct
if (rt2x00_rt_rev_lt(rt2x00dev, RT3071, REV_RT3071E) ||
rt2x00_rt_rev_lt(rt2x00dev, RT3090, REV_RT3090E) ||
rt2x00_rt_rev_lt(rt2x00dev, RT3390, REV_RT3390E)) {
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_DAC_TEST))
rt2800_register_write(rt2x00dev, TX_SW_CFG2,
0x0000002c);
-@@ -3559,6 +4613,23 @@ static int rt2800_init_registers(struct
+@@ -3559,6 +4613,23 @@ static int rt2800_init_registers(struct
} else if (rt2x00_rt(rt2x00dev, RT3572)) {
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000400);
rt2800_register_write(rt2x00dev, TX_SW_CFG1, 0x00080606);
} else if (rt2x00_rt(rt2x00dev, RT5390) ||
rt2x00_rt(rt2x00dev, RT5392) ||
rt2x00_rt(rt2x00dev, RT5592)) {
-@@ -3786,14 +4857,8 @@ static int rt2800_init_registers(struct
+@@ -3786,14 +4857,8 @@ static int rt2800_init_registers(struct
/*
* Clear all beacons
*/
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_TXPATH) == 1)
value |= 0x20;
if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RXPATH) == 1)
-@@ -4332,6 +5397,22 @@ static void rt2800_init_bbp_3572(struct
+@@ -4332,6 +5397,22 @@ static void rt2800_init_bbp_3572(struct
rt2800_disable_unused_dac_adc(rt2x00dev);
}
static void rt2800_init_bbp_53xx(struct rt2x00_dev *rt2x00dev)
{
int ant, div_mode;
-@@ -4402,7 +5483,7 @@ static void rt2800_init_bbp_53xx(struct
+@@ -4402,7 +5483,7 @@ static void rt2800_init_bbp_53xx(struct
rt2800_disable_unused_dac_adc(rt2x00dev);
div_mode = rt2x00_get_field16(eeprom,
EEPROM_NIC_CONF1_ANT_DIVERSITY);
ant = (div_mode == 3) ? 1 : 0;
-@@ -4488,7 +5569,7 @@ static void rt2800_init_bbp_5592(struct
+@@ -4488,7 +5569,7 @@ static void rt2800_init_bbp_5592(struct
rt2800_bbp4_mac_if_ctrl(rt2x00dev);
case RT5390:
rt2800_init_rfcsr_5390(rt2x00dev);
break;
-@@ -5456,15 +6711,15 @@ int rt2800_enable_radio(struct rt2x00_de
+@@ -5404,19 +6659,20 @@ int rt2800_enable_radio(struct rt2x00_de
+ rt2800_init_registers(rt2x00dev)))
+ return -EIO;
+
++ if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev)))
++ return -EIO;
++
+ /*
+ * Send signal to firmware during boot time.
+ */
+ rt2800_register_write(rt2x00dev, H2M_BBP_AGENT, 0);
+ rt2800_register_write(rt2x00dev, H2M_MAILBOX_CSR, 0);
+- if (rt2x00_is_usb(rt2x00dev)) {
++ if (rt2x00_is_usb(rt2x00dev))
+ rt2800_register_write(rt2x00dev, H2M_INT_SRC, 0);
+- rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
+- }
++ rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0, 0, 0);
+ msleep(1);
+
+- if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev) ||
+- rt2800_wait_bbp_ready(rt2x00dev)))
++ if (unlikely(rt2800_wait_bbp_ready(rt2x00dev)))
+ return -EIO;
+
+ rt2800_init_bbp(rt2x00dev);
+@@ -5456,15 +6712,15 @@ int rt2800_enable_radio(struct rt2x00_de
/*
* Initialize LED control
*/
rt2800_mcu_request(rt2x00dev, MCU_LED_LED_POLARITY, 0xff,
word & 0xff, (word >> 8) & 0xff);
-@@ -5560,6 +6815,34 @@ int rt2800_read_eeprom_efuse(struct rt2x
+@@ -5560,6 +6816,34 @@ int rt2800_read_eeprom_efuse(struct rt2x
}
EXPORT_SYMBOL_GPL(rt2800_read_eeprom_efuse);
static int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)
{
struct rt2800_drv_data *drv_data = rt2x00dev->drv_data;
-@@ -5578,18 +6861,18 @@ static int rt2800_validate_eeprom(struct
+@@ -5578,18 +6862,18 @@ static int rt2800_validate_eeprom(struct
/*
* Start validation of the data that has been read.
*/
rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
} else if (rt2x00_rt(rt2x00dev, RT2860) ||
rt2x00_rt(rt2x00dev, RT2872)) {
-@@ -5598,10 +6881,10 @@ static int rt2800_validate_eeprom(struct
+@@ -5598,10 +6882,10 @@ static int rt2800_validate_eeprom(struct
*/
if (rt2x00_get_field16(word, EEPROM_NIC_CONF0_RXPATH) > 2)
rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RXPATH, 2);
if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_NIC_CONF1_HW_RADIO, 0);
rt2x00_set_field16(&word, EEPROM_NIC_CONF1_EXTERNAL_TX_ALC, 0);
-@@ -5618,24 +6901,24 @@ static int rt2800_validate_eeprom(struct
+@@ -5618,24 +6902,24 @@ static int rt2800_validate_eeprom(struct
rt2x00_set_field16(&word, EEPROM_NIC_CONF1_INTERNAL_TX_ALC, 0);
rt2x00_set_field16(&word, EEPROM_NIC_CONF1_BT_COEXIST, 0);
rt2x00_set_field16(&word, EEPROM_NIC_CONF1_DAC_TEST, 0);
rt2x00_eeprom_dbg(rt2x00dev, "Led Mode: 0x%04x\n", word);
}
-@@ -5644,56 +6927,61 @@ static int rt2800_validate_eeprom(struct
+@@ -5644,56 +6928,61 @@ static int rt2800_validate_eeprom(struct
* lna0 as correct value. Note that EEPROM_LNA
* is never validated.
*/
return 0;
}
-@@ -5707,7 +6995,7 @@ static int rt2800_init_eeprom(struct rt2
+@@ -5707,7 +6996,7 @@ static int rt2800_init_eeprom(struct rt2
/*
* Read EEPROM word for configuration.
*/
/*
* Identify RF chipset by EEPROM value
-@@ -5717,7 +7005,7 @@ static int rt2800_init_eeprom(struct rt2
+@@ -5717,7 +7006,7 @@ static int rt2800_init_eeprom(struct rt2
if (rt2x00_rt(rt2x00dev, RT3290) ||
rt2x00_rt(rt2x00dev, RT5390) ||
rt2x00_rt(rt2x00dev, RT5392))
else
rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
-@@ -5731,6 +7019,7 @@ static int rt2800_init_eeprom(struct rt2
+@@ -5731,6 +7020,7 @@ static int rt2800_init_eeprom(struct rt2
case RF3021:
case RF3022:
case RF3052:
case RF3290:
case RF3320:
case RF3322:
-@@ -5757,7 +7046,7 @@ static int rt2800_init_eeprom(struct rt2
+@@ -5757,7 +7047,7 @@ static int rt2800_init_eeprom(struct rt2
rt2x00dev->default_ant.rx_chain_num =
rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RXPATH);
if (rt2x00_rt(rt2x00dev, RT3070) ||
rt2x00_rt(rt2x00dev, RT3090) ||
-@@ -5810,7 +7099,7 @@ static int rt2800_init_eeprom(struct rt2
+@@ -5810,7 +7100,7 @@ static int rt2800_init_eeprom(struct rt2
/*
* Read frequency offset and RF programming sequence.
*/
rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET);
/*
-@@ -5827,7 +7116,7 @@ static int rt2800_init_eeprom(struct rt2
+@@ -5827,7 +7117,7 @@ static int rt2800_init_eeprom(struct rt2
/*
* Check if support EIRP tx power limit feature.
*/
if (rt2x00_get_field16(eeprom, EEPROM_EIRP_MAX_TX_POWER_2GHZ) <
EIRP_MAX_TX_POWER_LIMIT)
-@@ -6109,12 +7398,79 @@ static const struct rf_channel rf_vals_5
+@@ -6109,12 +7399,79 @@ static const struct rf_channel rf_vals_5
{196, 83, 0, 12, 1},
};
unsigned int i;
u16 eeprom;
u32 reg;
-@@ -6149,7 +7505,7 @@ static int rt2800_probe_hw_mode(struct r
+@@ -6149,7 +7506,7 @@ static int rt2800_probe_hw_mode(struct r
SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
EEPROM_MAC_ADDR_0));
/*
-@@ -6165,7 +7521,7 @@ static int rt2800_probe_hw_mode(struct r
+@@ -6165,7 +7522,7 @@ static int rt2800_probe_hw_mode(struct r
rt2x00dev->hw->max_report_rates = 7;
rt2x00dev->hw->max_rate_tries = 1;
/*
* Initialize hw_mode information.
-@@ -6200,6 +7556,10 @@ static int rt2800_probe_hw_mode(struct r
+@@ -6200,6 +7557,10 @@ static int rt2800_probe_hw_mode(struct r
spec->supported_bands |= SUPPORT_BAND_5GHZ;
spec->num_channels = ARRAY_SIZE(rf_vals_3x);
spec->channels = rf_vals_3x;
} else if (rt2x00_rf(rt2x00dev, RF5592)) {
spec->supported_bands |= SUPPORT_BAND_5GHZ;
-@@ -6265,21 +7625,40 @@ static int rt2800_probe_hw_mode(struct r
+@@ -6265,21 +7626,40 @@ static int rt2800_probe_hw_mode(struct r
spec->channels_info = info;
}
}
-@@ -6290,6 +7669,7 @@ static int rt2800_probe_hw_mode(struct r
+@@ -6290,6 +7670,7 @@ static int rt2800_probe_hw_mode(struct r
case RF3022:
case RF3320:
case RF3052:
case RF3290:
case RF5360:
case RF5370:
-@@ -6328,6 +7708,7 @@ static int rt2800_probe_rt(struct rt2x00
+@@ -6328,6 +7709,7 @@ static int rt2800_probe_rt(struct rt2x00
case RT3352:
case RT3390:
case RT3572:
queue->priv_size = sizeof(struct queue_entry_priv_mmio);
break;
-@@ -1205,7 +1214,7 @@ static void rt2800pci_queue_init(struct
+@@ -1205,7 +1214,7 @@ static void rt2800pci_queue_init(struct
queue->limit = 64;
queue->data_size = AGGREGATION_SIZE;
queue->desc_size = TXD_DESC_SIZE;
queue->priv_size = sizeof(struct queue_entry_priv_mmio);
break;
-@@ -1213,7 +1222,7 @@ static void rt2800pci_queue_init(struct
+@@ -1213,7 +1222,7 @@ static void rt2800pci_queue_init(struct
queue->limit = 8;
queue->data_size = 0; /* No DMA required for beacons */
queue->desc_size = TXD_DESC_SIZE;
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
-@@ -854,13 +854,7 @@ static void rt2800usb_queue_init(struct
+@@ -176,8 +176,8 @@ static bool rt2800usb_tx_sta_fifo_read_c
+ queue_work(rt2x00dev->workqueue, &rt2x00dev->txdone_work);
+
+ if (rt2800usb_txstatus_pending(rt2x00dev)) {
+- /* Read register after 250 us */
+- hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 250000),
++ /* Read register after 1 ms */
++ hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 1000000),
+ HRTIMER_MODE_REL);
+ return false;
+ }
+@@ -202,8 +202,8 @@ static void rt2800usb_async_read_tx_stat
+ if (test_and_set_bit(TX_STATUS_READING, &rt2x00dev->flags))
+ return;
+
+- /* Read TX_STA_FIFO register after 500 us */
+- hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 500000),
++ /* Read TX_STA_FIFO register after 2 ms */
++ hrtimer_start(&rt2x00dev->txstatus_timer, ktime_set(0, 2000000),
+ HRTIMER_MODE_REL);
+ }
+
+@@ -854,13 +854,7 @@ static void rt2800usb_queue_init(struct
struct rt2x00_dev *rt2x00dev = queue->rt2x00dev;
unsigned short txwi_size, rxwi_size;