aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2011-11-15 05:21:01 -0500
committerStanislaw Gruszka <sgruszka@redhat.com>2011-11-15 05:21:01 -0500
commit58de00a464f1e7cf0b108341dc6cc49276d19d7a (patch)
tree9d9d56256f22f2bd5e87aa673eeadbae375293d5 /drivers/net/wireless/iwlegacy/iwl-4965-rs.c
parent2d27c5dbd696e7e3a162bba7b948486a9856abca (diff)
iwlegacy: rename IL_DEBUG_ to D_
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy/iwl-4965-rs.c')
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-rs.c106
1 files changed, 53 insertions, 53 deletions
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-rs.c b/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
index 782ec77715f5..b53cf1b70c30 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-rs.c
@@ -358,7 +358,7 @@ static int il4965_rs_tl_turn_on_agg_for_tid(struct il_priv *il,
358 load = il4965_rs_tl_get_load(lq_data, tid); 358 load = il4965_rs_tl_get_load(lq_data, tid);
359 359
360 if (load > IL_AGG_LOAD_THRESHOLD) { 360 if (load > IL_AGG_LOAD_THRESHOLD) {
361 IL_DEBUG_HT(il, "Starting Tx agg: STA: %pM tid: %d\n", 361 D_HT("Starting Tx agg: STA: %pM tid: %d\n",
362 sta->addr, tid); 362 sta->addr, tid);
363 ret = ieee80211_start_tx_ba_session(sta, tid, 5000); 363 ret = ieee80211_start_tx_ba_session(sta, tid, 5000);
364 if (ret == -EAGAIN) { 364 if (ret == -EAGAIN) {
@@ -707,7 +707,7 @@ il4965_rs_get_adjacent_rate(struct il_priv *il, u8 index, u16 rate_mask,
707 break; 707 break;
708 if (rate_mask & (1 << low)) 708 if (rate_mask & (1 << low))
709 break; 709 break;
710 IL_DEBUG_RATE(il, "Skipping masked lower rate: %d\n", low); 710 D_RATE("Skipping masked lower rate: %d\n", low);
711 } 711 }
712 712
713 high = index; 713 high = index;
@@ -717,7 +717,7 @@ il4965_rs_get_adjacent_rate(struct il_priv *il, u8 index, u16 rate_mask,
717 break; 717 break;
718 if (rate_mask & (1 << high)) 718 if (rate_mask & (1 << high))
719 break; 719 break;
720 IL_DEBUG_RATE(il, "Skipping masked higher rate: %d\n", high); 720 D_RATE("Skipping masked higher rate: %d\n", high);
721 } 721 }
722 722
723 return (high << 8) | low; 723 return (high << 8) | low;
@@ -817,15 +817,15 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband,
817 struct il_station_priv *sta_priv = (void *)sta->drv_priv; 817 struct il_station_priv *sta_priv = (void *)sta->drv_priv;
818 struct il_rxon_context *ctx = sta_priv->common.ctx; 818 struct il_rxon_context *ctx = sta_priv->common.ctx;
819 819
820 IL_DEBUG_RATE(il, 820 D_RATE(
821 "get frame ack response, update rate scale window\n"); 821 "get frame ack response, update rate scale window\n");
822 822
823 /* Treat uninitialized rate scaling data same as non-existing. */ 823 /* Treat uninitialized rate scaling data same as non-existing. */
824 if (!lq_sta) { 824 if (!lq_sta) {
825 IL_DEBUG_RATE(il, "Station rate scaling not created yet.\n"); 825 D_RATE("Station rate scaling not created yet.\n");
826 return; 826 return;
827 } else if (!lq_sta->drv) { 827 } else if (!lq_sta->drv) {
828 IL_DEBUG_RATE(il, "Rate scaling not initialized yet.\n"); 828 D_RATE("Rate scaling not initialized yet.\n");
829 return; 829 return;
830 } 830 }
831 831
@@ -880,7 +880,7 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband,
880 (!!(tx_rate & RATE_MCS_GF_MSK) != 880 (!!(tx_rate & RATE_MCS_GF_MSK) !=
881 !!(mac_flags & IEEE80211_TX_RC_GREEN_FIELD)) || 881 !!(mac_flags & IEEE80211_TX_RC_GREEN_FIELD)) ||
882 (rs_index != mac_index)) { 882 (rs_index != mac_index)) {
883 IL_DEBUG_RATE(il, 883 D_RATE(
884 "initial rate %d does not match %d (0x%x)\n", 884 "initial rate %d does not match %d (0x%x)\n",
885 mac_index, rs_index, tx_rate); 885 mac_index, rs_index, tx_rate);
886 /* 886 /*
@@ -910,15 +910,15 @@ il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband,
910 curr_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]); 910 curr_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
911 other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); 911 other_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
912 } else { 912 } else {
913 IL_DEBUG_RATE(il, 913 D_RATE(
914 "Neither active nor search matches tx rate\n"); 914 "Neither active nor search matches tx rate\n");
915 tmp_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]); 915 tmp_tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
916 IL_DEBUG_RATE(il, "active- lq:%x, ant:%x, SGI:%d\n", 916 D_RATE("active- lq:%x, ant:%x, SGI:%d\n",
917 tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI); 917 tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI);
918 tmp_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]); 918 tmp_tbl = &(lq_sta->lq_info[1 - lq_sta->active_tbl]);
919 IL_DEBUG_RATE(il, "search- lq:%x, ant:%x, SGI:%d\n", 919 D_RATE("search- lq:%x, ant:%x, SGI:%d\n",
920 tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI); 920 tmp_tbl->lq_type, tmp_tbl->ant_type, tmp_tbl->is_SGI);
921 IL_DEBUG_RATE(il, "actual- lq:%x, ant:%x, SGI:%d\n", 921 D_RATE("actual- lq:%x, ant:%x, SGI:%d\n",
922 tbl_type.lq_type, tbl_type.ant_type, tbl_type.is_SGI); 922 tbl_type.lq_type, tbl_type.ant_type, tbl_type.is_SGI);
923 /* 923 /*
924 * no matching table found, let's by-pass the data collection 924 * no matching table found, let's by-pass the data collection
@@ -1004,7 +1004,7 @@ done:
1004static void il4965_rs_set_stay_in_table(struct il_priv *il, u8 is_legacy, 1004static void il4965_rs_set_stay_in_table(struct il_priv *il, u8 is_legacy,
1005 struct il_lq_sta *lq_sta) 1005 struct il_lq_sta *lq_sta)
1006{ 1006{
1007 IL_DEBUG_RATE(il, "we are staying in the same table\n"); 1007 D_RATE("we are staying in the same table\n");
1008 lq_sta->stay_in_tbl = 1; /* only place this gets set */ 1008 lq_sta->stay_in_tbl = 1; /* only place this gets set */
1009 if (is_legacy) { 1009 if (is_legacy) {
1010 lq_sta->table_count_limit = IL_LEGACY_TABLE_COUNT; 1010 lq_sta->table_count_limit = IL_LEGACY_TABLE_COUNT;
@@ -1194,7 +1194,7 @@ static int il4965_rs_switch_to_mimo2(struct il_priv *il,
1194 if (il->hw_params.tx_chains_num < 2) 1194 if (il->hw_params.tx_chains_num < 2)
1195 return -1; 1195 return -1;
1196 1196
1197 IL_DEBUG_RATE(il, "LQ: try to switch to MIMO2\n"); 1197 D_RATE("LQ: try to switch to MIMO2\n");
1198 1198
1199 tbl->lq_type = LQ_MIMO2; 1199 tbl->lq_type = LQ_MIMO2;
1200 tbl->is_dup = lq_sta->is_dup; 1200 tbl->is_dup = lq_sta->is_dup;
@@ -1211,10 +1211,10 @@ static int il4965_rs_switch_to_mimo2(struct il_priv *il,
1211 1211
1212 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, index); 1212 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, index);
1213 1213
1214 IL_DEBUG_RATE(il, "LQ: MIMO2 best rate %d mask %X\n", 1214 D_RATE("LQ: MIMO2 best rate %d mask %X\n",
1215 rate, rate_mask); 1215 rate, rate_mask);
1216 if ((rate == IL_RATE_INVALID) || !((1 << rate) & rate_mask)) { 1216 if ((rate == IL_RATE_INVALID) || !((1 << rate) & rate_mask)) {
1217 IL_DEBUG_RATE(il, 1217 D_RATE(
1218 "Can't switch with index %d rate mask %x\n", 1218 "Can't switch with index %d rate mask %x\n",
1219 rate, rate_mask); 1219 rate, rate_mask);
1220 return -1; 1220 return -1;
@@ -1222,7 +1222,7 @@ static int il4965_rs_switch_to_mimo2(struct il_priv *il,
1222 tbl->current_rate = il4965_rate_n_flags_from_tbl(il, 1222 tbl->current_rate = il4965_rate_n_flags_from_tbl(il,
1223 tbl, rate, is_green); 1223 tbl, rate, is_green);
1224 1224
1225 IL_DEBUG_RATE(il, "LQ: Switch to new mcs %X index is green %X\n", 1225 D_RATE("LQ: Switch to new mcs %X index is green %X\n",
1226 tbl->current_rate, is_green); 1226 tbl->current_rate, is_green);
1227 return 0; 1227 return 0;
1228} 1228}
@@ -1245,7 +1245,7 @@ static int il4965_rs_switch_to_siso(struct il_priv *il,
1245 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported) 1245 if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
1246 return -1; 1246 return -1;
1247 1247
1248 IL_DEBUG_RATE(il, "LQ: try to switch to SISO\n"); 1248 D_RATE("LQ: try to switch to SISO\n");
1249 1249
1250 tbl->is_dup = lq_sta->is_dup; 1250 tbl->is_dup = lq_sta->is_dup;
1251 tbl->lq_type = LQ_SISO; 1251 tbl->lq_type = LQ_SISO;
@@ -1264,16 +1264,16 @@ static int il4965_rs_switch_to_siso(struct il_priv *il,
1264 il4965_rs_set_expected_tpt_table(lq_sta, tbl); 1264 il4965_rs_set_expected_tpt_table(lq_sta, tbl);
1265 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, index); 1265 rate = il4965_rs_get_best_rate(il, lq_sta, tbl, rate_mask, index);
1266 1266
1267 IL_DEBUG_RATE(il, "LQ: get best rate %d mask %X\n", rate, rate_mask); 1267 D_RATE("LQ: get best rate %d mask %X\n", rate, rate_mask);
1268 if ((rate == IL_RATE_INVALID) || !((1 << rate) & rate_mask)) { 1268 if ((rate == IL_RATE_INVALID) || !((1 << rate) & rate_mask)) {
1269 IL_DEBUG_RATE(il, 1269 D_RATE(
1270 "can not switch with index %d rate mask %x\n", 1270 "can not switch with index %d rate mask %x\n",
1271 rate, rate_mask); 1271 rate, rate_mask);
1272 return -1; 1272 return -1;
1273 } 1273 }
1274 tbl->current_rate = il4965_rate_n_flags_from_tbl(il, 1274 tbl->current_rate = il4965_rate_n_flags_from_tbl(il,
1275 tbl, rate, is_green); 1275 tbl, rate, is_green);
1276 IL_DEBUG_RATE(il, "LQ: Switch to new mcs %X index is green %X\n", 1276 D_RATE("LQ: Switch to new mcs %X index is green %X\n",
1277 tbl->current_rate, is_green); 1277 tbl->current_rate, is_green);
1278 return 0; 1278 return 0;
1279} 1279}
@@ -1307,7 +1307,7 @@ static int il4965_rs_move_legacy_other(struct il_priv *il,
1307 switch (tbl->action) { 1307 switch (tbl->action) {
1308 case IL_LEGACY_SWITCH_ANTENNA1: 1308 case IL_LEGACY_SWITCH_ANTENNA1:
1309 case IL_LEGACY_SWITCH_ANTENNA2: 1309 case IL_LEGACY_SWITCH_ANTENNA2:
1310 IL_DEBUG_RATE(il, "LQ: Legacy toggle Antenna\n"); 1310 D_RATE("LQ: Legacy toggle Antenna\n");
1311 1311
1312 if ((tbl->action == IL_LEGACY_SWITCH_ANTENNA1 && 1312 if ((tbl->action == IL_LEGACY_SWITCH_ANTENNA1 &&
1313 tx_chains_num <= 1) || 1313 tx_chains_num <= 1) ||
@@ -1331,7 +1331,7 @@ static int il4965_rs_move_legacy_other(struct il_priv *il,
1331 } 1331 }
1332 break; 1332 break;
1333 case IL_LEGACY_SWITCH_SISO: 1333 case IL_LEGACY_SWITCH_SISO:
1334 IL_DEBUG_RATE(il, "LQ: Legacy switch to SISO\n"); 1334 D_RATE("LQ: Legacy switch to SISO\n");
1335 1335
1336 /* Set up search table to try SISO */ 1336 /* Set up search table to try SISO */
1337 memcpy(search_tbl, tbl, sz); 1337 memcpy(search_tbl, tbl, sz);
@@ -1347,7 +1347,7 @@ static int il4965_rs_move_legacy_other(struct il_priv *il,
1347 case IL_LEGACY_SWITCH_MIMO2_AB: 1347 case IL_LEGACY_SWITCH_MIMO2_AB:
1348 case IL_LEGACY_SWITCH_MIMO2_AC: 1348 case IL_LEGACY_SWITCH_MIMO2_AC:
1349 case IL_LEGACY_SWITCH_MIMO2_BC: 1349 case IL_LEGACY_SWITCH_MIMO2_BC:
1350 IL_DEBUG_RATE(il, "LQ: Legacy switch to MIMO2\n"); 1350 D_RATE("LQ: Legacy switch to MIMO2\n");
1351 1351
1352 /* Set up search table to try MIMO */ 1352 /* Set up search table to try MIMO */
1353 memcpy(search_tbl, tbl, sz); 1353 memcpy(search_tbl, tbl, sz);
@@ -1424,7 +1424,7 @@ static int il4965_rs_move_siso_to_other(struct il_priv *il,
1424 switch (tbl->action) { 1424 switch (tbl->action) {
1425 case IL_SISO_SWITCH_ANTENNA1: 1425 case IL_SISO_SWITCH_ANTENNA1:
1426 case IL_SISO_SWITCH_ANTENNA2: 1426 case IL_SISO_SWITCH_ANTENNA2:
1427 IL_DEBUG_RATE(il, "LQ: SISO toggle Antenna\n"); 1427 D_RATE("LQ: SISO toggle Antenna\n");
1428 if ((tbl->action == IL_SISO_SWITCH_ANTENNA1 && 1428 if ((tbl->action == IL_SISO_SWITCH_ANTENNA1 &&
1429 tx_chains_num <= 1) || 1429 tx_chains_num <= 1) ||
1430 (tbl->action == IL_SISO_SWITCH_ANTENNA2 && 1430 (tbl->action == IL_SISO_SWITCH_ANTENNA2 &&
@@ -1444,7 +1444,7 @@ static int il4965_rs_move_siso_to_other(struct il_priv *il,
1444 case IL_SISO_SWITCH_MIMO2_AB: 1444 case IL_SISO_SWITCH_MIMO2_AB:
1445 case IL_SISO_SWITCH_MIMO2_AC: 1445 case IL_SISO_SWITCH_MIMO2_AC:
1446 case IL_SISO_SWITCH_MIMO2_BC: 1446 case IL_SISO_SWITCH_MIMO2_BC:
1447 IL_DEBUG_RATE(il, "LQ: SISO switch to MIMO2\n"); 1447 D_RATE("LQ: SISO switch to MIMO2\n");
1448 memcpy(search_tbl, tbl, sz); 1448 memcpy(search_tbl, tbl, sz);
1449 search_tbl->is_SGI = 0; 1449 search_tbl->is_SGI = 0;
1450 1450
@@ -1473,7 +1473,7 @@ static int il4965_rs_move_siso_to_other(struct il_priv *il,
1473 IEEE80211_HT_CAP_SGI_40)) 1473 IEEE80211_HT_CAP_SGI_40))
1474 break; 1474 break;
1475 1475
1476 IL_DEBUG_RATE(il, "LQ: SISO toggle SGI/NGI\n"); 1476 D_RATE("LQ: SISO toggle SGI/NGI\n");
1477 1477
1478 memcpy(search_tbl, tbl, sz); 1478 memcpy(search_tbl, tbl, sz);
1479 if (is_green) { 1479 if (is_green) {
@@ -1545,7 +1545,7 @@ static int il4965_rs_move_mimo2_to_other(struct il_priv *il,
1545 switch (tbl->action) { 1545 switch (tbl->action) {
1546 case IL_MIMO2_SWITCH_ANTENNA1: 1546 case IL_MIMO2_SWITCH_ANTENNA1:
1547 case IL_MIMO2_SWITCH_ANTENNA2: 1547 case IL_MIMO2_SWITCH_ANTENNA2:
1548 IL_DEBUG_RATE(il, "LQ: MIMO2 toggle Antennas\n"); 1548 D_RATE("LQ: MIMO2 toggle Antennas\n");
1549 1549
1550 if (tx_chains_num <= 2) 1550 if (tx_chains_num <= 2)
1551 break; 1551 break;
@@ -1563,7 +1563,7 @@ static int il4965_rs_move_mimo2_to_other(struct il_priv *il,
1563 case IL_MIMO2_SWITCH_SISO_A: 1563 case IL_MIMO2_SWITCH_SISO_A:
1564 case IL_MIMO2_SWITCH_SISO_B: 1564 case IL_MIMO2_SWITCH_SISO_B:
1565 case IL_MIMO2_SWITCH_SISO_C: 1565 case IL_MIMO2_SWITCH_SISO_C:
1566 IL_DEBUG_RATE(il, "LQ: MIMO2 switch to SISO\n"); 1566 D_RATE("LQ: MIMO2 switch to SISO\n");
1567 1567
1568 /* Set up new search table for SISO */ 1568 /* Set up new search table for SISO */
1569 memcpy(search_tbl, tbl, sz); 1569 memcpy(search_tbl, tbl, sz);
@@ -1595,7 +1595,7 @@ static int il4965_rs_move_mimo2_to_other(struct il_priv *il,
1595 IEEE80211_HT_CAP_SGI_40)) 1595 IEEE80211_HT_CAP_SGI_40))
1596 break; 1596 break;
1597 1597
1598 IL_DEBUG_RATE(il, "LQ: MIMO2 toggle SGI/NGI\n"); 1598 D_RATE("LQ: MIMO2 toggle SGI/NGI\n");
1599 1599
1600 /* Set up new search table for MIMO2 */ 1600 /* Set up new search table for MIMO2 */
1601 memcpy(search_tbl, tbl, sz); 1601 memcpy(search_tbl, tbl, sz);
@@ -1684,7 +1684,7 @@ il4965_rs_stay_in_table(struct il_lq_sta *lq_sta, bool force_search)
1684 (lq_sta->total_success > lq_sta->max_success_limit) || 1684 (lq_sta->total_success > lq_sta->max_success_limit) ||
1685 ((!lq_sta->search_better_tbl) && (lq_sta->flush_timer) 1685 ((!lq_sta->search_better_tbl) && (lq_sta->flush_timer)
1686 && (flush_interval_passed))) { 1686 && (flush_interval_passed))) {
1687 IL_DEBUG_RATE(il, "LQ: stay is expired %d %d %d\n:", 1687 D_RATE("LQ: stay is expired %d %d %d\n:",
1688 lq_sta->total_failed, 1688 lq_sta->total_failed,
1689 lq_sta->total_success, 1689 lq_sta->total_success,
1690 flush_interval_passed); 1690 flush_interval_passed);
@@ -1707,7 +1707,7 @@ il4965_rs_stay_in_table(struct il_lq_sta *lq_sta, bool force_search)
1707 lq_sta->table_count_limit) { 1707 lq_sta->table_count_limit) {
1708 lq_sta->table_count = 0; 1708 lq_sta->table_count = 0;
1709 1709
1710 IL_DEBUG_RATE(il, 1710 D_RATE(
1711 "LQ: stay in table clear win\n"); 1711 "LQ: stay in table clear win\n");
1712 for (i = 0; i < IL_RATE_COUNT; i++) 1712 for (i = 0; i < IL_RATE_COUNT; i++)
1713 il4965_rs_rate_scale_clear_window( 1713 il4965_rs_rate_scale_clear_window(
@@ -1783,7 +1783,7 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
1783 struct il_station_priv *sta_priv = (void *)sta->drv_priv; 1783 struct il_station_priv *sta_priv = (void *)sta->drv_priv;
1784 struct il_rxon_context *ctx = sta_priv->common.ctx; 1784 struct il_rxon_context *ctx = sta_priv->common.ctx;
1785 1785
1786 IL_DEBUG_RATE(il, "rate scale calculate new rate for skb\n"); 1786 D_RATE("rate scale calculate new rate for skb\n");
1787 1787
1788 /* Send management frames and NO_ACK data using lowest rate. */ 1788 /* Send management frames and NO_ACK data using lowest rate. */
1789 /* TODO: this could probably be improved.. */ 1789 /* TODO: this could probably be improved.. */
@@ -1826,13 +1826,13 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
1826 /* current tx rate */ 1826 /* current tx rate */
1827 index = lq_sta->last_txrate_idx; 1827 index = lq_sta->last_txrate_idx;
1828 1828
1829 IL_DEBUG_RATE(il, "Rate scale index %d for type %d\n", index, 1829 D_RATE("Rate scale index %d for type %d\n", index,
1830 tbl->lq_type); 1830 tbl->lq_type);
1831 1831
1832 /* rates available for this association, and for modulation mode */ 1832 /* rates available for this association, and for modulation mode */
1833 rate_mask = il4965_rs_get_supported_rates(lq_sta, hdr, tbl->lq_type); 1833 rate_mask = il4965_rs_get_supported_rates(lq_sta, hdr, tbl->lq_type);
1834 1834
1835 IL_DEBUG_RATE(il, "mask 0x%04X\n", rate_mask); 1835 D_RATE("mask 0x%04X\n", rate_mask);
1836 1836
1837 /* mask with station rate restriction */ 1837 /* mask with station rate restriction */
1838 if (is_legacy(tbl->lq_type)) { 1838 if (is_legacy(tbl->lq_type)) {
@@ -1892,7 +1892,7 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
1892 fail_count = window->counter - window->success_counter; 1892 fail_count = window->counter - window->success_counter;
1893 if ((fail_count < IL_RATE_MIN_FAILURE_TH) && 1893 if ((fail_count < IL_RATE_MIN_FAILURE_TH) &&
1894 (window->success_counter < IL_RATE_MIN_SUCCESS_TH)) { 1894 (window->success_counter < IL_RATE_MIN_SUCCESS_TH)) {
1895 IL_DEBUG_RATE(il, "LQ: still below TH. succ=%d total=%d " 1895 D_RATE("LQ: still below TH. succ=%d total=%d "
1896 "for index %d\n", 1896 "for index %d\n",
1897 window->success_counter, window->counter, index); 1897 window->success_counter, window->counter, index);
1898 1898
@@ -1922,7 +1922,7 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
1922 * continuing to use the setup that we've been trying. */ 1922 * continuing to use the setup that we've been trying. */
1923 if (window->average_tpt > lq_sta->last_tpt) { 1923 if (window->average_tpt > lq_sta->last_tpt) {
1924 1924
1925 IL_DEBUG_RATE(il, "LQ: SWITCHING TO NEW TABLE " 1925 D_RATE("LQ: SWITCHING TO NEW TABLE "
1926 "suc=%d cur-tpt=%d old-tpt=%d\n", 1926 "suc=%d cur-tpt=%d old-tpt=%d\n",
1927 window->success_ratio, 1927 window->success_ratio,
1928 window->average_tpt, 1928 window->average_tpt,
@@ -1938,7 +1938,7 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
1938 /* Else poor success; go back to mode in "active" table */ 1938 /* Else poor success; go back to mode in "active" table */
1939 } else { 1939 } else {
1940 1940
1941 IL_DEBUG_RATE(il, "LQ: GOING BACK TO THE OLD TABLE " 1941 D_RATE("LQ: GOING BACK TO THE OLD TABLE "
1942 "suc=%d cur-tpt=%d old-tpt=%d\n", 1942 "suc=%d cur-tpt=%d old-tpt=%d\n",
1943 window->success_ratio, 1943 window->success_ratio,
1944 window->average_tpt, 1944 window->average_tpt,
@@ -1992,7 +1992,7 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
1992 1992
1993 /* Too many failures, decrease rate */ 1993 /* Too many failures, decrease rate */
1994 if ((sr <= IL_RATE_DECREASE_TH) || (current_tpt == 0)) { 1994 if ((sr <= IL_RATE_DECREASE_TH) || (current_tpt == 0)) {
1995 IL_DEBUG_RATE(il, 1995 D_RATE(
1996 "decrease rate because of low success_ratio\n"); 1996 "decrease rate because of low success_ratio\n");
1997 scale_action = -1; 1997 scale_action = -1;
1998 1998
@@ -2031,7 +2031,7 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
2031 } else if (low_tpt != IL_INVALID_VALUE) { 2031 } else if (low_tpt != IL_INVALID_VALUE) {
2032 /* Lower rate has better throughput */ 2032 /* Lower rate has better throughput */
2033 if (low_tpt > current_tpt) { 2033 if (low_tpt > current_tpt) {
2034 IL_DEBUG_RATE(il, 2034 D_RATE(
2035 "decrease rate because of low tpt\n"); 2035 "decrease rate because of low tpt\n");
2036 scale_action = -1; 2036 scale_action = -1;
2037 } else if (sr >= IL_RATE_INCREASE_TH) { 2037 } else if (sr >= IL_RATE_INCREASE_TH) {
@@ -2070,7 +2070,7 @@ static void il4965_rs_rate_scale_perform(struct il_priv *il,
2070 break; 2070 break;
2071 } 2071 }
2072 2072
2073 IL_DEBUG_RATE(il, "choose rate scale index %d action %d low %d " 2073 D_RATE("choose rate scale index %d action %d low %d "
2074 "high %d type %d\n", 2074 "high %d type %d\n",
2075 index, scale_action, low, high, tbl->lq_type); 2075 index, scale_action, low, high, tbl->lq_type);
2076 2076
@@ -2118,7 +2118,7 @@ lq_update:
2118 /* Use new "search" start rate */ 2118 /* Use new "search" start rate */
2119 index = il4965_hwrate_to_plcp_idx(tbl->current_rate); 2119 index = il4965_hwrate_to_plcp_idx(tbl->current_rate);
2120 2120
2121 IL_DEBUG_RATE(il, 2121 D_RATE(
2122 "Switch current mcs: %X index: %d\n", 2122 "Switch current mcs: %X index: %d\n",
2123 tbl->current_rate, index); 2123 tbl->current_rate, index);
2124 il4965_rs_fill_link_cmd(il, lq_sta, 2124 il4965_rs_fill_link_cmd(il, lq_sta,
@@ -2138,7 +2138,7 @@ lq_update:
2138 tbl1 = &(lq_sta->lq_info[lq_sta->active_tbl]); 2138 tbl1 = &(lq_sta->lq_info[lq_sta->active_tbl]);
2139 if (is_legacy(tbl1->lq_type) && !conf_is_ht(conf) && 2139 if (is_legacy(tbl1->lq_type) && !conf_is_ht(conf) &&
2140 lq_sta->action_counter > tbl1->max_search) { 2140 lq_sta->action_counter > tbl1->max_search) {
2141 IL_DEBUG_RATE(il, "LQ: STAY in legacy table\n"); 2141 D_RATE("LQ: STAY in legacy table\n");
2142 il4965_rs_set_stay_in_table(il, 1, lq_sta); 2142 il4965_rs_set_stay_in_table(il, 1, lq_sta);
2143 } 2143 }
2144 2144
@@ -2153,7 +2153,7 @@ lq_update:
2153 tid_data = 2153 tid_data =
2154 &il->stations[lq_sta->lq.sta_id].tid[tid]; 2154 &il->stations[lq_sta->lq.sta_id].tid[tid];
2155 if (tid_data->agg.state == IL_AGG_OFF) { 2155 if (tid_data->agg.state == IL_AGG_OFF) {
2156 IL_DEBUG_RATE(il, 2156 D_RATE(
2157 "try to aggregate tid %d\n", 2157 "try to aggregate tid %d\n",
2158 tid); 2158 tid);
2159 il4965_rs_tl_turn_on_agg(il, tid, 2159 il4965_rs_tl_turn_on_agg(il, tid,
@@ -2251,7 +2251,7 @@ il4965_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
2251 struct il_lq_sta *lq_sta = il_sta; 2251 struct il_lq_sta *lq_sta = il_sta;
2252 int rate_idx; 2252 int rate_idx;
2253 2253
2254 IL_DEBUG_RATE(il, "rate scale calculate new rate for skb\n"); 2254 D_RATE("rate scale calculate new rate for skb\n");
2255 2255
2256 /* Get max rate if user set max rate */ 2256 /* Get max rate if user set max rate */
2257 if (lq_sta) { 2257 if (lq_sta) {
@@ -2266,7 +2266,7 @@ il4965_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
2266 2266
2267 /* Treat uninitialized rate scaling data same as non-existing. */ 2267 /* Treat uninitialized rate scaling data same as non-existing. */
2268 if (lq_sta && !lq_sta->drv) { 2268 if (lq_sta && !lq_sta->drv) {
2269 IL_DEBUG_RATE(il, "Rate scaling not initialized yet.\n"); 2269 D_RATE("Rate scaling not initialized yet.\n");
2270 il_sta = NULL; 2270 il_sta = NULL;
2271 } 2271 }
2272 2272
@@ -2323,7 +2323,7 @@ static void *il4965_rs_alloc_sta(void *il_rate, struct ieee80211_sta *sta,
2323 struct il_priv *il; 2323 struct il_priv *il;
2324 2324
2325 il = (struct il_priv *)il_rate; 2325 il = (struct il_priv *)il_rate;
2326 IL_DEBUG_RATE(il, "create station rate scale window\n"); 2326 D_RATE("create station rate scale window\n");
2327 2327
2328 lq_sta = &sta_priv->lq_sta; 2328 lq_sta = &sta_priv->lq_sta;
2329 2329
@@ -2365,7 +2365,7 @@ il4965_rs_rate_init(struct il_priv *il,
2365 il4965_rs_rate_scale_clear_window( 2365 il4965_rs_rate_scale_clear_window(
2366 &lq_sta->lq_info[j].win[i]); 2366 &lq_sta->lq_info[j].win[i]);
2367 2367
2368 IL_DEBUG_RATE(il, "LQ:" 2368 D_RATE("LQ:"
2369 "*** rate scale station global init for station %d ***\n", 2369 "*** rate scale station global init for station %d ***\n",
2370 sta_id); 2370 sta_id);
2371 /* TODO: what is a good starting rate for STA? About middle? Maybe not 2371 /* TODO: what is a good starting rate for STA? About middle? Maybe not
@@ -2561,8 +2561,8 @@ static void il4965_rs_free_sta(void *il_r, struct ieee80211_sta *sta,
2561{ 2561{
2562 struct il_priv *il __maybe_unused = il_r; 2562 struct il_priv *il __maybe_unused = il_r;
2563 2563
2564 IL_DEBUG_RATE(il, "enter\n"); 2564 D_RATE("enter\n");
2565 IL_DEBUG_RATE(il, "leave\n"); 2565 D_RATE("leave\n");
2566} 2566}
2567 2567
2568 2568
@@ -2587,16 +2587,16 @@ static void il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta,
2587 >> RATE_MCS_ANT_POS); 2587 >> RATE_MCS_ANT_POS);
2588 if ((valid_tx_ant & ant_sel_tx) == ant_sel_tx) { 2588 if ((valid_tx_ant & ant_sel_tx) == ant_sel_tx) {
2589 *rate_n_flags = lq_sta->dbg_fixed_rate; 2589 *rate_n_flags = lq_sta->dbg_fixed_rate;
2590 IL_DEBUG_RATE(il, "Fixed rate ON\n"); 2590 D_RATE("Fixed rate ON\n");
2591 } else { 2591 } else {
2592 lq_sta->dbg_fixed_rate = 0; 2592 lq_sta->dbg_fixed_rate = 0;
2593 IL_ERR(il, 2593 IL_ERR(il,
2594 "Invalid antenna selection 0x%X, Valid is 0x%X\n", 2594 "Invalid antenna selection 0x%X, Valid is 0x%X\n",
2595 ant_sel_tx, valid_tx_ant); 2595 ant_sel_tx, valid_tx_ant);
2596 IL_DEBUG_RATE(il, "Fixed rate OFF\n"); 2596 D_RATE("Fixed rate OFF\n");
2597 } 2597 }
2598 } else { 2598 } else {
2599 IL_DEBUG_RATE(il, "Fixed rate OFF\n"); 2599 D_RATE("Fixed rate OFF\n");
2600 } 2600 }
2601} 2601}
2602 2602
@@ -2627,7 +2627,7 @@ static ssize_t il4965_rs_sta_dbgfs_scale_table_write(struct file *file,
2627 lq_sta->active_siso_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ 2627 lq_sta->active_siso_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */
2628 lq_sta->active_mimo2_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */ 2628 lq_sta->active_mimo2_rate = 0x1FD0; /* 6 - 60 MBits, no 9, no CCK */
2629 2629
2630 IL_DEBUG_RATE(il, "sta_id %d rate 0x%X\n", 2630 D_RATE("sta_id %d rate 0x%X\n",
2631 lq_sta->lq.sta_id, lq_sta->dbg_fixed_rate); 2631 lq_sta->lq.sta_id, lq_sta->dbg_fixed_rate);
2632 2632
2633 if (lq_sta->dbg_fixed_rate) { 2633 if (lq_sta->dbg_fixed_rate) {