diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00dev.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 148 |
1 files changed, 0 insertions, 148 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 46c377873f16..171f445962db 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -612,154 +612,6 @@ void rt2x00lib_rxdone(struct queue_entry *entry, | |||
612 | EXPORT_SYMBOL_GPL(rt2x00lib_rxdone); | 612 | EXPORT_SYMBOL_GPL(rt2x00lib_rxdone); |
613 | 613 | ||
614 | /* | 614 | /* |
615 | * TX descriptor initializer | ||
616 | */ | ||
617 | void rt2x00lib_write_tx_desc(struct rt2x00_dev *rt2x00dev, | ||
618 | struct sk_buff *skb, | ||
619 | struct ieee80211_tx_control *control) | ||
620 | { | ||
621 | struct txentry_desc txdesc; | ||
622 | struct skb_frame_desc *skbdesc = get_skb_frame_desc(skb); | ||
623 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skbdesc->data; | ||
624 | const struct rt2x00_rate *rate; | ||
625 | int tx_rate; | ||
626 | int length; | ||
627 | int duration; | ||
628 | int residual; | ||
629 | u16 frame_control; | ||
630 | u16 seq_ctrl; | ||
631 | |||
632 | memset(&txdesc, 0, sizeof(txdesc)); | ||
633 | |||
634 | txdesc.queue = skbdesc->entry->queue->qid; | ||
635 | txdesc.cw_min = skbdesc->entry->queue->cw_min; | ||
636 | txdesc.cw_max = skbdesc->entry->queue->cw_max; | ||
637 | txdesc.aifs = skbdesc->entry->queue->aifs; | ||
638 | |||
639 | /* | ||
640 | * Read required fields from ieee80211 header. | ||
641 | */ | ||
642 | frame_control = le16_to_cpu(hdr->frame_control); | ||
643 | seq_ctrl = le16_to_cpu(hdr->seq_ctrl); | ||
644 | |||
645 | tx_rate = control->tx_rate->hw_value; | ||
646 | |||
647 | /* | ||
648 | * Check whether this frame is to be acked | ||
649 | */ | ||
650 | if (!(control->flags & IEEE80211_TXCTL_NO_ACK)) | ||
651 | __set_bit(ENTRY_TXD_ACK, &txdesc.flags); | ||
652 | |||
653 | /* | ||
654 | * Check if this is a RTS/CTS frame | ||
655 | */ | ||
656 | if (is_rts_frame(frame_control) || is_cts_frame(frame_control)) { | ||
657 | __set_bit(ENTRY_TXD_BURST, &txdesc.flags); | ||
658 | if (is_rts_frame(frame_control)) { | ||
659 | __set_bit(ENTRY_TXD_RTS_FRAME, &txdesc.flags); | ||
660 | __set_bit(ENTRY_TXD_ACK, &txdesc.flags); | ||
661 | } else | ||
662 | __clear_bit(ENTRY_TXD_ACK, &txdesc.flags); | ||
663 | if (control->rts_cts_rate) | ||
664 | tx_rate = control->rts_cts_rate->hw_value; | ||
665 | } | ||
666 | |||
667 | /* | ||
668 | * Determine retry information. | ||
669 | */ | ||
670 | txdesc.retry_limit = control->retry_limit; | ||
671 | if (control->flags & IEEE80211_TXCTL_LONG_RETRY_LIMIT) | ||
672 | __set_bit(ENTRY_TXD_RETRY_MODE, &txdesc.flags); | ||
673 | |||
674 | /* | ||
675 | * Check if more fragments are pending | ||
676 | */ | ||
677 | if (ieee80211_get_morefrag(hdr)) { | ||
678 | __set_bit(ENTRY_TXD_BURST, &txdesc.flags); | ||
679 | __set_bit(ENTRY_TXD_MORE_FRAG, &txdesc.flags); | ||
680 | } | ||
681 | |||
682 | /* | ||
683 | * Beacons and probe responses require the tsf timestamp | ||
684 | * to be inserted into the frame. | ||
685 | */ | ||
686 | if (txdesc.queue == QID_BEACON || is_probe_resp(frame_control)) | ||
687 | __set_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc.flags); | ||
688 | |||
689 | /* | ||
690 | * Determine with what IFS priority this frame should be send. | ||
691 | * Set ifs to IFS_SIFS when the this is not the first fragment, | ||
692 | * or this fragment came after RTS/CTS. | ||
693 | */ | ||
694 | if (test_bit(ENTRY_TXD_RTS_FRAME, &txdesc.flags)) { | ||
695 | txdesc.ifs = IFS_SIFS; | ||
696 | } else if (control->flags & IEEE80211_TXCTL_FIRST_FRAGMENT) { | ||
697 | __set_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc.flags); | ||
698 | txdesc.ifs = IFS_BACKOFF; | ||
699 | } else { | ||
700 | txdesc.ifs = IFS_SIFS; | ||
701 | } | ||
702 | |||
703 | /* | ||
704 | * PLCP setup | ||
705 | * Length calculation depends on OFDM/CCK rate. | ||
706 | */ | ||
707 | rate = rt2x00_get_rate(tx_rate); | ||
708 | txdesc.signal = rate->plcp; | ||
709 | txdesc.service = 0x04; | ||
710 | |||
711 | length = skbdesc->data_len + FCS_LEN; | ||
712 | if (rate->flags & DEV_RATE_OFDM) { | ||
713 | __set_bit(ENTRY_TXD_OFDM_RATE, &txdesc.flags); | ||
714 | |||
715 | txdesc.length_high = (length >> 6) & 0x3f; | ||
716 | txdesc.length_low = length & 0x3f; | ||
717 | } else { | ||
718 | /* | ||
719 | * Convert length to microseconds. | ||
720 | */ | ||
721 | residual = get_duration_res(length, rate->bitrate); | ||
722 | duration = get_duration(length, rate->bitrate); | ||
723 | |||
724 | if (residual != 0) { | ||
725 | duration++; | ||
726 | |||
727 | /* | ||
728 | * Check if we need to set the Length Extension | ||
729 | */ | ||
730 | if (rate->bitrate == 110 && residual <= 30) | ||
731 | txdesc.service |= 0x80; | ||
732 | } | ||
733 | |||
734 | txdesc.length_high = (duration >> 8) & 0xff; | ||
735 | txdesc.length_low = duration & 0xff; | ||
736 | |||
737 | /* | ||
738 | * When preamble is enabled we should set the | ||
739 | * preamble bit for the signal. | ||
740 | */ | ||
741 | if (rt2x00_get_rate_preamble(tx_rate)) | ||
742 | txdesc.signal |= 0x08; | ||
743 | } | ||
744 | |||
745 | rt2x00dev->ops->lib->write_tx_desc(rt2x00dev, skb, &txdesc); | ||
746 | |||
747 | /* | ||
748 | * Update queue entry. | ||
749 | */ | ||
750 | skbdesc->entry->skb = skb; | ||
751 | |||
752 | /* | ||
753 | * The frame has been completely initialized and ready | ||
754 | * for sending to the device. The caller will push the | ||
755 | * frame to the device, but we are going to push the | ||
756 | * frame to debugfs here. | ||
757 | */ | ||
758 | rt2x00debug_dump_frame(rt2x00dev, DUMP_FRAME_TX, skb); | ||
759 | } | ||
760 | EXPORT_SYMBOL_GPL(rt2x00lib_write_tx_desc); | ||
761 | |||
762 | /* | ||
763 | * Driver initialization handlers. | 615 | * Driver initialization handlers. |
764 | */ | 616 | */ |
765 | const struct rt2x00_rate rt2x00_supported_rates[12] = { | 617 | const struct rt2x00_rate rt2x00_supported_rates[12] = { |