wl12xx: always initialize AP-mode max power level
authorArik Nemtsov <arik@wizery.com>
Mon, 27 Jun 2011 19:06:34 +0000 (22:06 +0300)
committerLuciano Coelho <coelho@ti.com>
Tue, 5 Jul 2011 18:51:05 +0000 (21:51 +0300)
Sometimes we only get the Tx power level via op->config when the FW is
off. Record the received power level when this happens and use it to
initialize the firmware during boot.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
drivers/net/wireless/wl12xx/acx.c
drivers/net/wireless/wl12xx/init.c
drivers/net/wireless/wl12xx/main.c

index 2f5207ae7cf525936e148a3eedd6ee1e452a4659..7e33f1f4f3d47c7866baac5af76b656111139d2b 100644 (file)
@@ -90,7 +90,7 @@ int wl1271_acx_tx_power(struct wl1271 *wl, int power)
        struct acx_current_tx_power *acx;
        int ret;
 
-       wl1271_debug(DEBUG_ACX, "acx dot11_cur_tx_pwr");
+       wl1271_debug(DEBUG_ACX, "acx dot11_cur_tx_pwr %d", power);
 
        if (power < 0 || power > 25)
                return -EINVAL;
index ebfde942bec5be9c7f93ef3d798265fd1a4f52d1..c3e9a2e4410eb6ab4015c0b321519a0c1a312088 100644 (file)
@@ -455,6 +455,11 @@ static int wl1271_ap_hw_init(struct wl1271 *wl)
        if (ret < 0)
                return ret;
 
+       /* initialize Tx power */
+       ret = wl1271_acx_tx_power(wl, wl->power_level);
+       if (ret < 0)
+               return ret;
+
        return 0;
 }
 
index b381e6979b5140cc02a3318b89c3e6e98ca60b98..526b1ac2dd802b98c4fa9ef00858f583325c2882 100644 (file)
@@ -2278,6 +2278,9 @@ static int wl1271_op_config(struct ieee80211_hw *hw, u32 changed)
                        wl->channel = channel;
                }
 
+               if ((changed & IEEE80211_CONF_CHANGE_POWER))
+                       wl->power_level = conf->power_level;
+
                goto out;
        }