Lines Matching refs:tbl

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