diff options
author | Liu Hong <hong.liu@intel.com> | 2005-07-13 12:27:17 -0500 |
---|---|---|
committer | James Ketrenos <jketreno@linux.intel.com> | 2005-11-07 17:50:21 -0600 |
commit | 8400a1ceb445f2ace4b8d3c35c181b2b416a81ce (patch) | |
tree | 9ee014ce0dfbbf4b66ff39d2788b6352cadcfd3e /drivers | |
parent | d8bad6df045249cd1cff6a0d167c8f1b9caade7e (diff) | |
download | op-kernel-dev-8400a1ceb445f2ace4b8d3c35c181b2b416a81ce.zip op-kernel-dev-8400a1ceb445f2ace4b8d3c35c181b2b416a81ce.tar.gz |
[Bug 637] Set tx power for A band.
It uses the ieee80211-geo info to set the tx power of the a/b/g band.
Signed-off-by: James Ketrenos <jketreno@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ipw2200.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index f3048f8..0923038 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c @@ -8756,6 +8756,7 @@ static int ipw_wx_set_txpow(struct net_device *dev, union iwreq_data *wrqu, char *extra) { struct ipw_priv *priv = ieee80211_priv(dev); + const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); struct ipw_tx_power tx_power; int i; @@ -8785,10 +8786,15 @@ static int ipw_wx_set_txpow(struct net_device *dev, /* configure device for 'G' band */ tx_power.ieee_mode = IPW_G_MODE; - tx_power.num_channels = 11; - for (i = 0; i < 11; i++) { + tx_power.num_channels = geo->bg_channels; + for (i = 0; i < geo->bg_channels; i++) { + int max_power = geo->bg[i].max_power; + tx_power.channels_tx_power[i].channel_number = i + 1; - tx_power.channels_tx_power[i].tx_power = priv->tx_power; + if (max_power != 0 && priv->tx_power > max_power) + tx_power.channels_tx_power[i].tx_power = max_power; + else + tx_power.channels_tx_power[i].tx_power = priv->tx_power; } if (ipw_send_tx_power(priv, &tx_power)) goto error; @@ -8798,6 +8804,25 @@ static int ipw_wx_set_txpow(struct net_device *dev, if (ipw_send_tx_power(priv, &tx_power)) goto error; + /* configure device to also handle 'A' band */ + if (priv->ieee->abg_true) { + tx_power.ieee_mode = IPW_A_MODE; + tx_power.num_channels = geo->a_channels; + for (i = 0; i < geo->a_channels; i++) { + int max_power = geo->a[i].max_power; + + tx_power.channels_tx_power[i].channel_number = i + 1; + if (max_power != 0 && priv->tx_power > max_power) + tx_power.channels_tx_power[i].tx_power = + max_power; + else + tx_power.channels_tx_power[i].tx_power = + priv->tx_power; + } + if (ipw_send_tx_power(priv, &tx_power)) + goto error; + } + up(&priv->sem); return 0; |