aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-10-07 03:38:50 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-10-22 04:42:09 -0400
commit02219b3abca59fca81711bfe7ee78df7abad97ce (patch)
treeafaa7b17ffde140c2791a87c9dde1a489a949f36 /net/mac80211/ieee80211_i.h
parentf409079bb678600be0201cd03afb4731f0480b4e (diff)
mac80211: add WMM admission control support
Use the currently existing APIs between mac80211 and the low level driver to implement WMM admission control. The low level driver needs to report the media time used by each transmitted packet in ieee80211_tx_status. Based on that information, mac80211 will modify the QoS parameters of the admission controlled Access Category when the limit is reached. Once the original QoS parameters can be restored, mac80211 will do so. One issue with this approach is that management frames will also erroneously be downgraded, but the upside is that the implementation is simple. In the future, it can be extended to driver- or device-based implementations that are better. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 78d6121eb372..60063be057d0 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -399,6 +399,24 @@ struct ieee80211_mgd_assoc_data {
399 u8 ie[]; 399 u8 ie[];
400}; 400};
401 401
402struct ieee80211_sta_tx_tspec {
403 /* timestamp of the first packet in the time slice */
404 unsigned long time_slice_start;
405
406 u32 admitted_time; /* in usecs, unlike over the air */
407 u8 tsid;
408 s8 up; /* signed to be able to invalidate with -1 during teardown */
409
410 /* consumed TX time in microseconds in the time slice */
411 u32 consumed_tx_time;
412 enum {
413 TX_TSPEC_ACTION_NONE = 0,
414 TX_TSPEC_ACTION_DOWNGRADE,
415 TX_TSPEC_ACTION_STOP_DOWNGRADE,
416 } action;
417 bool downgraded;
418};
419
402struct ieee80211_if_managed { 420struct ieee80211_if_managed {
403 struct timer_list timer; 421 struct timer_list timer;
404 struct timer_list conn_mon_timer; 422 struct timer_list conn_mon_timer;
@@ -509,6 +527,16 @@ struct ieee80211_if_managed {
509 527
510 u8 tdls_peer[ETH_ALEN] __aligned(2); 528 u8 tdls_peer[ETH_ALEN] __aligned(2);
511 struct delayed_work tdls_peer_del_work; 529 struct delayed_work tdls_peer_del_work;
530
531 /* WMM-AC TSPEC support */
532 struct ieee80211_sta_tx_tspec tx_tspec[IEEE80211_NUM_ACS];
533 /* Use a separate work struct so that we can do something here
534 * while the sdata->work is flushing the queues, for example.
535 * otherwise, in scenarios where we hardly get any traffic out
536 * on the BE queue, but there's a lot of VO traffic, we might
537 * get stuck in a downgraded situation and flush takes forever.
538 */
539 struct delayed_work tx_tspec_wk;
512}; 540};
513 541
514struct ieee80211_if_ibss { 542struct ieee80211_if_ibss {
@@ -1459,6 +1487,7 @@ void ieee80211_mgd_conn_tx_status(struct ieee80211_sub_if_data *sdata,
1459 __le16 fc, bool acked); 1487 __le16 fc, bool acked);
1460void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata); 1488void ieee80211_mgd_quiesce(struct ieee80211_sub_if_data *sdata);
1461void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata); 1489void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata);
1490void ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata);
1462 1491
1463/* IBSS code */ 1492/* IBSS code */
1464void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); 1493void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
@@ -1763,6 +1792,13 @@ static inline bool ieee80211_rx_reorder_ready(struct sk_buff_head *frames)
1763 return true; 1792 return true;
1764} 1793}
1765 1794
1795extern const int ieee802_1d_to_ac[8];
1796
1797static inline int ieee80211_ac_from_tid(int tid)
1798{
1799 return ieee802_1d_to_ac[tid & 7];
1800}
1801
1766void ieee80211_dynamic_ps_enable_work(struct work_struct *work); 1802void ieee80211_dynamic_ps_enable_work(struct work_struct *work);
1767void ieee80211_dynamic_ps_disable_work(struct work_struct *work); 1803void ieee80211_dynamic_ps_disable_work(struct work_struct *work);
1768void ieee80211_dynamic_ps_timer(unsigned long data); 1804void ieee80211_dynamic_ps_timer(unsigned long data);
@@ -1772,7 +1808,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local,
1772void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, 1808void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
1773 struct ieee80211_hdr *hdr); 1809 struct ieee80211_hdr *hdr);
1774void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata, 1810void ieee80211_sta_tx_notify(struct ieee80211_sub_if_data *sdata,
1775 struct ieee80211_hdr *hdr, bool ack); 1811 struct ieee80211_hdr *hdr, bool ack, u16 tx_time);
1776 1812
1777void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw, 1813void ieee80211_wake_queues_by_reason(struct ieee80211_hw *hw,
1778 unsigned long queues, 1814 unsigned long queues,