aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-10-10 04:13:11 -0400
committerLuciano Coelho <coelho@ti.com>2011-10-11 08:12:13 -0400
commit6bd650299046f00df6d7374c7f61c5afe6df6696 (patch)
treed4b386acb9909478100cdb0f8c8876507b8bb83f
parent61f845f4f441a90e5328a78c6c4e0646d99fc2f0 (diff)
wl12xx: add power_level field to wlvif
move power_level into the per-interface data. mac80211 configures some values (e.g. band, channel) globally, while we configure them per-interface. In order to make it easier to keep track of the configured value for each value while keeping sync with mac80211, save these values both globally and per-vif. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r--drivers/net/wireless/wl12xx/init.c2
-rw-r--r--drivers/net/wireless/wl12xx/main.c4
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h3
3 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index 4af7e2fb52fd..74f569099b53 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -554,7 +554,7 @@ static int wl12xx_init_ap_role(struct wl1271 *wl, struct wl12xx_vif *wlvif)
554 return ret; 554 return ret;
555 555
556 /* initialize Tx power */ 556 /* initialize Tx power */
557 ret = wl1271_acx_tx_power(wl, wlvif, wl->power_level); 557 ret = wl1271_acx_tx_power(wl, wlvif, wlvif->power_level);
558 if (ret < 0) 558 if (ret < 0)
559 return ret; 559 return ret;
560 560
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 5137275d3591..cffb40be7b5b 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1974,6 +1974,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
1974 */ 1974 */
1975 wlvif->band = wl->band; 1975 wlvif->band = wl->band;
1976 wlvif->channel = wl->channel; 1976 wlvif->channel = wl->channel;
1977 wlvif->power_level = wl->power_level;
1977 1978
1978 INIT_WORK(&wlvif->rx_streaming_enable_work, 1979 INIT_WORK(&wlvif->rx_streaming_enable_work,
1979 wl1271_rx_streaming_enable_work); 1980 wl1271_rx_streaming_enable_work);
@@ -2562,12 +2563,13 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
2562 wlvif->basic_rate, true); 2563 wlvif->basic_rate, true);
2563 } 2564 }
2564 2565
2565 if (conf->power_level != wl->power_level) { 2566 if (conf->power_level != wlvif->power_level) {
2566 ret = wl1271_acx_tx_power(wl, wlvif, conf->power_level); 2567 ret = wl1271_acx_tx_power(wl, wlvif, conf->power_level);
2567 if (ret < 0) 2568 if (ret < 0)
2568 goto out_sleep; 2569 goto out_sleep;
2569 2570
2570 wl->power_level = conf->power_level; 2571 wl->power_level = conf->power_level;
2572 wlvif->power_level = conf->power_level;
2571 } 2573 }
2572 2574
2573out_sleep: 2575out_sleep:
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 02dedd191bd4..2689522ba4ed 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -631,6 +631,9 @@ struct wl12xx_vif {
631 /* retry counter for PSM entries */ 631 /* retry counter for PSM entries */
632 u8 psm_entry_retry; 632 u8 psm_entry_retry;
633 633
634 /* in dBm */
635 int power_level;
636
634 int rssi_thold; 637 int rssi_thold;
635 int last_rssi_event; 638 int last_rssi_event;
636 639