diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00ht.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00ht.c | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00ht.c b/drivers/net/wireless/rt2x00/rt2x00ht.c index 5a407602ce3e..c004cd3a8847 100644 --- a/drivers/net/wireless/rt2x00/rt2x00ht.c +++ b/drivers/net/wireless/rt2x00/rt2x00ht.c | |||
@@ -44,11 +44,22 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
44 | txdesc->mpdu_density = 0; | 44 | txdesc->mpdu_density = 0; |
45 | 45 | ||
46 | txdesc->ba_size = 7; /* FIXME: What value is needed? */ | 46 | txdesc->ba_size = 7; /* FIXME: What value is needed? */ |
47 | txdesc->stbc = 0; /* FIXME: What value is needed? */ | ||
48 | 47 | ||
49 | txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs); | 48 | txdesc->stbc = |
50 | if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | 49 | (tx_info->flags & IEEE80211_TX_CTL_STBC) >> IEEE80211_TX_CTL_STBC_SHIFT; |
51 | txdesc->mcs |= 0x08; | 50 | |
51 | /* | ||
52 | * If IEEE80211_TX_RC_MCS is set txrate->idx just contains the | ||
53 | * mcs rate to be used | ||
54 | */ | ||
55 | if (txrate->flags & IEEE80211_TX_RC_MCS) { | ||
56 | txdesc->mcs = txrate->idx; | ||
57 | } else { | ||
58 | txdesc->mcs = rt2x00_get_rate_mcs(hwrate->mcs); | ||
59 | if (txrate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) | ||
60 | txdesc->mcs |= 0x08; | ||
61 | } | ||
62 | |||
52 | 63 | ||
53 | /* | 64 | /* |
54 | * Convert flags | 65 | * Convert flags |
@@ -84,3 +95,31 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry, | |||
84 | else | 95 | else |
85 | txdesc->txop = TXOP_HTTXOP; | 96 | txdesc->txop = TXOP_HTTXOP; |
86 | } | 97 | } |
98 | |||
99 | u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev, | ||
100 | struct ieee80211_conf *conf) | ||
101 | { | ||
102 | struct hw_mode_spec *spec = &rt2x00dev->spec; | ||
103 | int center_channel; | ||
104 | u16 i; | ||
105 | |||
106 | /* | ||
107 | * Initialize center channel to current channel. | ||
108 | */ | ||
109 | center_channel = spec->channels[conf->channel->hw_value].channel; | ||
110 | |||
111 | /* | ||
112 | * Adjust center channel to HT40+ and HT40- operation. | ||
113 | */ | ||
114 | if (conf_is_ht40_plus(conf)) | ||
115 | center_channel += 2; | ||
116 | else if (conf_is_ht40_minus(conf)) | ||
117 | center_channel -= (center_channel == 14) ? 1 : 2; | ||
118 | |||
119 | for (i = 0; i < spec->num_channels; i++) | ||
120 | if (spec->channels[i].channel == center_channel) | ||
121 | return i; | ||
122 | |||
123 | WARN_ON(1); | ||
124 | return conf->channel->hw_value; | ||
125 | } | ||