diff options
author | Liu Hong <hong.liu@intel.com> | 2005-07-13 13:27:17 -0400 |
---|---|---|
committer | James Ketrenos <jketreno@linux.intel.com> | 2005-11-07 18:50:21 -0500 |
commit | 8400a1ceb445f2ace4b8d3c35c181b2b416a81ce (patch) | |
tree | 9ee014ce0dfbbf4b66ff39d2788b6352cadcfd3e /drivers/net/wireless/ipw2200.c | |
parent | d8bad6df045249cd1cff6a0d167c8f1b9caade7e (diff) |
[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/net/wireless/ipw2200.c')
-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 f3048f8e8238..0923038ca788 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, | |||
8756 | union iwreq_data *wrqu, char *extra) | 8756 | union iwreq_data *wrqu, char *extra) |
8757 | { | 8757 | { |
8758 | struct ipw_priv *priv = ieee80211_priv(dev); | 8758 | struct ipw_priv *priv = ieee80211_priv(dev); |
8759 | const struct ieee80211_geo *geo = ieee80211_get_geo(priv->ieee); | ||
8759 | struct ipw_tx_power tx_power; | 8760 | struct ipw_tx_power tx_power; |
8760 | int i; | 8761 | int i; |
8761 | 8762 | ||
@@ -8785,10 +8786,15 @@ static int ipw_wx_set_txpow(struct net_device *dev, | |||
8785 | 8786 | ||
8786 | /* configure device for 'G' band */ | 8787 | /* configure device for 'G' band */ |
8787 | tx_power.ieee_mode = IPW_G_MODE; | 8788 | tx_power.ieee_mode = IPW_G_MODE; |
8788 | tx_power.num_channels = 11; | 8789 | tx_power.num_channels = geo->bg_channels; |
8789 | for (i = 0; i < 11; i++) { | 8790 | for (i = 0; i < geo->bg_channels; i++) { |
8791 | int max_power = geo->bg[i].max_power; | ||
8792 | |||
8790 | tx_power.channels_tx_power[i].channel_number = i + 1; | 8793 | tx_power.channels_tx_power[i].channel_number = i + 1; |
8791 | tx_power.channels_tx_power[i].tx_power = priv->tx_power; | 8794 | if (max_power != 0 && priv->tx_power > max_power) |
8795 | tx_power.channels_tx_power[i].tx_power = max_power; | ||
8796 | else | ||
8797 | tx_power.channels_tx_power[i].tx_power = priv->tx_power; | ||
8792 | } | 8798 | } |
8793 | if (ipw_send_tx_power(priv, &tx_power)) | 8799 | if (ipw_send_tx_power(priv, &tx_power)) |
8794 | goto error; | 8800 | goto error; |
@@ -8798,6 +8804,25 @@ static int ipw_wx_set_txpow(struct net_device *dev, | |||
8798 | if (ipw_send_tx_power(priv, &tx_power)) | 8804 | if (ipw_send_tx_power(priv, &tx_power)) |
8799 | goto error; | 8805 | goto error; |
8800 | 8806 | ||
8807 | /* configure device to also handle 'A' band */ | ||
8808 | if (priv->ieee->abg_true) { | ||
8809 | tx_power.ieee_mode = IPW_A_MODE; | ||
8810 | tx_power.num_channels = geo->a_channels; | ||
8811 | for (i = 0; i < geo->a_channels; i++) { | ||
8812 | int max_power = geo->a[i].max_power; | ||
8813 | |||
8814 | tx_power.channels_tx_power[i].channel_number = i + 1; | ||
8815 | if (max_power != 0 && priv->tx_power > max_power) | ||
8816 | tx_power.channels_tx_power[i].tx_power = | ||
8817 | max_power; | ||
8818 | else | ||
8819 | tx_power.channels_tx_power[i].tx_power = | ||
8820 | priv->tx_power; | ||
8821 | } | ||
8822 | if (ipw_send_tx_power(priv, &tx_power)) | ||
8823 | goto error; | ||
8824 | } | ||
8825 | |||
8801 | up(&priv->sem); | 8826 | up(&priv->sem); |
8802 | return 0; | 8827 | return 0; |
8803 | 8828 | ||