Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: save tx params per sdata

save and configure tx param per sdata, rather than
per hardware.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Eliad Peller and committed by
John W. Linville
f6f3def3 f70f01c2

+31 -15
+3 -2
net/mac80211/cfg.c
··· 1275 1275 struct ieee80211_txq_params *params) 1276 1276 { 1277 1277 struct ieee80211_local *local = wiphy_priv(wiphy); 1278 + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1278 1279 struct ieee80211_tx_queue_params p; 1279 1280 1280 1281 if (!local->ops->conf_tx) ··· 1296 1295 if (params->queue >= local->hw.queues) 1297 1296 return -EINVAL; 1298 1297 1299 - local->tx_conf[params->queue] = p; 1300 - if (drv_conf_tx(local, params->queue, &p)) { 1298 + sdata->tx_conf[params->queue] = p; 1299 + if (drv_conf_tx(local, sdata, params->queue, &p)) { 1301 1300 wiphy_debug(local->hw.wiphy, 1302 1301 "failed to set TX queue parameters for queue %d\n", 1303 1302 params->queue);
+3 -2
net/mac80211/driver-ops.h
··· 413 413 trace_drv_return_void(local); 414 414 } 415 415 416 - static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue, 416 + static inline int drv_conf_tx(struct ieee80211_local *local, 417 + struct ieee80211_sub_if_data *sdata, u16 queue, 417 418 const struct ieee80211_tx_queue_params *params) 418 419 { 419 420 int ret = -EOPNOTSUPP; 420 421 421 422 might_sleep(); 422 423 423 - trace_drv_conf_tx(local, queue, params); 424 + trace_drv_conf_tx(local, sdata, queue, params); 424 425 if (local->ops->conf_tx) 425 426 ret = local->ops->conf_tx(&local->hw, queue, params); 426 427 trace_drv_return_int(local, ret);
+10 -4
net/mac80211/driver-trace.h
··· 697 697 ); 698 698 699 699 TRACE_EVENT(drv_conf_tx, 700 - TP_PROTO(struct ieee80211_local *local, u16 queue, 700 + TP_PROTO(struct ieee80211_local *local, 701 + struct ieee80211_sub_if_data *sdata, 702 + u16 queue, 701 703 const struct ieee80211_tx_queue_params *params), 702 704 703 - TP_ARGS(local, queue, params), 705 + TP_ARGS(local, sdata, queue, params), 704 706 705 707 TP_STRUCT__entry( 706 708 LOCAL_ENTRY 709 + VIF_ENTRY 707 710 __field(u16, queue) 708 711 __field(u16, txop) 709 712 __field(u16, cw_min) 710 713 __field(u16, cw_max) 711 714 __field(u8, aifs) 715 + __field(bool, uapsd) 712 716 ), 713 717 714 718 TP_fast_assign( 715 719 LOCAL_ASSIGN; 720 + VIF_ASSIGN; 716 721 __entry->queue = queue; 717 722 __entry->txop = params->txop; 718 723 __entry->cw_max = params->cw_max; 719 724 __entry->cw_min = params->cw_min; 720 725 __entry->aifs = params->aifs; 726 + __entry->uapsd = params->uapsd; 721 727 ), 722 728 723 729 TP_printk( 724 - LOCAL_PR_FMT " queue:%d", 725 - LOCAL_PR_ARG, __entry->queue 730 + LOCAL_PR_FMT VIF_PR_FMT " queue:%d", 731 + LOCAL_PR_ARG, VIF_PR_ARG, __entry->queue 726 732 ) 727 733 ); 728 734
+2 -1
net/mac80211/ieee80211_i.h
··· 609 609 __be16 control_port_protocol; 610 610 bool control_port_no_encrypt; 611 611 612 + struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES]; 613 + 612 614 struct work_struct work; 613 615 struct sk_buff_head skb_queue; 614 616 ··· 753 751 struct workqueue_struct *workqueue; 754 752 755 753 unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES]; 756 - struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES]; 757 754 /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */ 758 755 spinlock_t queue_stop_reason_lock; 759 756
+2 -2
net/mac80211/mlme.c
··· 936 936 params.aifs, params.cw_min, params.cw_max, 937 937 params.txop, params.uapsd); 938 938 #endif 939 - local->tx_conf[queue] = params; 940 - if (drv_conf_tx(local, queue, &params)) 939 + sdata->tx_conf[queue] = params; 940 + if (drv_conf_tx(local, sdata, queue, &params)) 941 941 wiphy_debug(local->hw.wiphy, 942 942 "failed to set TX queue parameters for queue %d\n", 943 943 queue);
+11 -4
net/mac80211/util.c
··· 632 632 633 633 qparam.uapsd = false; 634 634 635 - local->tx_conf[queue] = qparam; 636 - drv_conf_tx(local, queue, &qparam); 635 + sdata->tx_conf[queue] = qparam; 636 + drv_conf_tx(local, sdata, queue, &qparam); 637 637 } 638 638 639 639 /* after reinitialize QoS TX queues setting to default, ··· 1044 1044 mutex_unlock(&local->sta_mtx); 1045 1045 1046 1046 /* reconfigure tx conf */ 1047 - for (i = 0; i < hw->queues; i++) 1048 - drv_conf_tx(local, i, &local->tx_conf[i]); 1047 + list_for_each_entry(sdata, &local->interfaces, list) { 1048 + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN || 1049 + sdata->vif.type == NL80211_IFTYPE_MONITOR || 1050 + !ieee80211_sdata_running(sdata)) 1051 + continue; 1052 + 1053 + for (i = 0; i < hw->queues; i++) 1054 + drv_conf_tx(local, sdata, i, &sdata->tx_conf[i]); 1055 + } 1049 1056 1050 1057 /* reconfigure hardware */ 1051 1058 ieee80211_hw_config(local, ~0);