diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index 3558cb210747..cd5af656932d 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -633,6 +633,16 @@ static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev) | |||
633 | rt2x00dev->link.vgc_level = value; | 633 | rt2x00dev->link.vgc_level = value; |
634 | } | 634 | } |
635 | 635 | ||
636 | /* | ||
637 | * NOTE: This function is directly ported from legacy driver, but | ||
638 | * despite it being declared it was never called. Although link tuning | ||
639 | * sounds like a good idea, and usually works well for the other drivers, | ||
640 | * it does _not_ work with rt2500usb. Enabling this function will result | ||
641 | * in TX capabilities only until association kicks in. Immediately | ||
642 | * after the successful association all TX frames will be kept in the | ||
643 | * hardware queue and never transmitted. | ||
644 | */ | ||
645 | #if 0 | ||
636 | static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev) | 646 | static void rt2500usb_link_tuner(struct rt2x00_dev *rt2x00dev) |
637 | { | 647 | { |
638 | int rssi = rt2x00_get_link_rssi(&rt2x00dev->link); | 648 | int rssi = rt2x00_get_link_rssi(&rt2x00dev->link); |
@@ -752,6 +762,9 @@ dynamic_cca_tune: | |||
752 | rt2x00dev->link.vgc_level = r17; | 762 | rt2x00dev->link.vgc_level = r17; |
753 | } | 763 | } |
754 | } | 764 | } |
765 | #else | ||
766 | #define rt2500usb_link_tuner NULL | ||
767 | #endif | ||
755 | 768 | ||
756 | /* | 769 | /* |
757 | * Initialization functions. | 770 | * Initialization functions. |
@@ -1121,6 +1134,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry) | |||
1121 | int pipe = usb_sndbulkpipe(usb_dev, 1); | 1134 | int pipe = usb_sndbulkpipe(usb_dev, 1); |
1122 | int length; | 1135 | int length; |
1123 | u16 reg; | 1136 | u16 reg; |
1137 | u32 word, len; | ||
1124 | 1138 | ||
1125 | /* | 1139 | /* |
1126 | * Add the descriptor in front of the skb. | 1140 | * Add the descriptor in front of the skb. |
@@ -1130,6 +1144,17 @@ static void rt2500usb_write_beacon(struct queue_entry *entry) | |||
1130 | skbdesc->desc = entry->skb->data; | 1144 | skbdesc->desc = entry->skb->data; |
1131 | 1145 | ||
1132 | /* | 1146 | /* |
1147 | * Adjust the beacon databyte count. The current number is | ||
1148 | * calculated before this function gets called, but falsely | ||
1149 | * assumes that the descriptor was already present in the SKB. | ||
1150 | */ | ||
1151 | rt2x00_desc_read(skbdesc->desc, 0, &word); | ||
1152 | len = rt2x00_get_field32(word, TXD_W0_DATABYTE_COUNT); | ||
1153 | len += skbdesc->desc_len; | ||
1154 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, len); | ||
1155 | rt2x00_desc_write(skbdesc->desc, 0, word); | ||
1156 | |||
1157 | /* | ||
1133 | * Disable beaconing while we are reloading the beacon data, | 1158 | * Disable beaconing while we are reloading the beacon data, |
1134 | * otherwise we might be sending out invalid data. | 1159 | * otherwise we might be sending out invalid data. |
1135 | */ | 1160 | */ |
@@ -1364,6 +1389,9 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1364 | rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); | 1389 | rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); |
1365 | rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); | 1390 | rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); |
1366 | EEPROM(rt2x00dev, "BBPtune vgc: 0x%04x\n", word); | 1391 | EEPROM(rt2x00dev, "BBPtune vgc: 0x%04x\n", word); |
1392 | } else { | ||
1393 | rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); | ||
1394 | rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); | ||
1367 | } | 1395 | } |
1368 | 1396 | ||
1369 | rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R17, &word); | 1397 | rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R17, &word); |
@@ -1372,9 +1400,6 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1372 | rt2x00_set_field16(&word, EEPROM_BBPTUNE_R17_HIGH, 0x41); | 1400 | rt2x00_set_field16(&word, EEPROM_BBPTUNE_R17_HIGH, 0x41); |
1373 | rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_R17, word); | 1401 | rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_R17, word); |
1374 | EEPROM(rt2x00dev, "BBPtune r17: 0x%04x\n", word); | 1402 | EEPROM(rt2x00dev, "BBPtune r17: 0x%04x\n", word); |
1375 | } else { | ||
1376 | rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); | ||
1377 | rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); | ||
1378 | } | 1403 | } |
1379 | 1404 | ||
1380 | rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R24, &word); | 1405 | rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R24, &word); |
@@ -1650,7 +1675,6 @@ static void rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1650 | * Initialize all hw fields. | 1675 | * Initialize all hw fields. |
1651 | */ | 1676 | */ |
1652 | rt2x00dev->hw->flags = | 1677 | rt2x00dev->hw->flags = |
1653 | IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE | | ||
1654 | IEEE80211_HW_RX_INCLUDES_FCS | | 1678 | IEEE80211_HW_RX_INCLUDES_FCS | |
1655 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | 1679 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | |
1656 | IEEE80211_HW_SIGNAL_DBM; | 1680 | IEEE80211_HW_SIGNAL_DBM; |
@@ -1726,6 +1750,7 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1726 | __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); | 1750 | __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); |
1727 | __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags); | 1751 | __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags); |
1728 | __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags); | 1752 | __set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags); |
1753 | __set_bit(CONFIG_DISABLE_LINK_TUNING, &rt2x00dev->flags); | ||
1729 | 1754 | ||
1730 | /* | 1755 | /* |
1731 | * Set the rssi offset. | 1756 | * Set the rssi offset. |