aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c113
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.h2
2 files changed, 114 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index a4563389bad..f8eed92c1ad 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -301,7 +301,19 @@ static int rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
301 struct ieee80211_sta *sta) 301 struct ieee80211_sta *sta)
302{ 302{
303 int ret = -EAGAIN; 303 int ret = -EAGAIN;
304 u32 load = rs_tl_get_load(lq_data, tid); 304 u32 load;
305
306 /*
307 * Don't create TX aggregation sessions when in high
308 * BT traffic, as they would just be disrupted by BT.
309 */
310 if (priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH) {
311 IWL_ERR(priv, "BT traffic (%d), no aggregation allowed\n",
312 priv->bt_traffic_load);
313 return ret;
314 }
315
316 load = rs_tl_get_load(lq_data, tid);
305 317
306 if (load > IWL_AGG_LOAD_THRESHOLD) { 318 if (load > IWL_AGG_LOAD_THRESHOLD) {
307 IWL_DEBUG_HT(priv, "Starting Tx agg: STA: %pM tid: %d\n", 319 IWL_DEBUG_HT(priv, "Starting Tx agg: STA: %pM tid: %d\n",
@@ -1286,6 +1298,27 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1286 int ret = 0; 1298 int ret = 0;
1287 u8 update_search_tbl_counter = 0; 1299 u8 update_search_tbl_counter = 0;
1288 1300
1301 switch (priv->bt_traffic_load) {
1302 case IWL_BT_COEX_TRAFFIC_LOAD_NONE:
1303 /* nothing */
1304 break;
1305 case IWL_BT_COEX_TRAFFIC_LOAD_LOW:
1306 /* avoid antenna B unless MIMO */
1307 if (tbl->action == IWL_LEGACY_SWITCH_ANTENNA2)
1308 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1;
1309 break;
1310 case IWL_BT_COEX_TRAFFIC_LOAD_HIGH:
1311 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
1312 /* avoid antenna B and MIMO */
1313 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 &&
1314 tbl->action != IWL_LEGACY_SWITCH_SISO)
1315 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1316 break;
1317 default:
1318 IWL_ERR(priv, "Invalid BT load %d", priv->bt_traffic_load);
1319 break;
1320 }
1321
1289 if (!iwl_ht_enabled(priv)) 1322 if (!iwl_ht_enabled(priv))
1290 /* stay in Legacy */ 1323 /* stay in Legacy */
1291 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1; 1324 tbl->action = IWL_LEGACY_SWITCH_ANTENNA1;
@@ -1425,6 +1458,27 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1425 u8 update_search_tbl_counter = 0; 1458 u8 update_search_tbl_counter = 0;
1426 int ret; 1459 int ret;
1427 1460
1461 switch (priv->bt_traffic_load) {
1462 case IWL_BT_COEX_TRAFFIC_LOAD_NONE:
1463 /* nothing */
1464 break;
1465 case IWL_BT_COEX_TRAFFIC_LOAD_LOW:
1466 /* avoid antenna B unless MIMO */
1467 if (tbl->action == IWL_SISO_SWITCH_ANTENNA2)
1468 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1469 break;
1470 case IWL_BT_COEX_TRAFFIC_LOAD_HIGH:
1471 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
1472 /* avoid antenna B and MIMO */
1473 if (tbl->action >= IWL_SISO_SWITCH_ANTENNA2 &&
1474 tbl->action != IWL_SISO_SWITCH_GI)
1475 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1476 break;
1477 default:
1478 IWL_ERR(priv, "Invalid BT load %d", priv->bt_traffic_load);
1479 break;
1480 }
1481
1428 if (iwl_tx_ant_restriction(priv) == IWL_ANT_OK_SINGLE && 1482 if (iwl_tx_ant_restriction(priv) == IWL_ANT_OK_SINGLE &&
1429 tbl->action > IWL_SISO_SWITCH_ANTENNA2) { 1483 tbl->action > IWL_SISO_SWITCH_ANTENNA2) {
1430 /* stay in SISO */ 1484 /* stay in SISO */
@@ -1564,6 +1618,27 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv,
1564 u8 update_search_tbl_counter = 0; 1618 u8 update_search_tbl_counter = 0;
1565 int ret; 1619 int ret;
1566 1620
1621 switch (priv->bt_traffic_load) {
1622 case IWL_BT_COEX_TRAFFIC_LOAD_NONE:
1623 /* nothing */
1624 break;
1625 case IWL_BT_COEX_TRAFFIC_LOAD_HIGH:
1626 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
1627 /* avoid antenna B and MIMO */
1628 if (tbl->action == IWL_MIMO2_SWITCH_MIMO3_ABC)
1629 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1630 case IWL_BT_COEX_TRAFFIC_LOAD_LOW:
1631 /* avoid antenna B unless MIMO */
1632 if (tbl->action == IWL_MIMO2_SWITCH_ANTENNA2)
1633 tbl->action = IWL_MIMO2_SWITCH_ANTENNA1;
1634 else if (tbl->action == IWL_MIMO2_SWITCH_SISO_B)
1635 tbl->action = IWL_MIMO2_SWITCH_SISO_A;
1636 break;
1637 default:
1638 IWL_ERR(priv, "Invalid BT load %d", priv->bt_traffic_load);
1639 break;
1640 }
1641
1567 if ((iwl_tx_ant_restriction(priv) == IWL_ANT_OK_SINGLE) && 1642 if ((iwl_tx_ant_restriction(priv) == IWL_ANT_OK_SINGLE) &&
1568 (tbl->action < IWL_MIMO2_SWITCH_SISO_A || 1643 (tbl->action < IWL_MIMO2_SWITCH_SISO_A ||
1569 tbl->action > IWL_MIMO2_SWITCH_SISO_C)) { 1644 tbl->action > IWL_MIMO2_SWITCH_SISO_C)) {
@@ -1706,6 +1781,29 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv,
1706 int ret; 1781 int ret;
1707 u8 update_search_tbl_counter = 0; 1782 u8 update_search_tbl_counter = 0;
1708 1783
1784 switch (priv->bt_traffic_load) {
1785 case IWL_BT_COEX_TRAFFIC_LOAD_NONE:
1786 /* nothing */
1787 break;
1788 case IWL_BT_COEX_TRAFFIC_LOAD_HIGH:
1789 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
1790 /* avoid antenna B and MIMO */
1791 if (tbl->action == IWL_MIMO3_SWITCH_MIMO2_AB ||
1792 tbl->action == IWL_MIMO3_SWITCH_MIMO2_AC ||
1793 tbl->action == IWL_MIMO3_SWITCH_MIMO2_BC)
1794 tbl->action = IWL_MIMO3_SWITCH_SISO_A;
1795 case IWL_BT_COEX_TRAFFIC_LOAD_LOW:
1796 /* avoid antenna B unless MIMO */
1797 if (tbl->action == IWL_MIMO3_SWITCH_SISO_B)
1798 tbl->action = IWL_MIMO3_SWITCH_SISO_A;
1799 else if (tbl->action == IWL_MIMO3_SWITCH_ANTENNA2)
1800 tbl->action = IWL_MIMO3_SWITCH_ANTENNA1;
1801 break;
1802 default:
1803 IWL_ERR(priv, "Invalid BT load %d", priv->bt_traffic_load);
1804 break;
1805 }
1806
1709 if ((iwl_tx_ant_restriction(priv) == IWL_ANT_OK_SINGLE) && 1807 if ((iwl_tx_ant_restriction(priv) == IWL_ANT_OK_SINGLE) &&
1710 (tbl->action < IWL_MIMO3_SWITCH_SISO_A || 1808 (tbl->action < IWL_MIMO3_SWITCH_SISO_A ||
1711 tbl->action > IWL_MIMO3_SWITCH_SISO_C)) { 1809 tbl->action > IWL_MIMO3_SWITCH_SISO_C)) {
@@ -2234,6 +2332,19 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
2234 if (iwl_tx_ant_restriction(priv) != IWL_ANT_OK_MULTI && 2332 if (iwl_tx_ant_restriction(priv) != IWL_ANT_OK_MULTI &&
2235 (is_mimo2(tbl->lq_type) || is_mimo3(tbl->lq_type))) 2333 (is_mimo2(tbl->lq_type) || is_mimo3(tbl->lq_type)))
2236 scale_action = -1; 2334 scale_action = -1;
2335
2336 if (lq_sta->last_bt_traffic > priv->bt_traffic_load) {
2337 lq_sta->last_bt_traffic = priv->bt_traffic_load;
2338 /*
2339 * don't set scale_action, don't want to scale up if
2340 * the rate scale doesn't otherwise think that is a
2341 * good idea.
2342 */
2343 } else if (lq_sta->last_bt_traffic < priv->bt_traffic_load) {
2344 lq_sta->last_bt_traffic = priv->bt_traffic_load;
2345 scale_action = -1;
2346 }
2347
2237 switch (scale_action) { 2348 switch (scale_action) {
2238 case -1: 2349 case -1:
2239 /* Decrease starting rate, update uCode's rate table */ 2350 /* Decrease starting rate, update uCode's rate table */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
index 8292f6d48ec..3970ab1deaf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
@@ -432,6 +432,8 @@ struct iwl_lq_sta {
432 u32 last_rate_n_flags; 432 u32 last_rate_n_flags;
433 /* packets destined for this STA are aggregated */ 433 /* packets destined for this STA are aggregated */
434 u8 is_agg; 434 u8 is_agg;
435 /* BT traffic this sta was last updated in */
436 u8 last_bt_traffic;
435}; 437};
436 438
437static inline u8 num_of_ant(u8 mask) 439static inline u8 num_of_ant(u8 mask)