aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2007-09-26 23:27:41 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:53:26 -0400
commit1b696de23bb21b89f4a4c4fd6b12e26fe2cc4a37 (patch)
treeeb24b5e215b77bf926f76869cc2f8431c67250d7 /drivers/net
parent02dede04f280a2ea249025414ddb4b1da1fca770 (diff)
[PATCH] iwlwifi: rs_rate_scale_perform clean up
This patch cleans up rs_rate_scale_perform function. It removes dead code, shortens variable names and removes useless return i.e. function now returns void. Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index bad746613f5b..c4b8ca128495 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -131,7 +131,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
131 struct net_device *dev, 131 struct net_device *dev,
132 struct ieee80211_hdr *hdr, 132 struct ieee80211_hdr *hdr,
133 struct sta_info *sta); 133 struct sta_info *sta);
134static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, 134static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
135 struct iwl_rate *tx_mcs, 135 struct iwl_rate *tx_mcs,
136 struct iwl_link_quality_cmd *tbl); 136 struct iwl_link_quality_cmd *tbl);
137 137
@@ -1873,16 +1873,15 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
1873 rs_initialize_lq(priv, sta); 1873 rs_initialize_lq(priv, sta);
1874} 1874}
1875 1875
1876static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data, 1876static void rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
1877 struct iwl_rate *tx_mcs, 1877 struct iwl_rate *tx_mcs,
1878 struct iwl_link_quality_cmd *lq_cmd) 1878 struct iwl_link_quality_cmd *lq_cmd)
1879{ 1879{
1880 int index = 0; 1880 int index = 0;
1881 int rc = 0;
1882 int rate_idx; 1881 int rate_idx;
1882 int repeat_rate = 0;
1883 u8 ant_toggle_count = 0; 1883 u8 ant_toggle_count = 0;
1884 u8 use_ht_possible = 1; 1884 u8 use_ht_possible = 1;
1885 u8 repeat_cur_rate = 0;
1886 struct iwl_rate new_rate; 1885 struct iwl_rate new_rate;
1887 struct iwl_scale_tbl_info tbl_type = { 0 }; 1886 struct iwl_scale_tbl_info tbl_type = { 0 };
1888 1887
@@ -1891,9 +1890,9 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
1891 1890
1892 if (is_legacy(tbl_type.lq_type)) { 1891 if (is_legacy(tbl_type.lq_type)) {
1893 ant_toggle_count = 1; 1892 ant_toggle_count = 1;
1894 repeat_cur_rate = IWL_NUMBER_TRY; 1893 repeat_rate = IWL_NUMBER_TRY;
1895 } else 1894 } else
1896 repeat_cur_rate = IWL_HT_NUMBER_TRY; 1895 repeat_rate = IWL_HT_NUMBER_TRY;
1897 1896
1898 lq_cmd->general_params.mimo_delimiter = 1897 lq_cmd->general_params.mimo_delimiter =
1899 is_mimo(tbl_type.lq_type) ? 1 : 0; 1898 is_mimo(tbl_type.lq_type) ? 1 : 0;
@@ -1907,10 +1906,10 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
1907 lq_cmd->general_params.single_stream_ant_msk = 2; 1906 lq_cmd->general_params.single_stream_ant_msk = 2;
1908 1907
1909 index++; 1908 index++;
1910 repeat_cur_rate--; 1909 repeat_rate--;
1911 1910
1912 while (index < LINK_QUAL_MAX_RETRY_NUM) { 1911 while (index < LINK_QUAL_MAX_RETRY_NUM) {
1913 while (repeat_cur_rate && (index < LINK_QUAL_MAX_RETRY_NUM)) { 1912 while (repeat_rate > 0 && (index < LINK_QUAL_MAX_RETRY_NUM)) {
1914 if (is_legacy(tbl_type.lq_type)) { 1913 if (is_legacy(tbl_type.lq_type)) {
1915 if (ant_toggle_count < 1914 if (ant_toggle_count <
1916 NUM_TRY_BEFORE_ANTENNA_TOGGLE) 1915 NUM_TRY_BEFORE_ANTENNA_TOGGLE)
@@ -1922,7 +1921,7 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
1922 } 1921 }
1923 lq_cmd->rs_table[index].rate_n_flags = 1922 lq_cmd->rs_table[index].rate_n_flags =
1924 cpu_to_le32(new_rate.rate_n_flags); 1923 cpu_to_le32(new_rate.rate_n_flags);
1925 repeat_cur_rate--; 1924 repeat_rate--;
1926 index++; 1925 index++;
1927 } 1926 }
1928 1927
@@ -1942,26 +1941,22 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
1942 rs_toggle_antenna(&new_rate, &tbl_type); 1941 rs_toggle_antenna(&new_rate, &tbl_type);
1943 ant_toggle_count = 1; 1942 ant_toggle_count = 1;
1944 } 1943 }
1945 repeat_cur_rate = IWL_NUMBER_TRY; 1944 repeat_rate = IWL_NUMBER_TRY;
1946 } else 1945 } else
1947 repeat_cur_rate = IWL_HT_NUMBER_TRY; 1946 repeat_rate = IWL_HT_NUMBER_TRY;
1948 1947
1949 use_ht_possible = 0; 1948 use_ht_possible = 0;
1950 1949
1951 lq_cmd->rs_table[index].rate_n_flags = 1950 lq_cmd->rs_table[index].rate_n_flags =
1952 cpu_to_le32(new_rate.rate_n_flags); 1951 cpu_to_le32(new_rate.rate_n_flags);
1953 /* lq_cmd->rs_table[index].rate_n_flags = 0x800d; */
1954 1952
1955 index++; 1953 index++;
1956 repeat_cur_rate--; 1954 repeat_rate--;
1957 } 1955 }
1958 1956
1959 /* lq_cmd->rs_table[0].rate_n_flags = 0x800d; */
1960
1961 lq_cmd->general_params.dual_stream_ant_msk = 3; 1957 lq_cmd->general_params.dual_stream_ant_msk = 3;
1962 lq_cmd->agg_params.agg_dis_start_th = 3; 1958 lq_cmd->agg_params.agg_dis_start_th = 3;
1963 lq_cmd->agg_params.agg_time_limit = cpu_to_le16(4000); 1959 lq_cmd->agg_params.agg_time_limit = cpu_to_le16(4000);
1964 return rc;
1965} 1960}
1966 1961
1967static void *rs_alloc(struct ieee80211_local *local) 1962static void *rs_alloc(struct ieee80211_local *local)