diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-06-03 14:44:11 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-06-04 10:58:12 -0400 |
commit | 13c33a09b3703c2956345482017600434c853889 (patch) | |
tree | aa9401464d536dd49876b8a8b0525ce2fbf4e794 | |
parent | 258c44a0c02a7ffbb9555747008d6bf9a3ea58a0 (diff) |
iwlwifi: add value and range define for link quality command
Instead of hardcoding the link quality parameters inside the functions,
adding #define in iwl-commands.h to shared by different functions.
Also include the valid range for number of link quality parameters.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 5 |
3 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 2cdd191205b9..ff20e5048a55 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c | |||
@@ -2787,9 +2787,10 @@ static void rs_fill_link_cmd(const struct iwl_priv *priv, | |||
2787 | repeat_rate--; | 2787 | repeat_rate--; |
2788 | } | 2788 | } |
2789 | 2789 | ||
2790 | lq_cmd->agg_params.agg_frame_cnt_limit = 64; | 2790 | lq_cmd->agg_params.agg_frame_cnt_limit = LINK_QUAL_AGG_FRAME_LIMIT_MAX; |
2791 | lq_cmd->agg_params.agg_dis_start_th = 3; | 2791 | lq_cmd->agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF; |
2792 | lq_cmd->agg_params.agg_time_limit = cpu_to_le16(4000); | 2792 | lq_cmd->agg_params.agg_time_limit = |
2793 | cpu_to_le16(LINK_QUAL_AGG_TIME_LIMIT_DEF); | ||
2793 | } | 2794 | } |
2794 | 2795 | ||
2795 | static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | 2796 | static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index b3229f2db503..c87033bf3ad2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -1913,6 +1913,18 @@ struct iwl_link_qual_general_params { | |||
1913 | u8 start_rate_index[LINK_QUAL_AC_NUM]; | 1913 | u8 start_rate_index[LINK_QUAL_AC_NUM]; |
1914 | } __attribute__ ((packed)); | 1914 | } __attribute__ ((packed)); |
1915 | 1915 | ||
1916 | #define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000) /* 4 milliseconds */ | ||
1917 | #define LINK_QUAL_AGG_TIME_LIMIT_MAX (65535) | ||
1918 | #define LINK_QUAL_AGG_TIME_LIMIT_MIN (0) | ||
1919 | |||
1920 | #define LINK_QUAL_AGG_DISABLE_START_DEF (3) | ||
1921 | #define LINK_QUAL_AGG_DISABLE_START_MAX (255) | ||
1922 | #define LINK_QUAL_AGG_DISABLE_START_MIN (0) | ||
1923 | |||
1924 | #define LINK_QUAL_AGG_FRAME_LIMIT_DEF (31) | ||
1925 | #define LINK_QUAL_AGG_FRAME_LIMIT_MAX (64) | ||
1926 | #define LINK_QUAL_AGG_FRAME_LIMIT_MIN (0) | ||
1927 | |||
1916 | /** | 1928 | /** |
1917 | * struct iwl_link_qual_agg_params | 1929 | * struct iwl_link_qual_agg_params |
1918 | * | 1930 | * |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 5ea3bc78a66e..2addf735b193 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -985,8 +985,9 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, bool is_ap) | |||
985 | link_cmd.general_params.single_stream_ant_msk = | 985 | link_cmd.general_params.single_stream_ant_msk = |
986 | first_antenna(priv->hw_params.valid_tx_ant); | 986 | first_antenna(priv->hw_params.valid_tx_ant); |
987 | link_cmd.general_params.dual_stream_ant_msk = 3; | 987 | link_cmd.general_params.dual_stream_ant_msk = 3; |
988 | link_cmd.agg_params.agg_dis_start_th = 3; | 988 | link_cmd.agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF; |
989 | link_cmd.agg_params.agg_time_limit = cpu_to_le16(4000); | 989 | link_cmd.agg_params.agg_time_limit = |
990 | cpu_to_le16(LINK_QUAL_AGG_TIME_LIMIT_DEF); | ||
990 | 991 | ||
991 | /* Update the rate scaling for control frame Tx to AP */ | 992 | /* Update the rate scaling for control frame Tx to AP */ |
992 | link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id; | 993 | link_cmd.sta_id = is_ap ? IWL_AP_ID : priv->hw_params.bcast_sta_id; |