Lines Matching defs:tbl

404 il4965_get_expected_tpt(struct il_scale_tbl_info *tbl, int rs_idx)
406 if (tbl->expected_tpt)
407 return tbl->expected_tpt[rs_idx];
419 il4965_rs_collect_tx_data(struct il_scale_tbl_info *tbl, int scale_idx,
430 win = &(tbl->win[scale_idx]);
433 tpt = il4965_get_expected_tpt(tbl, scale_idx);
497 il4965_rate_n_flags_from_tbl(struct il_priv *il, struct il_scale_tbl_info *tbl,
502 if (is_legacy(tbl->lq_type)) {
507 } else if (is_Ht(tbl->lq_type)) {
514 if (is_siso(tbl->lq_type))
519 IL_ERR("Invalid tbl->lq_type %d\n", tbl->lq_type);
523 ((tbl->ant_type << RATE_MCS_ANT_POS) & RATE_MCS_ANT_ABC_MSK);
525 if (is_Ht(tbl->lq_type)) {
526 if (tbl->is_ht40) {
527 if (tbl->is_dup)
532 if (tbl->is_SGI)
537 if (is_siso(tbl->lq_type) && tbl->is_SGI) {
553 struct il_scale_tbl_info *tbl, int *rate_idx)
560 memset(tbl, 0, sizeof(struct il_scale_tbl_info));
567 tbl->is_SGI = 0; /* default legacy setup */
568 tbl->is_ht40 = 0;
569 tbl->is_dup = 0;
570 tbl->ant_type = (ant_msk >> RATE_MCS_ANT_POS);
571 tbl->lq_type = LQ_NONE;
572 tbl->max_search = IL_MAX_SEARCH;
578 tbl->lq_type = LQ_A;
580 tbl->lq_type = LQ_G;
585 tbl->is_SGI = 1;
589 tbl->is_ht40 = 1;
592 tbl->is_dup = 1;
599 tbl->lq_type = LQ_SISO; /*else NONE */
603 tbl->lq_type = LQ_MIMO2;
613 struct il_scale_tbl_info *tbl)
617 if (!tbl->ant_type || tbl->ant_type > ANT_ABC)
620 if (!il4965_rs_is_valid_ant(valid_ant, tbl->ant_type))
623 new_ant_type = ant_toggle_lookup[tbl->ant_type];
625 while (new_ant_type != tbl->ant_type &&
629 if (new_ant_type == tbl->ant_type)
632 tbl->ant_type = new_ant_type;
730 struct il_scale_tbl_info *tbl, u8 scale_idx,
743 if (!is_legacy(tbl->lq_type) && (!ht_possible || !scale_idx)) {
747 tbl->lq_type = LQ_A;
749 tbl->lq_type = LQ_G;
751 if (il4965_num_of_ant(tbl->ant_type) > 1)
752 tbl->ant_type =
755 tbl->is_ht40 = 0;
756 tbl->is_SGI = 0;
757 tbl->max_search = IL_MAX_SEARCH;
760 rate_mask = il4965_rs_get_supported_rates(lq_sta, NULL, tbl->lq_type);
763 if (is_legacy(tbl->lq_type)) {
781 tbl->lq_type);
788 return il4965_rate_n_flags_from_tbl(lq_sta->drv, tbl, low, is_green);
1027 struct il_scale_tbl_info *tbl)
1033 if (WARN_ON_ONCE(!is_legacy(tbl->lq_type) && !is_Ht(tbl->lq_type))) {
1034 tbl->expected_tpt = expected_tpt_legacy;
1039 if (is_legacy(tbl->lq_type)) {
1040 tbl->expected_tpt = expected_tpt_legacy;
1047 if (is_siso(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup))
1049 else if (is_siso(tbl->lq_type))
1051 else if (is_mimo2(tbl->lq_type) && (!tbl->is_ht40 || lq_sta->is_dup))
1053 else /* if (is_mimo2(tbl->lq_type)) <-- must be true */
1056 if (!tbl->is_SGI && !lq_sta->is_agg) /* Normal */
1057 tbl->expected_tpt = ht_tbl_pointer[0];
1058 else if (tbl->is_SGI && !lq_sta->is_agg) /* SGI */
1059 tbl->expected_tpt = ht_tbl_pointer[1];
1060 else if (!tbl->is_SGI && lq_sta->is_agg) /* AGG */
1061 tbl->expected_tpt = ht_tbl_pointer[2];
1063 tbl->expected_tpt = ht_tbl_pointer[3];
1080 struct il_scale_tbl_info *tbl, /* "search" */
1090 s32 *tpt_tbl = tbl->expected_tpt;
1101 tbl->lq_type);
1176 struct il_scale_tbl_info *tbl, int idx)
1194 tbl->lq_type = LQ_MIMO2;
1195 tbl->is_dup = lq_sta->is_dup;
1196 tbl->action = 0;
1197 tbl->max_search = IL_MAX_SEARCH;
1201 tbl->is_ht40 = 1;
1203 tbl->is_ht40 = 0;
1205 il4965_rs_set_expected_tpt_table(lq_sta, tbl);
1207 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx);
1215 tbl->current_rate =
1216 il4965_rate_n_flags_from_tbl(il, tbl, rate, is_green);
1218 D_RATE("LQ: Switch to new mcs %X idx is green %X\n", tbl->current_rate,
1229 struct il_scale_tbl_info *tbl, int idx)
1240 tbl->is_dup = lq_sta->is_dup;
1241 tbl->lq_type = LQ_SISO;
1242 tbl->action = 0;
1243 tbl->max_search = IL_MAX_SEARCH;
1247 tbl->is_ht40 = 1;
1249 tbl->is_ht40 = 0;
1252 tbl->is_SGI = 0; /*11n spec: no SGI in SISO+Greenfield */
1254 il4965_rs_set_expected_tpt_table(lq_sta, tbl);
1255 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, idx);
1263 tbl->current_rate =
1264 il4965_rate_n_flags_from_tbl(il, tbl, rate, is_green);
1265 D_RATE("LQ: Switch to new mcs %X idx is green %X\n", tbl->current_rate,
1278 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1281 struct il_rate_scale_data *win = &(tbl->win[idx]);
1291 tbl->action = IL_LEGACY_SWITCH_SISO;
1293 start_action = tbl->action;
1296 switch (tbl->action) {
1301 if ((tbl->action == IL_LEGACY_SWITCH_ANTENNA1 &&
1303 (tbl->action == IL_LEGACY_SWITCH_ANTENNA2 &&
1312 memcpy(search_tbl, tbl, sz);
1327 memcpy(search_tbl, tbl, sz);
1344 memcpy(search_tbl, tbl, sz);
1347 if (tbl->action == IL_LEGACY_SWITCH_MIMO2_AB)
1349 else if (tbl->action == IL_LEGACY_SWITCH_MIMO2_AC)
1367 tbl->action++;
1368 if (tbl->action > IL_LEGACY_SWITCH_MIMO2_BC)
1369 tbl->action = IL_LEGACY_SWITCH_ANTENNA1;
1371 if (tbl->action == start_action)
1380 tbl->action++;
1381 if (tbl->action > IL_LEGACY_SWITCH_MIMO2_BC)
1382 tbl->action = IL_LEGACY_SWITCH_ANTENNA1;
1384 search_tbl->action = tbl->action;
1398 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1401 struct il_rate_scale_data *win = &(tbl->win[idx]);
1412 start_action = tbl->action;
1416 switch (tbl->action) {
1420 if ((tbl->action == IL_SISO_SWITCH_ANTENNA1 &&
1422 (tbl->action == IL_SISO_SWITCH_ANTENNA2 &&
1429 memcpy(search_tbl, tbl, sz);
1441 memcpy(search_tbl, tbl, sz);
1444 if (tbl->action == IL_SISO_SWITCH_MIMO2_AB)
1446 else if (tbl->action == IL_SISO_SWITCH_MIMO2_AC)
1462 if (!tbl->is_ht40 &&
1465 if (tbl->is_ht40 &&
1471 memcpy(search_tbl, tbl, sz);
1473 if (!tbl->is_SGI)
1478 search_tbl->is_SGI = !tbl->is_SGI;
1480 if (tbl->is_SGI) {
1491 tbl->action++;
1492 if (tbl->action > IL_SISO_SWITCH_GI)
1493 tbl->action = IL_SISO_SWITCH_ANTENNA1;
1495 if (tbl->action == start_action)
1503 tbl->action++;
1504 if (tbl->action > IL_SISO_SWITCH_GI)
1505 tbl->action = IL_SISO_SWITCH_ANTENNA1;
1507 search_tbl->action = tbl->action;
1521 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1524 struct il_rate_scale_data *win = &(tbl->win[idx]);
1535 start_action = tbl->action;
1538 switch (tbl->action) {
1549 memcpy(search_tbl, tbl, sz);
1563 memcpy(search_tbl, tbl, sz);
1565 if (tbl->action == IL_MIMO2_SWITCH_SISO_A)
1567 else if (tbl->action == IL_MIMO2_SWITCH_SISO_B)
1585 if (!tbl->is_ht40 &&
1588 if (tbl->is_ht40 &&
1595 memcpy(search_tbl, tbl, sz);
1596 search_tbl->is_SGI = !tbl->is_SGI;
1604 if (tbl->is_SGI) {
1616 tbl->action++;
1617 if (tbl->action > IL_MIMO2_SWITCH_GI)
1618 tbl->action = IL_MIMO2_SWITCH_ANTENNA1;
1620 if (tbl->action == start_action)
1627 tbl->action++;
1628 if (tbl->action > IL_MIMO2_SWITCH_GI)
1629 tbl->action = IL_MIMO2_SWITCH_ANTENNA1;
1631 search_tbl->action = tbl->action;
1647 struct il_scale_tbl_info *tbl;
1656 tbl = &(lq_sta->lq_info[active_tbl]);
1705 (tbl->
1716 il4965_rs_rate_scale_clear_win(&(tbl->win[i]));
1726 struct il_scale_tbl_info *tbl, int idx, u8 is_green)
1731 rate = il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green);
1760 struct il_scale_tbl_info *tbl, *tbl1;
1800 tbl = &(lq_sta->lq_info[active_tbl]);
1801 if (is_legacy(tbl->lq_type))
1810 D_RATE("Rate scale idx %d for type %d\n", idx, tbl->lq_type);
1813 rate_mask = il4965_rs_get_supported_rates(lq_sta, hdr, tbl->lq_type);
1818 if (is_legacy(tbl->lq_type)) {
1838 tbl->lq_type = LQ_NONE;
1840 tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
1842 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate);
1843 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx,
1850 if (!tbl->expected_tpt) {
1851 IL_ERR("tbl->expected_tpt is NULL\n");
1859 win = &(tbl->win[idx]);
1863 win = &(tbl->win[idx]);
1890 ((win->success_ratio * tbl->expected_tpt[idx] + 64) / 128)) {
1893 ((win->success_ratio * tbl->expected_tpt[idx] + 64) / 128);
1908 if (!is_legacy(tbl->lq_type))
1924 tbl->lq_type = LQ_NONE;
1928 tbl = &(lq_sta->lq_info[active_tbl]);
1931 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate);
1949 tbl->lq_type);
1962 low_tpt = tbl->win[low].average_tpt;
1964 high_tpt = tbl->win[high].average_tpt;
2014 (sr > RATE_HIGH_TH || current_tpt > 100 * tbl->expected_tpt[low]))
2041 idx, scale_action, low, high, tbl->lq_type);
2046 il4965_rs_update_rate_tbl(il, lq_sta, tbl, idx, is_green);
2064 if (is_legacy(tbl->lq_type))
2066 else if (is_siso(tbl->lq_type))
2069 else /* (is_mimo2(tbl->lq_type)) */
2076 tbl = &(lq_sta->lq_info[(1 - lq_sta->active_tbl)]);
2078 il4965_rs_rate_scale_clear_win(&(tbl->win[i]));
2081 idx = il4965_hwrate_to_plcp_idx(tbl->current_rate);
2084 tbl->current_rate, idx);
2085 il4965_rs_fill_link_cmd(il, lq_sta, tbl->current_rate);
2126 tbl->current_rate =
2127 il4965_rate_n_flags_from_tbl(il, tbl, idx, is_green);
2150 struct il_scale_tbl_info *tbl;
2174 tbl = &(lq_sta->lq_info[active_tbl]);
2180 tbl->ant_type = il4965_first_antenna(valid_tx_ant);
2181 rate |= tbl->ant_type << RATE_MCS_ANT_POS;
2186 il4965_rs_get_tbl_info_from_mcs(rate, il->band, tbl, &rate_idx);
2187 if (!il4965_rs_is_valid_ant(valid_tx_ant, tbl->ant_type))
2188 il4965_rs_toggle_antenna(valid_tx_ant, &rate, tbl);
2190 rate = il4965_rate_n_flags_from_tbl(il, tbl, rate_idx, use_green);
2191 tbl->current_rate = rate;
2192 il4965_rs_set_expected_tpt_table(lq_sta, tbl);
2599 struct il_scale_tbl_info *tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
2620 (is_legacy(tbl->lq_type)) ? "legacy" : "HT");
2621 if (is_Ht(tbl->lq_type)) {
2624 (is_siso(tbl->lq_type)) ? "SISO" : "MIMO2");
2627 (tbl->is_ht40) ? "40MHz" : "20MHz");
2630 (tbl->is_SGI) ? "SGI" : "",
2666 if (is_legacy(tbl->lq_type)) {
2748 struct il_scale_tbl_info *tbl = &lq_sta->lq_info[lq_sta->active_tbl];
2750 if (is_Ht(tbl->lq_type))
2753 tbl->expected_tpt[lq_sta->last_txrate_idx]);