mirror of https://gitee.com/openkylin/linux.git
iwlwifi: rs: split rs_collect_tx_data
Make _rs_collect_tx_data get window as param, in order to be able to set various windows. This will be used later for saving tpc statistics as well. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This commit is contained in:
parent
7f5bd0422e
commit
0bd3c5a7ab
|
@ -566,19 +566,13 @@ static s32 get_expected_tpt(struct iwl_scale_tbl_info *tbl, int rs_index)
|
||||||
* at this rate. window->data contains the bitmask of successful
|
* at this rate. window->data contains the bitmask of successful
|
||||||
* packets.
|
* packets.
|
||||||
*/
|
*/
|
||||||
static int rs_collect_tx_data(struct iwl_scale_tbl_info *tbl,
|
static int _rs_collect_tx_data(struct iwl_scale_tbl_info *tbl,
|
||||||
int scale_index, int attempts, int successes)
|
int scale_index, int attempts, int successes,
|
||||||
|
struct iwl_rate_scale_data *window)
|
||||||
{
|
{
|
||||||
struct iwl_rate_scale_data *window = NULL;
|
|
||||||
static const u64 mask = (((u64)1) << (IWL_RATE_MAX_WINDOW - 1));
|
static const u64 mask = (((u64)1) << (IWL_RATE_MAX_WINDOW - 1));
|
||||||
s32 fail_count, tpt;
|
s32 fail_count, tpt;
|
||||||
|
|
||||||
if (scale_index < 0 || scale_index >= IWL_RATE_COUNT)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
/* Select window for current tx bit rate */
|
|
||||||
window = &(tbl->win[scale_index]);
|
|
||||||
|
|
||||||
/* Get expected throughput */
|
/* Get expected throughput */
|
||||||
tpt = get_expected_tpt(tbl, scale_index);
|
tpt = get_expected_tpt(tbl, scale_index);
|
||||||
|
|
||||||
|
@ -636,6 +630,21 @@ static int rs_collect_tx_data(struct iwl_scale_tbl_info *tbl,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rs_collect_tx_data(struct iwl_scale_tbl_info *tbl,
|
||||||
|
int scale_index, int attempts, int successes)
|
||||||
|
{
|
||||||
|
struct iwl_rate_scale_data *window = NULL;
|
||||||
|
|
||||||
|
if (scale_index < 0 || scale_index >= IWL_RATE_COUNT)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
/* Select window for current tx bit rate */
|
||||||
|
window = &(tbl->win[scale_index]);
|
||||||
|
|
||||||
|
return _rs_collect_tx_data(tbl, scale_index, attempts, successes,
|
||||||
|
window);
|
||||||
|
}
|
||||||
|
|
||||||
/* Convert rs_rate object into ucode rate bitmask */
|
/* Convert rs_rate object into ucode rate bitmask */
|
||||||
static u32 ucode_rate_from_rs_rate(struct iwl_mvm *mvm,
|
static u32 ucode_rate_from_rs_rate(struct iwl_mvm *mvm,
|
||||||
struct rs_rate *rate)
|
struct rs_rate *rate)
|
||||||
|
|
Loading…
Reference in New Issue