]> git.karo-electronics.de Git - linux-beck.git/commitdiff
libertas: Improvements on automatic tx power control via SIOCSIWTXPOW (fixups)
authorAnna Neal <anna@cozybit.com>
Fri, 26 Sep 2008 15:34:35 +0000 (11:34 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 30 Sep 2008 18:07:23 +0000 (14:07 -0400)
This patch addresses comments from Dan Williams about the patch
committed as "libertas: Improvements on automatic tx power control via
SIOCSIWTXPOW."

Signed-off-by: Anna Neal <anna@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/libertas/cmd.c
drivers/net/wireless/libertas/cmd.h
drivers/net/wireless/libertas/defs.h
drivers/net/wireless/libertas/wext.c

index aee19fa844e46b29531d67f66ab236b9ad4dc43c..a912fb68c09990fd12bfc18360e3d9c674b79e7f 100644 (file)
@@ -1949,7 +1949,7 @@ int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
        cmd.hdr.size = cpu_to_le16(sizeof(cmd));
        cmd.action = cpu_to_le16(CMD_ACT_SET);
        cmd.enable = !!enable;
-       cmd.usesnr = !!enable;
+       cmd.usesnr = !!usesnr;
        cmd.P0 = p0;
        cmd.P1 = p1;
        cmd.P2 = p2;
index d002160f597d6265dcef453dc9153511a5cc97cd..36be4c9703e0b0c12fd4f0ee6f4b31db56bc8fe5 100644 (file)
@@ -32,6 +32,12 @@ int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0,
 int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
                int8_t p2, int usesnr);
 
+int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0,
+               int8_t p1, int8_t p2);
+
+int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1,
+               int8_t p2, int usesnr);
+
 int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra,
                     struct cmd_header *resp);
 
index 58d11a35e61b9840349f32aeccb998253e964b23..076a636e8f62165252b8f931f88312187e64c1bf 100644 (file)
@@ -189,7 +189,6 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in
 #define MRVDRV_CMD_UPLD_RDY            0x0008
 #define MRVDRV_CARDEVENT               0x0010
 
-
 /* Automatic TX control default levels */
 #define POW_ADAPT_DEFAULT_P0 13
 #define POW_ADAPT_DEFAULT_P1 15
index 6ebdd7f161f1dec976f3b6fadbaf793984e0912a..82c3e5a50ea695602fa844b7cc5ce93493f1b0d3 100644 (file)
@@ -1025,6 +1025,18 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info,
                                new_rate);
                        goto out;
                }
+               if (priv->fwrelease < 0x09000000) {
+                       ret = lbs_set_power_adapt_cfg(priv, 0,
+                                       POW_ADAPT_DEFAULT_P0,
+                                       POW_ADAPT_DEFAULT_P1,
+                                       POW_ADAPT_DEFAULT_P2);
+                       if (ret)
+                               goto out;
+               }
+               ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1,
+                               TPC_DEFAULT_P2, 1);
+               if (ret)
+                       goto out;
        }
 
        /* Try the newer command first (Firmware Spec 5.1 and above) */