Lines Matching refs:tbl
389 il4965_get_expected_tpt(struct il_scale_tbl_info *tbl, int rs_idx) in il4965_get_expected_tpt() argument
391 if (tbl->expected_tpt) in il4965_get_expected_tpt()
392 return tbl->expected_tpt[rs_idx]; in il4965_get_expected_tpt()
404 il4965_rs_collect_tx_data(struct il_scale_tbl_info *tbl, int scale_idx, in il4965_rs_collect_tx_data() argument
415 win = &(tbl->win[scale_idx]); in il4965_rs_collect_tx_data()
418 tpt = il4965_get_expected_tpt(tbl, scale_idx); in il4965_rs_collect_tx_data()
482 il4965_rate_n_flags_from_tbl(struct il_priv *il, struct il_scale_tbl_info *tbl, in il4965_rate_n_flags_from_tbl() argument
487 if (is_legacy(tbl->lq_type)) { in il4965_rate_n_flags_from_tbl()
492 } else if (is_Ht(tbl->lq_type)) { in il4965_rate_n_flags_from_tbl()
499 if (is_siso(tbl->lq_type)) in il4965_rate_n_flags_from_tbl()
504 IL_ERR("Invalid tbl->lq_type %d\n", tbl->lq_type); in il4965_rate_n_flags_from_tbl()
508 ((tbl->ant_type << RATE_MCS_ANT_POS) & RATE_MCS_ANT_ABC_MSK); in il4965_rate_n_flags_from_tbl()
510 if (is_Ht(tbl->lq_type)) { in il4965_rate_n_flags_from_tbl()
511 if (tbl->is_ht40) { in il4965_rate_n_flags_from_tbl()
512 if (tbl->is_dup) in il4965_rate_n_flags_from_tbl()
517 if (tbl->is_SGI) in il4965_rate_n_flags_from_tbl()
522 if (is_siso(tbl->lq_type) && tbl->is_SGI) { in il4965_rate_n_flags_from_tbl()
538 struct il_scale_tbl_info *tbl, int *rate_idx) in il4965_rs_get_tbl_info_from_mcs() argument
545 memset(tbl, 0, sizeof(struct il_scale_tbl_info)); in il4965_rs_get_tbl_info_from_mcs()
552 tbl->is_SGI = 0; /* default legacy setup */ in il4965_rs_get_tbl_info_from_mcs()
553 tbl->is_ht40 = 0; in il4965_rs_get_tbl_info_from_mcs()
554 tbl->is_dup = 0; in il4965_rs_get_tbl_info_from_mcs()
555 tbl->ant_type = (ant_msk >> RATE_MCS_ANT_POS); in il4965_rs_get_tbl_info_from_mcs()
556 tbl->lq_type = LQ_NONE; in il4965_rs_get_tbl_info_from_mcs()
557 tbl->max_search = IL_MAX_SEARCH; in il4965_rs_get_tbl_info_from_mcs()
563 tbl->lq_type = LQ_A; in il4965_rs_get_tbl_info_from_mcs()
565 tbl->lq_type = LQ_G; in il4965_rs_get_tbl_info_from_mcs()
570 tbl->is_SGI = 1; in il4965_rs_get_tbl_info_from_mcs()
574 tbl->is_ht40 = 1; in il4965_rs_get_tbl_info_from_mcs()
577 tbl->is_dup = 1; in il4965_rs_get_tbl_info_from_mcs()
584 tbl->lq_type = LQ_SISO; /*else NONE */ in il4965_rs_get_tbl_info_from_mcs()
588 tbl->lq_type = LQ_MIMO2; in il4965_rs_get_tbl_info_from_mcs()
598 struct il_scale_tbl_info *tbl) in il4965_rs_toggle_antenna() argument
602 if (!tbl->ant_type || tbl->ant_type > ANT_ABC) in il4965_rs_toggle_antenna()
605 if (!il4965_rs_is_valid_ant(valid_ant, tbl->ant_type)) in il4965_rs_toggle_antenna()
608 new_ant_type = ant_toggle_lookup[tbl->ant_type]; in il4965_rs_toggle_antenna()
610 while (new_ant_type != tbl->ant_type && in il4965_rs_toggle_antenna()
614 if (new_ant_type == tbl->ant_type) in il4965_rs_toggle_antenna()
617 tbl->ant_type = new_ant_type; in il4965_rs_toggle_antenna()
715 struct il_scale_tbl_info *tbl, u8 scale_idx, in il4965_rs_get_lower_rate() argument
728 if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_idx)) { in il4965_rs_get_lower_rate()
732 tbl->lq_type = LQ_A; in il4965_rs_get_lower_rate()
734 tbl->lq_type = LQ_G; in il4965_rs_get_lower_rate()
736 if (il4965_num_of_ant(tbl->ant_type) > 1) in il4965_rs_get_lower_rate()
737 tbl->ant_type = in il4965_rs_get_lower_rate()
740 tbl->is_ht40 = 0; in il4965_rs_get_lower_rate()
741 tbl->is_SGI = 0; in il4965_rs_get_lower_rate()
742 tbl->max_search = IL_MAX_SEARCH; in il4965_rs_get_lower_rate()
745 rate_mask = il4965_rs_get_supported_rates(lq_sta, NULL, tbl->lq_type); in il4965_rs_get_lower_rate()
748 if (is_legacy(tbl->lq_type)) { in il4965_rs_get_lower_rate()
766 tbl->lq_type); in il4965_rs_get_lower_rate()
773 return il4965_rate_n_flags_from_tbl(lq_sta->drv, tbl, low, is_green); in il4965_rs_get_lower_rate()
1012 struct il_scale_tbl_info *tbl) in il4965_rs_set_expected_tpt_table() argument
1018 if (WARN_ON_ONCE(!is_legacy(tbl->lq_type) && !is_Ht(tbl->lq_type))) { in il4965_rs_set_expected_tpt_table()
1019 tbl->expected_tpt = expected_tpt_legacy; in il4965_rs_set_expected_tpt_table()
1024 if (is_legacy(tbl->lq_type)) { in il4965_rs_set_expected_tpt_table()
1025 tbl->expected_tpt = expected_tpt_legacy; in il4965_rs_set_expected_tpt_table()
1032 if (is_siso(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup)) in il4965_rs_set_expected_tpt_table()
1034 else if (is_siso(tbl->lq_type)) in il4965_rs_set_expected_tpt_table()
1036 else if (is_mimo2(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup)) in il4965_rs_set_expected_tpt_table()
1041 if (!tbl->is_SGI && !lq_sta->is_agg) /* Normal */ in il4965_rs_set_expected_tpt_table()
1042 tbl->expected_tpt = ht_tbl_pointer[0]; in il4965_rs_set_expected_tpt_table()
1043 else if (tbl->is_SGI && !lq_sta->is_agg) /* SGI */ in il4965_rs_set_expected_tpt_table()
1044 tbl->expected_tpt = ht_tbl_pointer[1]; in il4965_rs_set_expected_tpt_table()
1045 else if (!tbl->is_SGI && lq_sta->is_agg) /* AGG */ in il4965_rs_set_expected_tpt_table()
1046 tbl->expected_tpt = ht_tbl_pointer[2]; in il4965_rs_set_expected_tpt_table()
1048 tbl->expected_tpt = ht_tbl_pointer[3]; in il4965_rs_set_expected_tpt_table()
1065 struct il_scale_tbl_info *tbl, /* "search" */ in il4965_rs_get_best_rate() argument
1075 s32 *tpt_tbl = tbl->expected_tpt; in il4965_rs_get_best_rate()
1086 tbl->lq_type); in il4965_rs_get_best_rate()
1161 struct il_scale_tbl_info *tbl, int idx) in il4965_rs_switch_to_mimo2() argument
1179 tbl->lq_type = LQ_MIMO2; in il4965_rs_switch_to_mimo2()
1180 tbl->is_dup = lq_sta->is_dup; in il4965_rs_switch_to_mimo2()
1181 tbl->action = 0; in il4965_rs_switch_to_mimo2()
1182 tbl->max_search = IL_MAX_SEARCH; in il4965_rs_switch_to_mimo2()
1186 tbl->is_ht40 = 1; in il4965_rs_switch_to_mimo2()
1188 tbl->is_ht40 = 0; in il4965_rs_switch_to_mimo2()
1190 il4965_rs_set_expected_tpt_table(lq_sta, tbl); in il4965_rs_switch_to_mimo2()
1192 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx); in il4965_rs_switch_to_mimo2()
1200 tbl->current_rate = in il4965_rs_switch_to_mimo2()
1201 il4965_rate_n_flags_from_tbl(il, tbl, rate, is_green); in il4965_rs_switch_to_mimo2()
1203 D_RATE("LQ: Switch to new mcs %X idx is green %X\n", tbl->current_rate, in il4965_rs_switch_to_mimo2()
1214 struct il_scale_tbl_info *tbl, int idx) in il4965_rs_switch_to_siso() argument
1225 tbl->is_dup = lq_sta->is_dup; in il4965_rs_switch_to_siso()
1226 tbl->lq_type = LQ_SISO; in il4965_rs_switch_to_siso()
1227 tbl->action = 0; in il4965_rs_switch_to_siso()
1228 tbl->max_search = IL_MAX_SEARCH; in il4965_rs_switch_to_siso()
1232 tbl->is_ht40 = 1; in il4965_rs_switch_to_siso()
1234 tbl->is_ht40 = 0; in il4965_rs_switch_to_siso()
1237 tbl->is_SGI = 0; /*11n spec: no SGI in SISO+Greenfield */ in il4965_rs_switch_to_siso()
1239 il4965_rs_set_expected_tpt_table(lq_sta, tbl); in il4965_rs_switch_to_siso()
1240 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx); in il4965_rs_switch_to_siso()
1248 tbl->current_rate = in il4965_rs_switch_to_siso()
1249 il4965_rate_n_flags_from_tbl(il, tbl, rate, is_green); in il4965_rs_switch_to_siso()
1250 D_RATE("LQ: Switch to new mcs %X idx is green %X\n", tbl->current_rate, in il4965_rs_switch_to_siso()
1263 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_move_legacy_other() local
1266 struct il_rate_scale_data *win = &(tbl->win[idx]); in il4965_rs_move_legacy_other()
1276 tbl->action = IL_LEGACY_SWITCH_SISO; in il4965_rs_move_legacy_other()
1278 start_action = tbl->action; in il4965_rs_move_legacy_other()
1281 switch (tbl->action) { in il4965_rs_move_legacy_other()
1286 if ((tbl->action == IL_LEGACY_SWITCH_ANTENNA1 && in il4965_rs_move_legacy_other()
1288 (tbl->action == IL_LEGACY_SWITCH_ANTENNA2 && in il4965_rs_move_legacy_other()
1297 memcpy(search_tbl, tbl, sz); in il4965_rs_move_legacy_other()
1312 memcpy(search_tbl, tbl, sz); in il4965_rs_move_legacy_other()
1329 memcpy(search_tbl, tbl, sz); in il4965_rs_move_legacy_other()
1332 if (tbl->action == IL_LEGACY_SWITCH_MIMO2_AB) in il4965_rs_move_legacy_other()
1334 else if (tbl->action == IL_LEGACY_SWITCH_MIMO2_AC) in il4965_rs_move_legacy_other()
1352 tbl->action++; in il4965_rs_move_legacy_other()
1353 if (tbl->action > IL_LEGACY_SWITCH_MIMO2_BC) in il4965_rs_move_legacy_other()
1354 tbl->action = IL_LEGACY_SWITCH_ANTENNA1; in il4965_rs_move_legacy_other()
1356 if (tbl->action == start_action) in il4965_rs_move_legacy_other()
1365 tbl->action++; in il4965_rs_move_legacy_other()
1366 if (tbl->action > IL_LEGACY_SWITCH_MIMO2_BC) in il4965_rs_move_legacy_other()
1367 tbl->action = IL_LEGACY_SWITCH_ANTENNA1; in il4965_rs_move_legacy_other()
1369 search_tbl->action = tbl->action; in il4965_rs_move_legacy_other()
1383 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_move_siso_to_other() local
1386 struct il_rate_scale_data *win = &(tbl->win[idx]); in il4965_rs_move_siso_to_other()
1397 start_action = tbl->action; in il4965_rs_move_siso_to_other()
1401 switch (tbl->action) { in il4965_rs_move_siso_to_other()
1405 if ((tbl->action == IL_SISO_SWITCH_ANTENNA1 && in il4965_rs_move_siso_to_other()
1407 (tbl->action == IL_SISO_SWITCH_ANTENNA2 && in il4965_rs_move_siso_to_other()
1414 memcpy(search_tbl, tbl, sz); in il4965_rs_move_siso_to_other()
1426 memcpy(search_tbl, tbl, sz); in il4965_rs_move_siso_to_other()
1429 if (tbl->action == IL_SISO_SWITCH_MIMO2_AB) in il4965_rs_move_siso_to_other()
1431 else if (tbl->action == IL_SISO_SWITCH_MIMO2_AC) in il4965_rs_move_siso_to_other()
1447 if (!tbl->is_ht40 && in il4965_rs_move_siso_to_other()
1450 if (tbl->is_ht40 && in il4965_rs_move_siso_to_other()
1456 memcpy(search_tbl, tbl, sz); in il4965_rs_move_siso_to_other()
1458 if (!tbl->is_SGI) in il4965_rs_move_siso_to_other()
1463 search_tbl->is_SGI = !tbl->is_SGI; in il4965_rs_move_siso_to_other()
1465 if (tbl->is_SGI) { in il4965_rs_move_siso_to_other()
1476 tbl->action++; in il4965_rs_move_siso_to_other()
1477 if (tbl->action > IL_SISO_SWITCH_GI) in il4965_rs_move_siso_to_other()
1478 tbl->action = IL_SISO_SWITCH_ANTENNA1; in il4965_rs_move_siso_to_other()
1480 if (tbl->action == start_action) in il4965_rs_move_siso_to_other()
1488 tbl->action++; in il4965_rs_move_siso_to_other()
1489 if (tbl->action > IL_SISO_SWITCH_GI) in il4965_rs_move_siso_to_other()
1490 tbl->action = IL_SISO_SWITCH_ANTENNA1; in il4965_rs_move_siso_to_other()
1492 search_tbl->action = tbl->action; in il4965_rs_move_siso_to_other()
1506 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_move_mimo2_to_other() local
1509 struct il_rate_scale_data *win = &(tbl->win[idx]); in il4965_rs_move_mimo2_to_other()
1520 start_action = tbl->action; in il4965_rs_move_mimo2_to_other()
1523 switch (tbl->action) { in il4965_rs_move_mimo2_to_other()
1534 memcpy(search_tbl, tbl, sz); in il4965_rs_move_mimo2_to_other()
1548 memcpy(search_tbl, tbl, sz); in il4965_rs_move_mimo2_to_other()
1550 if (tbl->action == IL_MIMO2_SWITCH_SISO_A) in il4965_rs_move_mimo2_to_other()
1552 else if (tbl->action == IL_MIMO2_SWITCH_SISO_B) in il4965_rs_move_mimo2_to_other()
1570 if (!tbl->is_ht40 && in il4965_rs_move_mimo2_to_other()
1573 if (tbl->is_ht40 && in il4965_rs_move_mimo2_to_other()
1580 memcpy(search_tbl, tbl, sz); in il4965_rs_move_mimo2_to_other()
1581 search_tbl->is_SGI = !tbl->is_SGI; in il4965_rs_move_mimo2_to_other()
1589 if (tbl->is_SGI) { in il4965_rs_move_mimo2_to_other()
1601 tbl->action++; in il4965_rs_move_mimo2_to_other()
1602 if (tbl->action > IL_MIMO2_SWITCH_GI) in il4965_rs_move_mimo2_to_other()
1603 tbl->action = IL_MIMO2_SWITCH_ANTENNA1; in il4965_rs_move_mimo2_to_other()
1605 if (tbl->action == start_action) in il4965_rs_move_mimo2_to_other()
1612 tbl->action++; in il4965_rs_move_mimo2_to_other()
1613 if (tbl->action > IL_MIMO2_SWITCH_GI) in il4965_rs_move_mimo2_to_other()
1614 tbl->action = IL_MIMO2_SWITCH_ANTENNA1; in il4965_rs_move_mimo2_to_other()
1616 search_tbl->action = tbl->action; in il4965_rs_move_mimo2_to_other()
1632 struct il_scale_tbl_info *tbl; in il4965_rs_stay_in_table() local
1641 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_stay_in_table()
1690 (tbl-> in il4965_rs_stay_in_table()
1701 il4965_rs_rate_scale_clear_win(&(tbl->win[i])); in il4965_rs_stay_in_table()
1711 struct il_scale_tbl_info *tbl, int idx, u8 is_green) in il4965_rs_update_rate_tbl() argument
1716 rate = il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green); in il4965_rs_update_rate_tbl()
1745 struct il_scale_tbl_info *tbl, *tbl1; in il4965_rs_rate_scale_perform() local
1785 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_rate_scale_perform()
1786 if (is_legacy(tbl->lq_type)) in il4965_rs_rate_scale_perform()
1795 D_RATE("Rate scale idx %d for type %d\n", idx, tbl->lq_type); in il4965_rs_rate_scale_perform()
1798 rate_mask = il4965_rs_get_supported_rates(lq_sta, hdr, tbl->lq_type); in il4965_rs_rate_scale_perform()
1803 if (is_legacy(tbl->lq_type)) { in il4965_rs_rate_scale_perform()
1823 tbl->lq_type = LQ_NONE; in il4965_rs_rate_scale_perform()
1825 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_rate_scale_perform()
1827 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate); in il4965_rs_rate_scale_perform()
1828 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, in il4965_rs_rate_scale_perform()
1835 if (!tbl->expected_tpt) { in il4965_rs_rate_scale_perform()
1844 win = &(tbl->win[idx]); in il4965_rs_rate_scale_perform()
1848 win = &(tbl->win[idx]); in il4965_rs_rate_scale_perform()
1875 ((win->success_ratio * tbl->expected_tpt[idx] + 64) / 128)) { in il4965_rs_rate_scale_perform()
1878 ((win->success_ratio * tbl->expected_tpt[idx] + 64) / 128); in il4965_rs_rate_scale_perform()
1893 if (!is_legacy(tbl->lq_type)) in il4965_rs_rate_scale_perform()
1909 tbl->lq_type = LQ_NONE; in il4965_rs_rate_scale_perform()
1913 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_rate_scale_perform()
1916 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate); in il4965_rs_rate_scale_perform()
1934 tbl->lq_type); in il4965_rs_rate_scale_perform()
1947 low_tpt = tbl->win[low].average_tpt; in il4965_rs_rate_scale_perform()
1949 high_tpt = tbl->win[high].average_tpt; in il4965_rs_rate_scale_perform()
1999 (sr > RATE_HIGH_TH || current_tpt > 100 * tbl->expected_tpt[low])) in il4965_rs_rate_scale_perform()
2026 idx, scale_action, low, high, tbl->lq_type); in il4965_rs_rate_scale_perform()
2031 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, is_green); in il4965_rs_rate_scale_perform()
2049 if (is_legacy(tbl->lq_type)) in il4965_rs_rate_scale_perform()
2051 else if (is_siso(tbl->lq_type)) in il4965_rs_rate_scale_perform()
2061 tbl = &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]); in il4965_rs_rate_scale_perform()
2063 il4965_rs_rate_scale_clear_win(&(tbl->win[i])); in il4965_rs_rate_scale_perform()
2066 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate); in il4965_rs_rate_scale_perform()
2069 tbl->current_rate, idx); in il4965_rs_rate_scale_perform()
2070 il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate); in il4965_rs_rate_scale_perform()
2111 tbl->current_rate = in il4965_rs_rate_scale_perform()
2112 il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green); in il4965_rs_rate_scale_perform()
2135 struct il_scale_tbl_info *tbl; in il4965_rs_initialize_lq() local
2157 tbl = &(lq_sta->lq_info[active_tbl]); in il4965_rs_initialize_lq()
2163 tbl->ant_type = il4965_first_antenna(valid_tx_ant); in il4965_rs_initialize_lq()
2164 rate |= tbl->ant_type << RATE_MCS_ANT_POS; in il4965_rs_initialize_lq()
2169 il4965_rs_get_tbl_info_from_mcs(rate, il->band, tbl, &rate_idx); in il4965_rs_initialize_lq()
2170 if (!il4965_rs_is_valid_ant(valid_tx_ant, tbl->ant_type)) in il4965_rs_initialize_lq()
2171 il4965_rs_toggle_antenna(valid_tx_ant, &rate, tbl); in il4965_rs_initialize_lq()
2173 rate = il4965_rate_n_flags_from_tbl(il, tbl, rate_idx, use_green); in il4965_rs_initialize_lq()
2174 tbl->current_rate = rate; in il4965_rs_initialize_lq()
2175 il4965_rs_set_expected_tpt_table(lq_sta, tbl); in il4965_rs_initialize_lq()
2578 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); in il4965_rs_sta_dbgfs_scale_table_read() local
2599 (is_legacy(tbl->lq_type)) ? "legacy" : "HT"); in il4965_rs_sta_dbgfs_scale_table_read()
2600 if (is_Ht(tbl->lq_type)) { in il4965_rs_sta_dbgfs_scale_table_read()
2603 (is_siso(tbl->lq_type)) ? "SISO" : "MIMO2"); in il4965_rs_sta_dbgfs_scale_table_read()
2606 (tbl->is_ht40) ? "40MHz" : "20MHz"); in il4965_rs_sta_dbgfs_scale_table_read()
2609 (tbl->is_SGI) ? "SGI" : "", in il4965_rs_sta_dbgfs_scale_table_read()
2645 if (is_legacy(tbl->lq_type)) { in il4965_rs_sta_dbgfs_scale_table_read()
2727 struct il_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl]; in il4965_rs_sta_dbgfs_rate_scale_data_read() local
2729 if (is_Ht(tbl->lq_type)) in il4965_rs_sta_dbgfs_rate_scale_data_read()
2732 tbl->expected_tpt[lq_sta->last_txrate_idx]); in il4965_rs_sta_dbgfs_rate_scale_data_read()