Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202802
b: refs/heads/master
c: 06443e4
h: refs/heads/master
v: v3
  • Loading branch information
Gertjan van Wingerde authored and Ivo van Doorn committed Jun 3, 2010
1 parent 0581fb4 commit 7213e9d
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 532bc2d5244bd32d321da457d8e3919a1ed00c2e
refs/heads/master: 06443e46c65915d74b03fe1de10c00748e4706ee
5 changes: 1 addition & 4 deletions trunk/drivers/net/wireless/rt2x00/rt2800lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2531,11 +2531,8 @@ int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
else
spec->ht.ht_supported = false;

/*
* Don't set IEEE80211_HT_CAP_SUP_WIDTH_20_40 for now as it causes
* reception problems with HT40 capable 11n APs
*/
spec->ht.cap =
IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
IEEE80211_HT_CAP_GRN_FLD |
IEEE80211_HT_CAP_SGI_20 |
IEEE80211_HT_CAP_SGI_40 |
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/net/wireless/rt2x00/rt2x00config.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,23 +170,27 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
unsigned int ieee80211_flags)
{
struct rt2x00lib_conf libconf;
u16 hw_value;

memset(&libconf, 0, sizeof(libconf));

libconf.conf = conf;

if (ieee80211_flags & IEEE80211_CONF_CHANGE_CHANNEL) {
if (conf_is_ht40(conf))
if (conf_is_ht40(conf)) {
__set_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
else
hw_value = rt2x00ht_center_channel(rt2x00dev, conf);
} else {
__clear_bit(CONFIG_CHANNEL_HT40, &rt2x00dev->flags);
hw_value = conf->channel->hw_value;
}

memcpy(&libconf.rf,
&rt2x00dev->spec.channels[conf->channel->hw_value],
&rt2x00dev->spec.channels[hw_value],
sizeof(libconf.rf));

memcpy(&libconf.channel,
&rt2x00dev->spec.channels_info[conf->channel->hw_value],
&rt2x00dev->spec.channels_info[hw_value],
sizeof(libconf.channel));
}

Expand Down
28 changes: 28 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00ht.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,31 @@ void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
else
txdesc->txop = TXOP_HTTXOP;
}

u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev,
struct ieee80211_conf *conf)
{
struct hw_mode_spec *spec = &rt2x00dev->spec;
int center_channel;
u16 i;

/*
* Initialize center channel to current channel.
*/
center_channel = spec->channels[conf->channel->hw_value].channel;

/*
* Adjust center channel to HT40+ and HT40- operation.
*/
if (conf_is_ht40_plus(conf))
center_channel += 2;
else if (conf_is_ht40_minus(conf))
center_channel -= (center_channel == 14) ? 1 : 2;

for (i = 0; i < spec->num_channels; i++)
if (spec->channels[i].channel == center_channel)
return i;

WARN_ON(1);
return conf->channel->hw_value;
}
9 changes: 9 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,21 @@ static inline void rt2x00crypto_rx_insert_iv(struct sk_buff *skb,
void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
struct txentry_desc *txdesc,
const struct rt2x00_rate *hwrate);

u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev,
struct ieee80211_conf *conf);
#else
static inline void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
struct txentry_desc *txdesc,
const struct rt2x00_rate *hwrate)
{
}

static inline u16 rt2x00ht_center_channel(struct rt2x00_dev *rt2x00dev,
struct ieee80211_conf *conf)
{
return conf->channel->hw_value;
}
#endif /* CONFIG_RT2X00_LIB_HT */

/*
Expand Down

0 comments on commit 7213e9d

Please sign in to comment.