aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2011-09-25 13:06:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-27 14:34:11 -0400
commitf6f3def323e5d60cc2a5659533dce547c0aac5fc (patch)
tree9e5470eb3301c588f3ec75cc3f0ce504b50d77d5 /net/mac80211
parentf70f01c2ebbe31fbd8a96be3b45c5620dac45b96 (diff)
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>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c5
-rw-r--r--net/mac80211/driver-ops.h5
-rw-r--r--net/mac80211/driver-trace.h14
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/mlme.c4
-rw-r--r--net/mac80211/util.c15
6 files changed, 31 insertions, 15 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 726fb8819b43..8fef3cddbc4f 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1275,6 +1275,7 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
1275 struct ieee80211_txq_params *params) 1275 struct ieee80211_txq_params *params)
1276{ 1276{
1277 struct ieee80211_local *local = wiphy_priv(wiphy); 1277 struct ieee80211_local *local = wiphy_priv(wiphy);
1278 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1278 struct ieee80211_tx_queue_params p; 1279 struct ieee80211_tx_queue_params p;
1279 1280
1280 if (!local->ops->conf_tx) 1281 if (!local->ops->conf_tx)
@@ -1295,8 +1296,8 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
1295 if (params->queue >= local->hw.queues) 1296 if (params->queue >= local->hw.queues)
1296 return -EINVAL; 1297 return -EINVAL;
1297 1298
1298 local->tx_conf[params->queue] = p; 1299 sdata->tx_conf[params->queue] = p;
1299 if (drv_conf_tx(local, params->queue, &p)) { 1300 if (drv_conf_tx(local, sdata, params->queue, &p)) {
1300 wiphy_debug(local->hw.wiphy, 1301 wiphy_debug(local->hw.wiphy,
1301 "failed to set TX queue parameters for queue %d\n", 1302 "failed to set TX queue parameters for queue %d\n",
1302 params->queue); 1303 params->queue);
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 5e5d97389bc9..4f845c0845ee 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -413,14 +413,15 @@ static inline void drv_sta_remove(struct ieee80211_local *local,
413 trace_drv_return_void(local); 413 trace_drv_return_void(local);
414} 414}
415 415
416static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue, 416static inline int drv_conf_tx(struct ieee80211_local *local,
417 struct ieee80211_sub_if_data *sdata, u16 queue,
417 const struct ieee80211_tx_queue_params *params) 418 const struct ieee80211_tx_queue_params *params)
418{ 419{
419 int ret = -EOPNOTSUPP; 420 int ret = -EOPNOTSUPP;
420 421
421 might_sleep(); 422 might_sleep();
422 423
423 trace_drv_conf_tx(local, queue, params); 424 trace_drv_conf_tx(local, sdata, queue, params);
424 if (local->ops->conf_tx) 425 if (local->ops->conf_tx)
425 ret = local->ops->conf_tx(&local->hw, queue, params); 426 ret = local->ops->conf_tx(&local->hw, queue, params);
426 trace_drv_return_int(local, ret); 427 trace_drv_return_int(local, ret);
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index 07d94ff55798..a46b279bbbe4 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -697,32 +697,38 @@ TRACE_EVENT(drv_sta_remove,
697); 697);
698 698
699TRACE_EVENT(drv_conf_tx, 699TRACE_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 const struct ieee80211_tx_queue_params *params), 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 TP_STRUCT__entry( 707 TP_STRUCT__entry(
706 LOCAL_ENTRY 708 LOCAL_ENTRY
709 VIF_ENTRY
707 __field(u16, queue) 710 __field(u16, queue)
708 __field(u16, txop) 711 __field(u16, txop)
709 __field(u16, cw_min) 712 __field(u16, cw_min)
710 __field(u16, cw_max) 713 __field(u16, cw_max)
711 __field(u8, aifs) 714 __field(u8, aifs)
715 __field(bool, uapsd)
712 ), 716 ),
713 717
714 TP_fast_assign( 718 TP_fast_assign(
715 LOCAL_ASSIGN; 719 LOCAL_ASSIGN;
720 VIF_ASSIGN;
716 __entry->queue = queue; 721 __entry->queue = queue;
717 __entry->txop = params->txop; 722 __entry->txop = params->txop;
718 __entry->cw_max = params->cw_max; 723 __entry->cw_max = params->cw_max;
719 __entry->cw_min = params->cw_min; 724 __entry->cw_min = params->cw_min;
720 __entry->aifs = params->aifs; 725 __entry->aifs = params->aifs;
726 __entry->uapsd = params->uapsd;
721 ), 727 ),
722 728
723 TP_printk( 729 TP_printk(
724 LOCAL_PR_FMT " queue:%d", 730 LOCAL_PR_FMT VIF_PR_FMT " queue:%d",
725 LOCAL_PR_ARG, __entry->queue 731 LOCAL_PR_ARG, VIF_PR_ARG, __entry->queue
726 ) 732 )
727); 733);
728 734
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 4822d69930e2..5cadcbbc9a57 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -609,6 +609,8 @@ struct ieee80211_sub_if_data {
609 __be16 control_port_protocol; 609 __be16 control_port_protocol;
610 bool control_port_no_encrypt; 610 bool control_port_no_encrypt;
611 611
612 struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES];
613
612 struct work_struct work; 614 struct work_struct work;
613 struct sk_buff_head skb_queue; 615 struct sk_buff_head skb_queue;
614 616
@@ -751,7 +753,6 @@ struct ieee80211_local {
751 struct workqueue_struct *workqueue; 753 struct workqueue_struct *workqueue;
752 754
753 unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES]; 755 unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
754 struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES];
755 /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */ 756 /* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
756 spinlock_t queue_stop_reason_lock; 757 spinlock_t queue_stop_reason_lock;
757 758
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index cc80d320c922..cd37a4e3c0d7 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -936,8 +936,8 @@ static void ieee80211_sta_wmm_params(struct ieee80211_local *local,
936 params.aifs, params.cw_min, params.cw_max, 936 params.aifs, params.cw_min, params.cw_max,
937 params.txop, params.uapsd); 937 params.txop, params.uapsd);
938#endif 938#endif
939 local->tx_conf[queue] = params; 939 sdata->tx_conf[queue] = params;
940 if (drv_conf_tx(local, queue, &params)) 940 if (drv_conf_tx(local, sdata, queue, &params))
941 wiphy_debug(local->hw.wiphy, 941 wiphy_debug(local->hw.wiphy,
942 "failed to set TX queue parameters for queue %d\n", 942 "failed to set TX queue parameters for queue %d\n",
943 queue); 943 queue);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index ead345db7127..2c9dc360dc6d 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -632,8 +632,8 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata)
632 632
633 qparam.uapsd = false; 633 qparam.uapsd = false;
634 634
635 local->tx_conf[queue] = qparam; 635 sdata->tx_conf[queue] = qparam;
636 drv_conf_tx(local, queue, &qparam); 636 drv_conf_tx(local, sdata, queue, &qparam);
637 } 637 }
638 638
639 /* after reinitialize QoS TX queues setting to default, 639 /* after reinitialize QoS TX queues setting to default,
@@ -1044,8 +1044,15 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1044 mutex_unlock(&local->sta_mtx); 1044 mutex_unlock(&local->sta_mtx);
1045 1045
1046 /* reconfigure tx conf */ 1046 /* reconfigure tx conf */
1047 for (i = 0; i < hw->queues; i++) 1047 list_for_each_entry(sdata, &local->interfaces, list) {
1048 drv_conf_tx(local, i, &local->tx_conf[i]); 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 /* reconfigure hardware */ 1057 /* reconfigure hardware */
1051 ieee80211_hw_config(local, ~0); 1058 ieee80211_hw_config(local, ~0);