aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl18xx/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index a35eba2b8d8b..ed34a7f3391c 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1397,6 +1397,45 @@ static int wl18xx_set_peer_cap(struct wl1271 *wl,
1397 rate_set, hlid); 1397 rate_set, hlid);
1398} 1398}
1399 1399
1400static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
1401 struct wl1271_link *lnk)
1402{
1403 u8 thold;
1404 struct wl18xx_fw_status_priv *status_priv =
1405 (struct wl18xx_fw_status_priv *)wl->fw_status_2->priv;
1406 u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);
1407
1408 /* suspended links are never high priority */
1409 if (test_bit(hlid, (unsigned long *)&suspend_bitmap))
1410 return false;
1411
1412 /* the priority thresholds are taken from FW */
1413 if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map))
1414 thold = status_priv->tx_fast_link_prio_threshold;
1415 else
1416 thold = status_priv->tx_slow_link_prio_threshold;
1417
1418 return lnk->allocated_pkts < thold;
1419}
1420
1421static bool wl18xx_lnk_low_prio(struct wl1271 *wl, u8 hlid,
1422 struct wl1271_link *lnk)
1423{
1424 u8 thold;
1425 struct wl18xx_fw_status_priv *status_priv =
1426 (struct wl18xx_fw_status_priv *)wl->fw_status_2->priv;
1427 u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);
1428
1429 if (test_bit(hlid, (unsigned long *)&suspend_bitmap))
1430 thold = status_priv->tx_suspend_threshold;
1431 else if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map))
1432 thold = status_priv->tx_fast_stop_threshold;
1433 else
1434 thold = status_priv->tx_slow_stop_threshold;
1435
1436 return lnk->allocated_pkts < thold;
1437}
1438
1400static int wl18xx_setup(struct wl1271 *wl); 1439static int wl18xx_setup(struct wl1271 *wl);
1401 1440
1402static struct wlcore_ops wl18xx_ops = { 1441static struct wlcore_ops wl18xx_ops = {
@@ -1434,6 +1473,8 @@ static struct wlcore_ops wl18xx_ops = {
1434 .pre_pkt_send = wl18xx_pre_pkt_send, 1473 .pre_pkt_send = wl18xx_pre_pkt_send,
1435 .sta_rc_update = wl18xx_sta_rc_update, 1474 .sta_rc_update = wl18xx_sta_rc_update,
1436 .set_peer_cap = wl18xx_set_peer_cap, 1475 .set_peer_cap = wl18xx_set_peer_cap,
1476 .lnk_high_prio = wl18xx_lnk_high_prio,
1477 .lnk_low_prio = wl18xx_lnk_low_prio,
1437}; 1478};
1438 1479
1439/* HT cap appropriate for wide channels in 2Ghz */ 1480/* HT cap appropriate for wide channels in 2Ghz */