diff options
author | Anna Neal <anna@cozybit.com> | 2008-09-26 11:34:35 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-30 14:07:23 -0400 |
commit | 3ed6e0803b4fe95107f6cb5a432587d03cd4d17a (patch) | |
tree | 0b7b231ea5c315451a2efe5f5f74a25d8394d7f7 /drivers/net | |
parent | d88410a0b657c5ccebd1c120af1f14c5ca6a3d95 (diff) |
libertas: Improvements on automatic tx power control via SIOCSIWTXPOW (fixups)
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/cmd.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/defs.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 12 |
4 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index aee19fa844e4..a912fb68c099 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1949,7 +1949,7 @@ int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, | |||
1949 | cmd.hdr.size = cpu_to_le16(sizeof(cmd)); | 1949 | cmd.hdr.size = cpu_to_le16(sizeof(cmd)); |
1950 | cmd.action = cpu_to_le16(CMD_ACT_SET); | 1950 | cmd.action = cpu_to_le16(CMD_ACT_SET); |
1951 | cmd.enable = !!enable; | 1951 | cmd.enable = !!enable; |
1952 | cmd.usesnr = !!enable; | 1952 | cmd.usesnr = !!usesnr; |
1953 | cmd.P0 = p0; | 1953 | cmd.P0 = p0; |
1954 | cmd.P1 = p1; | 1954 | cmd.P1 = p1; |
1955 | cmd.P2 = p2; | 1955 | cmd.P2 = p2; |
diff --git a/drivers/net/wireless/libertas/cmd.h b/drivers/net/wireless/libertas/cmd.h index d002160f597d..36be4c9703e0 100644 --- a/drivers/net/wireless/libertas/cmd.h +++ b/drivers/net/wireless/libertas/cmd.h | |||
@@ -32,6 +32,12 @@ int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0, | |||
32 | int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, | 32 | int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, |
33 | int8_t p2, int usesnr); | 33 | int8_t p2, int usesnr); |
34 | 34 | ||
35 | int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0, | ||
36 | int8_t p1, int8_t p2); | ||
37 | |||
38 | int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, | ||
39 | int8_t p2, int usesnr); | ||
40 | |||
35 | int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra, | 41 | int lbs_cmd_copyback(struct lbs_private *priv, unsigned long extra, |
36 | struct cmd_header *resp); | 42 | struct cmd_header *resp); |
37 | 43 | ||
diff --git a/drivers/net/wireless/libertas/defs.h b/drivers/net/wireless/libertas/defs.h index 58d11a35e61b..076a636e8f62 100644 --- a/drivers/net/wireless/libertas/defs.h +++ b/drivers/net/wireless/libertas/defs.h | |||
@@ -189,7 +189,6 @@ static inline void lbs_deb_hex(unsigned int grp, const char *prompt, u8 *buf, in | |||
189 | #define MRVDRV_CMD_UPLD_RDY 0x0008 | 189 | #define MRVDRV_CMD_UPLD_RDY 0x0008 |
190 | #define MRVDRV_CARDEVENT 0x0010 | 190 | #define MRVDRV_CARDEVENT 0x0010 |
191 | 191 | ||
192 | |||
193 | /* Automatic TX control default levels */ | 192 | /* Automatic TX control default levels */ |
194 | #define POW_ADAPT_DEFAULT_P0 13 | 193 | #define POW_ADAPT_DEFAULT_P0 13 |
195 | #define POW_ADAPT_DEFAULT_P1 15 | 194 | #define POW_ADAPT_DEFAULT_P1 15 |
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 6ebdd7f161f1..82c3e5a50ea6 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -1025,6 +1025,18 @@ static int lbs_set_rate(struct net_device *dev, struct iw_request_info *info, | |||
1025 | new_rate); | 1025 | new_rate); |
1026 | goto out; | 1026 | goto out; |
1027 | } | 1027 | } |
1028 | if (priv->fwrelease < 0x09000000) { | ||
1029 | ret = lbs_set_power_adapt_cfg(priv, 0, | ||
1030 | POW_ADAPT_DEFAULT_P0, | ||
1031 | POW_ADAPT_DEFAULT_P1, | ||
1032 | POW_ADAPT_DEFAULT_P2); | ||
1033 | if (ret) | ||
1034 | goto out; | ||
1035 | } | ||
1036 | ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1, | ||
1037 | TPC_DEFAULT_P2, 1); | ||
1038 | if (ret) | ||
1039 | goto out; | ||
1028 | } | 1040 | } |
1029 | 1041 | ||
1030 | /* Try the newer command first (Firmware Spec 5.1 and above) */ | 1042 | /* Try the newer command first (Firmware Spec 5.1 and above) */ |