diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00config.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00config.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index e225a66f59a0..f70a2b45d430 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -163,6 +163,34 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev, | |||
163 | rt2x00queue_start_queue(rt2x00dev->rx); | 163 | rt2x00queue_start_queue(rt2x00dev->rx); |
164 | } | 164 | } |
165 | 165 | ||
166 | static u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev, | ||
167 | struct ieee80211_conf *conf) | ||
168 | { | ||
169 | struct hw_mode_spec *spec = &rt2x00dev->spec; | ||
170 | int center_channel; | ||
171 | u16 i; | ||
172 | |||
173 | /* | ||
174 | * Initialize center channel to current channel. | ||
175 | */ | ||
176 | center_channel = spec->channels[conf->channel->hw_value].channel; | ||
177 | |||
178 | /* | ||
179 | * Adjust center channel to HT40+ and HT40- operation. | ||
180 | */ | ||
181 | if (conf_is_ht40_plus(conf)) | ||
182 | center_channel += 2; | ||
183 | else if (conf_is_ht40_minus(conf)) | ||
184 | center_channel -= (center_channel == 14) ? 1 : 2; | ||
185 | |||
186 | for (i = 0; i < spec->num_channels; i++) | ||
187 | if (spec->channels[i].channel == center_channel) | ||
188 | return i; | ||
189 | |||
190 | WARN_ON(1); | ||
191 | return conf->channel->hw_value; | ||
192 | } | ||
193 | |||
166 | void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, | 194 | void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, |
167 | struct ieee80211_conf *conf, | 195 | struct ieee80211_conf *conf, |
168 | unsigned int ieee80211_flags) | 196 | unsigned int ieee80211_flags) |