diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2500usb.c | 264 |
1 files changed, 161 insertions, 103 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c index cdaf93f48263..15237c275486 100644 --- a/drivers/net/wireless/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/rt2x00/rt2500usb.c | |||
@@ -39,7 +39,7 @@ | |||
39 | /* | 39 | /* |
40 | * Allow hardware encryption to be disabled. | 40 | * Allow hardware encryption to be disabled. |
41 | */ | 41 | */ |
42 | static int modparam_nohwcrypt = 0; | 42 | static int modparam_nohwcrypt; |
43 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); | 43 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); |
44 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); | 44 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); |
45 | 45 | ||
@@ -355,7 +355,9 @@ static int rt2500usb_config_key(struct rt2x00_dev *rt2x00dev, | |||
355 | * it is known that not work at least on some hardware. | 355 | * it is known that not work at least on some hardware. |
356 | * SW crypto will be used in that case. | 356 | * SW crypto will be used in that case. |
357 | */ | 357 | */ |
358 | if (key->alg == ALG_WEP && key->keyidx != 0) | 358 | if ((key->cipher == WLAN_CIPHER_SUITE_WEP40 || |
359 | key->cipher == WLAN_CIPHER_SUITE_WEP104) && | ||
360 | key->keyidx != 0) | ||
359 | return -EOPNOTSUPP; | 361 | return -EOPNOTSUPP; |
360 | 362 | ||
361 | /* | 363 | /* |
@@ -476,9 +478,7 @@ static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev, | |||
476 | rt2500usb_register_write(rt2x00dev, TXRX_CSR18, reg); | 478 | rt2500usb_register_write(rt2x00dev, TXRX_CSR18, reg); |
477 | 479 | ||
478 | rt2500usb_register_read(rt2x00dev, TXRX_CSR19, ®); | 480 | rt2500usb_register_read(rt2x00dev, TXRX_CSR19, ®); |
479 | rt2x00_set_field16(®, TXRX_CSR19_TSF_COUNT, 1); | ||
480 | rt2x00_set_field16(®, TXRX_CSR19_TSF_SYNC, conf->sync); | 481 | rt2x00_set_field16(®, TXRX_CSR19_TSF_SYNC, conf->sync); |
481 | rt2x00_set_field16(®, TXRX_CSR19_TBCN, 1); | ||
482 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); | 482 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); |
483 | } | 483 | } |
484 | 484 | ||
@@ -492,24 +492,34 @@ static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev, | |||
492 | } | 492 | } |
493 | 493 | ||
494 | static void rt2500usb_config_erp(struct rt2x00_dev *rt2x00dev, | 494 | static void rt2500usb_config_erp(struct rt2x00_dev *rt2x00dev, |
495 | struct rt2x00lib_erp *erp) | 495 | struct rt2x00lib_erp *erp, |
496 | u32 changed) | ||
496 | { | 497 | { |
497 | u16 reg; | 498 | u16 reg; |
498 | 499 | ||
499 | rt2500usb_register_read(rt2x00dev, TXRX_CSR10, ®); | 500 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { |
500 | rt2x00_set_field16(®, TXRX_CSR10_AUTORESPOND_PREAMBLE, | 501 | rt2500usb_register_read(rt2x00dev, TXRX_CSR10, ®); |
501 | !!erp->short_preamble); | 502 | rt2x00_set_field16(®, TXRX_CSR10_AUTORESPOND_PREAMBLE, |
502 | rt2500usb_register_write(rt2x00dev, TXRX_CSR10, reg); | 503 | !!erp->short_preamble); |
504 | rt2500usb_register_write(rt2x00dev, TXRX_CSR10, reg); | ||
505 | } | ||
503 | 506 | ||
504 | rt2500usb_register_write(rt2x00dev, TXRX_CSR11, erp->basic_rates); | 507 | if (changed & BSS_CHANGED_BASIC_RATES) |
508 | rt2500usb_register_write(rt2x00dev, TXRX_CSR11, | ||
509 | erp->basic_rates); | ||
505 | 510 | ||
506 | rt2500usb_register_read(rt2x00dev, TXRX_CSR18, ®); | 511 | if (changed & BSS_CHANGED_BEACON_INT) { |
507 | rt2x00_set_field16(®, TXRX_CSR18_INTERVAL, erp->beacon_int * 4); | 512 | rt2500usb_register_read(rt2x00dev, TXRX_CSR18, ®); |
508 | rt2500usb_register_write(rt2x00dev, TXRX_CSR18, reg); | 513 | rt2x00_set_field16(®, TXRX_CSR18_INTERVAL, |
514 | erp->beacon_int * 4); | ||
515 | rt2500usb_register_write(rt2x00dev, TXRX_CSR18, reg); | ||
516 | } | ||
509 | 517 | ||
510 | rt2500usb_register_write(rt2x00dev, MAC_CSR10, erp->slot_time); | 518 | if (changed & BSS_CHANGED_ERP_SLOT) { |
511 | rt2500usb_register_write(rt2x00dev, MAC_CSR11, erp->sifs); | 519 | rt2500usb_register_write(rt2x00dev, MAC_CSR10, erp->slot_time); |
512 | rt2500usb_register_write(rt2x00dev, MAC_CSR12, erp->eifs); | 520 | rt2500usb_register_write(rt2x00dev, MAC_CSR11, erp->sifs); |
521 | rt2500usb_register_write(rt2x00dev, MAC_CSR12, erp->eifs); | ||
522 | } | ||
513 | } | 523 | } |
514 | 524 | ||
515 | static void rt2500usb_config_ant(struct rt2x00_dev *rt2x00dev, | 525 | static void rt2500usb_config_ant(struct rt2x00_dev *rt2x00dev, |
@@ -727,6 +737,55 @@ static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev, | |||
727 | } | 737 | } |
728 | 738 | ||
729 | /* | 739 | /* |
740 | * Queue handlers. | ||
741 | */ | ||
742 | static void rt2500usb_start_queue(struct data_queue *queue) | ||
743 | { | ||
744 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
745 | u16 reg; | ||
746 | |||
747 | switch (queue->qid) { | ||
748 | case QID_RX: | ||
749 | rt2500usb_register_read(rt2x00dev, TXRX_CSR2, ®); | ||
750 | rt2x00_set_field16(®, TXRX_CSR2_DISABLE_RX, 0); | ||
751 | rt2500usb_register_write(rt2x00dev, TXRX_CSR2, reg); | ||
752 | break; | ||
753 | case QID_BEACON: | ||
754 | rt2500usb_register_read(rt2x00dev, TXRX_CSR19, ®); | ||
755 | rt2x00_set_field16(®, TXRX_CSR19_TSF_COUNT, 1); | ||
756 | rt2x00_set_field16(®, TXRX_CSR19_TBCN, 1); | ||
757 | rt2x00_set_field16(®, TXRX_CSR19_BEACON_GEN, 1); | ||
758 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); | ||
759 | break; | ||
760 | default: | ||
761 | break; | ||
762 | } | ||
763 | } | ||
764 | |||
765 | static void rt2500usb_stop_queue(struct data_queue *queue) | ||
766 | { | ||
767 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
768 | u16 reg; | ||
769 | |||
770 | switch (queue->qid) { | ||
771 | case QID_RX: | ||
772 | rt2500usb_register_read(rt2x00dev, TXRX_CSR2, ®); | ||
773 | rt2x00_set_field16(®, TXRX_CSR2_DISABLE_RX, 1); | ||
774 | rt2500usb_register_write(rt2x00dev, TXRX_CSR2, reg); | ||
775 | break; | ||
776 | case QID_BEACON: | ||
777 | rt2500usb_register_read(rt2x00dev, TXRX_CSR19, ®); | ||
778 | rt2x00_set_field16(®, TXRX_CSR19_TSF_COUNT, 0); | ||
779 | rt2x00_set_field16(®, TXRX_CSR19_TBCN, 0); | ||
780 | rt2x00_set_field16(®, TXRX_CSR19_BEACON_GEN, 0); | ||
781 | rt2500usb_register_write(rt2x00dev, TXRX_CSR19, reg); | ||
782 | break; | ||
783 | default: | ||
784 | break; | ||
785 | } | ||
786 | } | ||
787 | |||
788 | /* | ||
730 | * Initialization functions. | 789 | * Initialization functions. |
731 | */ | 790 | */ |
732 | static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev) | 791 | static int rt2500usb_init_registers(struct rt2x00_dev *rt2x00dev) |
@@ -919,18 +978,6 @@ static int rt2500usb_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
919 | /* | 978 | /* |
920 | * Device state switch handlers. | 979 | * Device state switch handlers. |
921 | */ | 980 | */ |
922 | static void rt2500usb_toggle_rx(struct rt2x00_dev *rt2x00dev, | ||
923 | enum dev_state state) | ||
924 | { | ||
925 | u16 reg; | ||
926 | |||
927 | rt2500usb_register_read(rt2x00dev, TXRX_CSR2, ®); | ||
928 | rt2x00_set_field16(®, TXRX_CSR2_DISABLE_RX, | ||
929 | (state == STATE_RADIO_RX_OFF) || | ||
930 | (state == STATE_RADIO_RX_OFF_LINK)); | ||
931 | rt2500usb_register_write(rt2x00dev, TXRX_CSR2, reg); | ||
932 | } | ||
933 | |||
934 | static int rt2500usb_enable_radio(struct rt2x00_dev *rt2x00dev) | 981 | static int rt2500usb_enable_radio(struct rt2x00_dev *rt2x00dev) |
935 | { | 982 | { |
936 | /* | 983 | /* |
@@ -1006,16 +1053,8 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev, | |||
1006 | case STATE_RADIO_OFF: | 1053 | case STATE_RADIO_OFF: |
1007 | rt2500usb_disable_radio(rt2x00dev); | 1054 | rt2500usb_disable_radio(rt2x00dev); |
1008 | break; | 1055 | break; |
1009 | case STATE_RADIO_RX_ON: | ||
1010 | case STATE_RADIO_RX_ON_LINK: | ||
1011 | case STATE_RADIO_RX_OFF: | ||
1012 | case STATE_RADIO_RX_OFF_LINK: | ||
1013 | rt2500usb_toggle_rx(rt2x00dev, state); | ||
1014 | break; | ||
1015 | case STATE_RADIO_IRQ_ON: | 1056 | case STATE_RADIO_IRQ_ON: |
1016 | case STATE_RADIO_IRQ_ON_ISR: | ||
1017 | case STATE_RADIO_IRQ_OFF: | 1057 | case STATE_RADIO_IRQ_OFF: |
1018 | case STATE_RADIO_IRQ_OFF_ISR: | ||
1019 | /* No support, but no error either */ | 1058 | /* No support, but no error either */ |
1020 | break; | 1059 | break; |
1021 | case STATE_DEEP_SLEEP: | 1060 | case STATE_DEEP_SLEEP: |
@@ -1039,12 +1078,11 @@ static int rt2500usb_set_device_state(struct rt2x00_dev *rt2x00dev, | |||
1039 | /* | 1078 | /* |
1040 | * TX descriptor initialization | 1079 | * TX descriptor initialization |
1041 | */ | 1080 | */ |
1042 | static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | 1081 | static void rt2500usb_write_tx_desc(struct queue_entry *entry, |
1043 | struct sk_buff *skb, | ||
1044 | struct txentry_desc *txdesc) | 1082 | struct txentry_desc *txdesc) |
1045 | { | 1083 | { |
1046 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1084 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); |
1047 | __le32 *txd = (__le32 *) skb->data; | 1085 | __le32 *txd = (__le32 *) entry->skb->data; |
1048 | u32 word; | 1086 | u32 word; |
1049 | 1087 | ||
1050 | /* | 1088 | /* |
@@ -1062,7 +1100,7 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1062 | (txdesc->rate_mode == RATE_MODE_OFDM)); | 1100 | (txdesc->rate_mode == RATE_MODE_OFDM)); |
1063 | rt2x00_set_field32(&word, TXD_W0_NEW_SEQ, | 1101 | rt2x00_set_field32(&word, TXD_W0_NEW_SEQ, |
1064 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); | 1102 | test_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags)); |
1065 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | 1103 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->u.plcp.ifs); |
1066 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); | 1104 | rt2x00_set_field32(&word, TXD_W0_DATABYTE_COUNT, txdesc->length); |
1067 | rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher); | 1105 | rt2x00_set_field32(&word, TXD_W0_CIPHER, !!txdesc->cipher); |
1068 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); | 1106 | rt2x00_set_field32(&word, TXD_W0_KEY_ID, txdesc->key_idx); |
@@ -1070,16 +1108,18 @@ static void rt2500usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1070 | 1108 | ||
1071 | rt2x00_desc_read(txd, 1, &word); | 1109 | rt2x00_desc_read(txd, 1, &word); |
1072 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset); | 1110 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset); |
1073 | rt2x00_set_field32(&word, TXD_W1_AIFS, txdesc->aifs); | 1111 | rt2x00_set_field32(&word, TXD_W1_AIFS, entry->queue->aifs); |
1074 | rt2x00_set_field32(&word, TXD_W1_CWMIN, txdesc->cw_min); | 1112 | rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min); |
1075 | rt2x00_set_field32(&word, TXD_W1_CWMAX, txdesc->cw_max); | 1113 | rt2x00_set_field32(&word, TXD_W1_CWMAX, entry->queue->cw_max); |
1076 | rt2x00_desc_write(txd, 1, word); | 1114 | rt2x00_desc_write(txd, 1, word); |
1077 | 1115 | ||
1078 | rt2x00_desc_read(txd, 2, &word); | 1116 | rt2x00_desc_read(txd, 2, &word); |
1079 | rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->signal); | 1117 | rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal); |
1080 | rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->service); | 1118 | rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service); |
1081 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW, txdesc->length_low); | 1119 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW, |
1082 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_HIGH, txdesc->length_high); | 1120 | txdesc->u.plcp.length_low); |
1121 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_HIGH, | ||
1122 | txdesc->u.plcp.length_high); | ||
1083 | rt2x00_desc_write(txd, 2, word); | 1123 | rt2x00_desc_write(txd, 2, word); |
1084 | 1124 | ||
1085 | if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags)) { | 1125 | if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags)) { |
@@ -1127,7 +1167,7 @@ static void rt2500usb_write_beacon(struct queue_entry *entry, | |||
1127 | /* | 1167 | /* |
1128 | * Write the TX descriptor for the beacon. | 1168 | * Write the TX descriptor for the beacon. |
1129 | */ | 1169 | */ |
1130 | rt2500usb_write_tx_desc(rt2x00dev, entry->skb, txdesc); | 1170 | rt2500usb_write_tx_desc(entry, txdesc); |
1131 | 1171 | ||
1132 | /* | 1172 | /* |
1133 | * Dump beacon to userspace through debugfs. | 1173 | * Dump beacon to userspace through debugfs. |
@@ -1479,7 +1519,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1479 | * Detect if this device has an hardware controlled radio. | 1519 | * Detect if this device has an hardware controlled radio. |
1480 | */ | 1520 | */ |
1481 | if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) | 1521 | if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) |
1482 | __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); | 1522 | __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags); |
1483 | 1523 | ||
1484 | /* | 1524 | /* |
1485 | * Read the RSSI <-> dBm offset information. | 1525 | * Read the RSSI <-> dBm offset information. |
@@ -1655,10 +1695,15 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1655 | 1695 | ||
1656 | /* | 1696 | /* |
1657 | * Initialize all hw fields. | 1697 | * Initialize all hw fields. |
1698 | * | ||
1699 | * Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING unless we are | ||
1700 | * capable of sending the buffered frames out after the DTIM | ||
1701 | * transmission using rt2x00lib_beacondone. This will send out | ||
1702 | * multicast and broadcast traffic immediately instead of buffering it | ||
1703 | * infinitly and thus dropping it after some time. | ||
1658 | */ | 1704 | */ |
1659 | rt2x00dev->hw->flags = | 1705 | rt2x00dev->hw->flags = |
1660 | IEEE80211_HW_RX_INCLUDES_FCS | | 1706 | IEEE80211_HW_RX_INCLUDES_FCS | |
1661 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | ||
1662 | IEEE80211_HW_SIGNAL_DBM | | 1707 | IEEE80211_HW_SIGNAL_DBM | |
1663 | IEEE80211_HW_SUPPORTS_PS | | 1708 | IEEE80211_HW_SUPPORTS_PS | |
1664 | IEEE80211_HW_PS_NULLFUNC_STACK; | 1709 | IEEE80211_HW_PS_NULLFUNC_STACK; |
@@ -1698,19 +1743,23 @@ static int rt2500usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
1698 | /* | 1743 | /* |
1699 | * Create channel information array | 1744 | * Create channel information array |
1700 | */ | 1745 | */ |
1701 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 1746 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
1702 | if (!info) | 1747 | if (!info) |
1703 | return -ENOMEM; | 1748 | return -ENOMEM; |
1704 | 1749 | ||
1705 | spec->channels_info = info; | 1750 | spec->channels_info = info; |
1706 | 1751 | ||
1707 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_START); | 1752 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_START); |
1708 | for (i = 0; i < 14; i++) | 1753 | for (i = 0; i < 14; i++) { |
1709 | info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]); | 1754 | info[i].max_power = MAX_TXPOWER; |
1755 | info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]); | ||
1756 | } | ||
1710 | 1757 | ||
1711 | if (spec->num_channels > 14) { | 1758 | if (spec->num_channels > 14) { |
1712 | for (i = 14; i < spec->num_channels; i++) | 1759 | for (i = 14; i < spec->num_channels; i++) { |
1713 | info[i].tx_power1 = DEFAULT_TXPOWER; | 1760 | info[i].max_power = MAX_TXPOWER; |
1761 | info[i].default_power1 = DEFAULT_TXPOWER; | ||
1762 | } | ||
1714 | } | 1763 | } |
1715 | 1764 | ||
1716 | return 0; | 1765 | return 0; |
@@ -1741,13 +1790,14 @@ static int rt2500usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
1741 | /* | 1790 | /* |
1742 | * This device requires the atim queue | 1791 | * This device requires the atim queue |
1743 | */ | 1792 | */ |
1744 | __set_bit(DRIVER_REQUIRE_ATIM_QUEUE, &rt2x00dev->flags); | 1793 | __set_bit(REQUIRE_ATIM_QUEUE, &rt2x00dev->cap_flags); |
1745 | __set_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags); | 1794 | __set_bit(REQUIRE_BEACON_GUARD, &rt2x00dev->cap_flags); |
1746 | if (!modparam_nohwcrypt) { | 1795 | if (!modparam_nohwcrypt) { |
1747 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); | 1796 | __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags); |
1748 | __set_bit(DRIVER_REQUIRE_COPY_IV, &rt2x00dev->flags); | 1797 | __set_bit(REQUIRE_COPY_IV, &rt2x00dev->cap_flags); |
1749 | } | 1798 | } |
1750 | __set_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags); | 1799 | __set_bit(REQUIRE_SW_SEQNO, &rt2x00dev->cap_flags); |
1800 | __set_bit(REQUIRE_PS_AUTOWAKE, &rt2x00dev->cap_flags); | ||
1751 | 1801 | ||
1752 | /* | 1802 | /* |
1753 | * Set the rssi offset. | 1803 | * Set the rssi offset. |
@@ -1773,6 +1823,10 @@ static const struct ieee80211_ops rt2500usb_mac80211_ops = { | |||
1773 | .bss_info_changed = rt2x00mac_bss_info_changed, | 1823 | .bss_info_changed = rt2x00mac_bss_info_changed, |
1774 | .conf_tx = rt2x00mac_conf_tx, | 1824 | .conf_tx = rt2x00mac_conf_tx, |
1775 | .rfkill_poll = rt2x00mac_rfkill_poll, | 1825 | .rfkill_poll = rt2x00mac_rfkill_poll, |
1826 | .flush = rt2x00mac_flush, | ||
1827 | .set_antenna = rt2x00mac_set_antenna, | ||
1828 | .get_antenna = rt2x00mac_get_antenna, | ||
1829 | .get_ringparam = rt2x00mac_get_ringparam, | ||
1776 | }; | 1830 | }; |
1777 | 1831 | ||
1778 | static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { | 1832 | static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { |
@@ -1785,11 +1839,13 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { | |||
1785 | .link_stats = rt2500usb_link_stats, | 1839 | .link_stats = rt2500usb_link_stats, |
1786 | .reset_tuner = rt2500usb_reset_tuner, | 1840 | .reset_tuner = rt2500usb_reset_tuner, |
1787 | .watchdog = rt2x00usb_watchdog, | 1841 | .watchdog = rt2x00usb_watchdog, |
1842 | .start_queue = rt2500usb_start_queue, | ||
1843 | .kick_queue = rt2x00usb_kick_queue, | ||
1844 | .stop_queue = rt2500usb_stop_queue, | ||
1845 | .flush_queue = rt2x00usb_flush_queue, | ||
1788 | .write_tx_desc = rt2500usb_write_tx_desc, | 1846 | .write_tx_desc = rt2500usb_write_tx_desc, |
1789 | .write_beacon = rt2500usb_write_beacon, | 1847 | .write_beacon = rt2500usb_write_beacon, |
1790 | .get_tx_data_len = rt2500usb_get_tx_data_len, | 1848 | .get_tx_data_len = rt2500usb_get_tx_data_len, |
1791 | .kick_tx_queue = rt2x00usb_kick_tx_queue, | ||
1792 | .kill_tx_queue = rt2x00usb_kill_tx_queue, | ||
1793 | .fill_rxdone = rt2500usb_fill_rxdone, | 1849 | .fill_rxdone = rt2500usb_fill_rxdone, |
1794 | .config_shared_key = rt2500usb_config_key, | 1850 | .config_shared_key = rt2500usb_config_key, |
1795 | .config_pairwise_key = rt2500usb_config_key, | 1851 | .config_pairwise_key = rt2500usb_config_key, |
@@ -1801,28 +1857,28 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = { | |||
1801 | }; | 1857 | }; |
1802 | 1858 | ||
1803 | static const struct data_queue_desc rt2500usb_queue_rx = { | 1859 | static const struct data_queue_desc rt2500usb_queue_rx = { |
1804 | .entry_num = RX_ENTRIES, | 1860 | .entry_num = 32, |
1805 | .data_size = DATA_FRAME_SIZE, | 1861 | .data_size = DATA_FRAME_SIZE, |
1806 | .desc_size = RXD_DESC_SIZE, | 1862 | .desc_size = RXD_DESC_SIZE, |
1807 | .priv_size = sizeof(struct queue_entry_priv_usb), | 1863 | .priv_size = sizeof(struct queue_entry_priv_usb), |
1808 | }; | 1864 | }; |
1809 | 1865 | ||
1810 | static const struct data_queue_desc rt2500usb_queue_tx = { | 1866 | static const struct data_queue_desc rt2500usb_queue_tx = { |
1811 | .entry_num = TX_ENTRIES, | 1867 | .entry_num = 32, |
1812 | .data_size = DATA_FRAME_SIZE, | 1868 | .data_size = DATA_FRAME_SIZE, |
1813 | .desc_size = TXD_DESC_SIZE, | 1869 | .desc_size = TXD_DESC_SIZE, |
1814 | .priv_size = sizeof(struct queue_entry_priv_usb), | 1870 | .priv_size = sizeof(struct queue_entry_priv_usb), |
1815 | }; | 1871 | }; |
1816 | 1872 | ||
1817 | static const struct data_queue_desc rt2500usb_queue_bcn = { | 1873 | static const struct data_queue_desc rt2500usb_queue_bcn = { |
1818 | .entry_num = BEACON_ENTRIES, | 1874 | .entry_num = 1, |
1819 | .data_size = MGMT_FRAME_SIZE, | 1875 | .data_size = MGMT_FRAME_SIZE, |
1820 | .desc_size = TXD_DESC_SIZE, | 1876 | .desc_size = TXD_DESC_SIZE, |
1821 | .priv_size = sizeof(struct queue_entry_priv_usb_bcn), | 1877 | .priv_size = sizeof(struct queue_entry_priv_usb_bcn), |
1822 | }; | 1878 | }; |
1823 | 1879 | ||
1824 | static const struct data_queue_desc rt2500usb_queue_atim = { | 1880 | static const struct data_queue_desc rt2500usb_queue_atim = { |
1825 | .entry_num = ATIM_ENTRIES, | 1881 | .entry_num = 8, |
1826 | .data_size = DATA_FRAME_SIZE, | 1882 | .data_size = DATA_FRAME_SIZE, |
1827 | .desc_size = TXD_DESC_SIZE, | 1883 | .desc_size = TXD_DESC_SIZE, |
1828 | .priv_size = sizeof(struct queue_entry_priv_usb), | 1884 | .priv_size = sizeof(struct queue_entry_priv_usb), |
@@ -1852,58 +1908,54 @@ static const struct rt2x00_ops rt2500usb_ops = { | |||
1852 | */ | 1908 | */ |
1853 | static struct usb_device_id rt2500usb_device_table[] = { | 1909 | static struct usb_device_id rt2500usb_device_table[] = { |
1854 | /* ASUS */ | 1910 | /* ASUS */ |
1855 | { USB_DEVICE(0x0b05, 0x1706), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1911 | { USB_DEVICE(0x0b05, 0x1706) }, |
1856 | { USB_DEVICE(0x0b05, 0x1707), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1912 | { USB_DEVICE(0x0b05, 0x1707) }, |
1857 | /* Belkin */ | 1913 | /* Belkin */ |
1858 | { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1914 | { USB_DEVICE(0x050d, 0x7050) }, |
1859 | { USB_DEVICE(0x050d, 0x7051), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1915 | { USB_DEVICE(0x050d, 0x7051) }, |
1860 | { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt2500usb_ops) }, | ||
1861 | /* Cisco Systems */ | 1916 | /* Cisco Systems */ |
1862 | { USB_DEVICE(0x13b1, 0x000d), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1917 | { USB_DEVICE(0x13b1, 0x000d) }, |
1863 | { USB_DEVICE(0x13b1, 0x0011), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1918 | { USB_DEVICE(0x13b1, 0x0011) }, |
1864 | { USB_DEVICE(0x13b1, 0x001a), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1919 | { USB_DEVICE(0x13b1, 0x001a) }, |
1865 | /* CNet */ | ||
1866 | { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt2500usb_ops) }, | ||
1867 | /* Conceptronic */ | 1920 | /* Conceptronic */ |
1868 | { USB_DEVICE(0x14b2, 0x3c02), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1921 | { USB_DEVICE(0x14b2, 0x3c02) }, |
1869 | /* D-LINK */ | 1922 | /* D-LINK */ |
1870 | { USB_DEVICE(0x2001, 0x3c00), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1923 | { USB_DEVICE(0x2001, 0x3c00) }, |
1871 | /* Gigabyte */ | 1924 | /* Gigabyte */ |
1872 | { USB_DEVICE(0x1044, 0x8001), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1925 | { USB_DEVICE(0x1044, 0x8001) }, |
1873 | { USB_DEVICE(0x1044, 0x8007), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1926 | { USB_DEVICE(0x1044, 0x8007) }, |
1874 | /* Hercules */ | 1927 | /* Hercules */ |
1875 | { USB_DEVICE(0x06f8, 0xe000), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1928 | { USB_DEVICE(0x06f8, 0xe000) }, |
1876 | /* Melco */ | 1929 | /* Melco */ |
1877 | { USB_DEVICE(0x0411, 0x005e), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1930 | { USB_DEVICE(0x0411, 0x005e) }, |
1878 | { USB_DEVICE(0x0411, 0x0066), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1931 | { USB_DEVICE(0x0411, 0x0066) }, |
1879 | { USB_DEVICE(0x0411, 0x0067), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1932 | { USB_DEVICE(0x0411, 0x0067) }, |
1880 | { USB_DEVICE(0x0411, 0x008b), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1933 | { USB_DEVICE(0x0411, 0x008b) }, |
1881 | { USB_DEVICE(0x0411, 0x0097), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1934 | { USB_DEVICE(0x0411, 0x0097) }, |
1882 | /* MSI */ | 1935 | /* MSI */ |
1883 | { USB_DEVICE(0x0db0, 0x6861), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1936 | { USB_DEVICE(0x0db0, 0x6861) }, |
1884 | { USB_DEVICE(0x0db0, 0x6865), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1937 | { USB_DEVICE(0x0db0, 0x6865) }, |
1885 | { USB_DEVICE(0x0db0, 0x6869), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1938 | { USB_DEVICE(0x0db0, 0x6869) }, |
1886 | /* Ralink */ | 1939 | /* Ralink */ |
1887 | { USB_DEVICE(0x148f, 0x1706), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1940 | { USB_DEVICE(0x148f, 0x1706) }, |
1888 | { USB_DEVICE(0x148f, 0x2570), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1941 | { USB_DEVICE(0x148f, 0x2570) }, |
1889 | { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1942 | { USB_DEVICE(0x148f, 0x9020) }, |
1890 | { USB_DEVICE(0x148f, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) }, | ||
1891 | /* Sagem */ | 1943 | /* Sagem */ |
1892 | { USB_DEVICE(0x079b, 0x004b), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1944 | { USB_DEVICE(0x079b, 0x004b) }, |
1893 | /* Siemens */ | 1945 | /* Siemens */ |
1894 | { USB_DEVICE(0x0681, 0x3c06), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1946 | { USB_DEVICE(0x0681, 0x3c06) }, |
1895 | /* SMC */ | 1947 | /* SMC */ |
1896 | { USB_DEVICE(0x0707, 0xee13), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1948 | { USB_DEVICE(0x0707, 0xee13) }, |
1897 | /* Spairon */ | 1949 | /* Spairon */ |
1898 | { USB_DEVICE(0x114b, 0x0110), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1950 | { USB_DEVICE(0x114b, 0x0110) }, |
1899 | /* SURECOM */ | 1951 | /* SURECOM */ |
1900 | { USB_DEVICE(0x0769, 0x11f3), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1952 | { USB_DEVICE(0x0769, 0x11f3) }, |
1901 | /* Trust */ | 1953 | /* Trust */ |
1902 | { USB_DEVICE(0x0eb0, 0x9020), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1954 | { USB_DEVICE(0x0eb0, 0x9020) }, |
1903 | /* VTech */ | 1955 | /* VTech */ |
1904 | { USB_DEVICE(0x0f88, 0x3012), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1956 | { USB_DEVICE(0x0f88, 0x3012) }, |
1905 | /* Zinwell */ | 1957 | /* Zinwell */ |
1906 | { USB_DEVICE(0x5a57, 0x0260), USB_DEVICE_DATA(&rt2500usb_ops) }, | 1958 | { USB_DEVICE(0x5a57, 0x0260) }, |
1907 | { 0, } | 1959 | { 0, } |
1908 | }; | 1960 | }; |
1909 | 1961 | ||
@@ -1914,10 +1966,16 @@ MODULE_SUPPORTED_DEVICE("Ralink RT2570 USB chipset based cards"); | |||
1914 | MODULE_DEVICE_TABLE(usb, rt2500usb_device_table); | 1966 | MODULE_DEVICE_TABLE(usb, rt2500usb_device_table); |
1915 | MODULE_LICENSE("GPL"); | 1967 | MODULE_LICENSE("GPL"); |
1916 | 1968 | ||
1969 | static int rt2500usb_probe(struct usb_interface *usb_intf, | ||
1970 | const struct usb_device_id *id) | ||
1971 | { | ||
1972 | return rt2x00usb_probe(usb_intf, &rt2500usb_ops); | ||
1973 | } | ||
1974 | |||
1917 | static struct usb_driver rt2500usb_driver = { | 1975 | static struct usb_driver rt2500usb_driver = { |
1918 | .name = KBUILD_MODNAME, | 1976 | .name = KBUILD_MODNAME, |
1919 | .id_table = rt2500usb_device_table, | 1977 | .id_table = rt2500usb_device_table, |
1920 | .probe = rt2x00usb_probe, | 1978 | .probe = rt2500usb_probe, |
1921 | .disconnect = rt2x00usb_disconnect, | 1979 | .disconnect = rt2x00usb_disconnect, |
1922 | .suspend = rt2x00usb_suspend, | 1980 | .suspend = rt2x00usb_suspend, |
1923 | .resume = rt2x00usb_resume, | 1981 | .resume = rt2x00usb_resume, |