diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-11 18:46:02 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-11 18:46:02 -0400 |
commit | c65570503716015110350ba1c52a04156df3a455 (patch) | |
tree | eda3dbe423a85a6bd07aba954f52d2fc6fa4336d /drivers/net/wireless/libertas/cmd.c | |
parent | 638266f7e879e34de4a4635049c15f5a58505e75 (diff) | |
parent | 0112c9e9e8d47f1d1e6ce1323675cb43ca6aae86 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmd.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c index 802547e79671..5fef05f3cd00 100644 --- a/drivers/net/wireless/libertas/cmd.c +++ b/drivers/net/wireless/libertas/cmd.c | |||
@@ -1971,6 +1971,70 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv) | |||
1971 | } | 1971 | } |
1972 | 1972 | ||
1973 | 1973 | ||
1974 | /** | ||
1975 | * @brief Configures the transmission power control functionality. | ||
1976 | * | ||
1977 | * @param priv A pointer to struct lbs_private structure | ||
1978 | * @param enable Transmission power control enable | ||
1979 | * @param p0 Power level when link quality is good (dBm). | ||
1980 | * @param p1 Power level when link quality is fair (dBm). | ||
1981 | * @param p2 Power level when link quality is poor (dBm). | ||
1982 | * @param usesnr Use Signal to Noise Ratio in TPC | ||
1983 | * | ||
1984 | * @return 0 on success | ||
1985 | */ | ||
1986 | int lbs_set_tpc_cfg(struct lbs_private *priv, int enable, int8_t p0, int8_t p1, | ||
1987 | int8_t p2, int usesnr) | ||
1988 | { | ||
1989 | struct cmd_ds_802_11_tpc_cfg cmd; | ||
1990 | int ret; | ||
1991 | |||
1992 | memset(&cmd, 0, sizeof(cmd)); | ||
1993 | cmd.hdr.size = cpu_to_le16(sizeof(cmd)); | ||
1994 | cmd.action = cpu_to_le16(CMD_ACT_SET); | ||
1995 | cmd.enable = !!enable; | ||
1996 | cmd.usesnr = !!enable; | ||
1997 | cmd.P0 = p0; | ||
1998 | cmd.P1 = p1; | ||
1999 | cmd.P2 = p2; | ||
2000 | |||
2001 | ret = lbs_cmd_with_response(priv, CMD_802_11_TPC_CFG, &cmd); | ||
2002 | |||
2003 | return ret; | ||
2004 | } | ||
2005 | |||
2006 | /** | ||
2007 | * @brief Configures the power adaptation settings. | ||
2008 | * | ||
2009 | * @param priv A pointer to struct lbs_private structure | ||
2010 | * @param enable Power adaptation enable | ||
2011 | * @param p0 Power level for 1, 2, 5.5 and 11 Mbps (dBm). | ||
2012 | * @param p1 Power level for 6, 9, 12, 18, 22, 24 and 36 Mbps (dBm). | ||
2013 | * @param p2 Power level for 48 and 54 Mbps (dBm). | ||
2014 | * | ||
2015 | * @return 0 on Success | ||
2016 | */ | ||
2017 | |||
2018 | int lbs_set_power_adapt_cfg(struct lbs_private *priv, int enable, int8_t p0, | ||
2019 | int8_t p1, int8_t p2) | ||
2020 | { | ||
2021 | struct cmd_ds_802_11_pa_cfg cmd; | ||
2022 | int ret; | ||
2023 | |||
2024 | memset(&cmd, 0, sizeof(cmd)); | ||
2025 | cmd.hdr.size = cpu_to_le16(sizeof(cmd)); | ||
2026 | cmd.action = cpu_to_le16(CMD_ACT_SET); | ||
2027 | cmd.enable = !!enable; | ||
2028 | cmd.P0 = p0; | ||
2029 | cmd.P1 = p1; | ||
2030 | cmd.P2 = p2; | ||
2031 | |||
2032 | ret = lbs_cmd_with_response(priv, CMD_802_11_PA_CFG , &cmd); | ||
2033 | |||
2034 | return ret; | ||
2035 | } | ||
2036 | |||
2037 | |||
1974 | static struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, | 2038 | static struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, |
1975 | uint16_t command, struct cmd_header *in_cmd, int in_cmd_size, | 2039 | uint16_t command, struct cmd_header *in_cmd, int in_cmd_size, |
1976 | int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *), | 2040 | int (*callback)(struct lbs_private *, unsigned long, struct cmd_header *), |