Lines Matching refs:tbl

414 static s32 get_expected_tpt(struct iwl_scale_tbl_info *tbl, int rs_index)
416 if (tbl->expected_tpt)
417 return tbl->expected_tpt[rs_index];
428 static int rs_collect_tx_data(struct iwl_scale_tbl_info *tbl,
439 window = &(tbl->win[scale_index]);
442 tpt = get_expected_tpt(tbl, scale_index);
507 struct iwl_scale_tbl_info *tbl,
512 if (is_legacy(tbl->lq_type)) {
517 } else if (is_Ht(tbl->lq_type)) {
524 if (is_siso(tbl->lq_type))
526 else if (is_mimo2(tbl->lq_type))
531 IWL_ERR(priv, "Invalid tbl->lq_type %d\n", tbl->lq_type);
534 rate_n_flags |= ((tbl->ant_type << RATE_MCS_ANT_POS) &
537 if (is_Ht(tbl->lq_type)) {
538 if (tbl->is_ht40) {
539 if (tbl->is_dup)
544 if (tbl->is_SGI)
549 if (is_siso(tbl->lq_type) && tbl->is_SGI) {
564 struct iwl_scale_tbl_info *tbl,
571 memset(tbl, 0, sizeof(struct iwl_scale_tbl_info));
578 tbl->is_SGI = 0; /* default legacy setup */
579 tbl->is_ht40 = 0;
580 tbl->is_dup = 0;
581 tbl->ant_type = (ant_msk >> RATE_MCS_ANT_POS);
582 tbl->lq_type = LQ_NONE;
583 tbl->max_search = IWL_MAX_SEARCH;
589 tbl->lq_type = LQ_A;
591 tbl->lq_type = LQ_G;
596 tbl->is_SGI = 1;
600 tbl->is_ht40 = 1;
603 tbl->is_dup = 1;
610 tbl->lq_type = LQ_SISO; /*else NONE*/
614 tbl->lq_type = LQ_MIMO2;
618 tbl->max_search = IWL_MAX_11N_MIMO3_SEARCH;
619 tbl->lq_type = LQ_MIMO3;
629 struct iwl_scale_tbl_info *tbl)
633 if (!tbl->ant_type || tbl->ant_type > ANT_ABC)
636 if (!rs_is_valid_ant(valid_ant, tbl->ant_type))
639 new_ant_type = ant_toggle_lookup[tbl->ant_type];
641 while ((new_ant_type != tbl->ant_type) &&
645 if (new_ant_type == tbl->ant_type)
648 tbl->ant_type = new_ant_type;
753 struct iwl_scale_tbl_info *tbl,
766 if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_index)) {
770 tbl->lq_type = LQ_A;
772 tbl->lq_type = LQ_G;
774 if (num_of_ant(tbl->ant_type) > 1)
775 tbl->ant_type =
778 tbl->is_ht40 = 0;
779 tbl->is_SGI = 0;
780 tbl->max_search = IWL_MAX_SEARCH;
783 rate_mask = rs_get_supported_rates(lq_sta, NULL, tbl->lq_type);
786 if (is_legacy(tbl->lq_type)) {
802 tbl->lq_type);
809 return rate_n_flags_from_tbl(lq_sta->drv, tbl, low, is_green);
825 struct iwl_scale_tbl_info *tbl;
834 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
835 rs_fill_link_cmd(priv, lq_sta, tbl->current_rate);
1065 struct iwl_scale_tbl_info *tbl)
1071 if (WARN_ON_ONCE(!is_legacy(tbl->lq_type) && !is_Ht(tbl->lq_type))) {
1072 tbl->expected_tpt = expected_tpt_legacy;
1077 if (is_legacy(tbl->lq_type)) {
1078 tbl->expected_tpt = expected_tpt_legacy;
1085 if (is_siso(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup))
1087 else if (is_siso(tbl->lq_type))
1089 else if (is_mimo2(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup))
1091 else if (is_mimo2(tbl->lq_type))
1093 else if (is_mimo3(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup))
1095 else /* if (is_mimo3(tbl->lq_type)) <-- must be true */
1098 if (!tbl->is_SGI && !lq_sta->is_agg) /* Normal */
1099 tbl->expected_tpt = ht_tbl_pointer[0];
1100 else if (tbl->is_SGI && !lq_sta->is_agg) /* SGI */
1101 tbl->expected_tpt = ht_tbl_pointer[1];
1102 else if (!tbl->is_SGI && lq_sta->is_agg) /* AGG */
1103 tbl->expected_tpt = ht_tbl_pointer[2];
1105 tbl->expected_tpt = ht_tbl_pointer[3];
1122 struct iwl_scale_tbl_info *tbl, /* "search" */
1131 const u16 *tpt_tbl = tbl->expected_tpt;
1141 tbl->lq_type);
1217 struct iwl_scale_tbl_info *tbl, int index)
1237 tbl->lq_type = LQ_MIMO2;
1238 tbl->is_dup = lq_sta->is_dup;
1239 tbl->action = 0;
1240 tbl->max_search = IWL_MAX_SEARCH;
1244 tbl->is_ht40 = 1;
1246 tbl->is_ht40 = 0;
1248 rs_set_expected_tpt_table(lq_sta, tbl);
1250 rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index);
1258 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green);
1261 tbl->current_rate, is_green);
1272 struct iwl_scale_tbl_info *tbl, int index)
1292 tbl->lq_type = LQ_MIMO3;
1293 tbl->is_dup = lq_sta->is_dup;
1294 tbl->action = 0;
1295 tbl->max_search = IWL_MAX_11N_MIMO3_SEARCH;
1299 tbl->is_ht40 = 1;
1301 tbl->is_ht40 = 0;
1303 rs_set_expected_tpt_table(lq_sta, tbl);
1305 rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index);
1314 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green);
1317 tbl->current_rate, is_green);
1328 struct iwl_scale_tbl_info *tbl, int index)
1341 tbl->is_dup = lq_sta->is_dup;
1342 tbl->lq_type = LQ_SISO;
1343 tbl->action = 0;
1344 tbl->max_search = IWL_MAX_SEARCH;
1348 tbl->is_ht40 = 1;
1350 tbl->is_ht40 = 0;
1353 tbl->is_SGI = 0; /*11n spec: no SGI in SISO+Greenfield*/
1355 rs_set_expected_tpt_table(lq_sta, tbl);
1356 rate = rs_get_best_rate(priv, lq_sta, tbl, rate_mask, index);
1364 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, rate, is_green);
1366 tbl->current_rate, is_green);
1379 struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1382 struct iwl_rate_scale_data *window = &(tbl->win[index]);
1397 if (tbl->action == IWL_LEGACY_SWITCH_ANTENNA2)
1398 tbl->action = IWL_LEGACY_SWITCH_SISO;
1405 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 &&
1406 tbl->action != IWL_LEGACY_SWITCH_SISO)
1407 tbl->action = IWL_LEGACY_SWITCH_SISO;
1416 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1;
1418 tbl->action > IWL_LEGACY_SWITCH_SISO)
1419 tbl->action = IWL_LEGACY_SWITCH_SISO;
1424 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1;
1425 else if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2)
1426 tbl->action = IWL_LEGACY_SWITCH_SISO;
1431 start_action = tbl->action;
1434 switch (tbl->action) {
1439 if ((tbl->action == IWL_LEGACY_SWITCH_ANTENNA1 &&
1441 (tbl->action == IWL_LEGACY_SWITCH_ANTENNA2 &&
1453 memcpy(search_tbl, tbl, sz);
1466 memcpy(search_tbl, tbl, sz);
1482 memcpy(search_tbl, tbl, sz);
1485 if (tbl->action == IWL_LEGACY_SWITCH_MIMO2_AB)
1487 else if (tbl->action == IWL_LEGACY_SWITCH_MIMO2_AC)
1507 memcpy(search_tbl, tbl, sz);
1523 tbl->action++;
1524 if (tbl->action > IWL_LEGACY_SWITCH_MIMO3_ABC)
1525 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1;
1527 if (tbl->action == start_action)
1536 tbl->action++;
1537 if (tbl->action > IWL_LEGACY_SWITCH_MIMO3_ABC)
1538 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1;
1540 search_tbl->action = tbl->action;
1552 struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1555 struct iwl_rate_scale_data *window = &(tbl->win[index]);
1571 if (tbl->action == IWL_SISO_SWITCH_ANTENNA2)
1572 tbl->action = IWL_SISO_SWITCH_MIMO2_AB;
1579 if (tbl->action != IWL_SISO_SWITCH_ANTENNA1)
1580 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1588 tbl->action > IWL_SISO_SWITCH_ANTENNA2) {
1590 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1597 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2)
1598 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1601 start_action = tbl->action;
1604 switch (tbl->action) {
1608 if ((tbl->action == IWL_SISO_SWITCH_ANTENNA1 &&
1610 (tbl->action == IWL_SISO_SWITCH_ANTENNA2 &&
1620 memcpy(search_tbl, tbl, sz);
1631 memcpy(search_tbl, tbl, sz);
1634 if (tbl->action == IWL_SISO_SWITCH_MIMO2_AB)
1636 else if (tbl->action == IWL_SISO_SWITCH_MIMO2_AC)
1650 if (!tbl->is_ht40 && !(ht_cap->cap &
1653 if (tbl->is_ht40 && !(ht_cap->cap &
1659 memcpy(search_tbl, tbl, sz);
1661 if (!tbl->is_SGI)
1667 search_tbl->is_SGI = !tbl->is_SGI;
1669 if (tbl->is_SGI) {
1681 memcpy(search_tbl, tbl, sz);
1694 tbl->action++;
1695 if (tbl->action > IWL_LEGACY_SWITCH_MIMO3_ABC)
1696 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1698 if (tbl->action == start_action)
1706 tbl->action++;
1707 if (tbl->action > IWL_SISO_SWITCH_MIMO3_ABC)
1708 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1710 search_tbl->action = tbl->action;
1722 struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1725 struct iwl_rate_scale_data *window = &(tbl->win[index]);
1742 if (tbl->action != IWL_MIMO2_SWITCH_SISO_A)
1743 tbl->action = IWL_MIMO2_SWITCH_SISO_A;
1747 if (tbl->action == IWL_MIMO2_SWITCH_SISO_B ||
1748 tbl->action == IWL_MIMO2_SWITCH_SISO_C)
1749 tbl->action = IWL_MIMO2_SWITCH_SISO_A;
1757 (tbl->action < IWL_MIMO2_SWITCH_SISO_A ||
1758 tbl->action > IWL_MIMO2_SWITCH_SISO_C)) {
1760 tbl->action = IWL_MIMO2_SWITCH_SISO_A;
1765 (tbl->action < IWL_MIMO2_SWITCH_SISO_A ||
1766 tbl->action > IWL_MIMO2_SWITCH_SISO_C))
1767 tbl->action = IWL_MIMO2_SWITCH_SISO_A;
1769 start_action = tbl->action;
1772 switch (tbl->action) {
1783 memcpy(search_tbl, tbl, sz);
1796 memcpy(search_tbl, tbl, sz);
1798 if (tbl->action == IWL_MIMO2_SWITCH_SISO_A)
1800 else if (tbl->action == IWL_MIMO2_SWITCH_SISO_B)
1816 if (!tbl->is_ht40 && !(ht_cap->cap &
1819 if (tbl->is_ht40 && !(ht_cap->cap &
1826 memcpy(search_tbl, tbl, sz);
1827 search_tbl->is_SGI = !tbl->is_SGI;
1835 if (tbl->is_SGI) {
1848 memcpy(search_tbl, tbl, sz);
1862 tbl->action++;
1863 if (tbl->action > IWL_MIMO2_SWITCH_MIMO3_ABC)
1864 tbl->action = IWL_MIMO2_SWITCH_ANTENNA1;
1866 if (tbl->action == start_action)
1873 tbl->action++;
1874 if (tbl->action > IWL_MIMO2_SWITCH_MIMO3_ABC)
1875 tbl->action = IWL_MIMO2_SWITCH_ANTENNA1;
1877 search_tbl->action = tbl->action;
1890 struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1893 struct iwl_rate_scale_data *window = &(tbl->win[index]);
1910 if (tbl->action != IWL_MIMO3_SWITCH_SISO_A)
1911 tbl->action = IWL_MIMO3_SWITCH_SISO_A;
1915 if (tbl->action == IWL_MIMO3_SWITCH_SISO_B ||
1916 tbl->action == IWL_MIMO3_SWITCH_SISO_C)
1917 tbl->action = IWL_MIMO3_SWITCH_SISO_A;
1925 (tbl->action < IWL_MIMO3_SWITCH_SISO_A ||
1926 tbl->action > IWL_MIMO3_SWITCH_SISO_C)) {
1928 tbl->action = IWL_MIMO3_SWITCH_SISO_A;
1933 (tbl->action < IWL_MIMO3_SWITCH_SISO_A ||
1934 tbl->action > IWL_MIMO3_SWITCH_SISO_C))
1935 tbl->action = IWL_MIMO3_SWITCH_SISO_A;
1937 start_action = tbl->action;
1940 switch (tbl->action) {
1951 memcpy(search_tbl, tbl, sz);
1962 memcpy(search_tbl, tbl, sz);
1964 if (tbl->action == IWL_MIMO3_SWITCH_SISO_A)
1966 else if (tbl->action == IWL_MIMO3_SWITCH_SISO_B)
1986 memcpy(search_tbl, tbl, sz);
1988 if (tbl->action == IWL_MIMO3_SWITCH_MIMO2_AB)
1990 else if (tbl->action == IWL_MIMO3_SWITCH_MIMO2_AC)
2006 if (!tbl->is_ht40 && !(ht_cap->cap &
2009 if (tbl->is_ht40 && !(ht_cap->cap &
2016 memcpy(search_tbl, tbl, sz);
2017 search_tbl->is_SGI = !tbl->is_SGI;
2025 if (tbl->is_SGI) {
2036 tbl->action++;
2037 if (tbl->action > IWL_MIMO3_SWITCH_GI)
2038 tbl->action = IWL_MIMO3_SWITCH_ANTENNA1;
2040 if (tbl->action == start_action)
2047 tbl->action++;
2048 if (tbl->action > IWL_MIMO3_SWITCH_GI)
2049 tbl->action = IWL_MIMO3_SWITCH_ANTENNA1;
2051 search_tbl->action = tbl->action;
2063 struct iwl_scale_tbl_info *tbl;
2072 tbl = &(lq_sta->lq_info[active_tbl]);
2123 &(tbl->win[i]));
2132 rs_rate_scale_clear_window(&(tbl->win[i]));
2143 struct iwl_scale_tbl_info *tbl,
2149 rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
2178 struct iwl_scale_tbl_info *tbl, *tbl1;
2221 tbl = &(lq_sta->lq_info[active_tbl]);
2222 if (is_legacy(tbl->lq_type))
2232 tbl->lq_type);
2235 rate_mask = rs_get_supported_rates(lq_sta, hdr, tbl->lq_type);
2240 if (is_legacy(tbl->lq_type)) {
2259 tbl->lq_type = LQ_NONE;
2261 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
2263 index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
2264 rs_update_rate_tbl(priv, ctx, lq_sta, tbl,
2271 if (!tbl->expected_tpt) {
2272 IWL_ERR(priv, "tbl->expected_tpt is NULL\n");
2281 window = &(tbl->win[index]);
2285 window = &(tbl->win[index]);
2313 tbl->expected_tpt[index] + 64) / 128)) {
2316 tbl->expected_tpt[index] + 64) / 128);
2333 if (!is_legacy(tbl->lq_type))
2350 tbl->lq_type = LQ_NONE;
2354 tbl = &(lq_sta->lq_info[active_tbl]);
2357 index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
2374 tbl->lq_type);
2388 low_tpt = tbl->win[low].average_tpt;
2390 high_tpt = tbl->win[high].average_tpt;
2447 (current_tpt > (100 * tbl->expected_tpt[low]))))
2449 if (!iwl_ht_enabled(priv) && !is_legacy(tbl->lq_type))
2452 (is_mimo2(tbl->lq_type) || is_mimo3(tbl->lq_type)))
2456 (is_mimo2(tbl->lq_type) || is_mimo3(tbl->lq_type))) {
2470 (is_mimo2(tbl->lq_type) || is_mimo3(tbl->lq_type))) {
2501 index, scale_action, low, high, tbl->lq_type);
2506 rs_update_rate_tbl(priv, ctx, lq_sta, tbl, index, is_green);
2525 if (is_legacy(tbl->lq_type))
2527 else if (is_siso(tbl->lq_type))
2529 else if (is_mimo2(tbl->lq_type))
2537 tbl = &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]);
2539 rs_rate_scale_clear_window(&(tbl->win[i]));
2542 index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
2545 tbl->current_rate, index);
2546 rs_fill_link_cmd(priv, lq_sta, tbl->current_rate);
2589 tbl->current_rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
2611 struct iwl_scale_tbl_info *tbl;
2636 tbl = &(lq_sta->lq_info[active_tbl]);
2642 tbl->ant_type = first_antenna(valid_tx_ant);
2643 rate |= tbl->ant_type << RATE_MCS_ANT_POS;
2648 rs_get_tbl_info_from_mcs(rate, priv->band, tbl, &rate_idx);
2649 if (!rs_is_valid_ant(valid_tx_ant, tbl->ant_type))
2650 rs_toggle_antenna(valid_tx_ant, &rate, tbl);
2652 rate = rate_n_flags_from_tbl(priv, tbl, rate_idx, use_green);
2653 tbl->current_rate = rate;
2654 rs_set_expected_tpt_table(lq_sta, tbl);
3094 struct iwl_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
3112 (is_legacy(tbl->lq_type)) ? "legacy" : "HT");
3113 if (is_Ht(tbl->lq_type)) {
3115 (is_siso(tbl->lq_type)) ? "SISO" :
3116 ((is_mimo2(tbl->lq_type)) ? "MIMO2" : "MIMO3"));
3118 (tbl->is_ht40) ? "40MHz" : "20MHz");
3120 (tbl->is_SGI) ? "SGI" : "",
3152 } else if (is_legacy(tbl->lq_type)) {
3222 struct iwl_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl];
3226 if (is_Ht(tbl->lq_type))
3229 tbl->expected_tpt[lq_sta->last_txrate_idx]);