Lines Matching refs:tbl

405 il4965_get_expected_tpt(struct il_scale_tbl_info *tbl, int rs_idx)
407 if (tbl->expected_tpt)
408 return tbl->expected_tpt[rs_idx];
420 il4965_rs_collect_tx_data(struct il_scale_tbl_info *tbl, int scale_idx,
431 win = &(tbl->win[scale_idx]);
434 tpt = il4965_get_expected_tpt(tbl, scale_idx);
498 il4965_rate_n_flags_from_tbl(struct il_priv *il, struct il_scale_tbl_info *tbl,
503 if (is_legacy(tbl->lq_type)) {
508 } else if (is_Ht(tbl->lq_type)) {
515 if (is_siso(tbl->lq_type))
520 IL_ERR("Invalid tbl->lq_type %d\n", tbl->lq_type);
524 ((tbl->ant_type << RATE_MCS_ANT_POS) & RATE_MCS_ANT_ABC_MSK);
526 if (is_Ht(tbl->lq_type)) {
527 if (tbl->is_ht40) {
528 if (tbl->is_dup)
533 if (tbl->is_SGI)
538 if (is_siso(tbl->lq_type) && tbl->is_SGI) {
554 struct il_scale_tbl_info *tbl, int *rate_idx)
561 memset(tbl, 0, sizeof(struct il_scale_tbl_info));
568 tbl->is_SGI = 0; /* default legacy setup */
569 tbl->is_ht40 = 0;
570 tbl->is_dup = 0;
571 tbl->ant_type = (ant_msk >> RATE_MCS_ANT_POS);
572 tbl->lq_type = LQ_NONE;
573 tbl->max_search = IL_MAX_SEARCH;
579 tbl->lq_type = LQ_A;
581 tbl->lq_type = LQ_G;
586 tbl->is_SGI = 1;
590 tbl->is_ht40 = 1;
593 tbl->is_dup = 1;
600 tbl->lq_type = LQ_SISO; /*else NONE */
604 tbl->lq_type = LQ_MIMO2;
614 struct il_scale_tbl_info *tbl)
618 if (!tbl->ant_type || tbl->ant_type > ANT_ABC)
621 if (!il4965_rs_is_valid_ant(valid_ant, tbl->ant_type))
624 new_ant_type = ant_toggle_lookup[tbl->ant_type];
626 while (new_ant_type != tbl->ant_type &&
630 if (new_ant_type == tbl->ant_type)
633 tbl->ant_type = new_ant_type;
731 struct il_scale_tbl_info *tbl, u8 scale_idx,
744 if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_idx)) {
748 tbl->lq_type = LQ_A;
750 tbl->lq_type = LQ_G;
752 if (il4965_num_of_ant(tbl->ant_type) > 1)
753 tbl->ant_type =
756 tbl->is_ht40 = 0;
757 tbl->is_SGI = 0;
758 tbl->max_search = IL_MAX_SEARCH;
761 rate_mask = il4965_rs_get_supported_rates(lq_sta, NULL, tbl->lq_type);
764 if (is_legacy(tbl->lq_type)) {
782 tbl->lq_type);
789 return il4965_rate_n_flags_from_tbl(lq_sta->drv, tbl, low, is_green);
1028 struct il_scale_tbl_info *tbl)
1034 if (WARN_ON_ONCE(!is_legacy(tbl->lq_type) && !is_Ht(tbl->lq_type))) {
1035 tbl->expected_tpt = expected_tpt_legacy;
1040 if (is_legacy(tbl->lq_type)) {
1041 tbl->expected_tpt = expected_tpt_legacy;
1048 if (is_siso(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup))
1050 else if (is_siso(tbl->lq_type))
1052 else if (is_mimo2(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup))
1054 else /* if (is_mimo2(tbl->lq_type)) <-- must be true */
1057 if (!tbl->is_SGI && !lq_sta->is_agg) /* Normal */
1058 tbl->expected_tpt = ht_tbl_pointer[0];
1059 else if (tbl->is_SGI && !lq_sta->is_agg) /* SGI */
1060 tbl->expected_tpt = ht_tbl_pointer[1];
1061 else if (!tbl->is_SGI && lq_sta->is_agg) /* AGG */
1062 tbl->expected_tpt = ht_tbl_pointer[2];
1064 tbl->expected_tpt = ht_tbl_pointer[3];
1081 struct il_scale_tbl_info *tbl, /* "search" */
1091 s32 *tpt_tbl = tbl->expected_tpt;
1102 tbl->lq_type);
1177 struct il_scale_tbl_info *tbl, int idx)
1196 tbl->lq_type = LQ_MIMO2;
1197 tbl->is_dup = lq_sta->is_dup;
1198 tbl->action = 0;
1199 tbl->max_search = IL_MAX_SEARCH;
1203 tbl->is_ht40 = 1;
1205 tbl->is_ht40 = 0;
1207 il4965_rs_set_expected_tpt_table(lq_sta, tbl);
1209 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx);
1217 tbl->current_rate =
1218 il4965_rate_n_flags_from_tbl(il, tbl, rate, is_green);
1220 D_RATE("LQ: Switch to new mcs %X idx is green %X\n", tbl->current_rate,
1231 struct il_scale_tbl_info *tbl, int idx)
1242 tbl->is_dup = lq_sta->is_dup;
1243 tbl->lq_type = LQ_SISO;
1244 tbl->action = 0;
1245 tbl->max_search = IL_MAX_SEARCH;
1249 tbl->is_ht40 = 1;
1251 tbl->is_ht40 = 0;
1254 tbl->is_SGI = 0; /*11n spec: no SGI in SISO+Greenfield */
1256 il4965_rs_set_expected_tpt_table(lq_sta, tbl);
1257 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx);
1265 tbl->current_rate =
1266 il4965_rate_n_flags_from_tbl(il, tbl, rate, is_green);
1267 D_RATE("LQ: Switch to new mcs %X idx is green %X\n", tbl->current_rate,
1280 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1283 struct il_rate_scale_data *win = &(tbl->win[idx]);
1293 tbl->action = IL_LEGACY_SWITCH_SISO;
1295 start_action = tbl->action;
1298 switch (tbl->action) {
1303 if ((tbl->action == IL_LEGACY_SWITCH_ANTENNA1 &&
1305 (tbl->action == IL_LEGACY_SWITCH_ANTENNA2 &&
1314 memcpy(search_tbl, tbl, sz);
1329 memcpy(search_tbl, tbl, sz);
1346 memcpy(search_tbl, tbl, sz);
1349 if (tbl->action == IL_LEGACY_SWITCH_MIMO2_AB)
1351 else if (tbl->action == IL_LEGACY_SWITCH_MIMO2_AC)
1369 tbl->action++;
1370 if (tbl->action > IL_LEGACY_SWITCH_MIMO2_BC)
1371 tbl->action = IL_LEGACY_SWITCH_ANTENNA1;
1373 if (tbl->action == start_action)
1382 tbl->action++;
1383 if (tbl->action > IL_LEGACY_SWITCH_MIMO2_BC)
1384 tbl->action = IL_LEGACY_SWITCH_ANTENNA1;
1386 search_tbl->action = tbl->action;
1400 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1403 struct il_rate_scale_data *win = &(tbl->win[idx]);
1414 start_action = tbl->action;
1418 switch (tbl->action) {
1422 if ((tbl->action == IL_SISO_SWITCH_ANTENNA1 &&
1424 (tbl->action == IL_SISO_SWITCH_ANTENNA2 &&
1431 memcpy(search_tbl, tbl, sz);
1443 memcpy(search_tbl, tbl, sz);
1446 if (tbl->action == IL_SISO_SWITCH_MIMO2_AB)
1448 else if (tbl->action == IL_SISO_SWITCH_MIMO2_AC)
1464 if (!tbl->is_ht40 &&
1467 if (tbl->is_ht40 &&
1473 memcpy(search_tbl, tbl, sz);
1475 if (!tbl->is_SGI)
1480 search_tbl->is_SGI = !tbl->is_SGI;
1482 if (tbl->is_SGI) {
1493 tbl->action++;
1494 if (tbl->action > IL_SISO_SWITCH_GI)
1495 tbl->action = IL_SISO_SWITCH_ANTENNA1;
1497 if (tbl->action == start_action)
1505 tbl->action++;
1506 if (tbl->action > IL_SISO_SWITCH_GI)
1507 tbl->action = IL_SISO_SWITCH_ANTENNA1;
1509 search_tbl->action = tbl->action;
1523 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1526 struct il_rate_scale_data *win = &(tbl->win[idx]);
1537 start_action = tbl->action;
1540 switch (tbl->action) {
1551 memcpy(search_tbl, tbl, sz);
1565 memcpy(search_tbl, tbl, sz);
1567 if (tbl->action == IL_MIMO2_SWITCH_SISO_A)
1569 else if (tbl->action == IL_MIMO2_SWITCH_SISO_B)
1587 if (!tbl->is_ht40 &&
1590 if (tbl->is_ht40 &&
1597 memcpy(search_tbl, tbl, sz);
1598 search_tbl->is_SGI = !tbl->is_SGI;
1606 if (tbl->is_SGI) {
1618 tbl->action++;
1619 if (tbl->action > IL_MIMO2_SWITCH_GI)
1620 tbl->action = IL_MIMO2_SWITCH_ANTENNA1;
1622 if (tbl->action == start_action)
1629 tbl->action++;
1630 if (tbl->action > IL_MIMO2_SWITCH_GI)
1631 tbl->action = IL_MIMO2_SWITCH_ANTENNA1;
1633 search_tbl->action = tbl->action;
1649 struct il_scale_tbl_info *tbl;
1658 tbl = &(lq_sta->lq_info[active_tbl]);
1707 (tbl->
1718 il4965_rs_rate_scale_clear_win(&(tbl->win[i]));
1728 struct il_scale_tbl_info *tbl, int idx, u8 is_green)
1733 rate = il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green);
1762 struct il_scale_tbl_info *tbl, *tbl1;
1802 tbl = &(lq_sta->lq_info[active_tbl]);
1803 if (is_legacy(tbl->lq_type))
1812 D_RATE("Rate scale idx %d for type %d\n", idx, tbl->lq_type);
1815 rate_mask = il4965_rs_get_supported_rates(lq_sta, hdr, tbl->lq_type);
1820 if (is_legacy(tbl->lq_type)) {
1840 tbl->lq_type = LQ_NONE;
1842 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1844 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate);
1845 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx,
1852 if (!tbl->expected_tpt) {
1853 IL_ERR("tbl->expected_tpt is NULL\n");
1861 win = &(tbl->win[idx]);
1865 win = &(tbl->win[idx]);
1892 ((win->success_ratio * tbl->expected_tpt[idx] + 64) / 128)) {
1895 ((win->success_ratio * tbl->expected_tpt[idx] + 64) / 128);
1910 if (!is_legacy(tbl->lq_type))
1926 tbl->lq_type = LQ_NONE;
1930 tbl = &(lq_sta->lq_info[active_tbl]);
1933 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate);
1951 tbl->lq_type);
1964 low_tpt = tbl->win[low].average_tpt;
1966 high_tpt = tbl->win[high].average_tpt;
2016 (sr > RATE_HIGH_TH || current_tpt > 100 * tbl->expected_tpt[low]))
2043 idx, scale_action, low, high, tbl->lq_type);
2048 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, is_green);
2066 if (is_legacy(tbl->lq_type))
2068 else if (is_siso(tbl->lq_type))
2071 else /* (is_mimo2(tbl->lq_type)) */
2078 tbl = &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]);
2080 il4965_rs_rate_scale_clear_win(&(tbl->win[i]));
2083 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate);
2086 tbl->current_rate, idx);
2087 il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate);
2128 tbl->current_rate =
2129 il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green);
2152 struct il_scale_tbl_info *tbl;
2175 tbl = &(lq_sta->lq_info[active_tbl]);
2181 tbl->ant_type = il4965_first_antenna(valid_tx_ant);
2182 rate |= tbl->ant_type << RATE_MCS_ANT_POS;
2187 il4965_rs_get_tbl_info_from_mcs(rate, il->band, tbl, &rate_idx);
2188 if (!il4965_rs_is_valid_ant(valid_tx_ant, tbl->ant_type))
2189 il4965_rs_toggle_antenna(valid_tx_ant, &rate, tbl);
2191 rate = il4965_rate_n_flags_from_tbl(il, tbl, rate_idx, use_green);
2192 tbl->current_rate = rate;
2193 il4965_rs_set_expected_tpt_table(lq_sta, tbl);
2600 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
2621 (is_legacy(tbl->lq_type)) ? "legacy" : "HT");
2622 if (is_Ht(tbl->lq_type)) {
2625 (is_siso(tbl->lq_type)) ? "SISO" : "MIMO2");
2628 (tbl->is_ht40) ? "40MHz" : "20MHz");
2631 (tbl->is_SGI) ? "SGI" : "",
2667 if (is_legacy(tbl->lq_type)) {
2749 struct il_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl];
2751 if (is_Ht(tbl->lq_type))
2754 tbl->expected_tpt[lq_sta->last_txrate_idx]);