aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-09-06 08:25:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-11 15:53:32 -0400
commit09adf284039f896401df8ea219ee1d13e80333a8 (patch)
tree3d9aa675915304ad6c2c23d33bde475d93e9bd2c /drivers
parentcc6de669f648bc8820f1cf93ee311eb4eaab9fc5 (diff)
p54: control output power levels
I hope this patch is enough to cover at least the basic requirements of IEEE 802.11h's TPC. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/p54/p54.h1
-rw-r--r--drivers/net/wireless/p54/p54common.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h
index 370202f6de2c..1d0704fe146f 100644
--- a/drivers/net/wireless/p54/p54.h
+++ b/drivers/net/wireless/p54/p54.h
@@ -88,6 +88,7 @@ struct p54_common {
88 void *cached_vdcf; 88 void *cached_vdcf;
89 unsigned int fw_var; 89 unsigned int fw_var;
90 unsigned int fw_interface; 90 unsigned int fw_interface;
91 unsigned int output_power;
91 u32 tsf_low32; 92 u32 tsf_low32;
92 u32 tsf_high32; 93 u32 tsf_high32;
93 struct ieee80211_tx_queue_stats tx_stats[8]; 94 struct ieee80211_tx_queue_stats tx_stats[8];
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 670d7ad4120b..7ec695ca9ea4 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -800,7 +800,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
800 txhdr->hw_queue = skb_get_queue_mapping(skb) + 4; 800 txhdr->hw_queue = skb_get_queue_mapping(skb) + 4;
801 txhdr->tx_antenna = (info->antenna_sel_tx == 0) ? 801 txhdr->tx_antenna = (info->antenna_sel_tx == 0) ?
802 2 : info->antenna_sel_tx - 1; 802 2 : info->antenna_sel_tx - 1;
803 txhdr->output_power = 0x7f; // HW Maximum 803 txhdr->output_power = priv->output_power;
804 txhdr->cts_rate = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 804 txhdr->cts_rate = (info->flags & IEEE80211_TX_CTL_NO_ACK) ?
805 0 : cts_rate; 805 0 : cts_rate;
806 if (padding) 806 if (padding)
@@ -1154,6 +1154,7 @@ static int p54_config(struct ieee80211_hw *dev, struct ieee80211_conf *conf)
1154 mutex_lock(&priv->conf_mutex); 1154 mutex_lock(&priv->conf_mutex);
1155 priv->rx_antenna = (conf->antenna_sel_rx == 0) ? 1155 priv->rx_antenna = (conf->antenna_sel_rx == 0) ?
1156 2 : conf->antenna_sel_tx - 1; 1156 2 : conf->antenna_sel_tx - 1;
1157 priv->output_power = conf->power_level << 2;
1157 ret = p54_set_freq(dev, cpu_to_le16(conf->channel->center_freq)); 1158 ret = p54_set_freq(dev, cpu_to_le16(conf->channel->center_freq));
1158 p54_set_vdcf(dev); 1159 p54_set_vdcf(dev);
1159 mutex_unlock(&priv->conf_mutex); 1160 mutex_unlock(&priv->conf_mutex);