Skip to content

Commit

Permalink
wl12xx: add power_level field to wlvif
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eliad Peller authored and Luciano Coelho committed Oct 11, 2011
1 parent 61f845f commit 6bd6502
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/wl12xx/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ static int wl12xx_init_ap_role(struct wl1271 *wl, struct wl12xx_vif *wlvif)
return ret;

/* initialize Tx power */
ret = wl1271_acx_tx_power(wl, wlvif, wl->power_level);
ret = wl1271_acx_tx_power(wl, wlvif, wlvif->power_level);
if (ret < 0)
return ret;

Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,7 @@ static int wl12xx_init_vif_data(struct wl1271 *wl, struct ieee80211_vif *vif)
*/
wlvif->band = wl->band;
wlvif->channel = wl->channel;
wlvif->power_level = wl->power_level;

INIT_WORK(&wlvif->rx_streaming_enable_work,
wl1271_rx_streaming_enable_work);
Expand Down Expand Up @@ -2562,12 +2563,13 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
wlvif->basic_rate, true);
}

if (conf->power_level != wl->power_level) {
if (conf->power_level != wlvif->power_level) {
ret = wl1271_acx_tx_power(wl, wlvif, conf->power_level);
if (ret < 0)
goto out_sleep;

wl->power_level = conf->power_level;
wlvif->power_level = conf->power_level;
}

out_sleep:
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/wl12xx/wl12xx.h
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ struct wl12xx_vif {
/* retry counter for PSM entries */
u8 psm_entry_retry;

/* in dBm */
int power_level;

int rssi_thold;
int last_rssi_event;

Expand Down

0 comments on commit 6bd6502

Please sign in to comment.