diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt73usb.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt73usb.c | 445 |
1 files changed, 265 insertions, 180 deletions
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c index aa9de18fd410..ad20953cbf05 100644 --- a/drivers/net/wireless/rt2x00/rt73usb.c +++ b/drivers/net/wireless/rt2x00/rt73usb.c | |||
@@ -40,7 +40,7 @@ | |||
40 | /* | 40 | /* |
41 | * Allow hardware encryption to be disabled. | 41 | * Allow hardware encryption to be disabled. |
42 | */ | 42 | */ |
43 | static int modparam_nohwcrypt = 0; | 43 | static int modparam_nohwcrypt; |
44 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); | 44 | module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO); |
45 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); | 45 | MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption."); |
46 | 46 | ||
@@ -502,26 +502,14 @@ static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev, | |||
502 | struct rt2x00intf_conf *conf, | 502 | struct rt2x00intf_conf *conf, |
503 | const unsigned int flags) | 503 | const unsigned int flags) |
504 | { | 504 | { |
505 | unsigned int beacon_base; | ||
506 | u32 reg; | 505 | u32 reg; |
507 | 506 | ||
508 | if (flags & CONFIG_UPDATE_TYPE) { | 507 | if (flags & CONFIG_UPDATE_TYPE) { |
509 | /* | 508 | /* |
510 | * Clear current synchronisation setup. | ||
511 | * For the Beacon base registers we only need to clear | ||
512 | * the first byte since that byte contains the VALID and OWNER | ||
513 | * bits which (when set to 0) will invalidate the entire beacon. | ||
514 | */ | ||
515 | beacon_base = HW_BEACON_OFFSET(intf->beacon->entry_idx); | ||
516 | rt2x00usb_register_write(rt2x00dev, beacon_base, 0); | ||
517 | |||
518 | /* | ||
519 | * Enable synchronisation. | 509 | * Enable synchronisation. |
520 | */ | 510 | */ |
521 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); | 511 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); |
522 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 1); | ||
523 | rt2x00_set_field32(®, TXRX_CSR9_TSF_SYNC, conf->sync); | 512 | rt2x00_set_field32(®, TXRX_CSR9_TSF_SYNC, conf->sync); |
524 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 1); | ||
525 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | 513 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); |
526 | } | 514 | } |
527 | 515 | ||
@@ -545,7 +533,8 @@ static void rt73usb_config_intf(struct rt2x00_dev *rt2x00dev, | |||
545 | } | 533 | } |
546 | 534 | ||
547 | static void rt73usb_config_erp(struct rt2x00_dev *rt2x00dev, | 535 | static void rt73usb_config_erp(struct rt2x00_dev *rt2x00dev, |
548 | struct rt2x00lib_erp *erp) | 536 | struct rt2x00lib_erp *erp, |
537 | u32 changed) | ||
549 | { | 538 | { |
550 | u32 reg; | 539 | u32 reg; |
551 | 540 | ||
@@ -554,28 +543,36 @@ static void rt73usb_config_erp(struct rt2x00_dev *rt2x00dev, | |||
554 | rt2x00_set_field32(®, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER); | 543 | rt2x00_set_field32(®, TXRX_CSR0_TSF_OFFSET, IEEE80211_HEADER); |
555 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg); | 544 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg); |
556 | 545 | ||
557 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, ®); | 546 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { |
558 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_ENABLE, 1); | 547 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR4, ®); |
559 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE, | 548 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_ENABLE, 1); |
560 | !!erp->short_preamble); | 549 | rt2x00_set_field32(®, TXRX_CSR4_AUTORESPOND_PREAMBLE, |
561 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR4, reg); | 550 | !!erp->short_preamble); |
551 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR4, reg); | ||
552 | } | ||
562 | 553 | ||
563 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR5, erp->basic_rates); | 554 | if (changed & BSS_CHANGED_BASIC_RATES) |
555 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR5, | ||
556 | erp->basic_rates); | ||
564 | 557 | ||
565 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); | 558 | if (changed & BSS_CHANGED_BEACON_INT) { |
566 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_INTERVAL, | 559 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); |
567 | erp->beacon_int * 16); | 560 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_INTERVAL, |
568 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | 561 | erp->beacon_int * 16); |
562 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
563 | } | ||
569 | 564 | ||
570 | rt2x00usb_register_read(rt2x00dev, MAC_CSR9, ®); | 565 | if (changed & BSS_CHANGED_ERP_SLOT) { |
571 | rt2x00_set_field32(®, MAC_CSR9_SLOT_TIME, erp->slot_time); | 566 | rt2x00usb_register_read(rt2x00dev, MAC_CSR9, ®); |
572 | rt2x00usb_register_write(rt2x00dev, MAC_CSR9, reg); | 567 | rt2x00_set_field32(®, MAC_CSR9_SLOT_TIME, erp->slot_time); |
568 | rt2x00usb_register_write(rt2x00dev, MAC_CSR9, reg); | ||
573 | 569 | ||
574 | rt2x00usb_register_read(rt2x00dev, MAC_CSR8, ®); | 570 | rt2x00usb_register_read(rt2x00dev, MAC_CSR8, ®); |
575 | rt2x00_set_field32(®, MAC_CSR8_SIFS, erp->sifs); | 571 | rt2x00_set_field32(®, MAC_CSR8_SIFS, erp->sifs); |
576 | rt2x00_set_field32(®, MAC_CSR8_SIFS_AFTER_RX_OFDM, 3); | 572 | rt2x00_set_field32(®, MAC_CSR8_SIFS_AFTER_RX_OFDM, 3); |
577 | rt2x00_set_field32(®, MAC_CSR8_EIFS, erp->eifs); | 573 | rt2x00_set_field32(®, MAC_CSR8_EIFS, erp->eifs); |
578 | rt2x00usb_register_write(rt2x00dev, MAC_CSR8, reg); | 574 | rt2x00usb_register_write(rt2x00dev, MAC_CSR8, reg); |
575 | } | ||
579 | } | 576 | } |
580 | 577 | ||
581 | static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev, | 578 | static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev, |
@@ -598,7 +595,7 @@ static void rt73usb_config_antenna_5x(struct rt2x00_dev *rt2x00dev, | |||
598 | switch (ant->rx) { | 595 | switch (ant->rx) { |
599 | case ANTENNA_HW_DIVERSITY: | 596 | case ANTENNA_HW_DIVERSITY: |
600 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 2); | 597 | rt2x00_set_field8(&r4, BBP_R4_RX_ANTENNA_CONTROL, 2); |
601 | temp = !test_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags) | 598 | temp = !test_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags) |
602 | && (rt2x00dev->curr_band != IEEE80211_BAND_5GHZ); | 599 | && (rt2x00dev->curr_band != IEEE80211_BAND_5GHZ); |
603 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, temp); | 600 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, temp); |
604 | break; | 601 | break; |
@@ -639,7 +636,7 @@ static void rt73usb_config_antenna_2x(struct rt2x00_dev *rt2x00dev, | |||
639 | 636 | ||
640 | rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, 0); | 637 | rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, 0); |
641 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, | 638 | rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, |
642 | !test_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags)); | 639 | !test_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags)); |
643 | 640 | ||
644 | /* | 641 | /* |
645 | * Configure the RX antenna. | 642 | * Configure the RX antenna. |
@@ -712,10 +709,10 @@ static void rt73usb_config_ant(struct rt2x00_dev *rt2x00dev, | |||
712 | 709 | ||
713 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { | 710 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { |
714 | sel = antenna_sel_a; | 711 | sel = antenna_sel_a; |
715 | lna = test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); | 712 | lna = test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); |
716 | } else { | 713 | } else { |
717 | sel = antenna_sel_bg; | 714 | sel = antenna_sel_bg; |
718 | lna = test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); | 715 | lna = test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags); |
719 | } | 716 | } |
720 | 717 | ||
721 | for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) | 718 | for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) |
@@ -743,7 +740,7 @@ static void rt73usb_config_lna_gain(struct rt2x00_dev *rt2x00dev, | |||
743 | short lna_gain = 0; | 740 | short lna_gain = 0; |
744 | 741 | ||
745 | if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) { | 742 | if (libconf->conf->channel->band == IEEE80211_BAND_2GHZ) { |
746 | if (test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags)) | 743 | if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) |
747 | lna_gain += 14; | 744 | lna_gain += 14; |
748 | 745 | ||
749 | rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom); | 746 | rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom); |
@@ -929,11 +926,11 @@ static void rt73usb_link_tuner(struct rt2x00_dev *rt2x00dev, | |||
929 | /* | 926 | /* |
930 | * Determine r17 bounds. | 927 | * Determine r17 bounds. |
931 | */ | 928 | */ |
932 | if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) { | 929 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { |
933 | low_bound = 0x28; | 930 | low_bound = 0x28; |
934 | up_bound = 0x48; | 931 | up_bound = 0x48; |
935 | 932 | ||
936 | if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { | 933 | if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags)) { |
937 | low_bound += 0x10; | 934 | low_bound += 0x10; |
938 | up_bound += 0x10; | 935 | up_bound += 0x10; |
939 | } | 936 | } |
@@ -949,7 +946,7 @@ static void rt73usb_link_tuner(struct rt2x00_dev *rt2x00dev, | |||
949 | up_bound = 0x1c; | 946 | up_bound = 0x1c; |
950 | } | 947 | } |
951 | 948 | ||
952 | if (test_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags)) { | 949 | if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) { |
953 | low_bound += 0x14; | 950 | low_bound += 0x14; |
954 | up_bound += 0x10; | 951 | up_bound += 0x10; |
955 | } | 952 | } |
@@ -1022,6 +1019,55 @@ dynamic_cca_tune: | |||
1022 | } | 1019 | } |
1023 | 1020 | ||
1024 | /* | 1021 | /* |
1022 | * Queue handlers. | ||
1023 | */ | ||
1024 | static void rt73usb_start_queue(struct data_queue *queue) | ||
1025 | { | ||
1026 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
1027 | u32 reg; | ||
1028 | |||
1029 | switch (queue->qid) { | ||
1030 | case QID_RX: | ||
1031 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, ®); | ||
1032 | rt2x00_set_field32(®, TXRX_CSR0_DISABLE_RX, 0); | ||
1033 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg); | ||
1034 | break; | ||
1035 | case QID_BEACON: | ||
1036 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); | ||
1037 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 1); | ||
1038 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 1); | ||
1039 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 1); | ||
1040 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
1041 | break; | ||
1042 | default: | ||
1043 | break; | ||
1044 | } | ||
1045 | } | ||
1046 | |||
1047 | static void rt73usb_stop_queue(struct data_queue *queue) | ||
1048 | { | ||
1049 | struct rt2x00_dev *rt2x00dev = queue->rt2x00dev; | ||
1050 | u32 reg; | ||
1051 | |||
1052 | switch (queue->qid) { | ||
1053 | case QID_RX: | ||
1054 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, ®); | ||
1055 | rt2x00_set_field32(®, TXRX_CSR0_DISABLE_RX, 1); | ||
1056 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg); | ||
1057 | break; | ||
1058 | case QID_BEACON: | ||
1059 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); | ||
1060 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 0); | ||
1061 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 0); | ||
1062 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); | ||
1063 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
1064 | break; | ||
1065 | default: | ||
1066 | break; | ||
1067 | } | ||
1068 | } | ||
1069 | |||
1070 | /* | ||
1025 | * Firmware functions | 1071 | * Firmware functions |
1026 | */ | 1072 | */ |
1027 | static char *rt73usb_get_firmware_name(struct rt2x00_dev *rt2x00dev) | 1073 | static char *rt73usb_get_firmware_name(struct rt2x00_dev *rt2x00dev) |
@@ -1315,18 +1361,6 @@ static int rt73usb_init_bbp(struct rt2x00_dev *rt2x00dev) | |||
1315 | /* | 1361 | /* |
1316 | * Device state switch handlers. | 1362 | * Device state switch handlers. |
1317 | */ | 1363 | */ |
1318 | static void rt73usb_toggle_rx(struct rt2x00_dev *rt2x00dev, | ||
1319 | enum dev_state state) | ||
1320 | { | ||
1321 | u32 reg; | ||
1322 | |||
1323 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR0, ®); | ||
1324 | rt2x00_set_field32(®, TXRX_CSR0_DISABLE_RX, | ||
1325 | (state == STATE_RADIO_RX_OFF) || | ||
1326 | (state == STATE_RADIO_RX_OFF_LINK)); | ||
1327 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR0, reg); | ||
1328 | } | ||
1329 | |||
1330 | static int rt73usb_enable_radio(struct rt2x00_dev *rt2x00dev) | 1364 | static int rt73usb_enable_radio(struct rt2x00_dev *rt2x00dev) |
1331 | { | 1365 | { |
1332 | /* | 1366 | /* |
@@ -1393,16 +1427,8 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev, | |||
1393 | case STATE_RADIO_OFF: | 1427 | case STATE_RADIO_OFF: |
1394 | rt73usb_disable_radio(rt2x00dev); | 1428 | rt73usb_disable_radio(rt2x00dev); |
1395 | break; | 1429 | break; |
1396 | case STATE_RADIO_RX_ON: | ||
1397 | case STATE_RADIO_RX_ON_LINK: | ||
1398 | case STATE_RADIO_RX_OFF: | ||
1399 | case STATE_RADIO_RX_OFF_LINK: | ||
1400 | rt73usb_toggle_rx(rt2x00dev, state); | ||
1401 | break; | ||
1402 | case STATE_RADIO_IRQ_ON: | 1430 | case STATE_RADIO_IRQ_ON: |
1403 | case STATE_RADIO_IRQ_ON_ISR: | ||
1404 | case STATE_RADIO_IRQ_OFF: | 1431 | case STATE_RADIO_IRQ_OFF: |
1405 | case STATE_RADIO_IRQ_OFF_ISR: | ||
1406 | /* No support, but no error either */ | 1432 | /* No support, but no error either */ |
1407 | break; | 1433 | break; |
1408 | case STATE_DEEP_SLEEP: | 1434 | case STATE_DEEP_SLEEP: |
@@ -1426,12 +1452,11 @@ static int rt73usb_set_device_state(struct rt2x00_dev *rt2x00dev, | |||
1426 | /* | 1452 | /* |
1427 | * TX descriptor initialization | 1453 | * TX descriptor initialization |
1428 | */ | 1454 | */ |
1429 | static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | 1455 | static void rt73usb_write_tx_desc(struct queue_entry *entry, |
1430 | struct sk_buff *skb, | ||
1431 | struct txentry_desc *txdesc) | 1456 | struct txentry_desc *txdesc) |
1432 | { | 1457 | { |
1433 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | 1458 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(entry->skb); |
1434 | __le32 *txd = (__le32 *) skb->data; | 1459 | __le32 *txd = (__le32 *) entry->skb->data; |
1435 | u32 word; | 1460 | u32 word; |
1436 | 1461 | ||
1437 | /* | 1462 | /* |
@@ -1449,7 +1474,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1449 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); | 1474 | test_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags)); |
1450 | rt2x00_set_field32(&word, TXD_W0_OFDM, | 1475 | rt2x00_set_field32(&word, TXD_W0_OFDM, |
1451 | (txdesc->rate_mode == RATE_MODE_OFDM)); | 1476 | (txdesc->rate_mode == RATE_MODE_OFDM)); |
1452 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->ifs); | 1477 | rt2x00_set_field32(&word, TXD_W0_IFS, txdesc->u.plcp.ifs); |
1453 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, | 1478 | rt2x00_set_field32(&word, TXD_W0_RETRY_MODE, |
1454 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); | 1479 | test_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags)); |
1455 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, | 1480 | rt2x00_set_field32(&word, TXD_W0_TKIP_MIC, |
@@ -1464,20 +1489,22 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1464 | rt2x00_desc_write(txd, 0, word); | 1489 | rt2x00_desc_write(txd, 0, word); |
1465 | 1490 | ||
1466 | rt2x00_desc_read(txd, 1, &word); | 1491 | rt2x00_desc_read(txd, 1, &word); |
1467 | rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, txdesc->queue); | 1492 | rt2x00_set_field32(&word, TXD_W1_HOST_Q_ID, entry->queue->qid); |
1468 | rt2x00_set_field32(&word, TXD_W1_AIFSN, txdesc->aifs); | 1493 | rt2x00_set_field32(&word, TXD_W1_AIFSN, entry->queue->aifs); |
1469 | rt2x00_set_field32(&word, TXD_W1_CWMIN, txdesc->cw_min); | 1494 | rt2x00_set_field32(&word, TXD_W1_CWMIN, entry->queue->cw_min); |
1470 | rt2x00_set_field32(&word, TXD_W1_CWMAX, txdesc->cw_max); | 1495 | rt2x00_set_field32(&word, TXD_W1_CWMAX, entry->queue->cw_max); |
1471 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset); | 1496 | rt2x00_set_field32(&word, TXD_W1_IV_OFFSET, txdesc->iv_offset); |
1472 | rt2x00_set_field32(&word, TXD_W1_HW_SEQUENCE, | 1497 | rt2x00_set_field32(&word, TXD_W1_HW_SEQUENCE, |
1473 | test_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags)); | 1498 | test_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags)); |
1474 | rt2x00_desc_write(txd, 1, word); | 1499 | rt2x00_desc_write(txd, 1, word); |
1475 | 1500 | ||
1476 | rt2x00_desc_read(txd, 2, &word); | 1501 | rt2x00_desc_read(txd, 2, &word); |
1477 | rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->signal); | 1502 | rt2x00_set_field32(&word, TXD_W2_PLCP_SIGNAL, txdesc->u.plcp.signal); |
1478 | rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->service); | 1503 | rt2x00_set_field32(&word, TXD_W2_PLCP_SERVICE, txdesc->u.plcp.service); |
1479 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW, txdesc->length_low); | 1504 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_LOW, |
1480 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_HIGH, txdesc->length_high); | 1505 | txdesc->u.plcp.length_low); |
1506 | rt2x00_set_field32(&word, TXD_W2_PLCP_LENGTH_HIGH, | ||
1507 | txdesc->u.plcp.length_high); | ||
1481 | rt2x00_desc_write(txd, 2, word); | 1508 | rt2x00_desc_write(txd, 2, word); |
1482 | 1509 | ||
1483 | if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags)) { | 1510 | if (test_bit(ENTRY_TXD_ENCRYPT, &txdesc->flags)) { |
@@ -1487,7 +1514,7 @@ static void rt73usb_write_tx_desc(struct rt2x00_dev *rt2x00dev, | |||
1487 | 1514 | ||
1488 | rt2x00_desc_read(txd, 5, &word); | 1515 | rt2x00_desc_read(txd, 5, &word); |
1489 | rt2x00_set_field32(&word, TXD_W5_TX_POWER, | 1516 | rt2x00_set_field32(&word, TXD_W5_TX_POWER, |
1490 | TXPOWER_TO_DEV(rt2x00dev->tx_power)); | 1517 | TXPOWER_TO_DEV(entry->queue->rt2x00dev->tx_power)); |
1491 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); | 1518 | rt2x00_set_field32(&word, TXD_W5_WAITING_DMA_DONE_INT, 1); |
1492 | rt2x00_desc_write(txd, 5, word); | 1519 | rt2x00_desc_write(txd, 5, word); |
1493 | 1520 | ||
@@ -1507,13 +1534,15 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1507 | { | 1534 | { |
1508 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | 1535 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; |
1509 | unsigned int beacon_base; | 1536 | unsigned int beacon_base; |
1510 | u32 reg; | 1537 | unsigned int padding_len; |
1538 | u32 orig_reg, reg; | ||
1511 | 1539 | ||
1512 | /* | 1540 | /* |
1513 | * Disable beaconing while we are reloading the beacon data, | 1541 | * Disable beaconing while we are reloading the beacon data, |
1514 | * otherwise we might be sending out invalid data. | 1542 | * otherwise we might be sending out invalid data. |
1515 | */ | 1543 | */ |
1516 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); | 1544 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); |
1545 | orig_reg = reg; | ||
1517 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); | 1546 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); |
1518 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | 1547 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); |
1519 | 1548 | ||
@@ -1526,7 +1555,7 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1526 | /* | 1555 | /* |
1527 | * Write the TX descriptor for the beacon. | 1556 | * Write the TX descriptor for the beacon. |
1528 | */ | 1557 | */ |
1529 | rt73usb_write_tx_desc(rt2x00dev, entry->skb, txdesc); | 1558 | rt73usb_write_tx_desc(entry, txdesc); |
1530 | 1559 | ||
1531 | /* | 1560 | /* |
1532 | * Dump beacon to userspace through debugfs. | 1561 | * Dump beacon to userspace through debugfs. |
@@ -1534,11 +1563,20 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1534 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb); | 1563 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_BEACON, entry->skb); |
1535 | 1564 | ||
1536 | /* | 1565 | /* |
1537 | * Write entire beacon with descriptor to register. | 1566 | * Write entire beacon with descriptor and padding to register. |
1538 | */ | 1567 | */ |
1568 | padding_len = roundup(entry->skb->len, 4) - entry->skb->len; | ||
1569 | if (padding_len && skb_pad(entry->skb, padding_len)) { | ||
1570 | ERROR(rt2x00dev, "Failure padding beacon, aborting\n"); | ||
1571 | /* skb freed by skb_pad() on failure */ | ||
1572 | entry->skb = NULL; | ||
1573 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, orig_reg); | ||
1574 | return; | ||
1575 | } | ||
1576 | |||
1539 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | 1577 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); |
1540 | rt2x00usb_register_multiwrite(rt2x00dev, beacon_base, | 1578 | rt2x00usb_register_multiwrite(rt2x00dev, beacon_base, entry->skb->data, |
1541 | entry->skb->data, entry->skb->len); | 1579 | entry->skb->len + padding_len); |
1542 | 1580 | ||
1543 | /* | 1581 | /* |
1544 | * Enable beaconing again. | 1582 | * Enable beaconing again. |
@@ -1548,8 +1586,6 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1548 | */ | 1586 | */ |
1549 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR10, 0x00001008); | 1587 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR10, 0x00001008); |
1550 | 1588 | ||
1551 | rt2x00_set_field32(®, TXRX_CSR9_TSF_TICKING, 1); | ||
1552 | rt2x00_set_field32(®, TXRX_CSR9_TBTT_ENABLE, 1); | ||
1553 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 1); | 1589 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 1); |
1554 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | 1590 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); |
1555 | 1591 | ||
@@ -1560,6 +1596,33 @@ static void rt73usb_write_beacon(struct queue_entry *entry, | |||
1560 | entry->skb = NULL; | 1596 | entry->skb = NULL; |
1561 | } | 1597 | } |
1562 | 1598 | ||
1599 | static void rt73usb_clear_beacon(struct queue_entry *entry) | ||
1600 | { | ||
1601 | struct rt2x00_dev *rt2x00dev = entry->queue->rt2x00dev; | ||
1602 | unsigned int beacon_base; | ||
1603 | u32 reg; | ||
1604 | |||
1605 | /* | ||
1606 | * Disable beaconing while we are reloading the beacon data, | ||
1607 | * otherwise we might be sending out invalid data. | ||
1608 | */ | ||
1609 | rt2x00usb_register_read(rt2x00dev, TXRX_CSR9, ®); | ||
1610 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 0); | ||
1611 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
1612 | |||
1613 | /* | ||
1614 | * Clear beacon. | ||
1615 | */ | ||
1616 | beacon_base = HW_BEACON_OFFSET(entry->entry_idx); | ||
1617 | rt2x00usb_register_write(rt2x00dev, beacon_base, 0); | ||
1618 | |||
1619 | /* | ||
1620 | * Enable beaconing again. | ||
1621 | */ | ||
1622 | rt2x00_set_field32(®, TXRX_CSR9_BEACON_GEN, 1); | ||
1623 | rt2x00usb_register_write(rt2x00dev, TXRX_CSR9, reg); | ||
1624 | } | ||
1625 | |||
1563 | static int rt73usb_get_tx_data_len(struct queue_entry *entry) | 1626 | static int rt73usb_get_tx_data_len(struct queue_entry *entry) |
1564 | { | 1627 | { |
1565 | int length; | 1628 | int length; |
@@ -1597,8 +1660,8 @@ static int rt73usb_agc_to_rssi(struct rt2x00_dev *rt2x00dev, int rxd_w1) | |||
1597 | return 0; | 1660 | return 0; |
1598 | } | 1661 | } |
1599 | 1662 | ||
1600 | if (rt2x00dev->rx_status.band == IEEE80211_BAND_5GHZ) { | 1663 | if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { |
1601 | if (test_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags)) { | 1664 | if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags)) { |
1602 | if (lna == 3 || lna == 2) | 1665 | if (lna == 3 || lna == 2) |
1603 | offset += 10; | 1666 | offset += 10; |
1604 | } else { | 1667 | } else { |
@@ -1656,9 +1719,8 @@ static void rt73usb_fill_rxdone(struct queue_entry *entry, | |||
1656 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; | 1719 | rxdesc->flags |= RX_FLAG_IV_STRIPPED; |
1657 | 1720 | ||
1658 | /* | 1721 | /* |
1659 | * FIXME: Legacy driver indicates that the frame does | 1722 | * The hardware has already checked the Michael Mic and has |
1660 | * contain the Michael Mic. Unfortunately, in rt2x00 | 1723 | * stripped it from the frame. Signal this to mac80211. |
1661 | * the MIC seems to be missing completely... | ||
1662 | */ | 1724 | */ |
1663 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; | 1725 | rxdesc->flags |= RX_FLAG_MMIC_STRIPPED; |
1664 | 1726 | ||
@@ -1837,13 +1899,13 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1837 | * Read the Frame type. | 1899 | * Read the Frame type. |
1838 | */ | 1900 | */ |
1839 | if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_FRAME_TYPE)) | 1901 | if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_FRAME_TYPE)) |
1840 | __set_bit(CONFIG_FRAME_TYPE, &rt2x00dev->flags); | 1902 | __set_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags); |
1841 | 1903 | ||
1842 | /* | 1904 | /* |
1843 | * Detect if this device has an hardware controlled radio. | 1905 | * Detect if this device has an hardware controlled radio. |
1844 | */ | 1906 | */ |
1845 | if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) | 1907 | if (rt2x00_get_field16(eeprom, EEPROM_ANTENNA_HARDWARE_RADIO)) |
1846 | __set_bit(CONFIG_SUPPORT_HW_BUTTON, &rt2x00dev->flags); | 1908 | __set_bit(CAPABILITY_HW_BUTTON, &rt2x00dev->cap_flags); |
1847 | 1909 | ||
1848 | /* | 1910 | /* |
1849 | * Read frequency offset. | 1911 | * Read frequency offset. |
@@ -1857,8 +1919,8 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) | |||
1857 | rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); | 1919 | rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); |
1858 | 1920 | ||
1859 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA)) { | 1921 | if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA)) { |
1860 | __set_bit(CONFIG_EXTERNAL_LNA_A, &rt2x00dev->flags); | 1922 | __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); |
1861 | __set_bit(CONFIG_EXTERNAL_LNA_BG, &rt2x00dev->flags); | 1923 | __set_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags); |
1862 | } | 1924 | } |
1863 | 1925 | ||
1864 | /* | 1926 | /* |
@@ -2047,9 +2109,14 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2047 | 2109 | ||
2048 | /* | 2110 | /* |
2049 | * Initialize all hw fields. | 2111 | * Initialize all hw fields. |
2112 | * | ||
2113 | * Don't set IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING unless we are | ||
2114 | * capable of sending the buffered frames out after the DTIM | ||
2115 | * transmission using rt2x00lib_beacondone. This will send out | ||
2116 | * multicast and broadcast traffic immediately instead of buffering it | ||
2117 | * infinitly and thus dropping it after some time. | ||
2050 | */ | 2118 | */ |
2051 | rt2x00dev->hw->flags = | 2119 | rt2x00dev->hw->flags = |
2052 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING | | ||
2053 | IEEE80211_HW_SIGNAL_DBM | | 2120 | IEEE80211_HW_SIGNAL_DBM | |
2054 | IEEE80211_HW_SUPPORTS_PS | | 2121 | IEEE80211_HW_SUPPORTS_PS | |
2055 | IEEE80211_HW_PS_NULLFUNC_STACK; | 2122 | IEEE80211_HW_PS_NULLFUNC_STACK; |
@@ -2084,20 +2151,24 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) | |||
2084 | /* | 2151 | /* |
2085 | * Create channel information array | 2152 | * Create channel information array |
2086 | */ | 2153 | */ |
2087 | info = kzalloc(spec->num_channels * sizeof(*info), GFP_KERNEL); | 2154 | info = kcalloc(spec->num_channels, sizeof(*info), GFP_KERNEL); |
2088 | if (!info) | 2155 | if (!info) |
2089 | return -ENOMEM; | 2156 | return -ENOMEM; |
2090 | 2157 | ||
2091 | spec->channels_info = info; | 2158 | spec->channels_info = info; |
2092 | 2159 | ||
2093 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_G_START); | 2160 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_G_START); |
2094 | for (i = 0; i < 14; i++) | 2161 | for (i = 0; i < 14; i++) { |
2095 | info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]); | 2162 | info[i].max_power = MAX_TXPOWER; |
2163 | info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]); | ||
2164 | } | ||
2096 | 2165 | ||
2097 | if (spec->num_channels > 14) { | 2166 | if (spec->num_channels > 14) { |
2098 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); | 2167 | tx_power = rt2x00_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_A_START); |
2099 | for (i = 14; i < spec->num_channels; i++) | 2168 | for (i = 14; i < spec->num_channels; i++) { |
2100 | info[i].tx_power1 = TXPOWER_FROM_DEV(tx_power[i]); | 2169 | info[i].max_power = MAX_TXPOWER; |
2170 | info[i].default_power1 = TXPOWER_FROM_DEV(tx_power[i]); | ||
2171 | } | ||
2101 | } | 2172 | } |
2102 | 2173 | ||
2103 | return 0; | 2174 | return 0; |
@@ -2129,16 +2200,16 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
2129 | * This device has multiple filters for control frames, | 2200 | * This device has multiple filters for control frames, |
2130 | * but has no a separate filter for PS Poll frames. | 2201 | * but has no a separate filter for PS Poll frames. |
2131 | */ | 2202 | */ |
2132 | __set_bit(DRIVER_SUPPORT_CONTROL_FILTERS, &rt2x00dev->flags); | 2203 | __set_bit(CAPABILITY_CONTROL_FILTERS, &rt2x00dev->cap_flags); |
2133 | 2204 | ||
2134 | /* | 2205 | /* |
2135 | * This device requires firmware. | 2206 | * This device requires firmware. |
2136 | */ | 2207 | */ |
2137 | __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); | 2208 | __set_bit(REQUIRE_FIRMWARE, &rt2x00dev->cap_flags); |
2138 | if (!modparam_nohwcrypt) | 2209 | if (!modparam_nohwcrypt) |
2139 | __set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags); | 2210 | __set_bit(CAPABILITY_HW_CRYPTO, &rt2x00dev->cap_flags); |
2140 | __set_bit(DRIVER_SUPPORT_LINK_TUNING, &rt2x00dev->flags); | 2211 | __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags); |
2141 | __set_bit(DRIVER_SUPPORT_WATCHDOG, &rt2x00dev->flags); | 2212 | __set_bit(REQUIRE_PS_AUTOWAKE, &rt2x00dev->cap_flags); |
2142 | 2213 | ||
2143 | /* | 2214 | /* |
2144 | * Set the rssi offset. | 2215 | * Set the rssi offset. |
@@ -2178,7 +2249,7 @@ static int rt73usb_conf_tx(struct ieee80211_hw *hw, u16 queue_idx, | |||
2178 | if (queue_idx >= 4) | 2249 | if (queue_idx >= 4) |
2179 | return 0; | 2250 | return 0; |
2180 | 2251 | ||
2181 | queue = rt2x00queue_get_queue(rt2x00dev, queue_idx); | 2252 | queue = rt2x00queue_get_tx_queue(rt2x00dev, queue_idx); |
2182 | 2253 | ||
2183 | /* Update WMM TXOP register */ | 2254 | /* Update WMM TXOP register */ |
2184 | offset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx & 2))); | 2255 | offset = AC_TXOP_CSR0 + (sizeof(u32) * (!!(queue_idx & 2))); |
@@ -2239,6 +2310,10 @@ static const struct ieee80211_ops rt73usb_mac80211_ops = { | |||
2239 | .conf_tx = rt73usb_conf_tx, | 2310 | .conf_tx = rt73usb_conf_tx, |
2240 | .get_tsf = rt73usb_get_tsf, | 2311 | .get_tsf = rt73usb_get_tsf, |
2241 | .rfkill_poll = rt2x00mac_rfkill_poll, | 2312 | .rfkill_poll = rt2x00mac_rfkill_poll, |
2313 | .flush = rt2x00mac_flush, | ||
2314 | .set_antenna = rt2x00mac_set_antenna, | ||
2315 | .get_antenna = rt2x00mac_get_antenna, | ||
2316 | .get_ringparam = rt2x00mac_get_ringparam, | ||
2242 | }; | 2317 | }; |
2243 | 2318 | ||
2244 | static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { | 2319 | static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { |
@@ -2255,11 +2330,14 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { | |||
2255 | .reset_tuner = rt73usb_reset_tuner, | 2330 | .reset_tuner = rt73usb_reset_tuner, |
2256 | .link_tuner = rt73usb_link_tuner, | 2331 | .link_tuner = rt73usb_link_tuner, |
2257 | .watchdog = rt2x00usb_watchdog, | 2332 | .watchdog = rt2x00usb_watchdog, |
2333 | .start_queue = rt73usb_start_queue, | ||
2334 | .kick_queue = rt2x00usb_kick_queue, | ||
2335 | .stop_queue = rt73usb_stop_queue, | ||
2336 | .flush_queue = rt2x00usb_flush_queue, | ||
2258 | .write_tx_desc = rt73usb_write_tx_desc, | 2337 | .write_tx_desc = rt73usb_write_tx_desc, |
2259 | .write_beacon = rt73usb_write_beacon, | 2338 | .write_beacon = rt73usb_write_beacon, |
2339 | .clear_beacon = rt73usb_clear_beacon, | ||
2260 | .get_tx_data_len = rt73usb_get_tx_data_len, | 2340 | .get_tx_data_len = rt73usb_get_tx_data_len, |
2261 | .kick_tx_queue = rt2x00usb_kick_tx_queue, | ||
2262 | .kill_tx_queue = rt2x00usb_kill_tx_queue, | ||
2263 | .fill_rxdone = rt73usb_fill_rxdone, | 2341 | .fill_rxdone = rt73usb_fill_rxdone, |
2264 | .config_shared_key = rt73usb_config_shared_key, | 2342 | .config_shared_key = rt73usb_config_shared_key, |
2265 | .config_pairwise_key = rt73usb_config_pairwise_key, | 2343 | .config_pairwise_key = rt73usb_config_pairwise_key, |
@@ -2271,21 +2349,21 @@ static const struct rt2x00lib_ops rt73usb_rt2x00_ops = { | |||
2271 | }; | 2349 | }; |
2272 | 2350 | ||
2273 | static const struct data_queue_desc rt73usb_queue_rx = { | 2351 | static const struct data_queue_desc rt73usb_queue_rx = { |
2274 | .entry_num = RX_ENTRIES, | 2352 | .entry_num = 32, |
2275 | .data_size = DATA_FRAME_SIZE, | 2353 | .data_size = DATA_FRAME_SIZE, |
2276 | .desc_size = RXD_DESC_SIZE, | 2354 | .desc_size = RXD_DESC_SIZE, |
2277 | .priv_size = sizeof(struct queue_entry_priv_usb), | 2355 | .priv_size = sizeof(struct queue_entry_priv_usb), |
2278 | }; | 2356 | }; |
2279 | 2357 | ||
2280 | static const struct data_queue_desc rt73usb_queue_tx = { | 2358 | static const struct data_queue_desc rt73usb_queue_tx = { |
2281 | .entry_num = TX_ENTRIES, | 2359 | .entry_num = 32, |
2282 | .data_size = DATA_FRAME_SIZE, | 2360 | .data_size = DATA_FRAME_SIZE, |
2283 | .desc_size = TXD_DESC_SIZE, | 2361 | .desc_size = TXD_DESC_SIZE, |
2284 | .priv_size = sizeof(struct queue_entry_priv_usb), | 2362 | .priv_size = sizeof(struct queue_entry_priv_usb), |
2285 | }; | 2363 | }; |
2286 | 2364 | ||
2287 | static const struct data_queue_desc rt73usb_queue_bcn = { | 2365 | static const struct data_queue_desc rt73usb_queue_bcn = { |
2288 | .entry_num = 4 * BEACON_ENTRIES, | 2366 | .entry_num = 4, |
2289 | .data_size = MGMT_FRAME_SIZE, | 2367 | .data_size = MGMT_FRAME_SIZE, |
2290 | .desc_size = TXINFO_SIZE, | 2368 | .desc_size = TXINFO_SIZE, |
2291 | .priv_size = sizeof(struct queue_entry_priv_usb), | 2369 | .priv_size = sizeof(struct queue_entry_priv_usb), |
@@ -2314,112 +2392,113 @@ static const struct rt2x00_ops rt73usb_ops = { | |||
2314 | */ | 2392 | */ |
2315 | static struct usb_device_id rt73usb_device_table[] = { | 2393 | static struct usb_device_id rt73usb_device_table[] = { |
2316 | /* AboCom */ | 2394 | /* AboCom */ |
2317 | { USB_DEVICE(0x07b8, 0xb21b), USB_DEVICE_DATA(&rt73usb_ops) }, | 2395 | { USB_DEVICE(0x07b8, 0xb21b) }, |
2318 | { USB_DEVICE(0x07b8, 0xb21c), USB_DEVICE_DATA(&rt73usb_ops) }, | 2396 | { USB_DEVICE(0x07b8, 0xb21c) }, |
2319 | { USB_DEVICE(0x07b8, 0xb21d), USB_DEVICE_DATA(&rt73usb_ops) }, | 2397 | { USB_DEVICE(0x07b8, 0xb21d) }, |
2320 | { USB_DEVICE(0x07b8, 0xb21e), USB_DEVICE_DATA(&rt73usb_ops) }, | 2398 | { USB_DEVICE(0x07b8, 0xb21e) }, |
2321 | { USB_DEVICE(0x07b8, 0xb21f), USB_DEVICE_DATA(&rt73usb_ops) }, | 2399 | { USB_DEVICE(0x07b8, 0xb21f) }, |
2322 | /* AL */ | 2400 | /* AL */ |
2323 | { USB_DEVICE(0x14b2, 0x3c10), USB_DEVICE_DATA(&rt73usb_ops) }, | 2401 | { USB_DEVICE(0x14b2, 0x3c10) }, |
2324 | /* Amigo */ | 2402 | /* Amigo */ |
2325 | { USB_DEVICE(0x148f, 0x9021), USB_DEVICE_DATA(&rt73usb_ops) }, | 2403 | { USB_DEVICE(0x148f, 0x9021) }, |
2326 | { USB_DEVICE(0x0eb0, 0x9021), USB_DEVICE_DATA(&rt73usb_ops) }, | 2404 | { USB_DEVICE(0x0eb0, 0x9021) }, |
2327 | /* AMIT */ | 2405 | /* AMIT */ |
2328 | { USB_DEVICE(0x18c5, 0x0002), USB_DEVICE_DATA(&rt73usb_ops) }, | 2406 | { USB_DEVICE(0x18c5, 0x0002) }, |
2329 | /* Askey */ | 2407 | /* Askey */ |
2330 | { USB_DEVICE(0x1690, 0x0722), USB_DEVICE_DATA(&rt73usb_ops) }, | 2408 | { USB_DEVICE(0x1690, 0x0722) }, |
2331 | /* ASUS */ | 2409 | /* ASUS */ |
2332 | { USB_DEVICE(0x0b05, 0x1723), USB_DEVICE_DATA(&rt73usb_ops) }, | 2410 | { USB_DEVICE(0x0b05, 0x1723) }, |
2333 | { USB_DEVICE(0x0b05, 0x1724), USB_DEVICE_DATA(&rt73usb_ops) }, | 2411 | { USB_DEVICE(0x0b05, 0x1724) }, |
2334 | /* Belkin */ | 2412 | /* Belkin */ |
2335 | { USB_DEVICE(0x050d, 0x7050), USB_DEVICE_DATA(&rt73usb_ops) }, | 2413 | { USB_DEVICE(0x050d, 0x705a) }, |
2336 | { USB_DEVICE(0x050d, 0x705a), USB_DEVICE_DATA(&rt73usb_ops) }, | 2414 | { USB_DEVICE(0x050d, 0x905b) }, |
2337 | { USB_DEVICE(0x050d, 0x905b), USB_DEVICE_DATA(&rt73usb_ops) }, | 2415 | { USB_DEVICE(0x050d, 0x905c) }, |
2338 | { USB_DEVICE(0x050d, 0x905c), USB_DEVICE_DATA(&rt73usb_ops) }, | ||
2339 | /* Billionton */ | 2416 | /* Billionton */ |
2340 | { USB_DEVICE(0x1631, 0xc019), USB_DEVICE_DATA(&rt73usb_ops) }, | 2417 | { USB_DEVICE(0x1631, 0xc019) }, |
2341 | { USB_DEVICE(0x08dd, 0x0120), USB_DEVICE_DATA(&rt73usb_ops) }, | 2418 | { USB_DEVICE(0x08dd, 0x0120) }, |
2342 | /* Buffalo */ | 2419 | /* Buffalo */ |
2343 | { USB_DEVICE(0x0411, 0x00d8), USB_DEVICE_DATA(&rt73usb_ops) }, | 2420 | { USB_DEVICE(0x0411, 0x00d8) }, |
2344 | { USB_DEVICE(0x0411, 0x00d9), USB_DEVICE_DATA(&rt73usb_ops) }, | 2421 | { USB_DEVICE(0x0411, 0x00d9) }, |
2345 | { USB_DEVICE(0x0411, 0x00f4), USB_DEVICE_DATA(&rt73usb_ops) }, | 2422 | { USB_DEVICE(0x0411, 0x00f4) }, |
2346 | { USB_DEVICE(0x0411, 0x0116), USB_DEVICE_DATA(&rt73usb_ops) }, | 2423 | { USB_DEVICE(0x0411, 0x0116) }, |
2347 | { USB_DEVICE(0x0411, 0x0119), USB_DEVICE_DATA(&rt73usb_ops) }, | 2424 | { USB_DEVICE(0x0411, 0x0119) }, |
2425 | { USB_DEVICE(0x0411, 0x0137) }, | ||
2348 | /* CEIVA */ | 2426 | /* CEIVA */ |
2349 | { USB_DEVICE(0x178d, 0x02be), USB_DEVICE_DATA(&rt73usb_ops) }, | 2427 | { USB_DEVICE(0x178d, 0x02be) }, |
2350 | /* CNet */ | 2428 | /* CNet */ |
2351 | { USB_DEVICE(0x1371, 0x9022), USB_DEVICE_DATA(&rt73usb_ops) }, | 2429 | { USB_DEVICE(0x1371, 0x9022) }, |
2352 | { USB_DEVICE(0x1371, 0x9032), USB_DEVICE_DATA(&rt73usb_ops) }, | 2430 | { USB_DEVICE(0x1371, 0x9032) }, |
2353 | /* Conceptronic */ | 2431 | /* Conceptronic */ |
2354 | { USB_DEVICE(0x14b2, 0x3c22), USB_DEVICE_DATA(&rt73usb_ops) }, | 2432 | { USB_DEVICE(0x14b2, 0x3c22) }, |
2355 | /* Corega */ | 2433 | /* Corega */ |
2356 | { USB_DEVICE(0x07aa, 0x002e), USB_DEVICE_DATA(&rt73usb_ops) }, | 2434 | { USB_DEVICE(0x07aa, 0x002e) }, |
2357 | /* D-Link */ | 2435 | /* D-Link */ |
2358 | { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, | 2436 | { USB_DEVICE(0x07d1, 0x3c03) }, |
2359 | { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, | 2437 | { USB_DEVICE(0x07d1, 0x3c04) }, |
2360 | { USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) }, | 2438 | { USB_DEVICE(0x07d1, 0x3c06) }, |
2361 | { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) }, | 2439 | { USB_DEVICE(0x07d1, 0x3c07) }, |
2362 | /* Edimax */ | 2440 | /* Edimax */ |
2363 | { USB_DEVICE(0x7392, 0x7318), USB_DEVICE_DATA(&rt73usb_ops) }, | 2441 | { USB_DEVICE(0x7392, 0x7318) }, |
2364 | { USB_DEVICE(0x7392, 0x7618), USB_DEVICE_DATA(&rt73usb_ops) }, | 2442 | { USB_DEVICE(0x7392, 0x7618) }, |
2365 | /* EnGenius */ | 2443 | /* EnGenius */ |
2366 | { USB_DEVICE(0x1740, 0x3701), USB_DEVICE_DATA(&rt73usb_ops) }, | 2444 | { USB_DEVICE(0x1740, 0x3701) }, |
2367 | /* Gemtek */ | 2445 | /* Gemtek */ |
2368 | { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, | 2446 | { USB_DEVICE(0x15a9, 0x0004) }, |
2369 | /* Gigabyte */ | 2447 | /* Gigabyte */ |
2370 | { USB_DEVICE(0x1044, 0x8008), USB_DEVICE_DATA(&rt73usb_ops) }, | 2448 | { USB_DEVICE(0x1044, 0x8008) }, |
2371 | { USB_DEVICE(0x1044, 0x800a), USB_DEVICE_DATA(&rt73usb_ops) }, | 2449 | { USB_DEVICE(0x1044, 0x800a) }, |
2372 | /* Huawei-3Com */ | 2450 | /* Huawei-3Com */ |
2373 | { USB_DEVICE(0x1472, 0x0009), USB_DEVICE_DATA(&rt73usb_ops) }, | 2451 | { USB_DEVICE(0x1472, 0x0009) }, |
2374 | /* Hercules */ | 2452 | /* Hercules */ |
2375 | { USB_DEVICE(0x06f8, 0xe002), USB_DEVICE_DATA(&rt73usb_ops) }, | 2453 | { USB_DEVICE(0x06f8, 0xe002) }, |
2376 | { USB_DEVICE(0x06f8, 0xe010), USB_DEVICE_DATA(&rt73usb_ops) }, | 2454 | { USB_DEVICE(0x06f8, 0xe010) }, |
2377 | { USB_DEVICE(0x06f8, 0xe020), USB_DEVICE_DATA(&rt73usb_ops) }, | 2455 | { USB_DEVICE(0x06f8, 0xe020) }, |
2378 | /* Linksys */ | 2456 | /* Linksys */ |
2379 | { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) }, | 2457 | { USB_DEVICE(0x13b1, 0x0020) }, |
2380 | { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) }, | 2458 | { USB_DEVICE(0x13b1, 0x0023) }, |
2381 | { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) }, | 2459 | { USB_DEVICE(0x13b1, 0x0028) }, |
2382 | /* MSI */ | 2460 | /* MSI */ |
2383 | { USB_DEVICE(0x0db0, 0x4600), USB_DEVICE_DATA(&rt73usb_ops) }, | 2461 | { USB_DEVICE(0x0db0, 0x4600) }, |
2384 | { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) }, | 2462 | { USB_DEVICE(0x0db0, 0x6877) }, |
2385 | { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) }, | 2463 | { USB_DEVICE(0x0db0, 0x6874) }, |
2386 | { USB_DEVICE(0x0db0, 0xa861), USB_DEVICE_DATA(&rt73usb_ops) }, | 2464 | { USB_DEVICE(0x0db0, 0xa861) }, |
2387 | { USB_DEVICE(0x0db0, 0xa874), USB_DEVICE_DATA(&rt73usb_ops) }, | 2465 | { USB_DEVICE(0x0db0, 0xa874) }, |
2388 | /* Ovislink */ | 2466 | /* Ovislink */ |
2389 | { USB_DEVICE(0x1b75, 0x7318), USB_DEVICE_DATA(&rt73usb_ops) }, | 2467 | { USB_DEVICE(0x1b75, 0x7318) }, |
2390 | /* Ralink */ | 2468 | /* Ralink */ |
2391 | { USB_DEVICE(0x04bb, 0x093d), USB_DEVICE_DATA(&rt73usb_ops) }, | 2469 | { USB_DEVICE(0x04bb, 0x093d) }, |
2392 | { USB_DEVICE(0x148f, 0x2573), USB_DEVICE_DATA(&rt73usb_ops) }, | 2470 | { USB_DEVICE(0x148f, 0x2573) }, |
2393 | { USB_DEVICE(0x148f, 0x2671), USB_DEVICE_DATA(&rt73usb_ops) }, | 2471 | { USB_DEVICE(0x148f, 0x2671) }, |
2472 | { USB_DEVICE(0x0812, 0x3101) }, | ||
2394 | /* Qcom */ | 2473 | /* Qcom */ |
2395 | { USB_DEVICE(0x18e8, 0x6196), USB_DEVICE_DATA(&rt73usb_ops) }, | 2474 | { USB_DEVICE(0x18e8, 0x6196) }, |
2396 | { USB_DEVICE(0x18e8, 0x6229), USB_DEVICE_DATA(&rt73usb_ops) }, | 2475 | { USB_DEVICE(0x18e8, 0x6229) }, |
2397 | { USB_DEVICE(0x18e8, 0x6238), USB_DEVICE_DATA(&rt73usb_ops) }, | 2476 | { USB_DEVICE(0x18e8, 0x6238) }, |
2398 | /* Samsung */ | 2477 | /* Samsung */ |
2399 | { USB_DEVICE(0x04e8, 0x4471), USB_DEVICE_DATA(&rt73usb_ops) }, | 2478 | { USB_DEVICE(0x04e8, 0x4471) }, |
2400 | /* Senao */ | 2479 | /* Senao */ |
2401 | { USB_DEVICE(0x1740, 0x7100), USB_DEVICE_DATA(&rt73usb_ops) }, | 2480 | { USB_DEVICE(0x1740, 0x7100) }, |
2402 | /* Sitecom */ | 2481 | /* Sitecom */ |
2403 | { USB_DEVICE(0x0df6, 0x0024), USB_DEVICE_DATA(&rt73usb_ops) }, | 2482 | { USB_DEVICE(0x0df6, 0x0024) }, |
2404 | { USB_DEVICE(0x0df6, 0x0027), USB_DEVICE_DATA(&rt73usb_ops) }, | 2483 | { USB_DEVICE(0x0df6, 0x0027) }, |
2405 | { USB_DEVICE(0x0df6, 0x002f), USB_DEVICE_DATA(&rt73usb_ops) }, | 2484 | { USB_DEVICE(0x0df6, 0x002f) }, |
2406 | { USB_DEVICE(0x0df6, 0x90ac), USB_DEVICE_DATA(&rt73usb_ops) }, | 2485 | { USB_DEVICE(0x0df6, 0x90ac) }, |
2407 | { USB_DEVICE(0x0df6, 0x9712), USB_DEVICE_DATA(&rt73usb_ops) }, | 2486 | { USB_DEVICE(0x0df6, 0x9712) }, |
2408 | /* Surecom */ | 2487 | /* Surecom */ |
2409 | { USB_DEVICE(0x0769, 0x31f3), USB_DEVICE_DATA(&rt73usb_ops) }, | 2488 | { USB_DEVICE(0x0769, 0x31f3) }, |
2410 | /* Tilgin */ | 2489 | /* Tilgin */ |
2411 | { USB_DEVICE(0x6933, 0x5001), USB_DEVICE_DATA(&rt73usb_ops) }, | 2490 | { USB_DEVICE(0x6933, 0x5001) }, |
2412 | /* Philips */ | 2491 | /* Philips */ |
2413 | { USB_DEVICE(0x0471, 0x200a), USB_DEVICE_DATA(&rt73usb_ops) }, | 2492 | { USB_DEVICE(0x0471, 0x200a) }, |
2414 | /* Planex */ | 2493 | /* Planex */ |
2415 | { USB_DEVICE(0x2019, 0xab01), USB_DEVICE_DATA(&rt73usb_ops) }, | 2494 | { USB_DEVICE(0x2019, 0xab01) }, |
2416 | { USB_DEVICE(0x2019, 0xab50), USB_DEVICE_DATA(&rt73usb_ops) }, | 2495 | { USB_DEVICE(0x2019, 0xab50) }, |
2417 | /* WideTell */ | 2496 | /* WideTell */ |
2418 | { USB_DEVICE(0x7167, 0x3840), USB_DEVICE_DATA(&rt73usb_ops) }, | 2497 | { USB_DEVICE(0x7167, 0x3840) }, |
2419 | /* Zcom */ | 2498 | /* Zcom */ |
2420 | { USB_DEVICE(0x0cde, 0x001c), USB_DEVICE_DATA(&rt73usb_ops) }, | 2499 | { USB_DEVICE(0x0cde, 0x001c) }, |
2421 | /* ZyXEL */ | 2500 | /* ZyXEL */ |
2422 | { USB_DEVICE(0x0586, 0x3415), USB_DEVICE_DATA(&rt73usb_ops) }, | 2501 | { USB_DEVICE(0x0586, 0x3415) }, |
2423 | { 0, } | 2502 | { 0, } |
2424 | }; | 2503 | }; |
2425 | 2504 | ||
@@ -2431,10 +2510,16 @@ MODULE_DEVICE_TABLE(usb, rt73usb_device_table); | |||
2431 | MODULE_FIRMWARE(FIRMWARE_RT2571); | 2510 | MODULE_FIRMWARE(FIRMWARE_RT2571); |
2432 | MODULE_LICENSE("GPL"); | 2511 | MODULE_LICENSE("GPL"); |
2433 | 2512 | ||
2513 | static int rt73usb_probe(struct usb_interface *usb_intf, | ||
2514 | const struct usb_device_id *id) | ||
2515 | { | ||
2516 | return rt2x00usb_probe(usb_intf, &rt73usb_ops); | ||
2517 | } | ||
2518 | |||
2434 | static struct usb_driver rt73usb_driver = { | 2519 | static struct usb_driver rt73usb_driver = { |
2435 | .name = KBUILD_MODNAME, | 2520 | .name = KBUILD_MODNAME, |
2436 | .id_table = rt73usb_device_table, | 2521 | .id_table = rt73usb_device_table, |
2437 | .probe = rt2x00usb_probe, | 2522 | .probe = rt73usb_probe, |
2438 | .disconnect = rt2x00usb_disconnect, | 2523 | .disconnect = rt2x00usb_disconnect, |
2439 | .suspend = rt2x00usb_suspend, | 2524 | .suspend = rt2x00usb_suspend, |
2440 | .resume = rt2x00usb_resume, | 2525 | .resume = rt2x00usb_resume, |