All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params()
@ 2011-09-25 17:06 Eliad Peller
  2011-09-25 17:06 ` [PATCH 2/3] mac80211: save tx params per sdata Eliad Peller
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Eliad Peller @ 2011-09-25 17:06 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

tx params are currently configured per hw, although they
should be configured per interface.

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 include/net/cfg80211.h |    2 +-
 net/mac80211/cfg.c     |    1 +
 net/wireless/nl80211.c |    6 ++++++
 3 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index ccfdf3f..1635e78 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1484,7 +1484,7 @@ struct cfg80211_ops {
 	int	(*change_bss)(struct wiphy *wiphy, struct net_device *dev,
 			      struct bss_parameters *params);
 
-	int	(*set_txq_params)(struct wiphy *wiphy,
+	int	(*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
 				  struct ieee80211_txq_params *params);
 
 	int	(*set_channel)(struct wiphy *wiphy, struct net_device *dev,
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index b57ddf9..805b40b 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1271,6 +1271,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
 }
 
 static int ieee80211_set_txq_params(struct wiphy *wiphy,
+				    struct net_device *dev,
 				    struct ieee80211_txq_params *params)
 {
 	struct ieee80211_local *local = wiphy_priv(wiphy);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c26a1da..b43f354 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1235,6 +1235,11 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 			goto bad_res;
 		}
 
+		if (!netdev) {
+			result = -EINVAL;
+			goto bad_res;
+		}
+
 		nla_for_each_nested(nl_txq_params,
 				    info->attrs[NL80211_ATTR_WIPHY_TXQ_PARAMS],
 				    rem_txq_params) {
@@ -1247,6 +1252,7 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 				goto bad_res;
 
 			result = rdev->ops->set_txq_params(&rdev->wiphy,
+							   netdev,
 							   &txq_params);
 			if (result)
 				goto bad_res;
-- 
1.7.6.401.g6a319


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] mac80211: save tx params per sdata
  2011-09-25 17:06 [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params() Eliad Peller
@ 2011-09-25 17:06 ` Eliad Peller
  2011-09-25 17:06 ` [PATCH 3/3] mac80211: pass vif param to conf_tx() callback Eliad Peller
  2011-09-26  9:34 ` [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params() Johannes Berg
  2 siblings, 0 replies; 9+ messages in thread
From: Eliad Peller @ 2011-09-25 17:06 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

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

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 net/mac80211/cfg.c          |    5 +++--
 net/mac80211/driver-ops.h   |    5 +++--
 net/mac80211/driver-trace.h |   14 ++++++++++----
 net/mac80211/ieee80211_i.h  |    3 ++-
 net/mac80211/mlme.c         |    4 ++--
 net/mac80211/util.c         |   15 +++++++++++----
 6 files changed, 31 insertions(+), 15 deletions(-)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 805b40b..edc1d21 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1275,6 +1275,7 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
 				    struct ieee80211_txq_params *params)
 {
 	struct ieee80211_local *local = wiphy_priv(wiphy);
+	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 	struct ieee80211_tx_queue_params p;
 
 	if (!local->ops->conf_tx)
@@ -1295,8 +1296,8 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
 	if (params->queue >= local->hw.queues)
 		return -EINVAL;
 
-	local->tx_conf[params->queue] = p;
-	if (drv_conf_tx(local, params->queue, &p)) {
+	sdata->tx_conf[params->queue] = p;
+	if (drv_conf_tx(local, sdata, params->queue, &p)) {
 		wiphy_debug(local->hw.wiphy,
 			    "failed to set TX queue parameters for queue %d\n",
 			    params->queue);
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 9001ff3..5315a5d 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,
 	trace_drv_return_void(local);
 }
 
-static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue,
+static inline int drv_conf_tx(struct ieee80211_local *local,
+			      struct ieee80211_sub_if_data *sdata, u16 queue,
 			      const struct ieee80211_tx_queue_params *params)
 {
 	int ret = -EOPNOTSUPP;
 
 	might_sleep();
 
-	trace_drv_conf_tx(local, queue, params);
+	trace_drv_conf_tx(local, sdata, queue, params);
 	if (local->ops->conf_tx)
 		ret = local->ops->conf_tx(&local->hw, queue, params);
 	trace_drv_return_int(local, ret);
diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h
index f47b00d..aaf97da 100644
--- a/net/mac80211/driver-trace.h
+++ b/net/mac80211/driver-trace.h
@@ -697,32 +697,38 @@ TRACE_EVENT(drv_sta_remove,
 );
 
 TRACE_EVENT(drv_conf_tx,
-	TP_PROTO(struct ieee80211_local *local, u16 queue,
+	TP_PROTO(struct ieee80211_local *local,
+		 struct ieee80211_sub_if_data *sdata,
+		 u16 queue,
 		 const struct ieee80211_tx_queue_params *params),
 
-	TP_ARGS(local, queue, params),
+	TP_ARGS(local, sdata, queue, params),
 
 	TP_STRUCT__entry(
 		LOCAL_ENTRY
+		VIF_ENTRY
 		__field(u16, queue)
 		__field(u16, txop)
 		__field(u16, cw_min)
 		__field(u16, cw_max)
 		__field(u8, aifs)
+		__field(bool, uapsd)
 	),
 
 	TP_fast_assign(
 		LOCAL_ASSIGN;
+		VIF_ASSIGN;
 		__entry->queue = queue;
 		__entry->txop = params->txop;
 		__entry->cw_max = params->cw_max;
 		__entry->cw_min = params->cw_min;
 		__entry->aifs = params->aifs;
+		__entry->uapsd = params->uapsd;
 	),
 
 	TP_printk(
-		LOCAL_PR_FMT " queue:%d",
-		LOCAL_PR_ARG, __entry->queue
+		LOCAL_PR_FMT  VIF_PR_FMT  " queue:%d",
+		LOCAL_PR_ARG, VIF_PR_ARG, __entry->queue
 	)
 );
 
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 21186e2..fc3e846 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -609,6 +609,8 @@ struct ieee80211_sub_if_data {
 	__be16 control_port_protocol;
 	bool control_port_no_encrypt;
 
+	struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES];
+
 	struct work_struct work;
 	struct sk_buff_head skb_queue;
 
@@ -751,7 +753,6 @@ struct ieee80211_local {
 	struct workqueue_struct *workqueue;
 
 	unsigned long queue_stop_reasons[IEEE80211_MAX_QUEUES];
-	struct ieee80211_tx_queue_params tx_conf[IEEE80211_MAX_QUEUES];
 	/* also used to protect ampdu_ac_queue and amdpu_ac_stop_refcnt */
 	spinlock_t queue_stop_reason_lock;
 
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1a59fb6..fefd9bf 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,
 			    params.aifs, params.cw_min, params.cw_max,
 			    params.txop, params.uapsd);
 #endif
-		local->tx_conf[queue] = params;
-		if (drv_conf_tx(local, queue, &params))
+		sdata->tx_conf[queue] = params;
+		if (drv_conf_tx(local, sdata, queue, &params))
 			wiphy_debug(local->hw.wiphy,
 				    "failed to set TX queue parameters for queue %d\n",
 				    queue);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 4b1466d..8413dc0 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)
 
 		qparam.uapsd = false;
 
-		local->tx_conf[queue] = qparam;
-		drv_conf_tx(local, queue, &qparam);
+		sdata->tx_conf[queue] = qparam;
+		drv_conf_tx(local, sdata, queue, &qparam);
 	}
 
 	/* after reinitialize QoS TX queues setting to default,
@@ -1040,8 +1040,15 @@ int ieee80211_reconfig(struct ieee80211_local *local)
 	mutex_unlock(&local->sta_mtx);
 
 	/* reconfigure tx conf */
-	for (i = 0; i < hw->queues; i++)
-		drv_conf_tx(local, i, &local->tx_conf[i]);
+	list_for_each_entry(sdata, &local->interfaces, list) {
+		if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN ||
+		    sdata->vif.type == NL80211_IFTYPE_MONITOR ||
+		    !ieee80211_sdata_running(sdata))
+			continue;
+
+		for (i = 0; i < hw->queues; i++)
+			drv_conf_tx(local, sdata, i, &sdata->tx_conf[i]);
+	}
 
 	/* reconfigure hardware */
 	ieee80211_hw_config(local, ~0);
-- 
1.7.6.401.g6a319


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] mac80211: pass vif param to conf_tx() callback
  2011-09-25 17:06 [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params() Eliad Peller
  2011-09-25 17:06 ` [PATCH 2/3] mac80211: save tx params per sdata Eliad Peller
@ 2011-09-25 17:06 ` Eliad Peller
  2011-09-26  9:36   ` Johannes Berg
                     ` (2 more replies)
  2011-09-26  9:34 ` [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params() Johannes Berg
  2 siblings, 3 replies; 9+ messages in thread
From: Eliad Peller @ 2011-09-25 17:06 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless

tx params should be configured per interface.
Add ieee80211_vif param to the conf_tx callback,
and update all the drivers that use this callback.

The following spatch was used:
@rule1@
struct ieee80211_ops ops;
identifier conf_tx_op;
@@
	ops.conf_tx = conf_tx_op;

@rule2@
identifier rule1.conf_tx_op;
identifier hw, queue, params;
@@
	conf_tx_op (
-		struct ieee80211_hw *hw,
+		struct ieee80211_hw *hw, struct ieee80211_vif *vif,
		u16 queue,
		const struct ieee80211_tx_queue_params *params) {...}

Signed-off-by: Eliad Peller <eliad@wizery.com>
---
 drivers/net/wireless/ath/ath5k/mac80211-ops.c    |    2 +-
 drivers/net/wireless/ath/ath9k/htc_drv_main.c    |    3 ++-
 drivers/net/wireless/ath/ath9k/main.c            |    3 ++-
 drivers/net/wireless/ath/carl9170/main.c         |    3 ++-
 drivers/net/wireless/b43/main.c                  |    3 ++-
 drivers/net/wireless/b43legacy/main.c            |    3 ++-
 drivers/net/wireless/mac80211_hwsim.c            |    3 ++-
 drivers/net/wireless/mwl8k.c                     |    3 ++-
 drivers/net/wireless/p54/main.c                  |    3 ++-
 drivers/net/wireless/rt2x00/rt2400pci.c          |    3 ++-
 drivers/net/wireless/rt2x00/rt61pci.c            |    3 ++-
 drivers/net/wireless/rt2x00/rt73usb.c            |    3 ++-
 drivers/net/wireless/rtl818x/rtl8187/dev.c       |    3 ++-
 drivers/net/wireless/rtlwifi/core.c              |    3 ++-
 drivers/net/wireless/wl1251/main.c               |    3 ++-
 drivers/net/wireless/wl12xx/main.c               |    3 ++-
 drivers/staging/brcm80211/brcmsmac/mac80211_if.c |    7 ++++---
 include/net/mac80211.h                           |    3 ++-
 net/mac80211/driver-ops.h                        |    3 ++-
 19 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 0560234..0fbfc72 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -563,7 +563,7 @@ ath5k_get_stats(struct ieee80211_hw *hw,
 
 
 static int
-ath5k_conf_tx(struct ieee80211_hw *hw, u16 queue,
+ath5k_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue,
 	      const struct ieee80211_tx_queue_params *params)
 {
 	struct ath5k_hw *ah = hw->priv;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 495fdf6..d56a154 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1352,7 +1352,8 @@ static int ath9k_htc_sta_remove(struct ieee80211_hw *hw,
 	return ret;
 }
 
-static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int ath9k_htc_conf_tx(struct ieee80211_hw *hw,
+			     struct ieee80211_vif *vif, u16 queue,
 			     const struct ieee80211_tx_queue_params *params)
 {
 	struct ath9k_htc_priv *priv = hw->priv;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index ee39702..0601579 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1843,7 +1843,8 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
 	}
 }
 
-static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int ath9k_conf_tx(struct ieee80211_hw *hw,
+			 struct ieee80211_vif *vif, u16 queue,
 			 const struct ieee80211_tx_queue_params *params)
 {
 	struct ath_softc *sc = hw->priv;
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index af351ec..e390a8e 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -1304,7 +1304,8 @@ static int carl9170_op_sta_remove(struct ieee80211_hw *hw,
 	return 0;
 }
 
-static int carl9170_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int carl9170_op_conf_tx(struct ieee80211_hw *hw,
+			       struct ieee80211_vif *vif, u16 queue,
 			       const struct ieee80211_tx_queue_params *param)
 {
 	struct ar9170 *ar = hw->priv;
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 56fa3a3..29b86d4 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3552,7 +3552,8 @@ static void b43_qos_init(struct b43_wldev *dev)
 	b43dbg(dev->wl, "QoS enabled\n");
 }
 
-static int b43_op_conf_tx(struct ieee80211_hw *hw, u16 _queue,
+static int b43_op_conf_tx(struct ieee80211_hw *hw,
+			  struct ieee80211_vif *vif, u16 _queue,
 			  const struct ieee80211_tx_queue_params *params)
 {
 	struct b43_wl *wl = hw_to_b43_wl(hw);
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 468d183..a3b72cd 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2466,7 +2466,8 @@ out:
 	}
 }
 
-static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int b43legacy_op_conf_tx(struct ieee80211_hw *hw,
+				struct ieee80211_vif *vif, u16 queue,
 				const struct ieee80211_tx_queue_params *params)
 {
 	return 0;
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 34b79fc..68455a2 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -970,7 +970,8 @@ static int mac80211_hwsim_set_tim(struct ieee80211_hw *hw,
 }
 
 static int mac80211_hwsim_conf_tx(
-	struct ieee80211_hw *hw, u16 queue,
+	struct ieee80211_hw *hw,
+	struct ieee80211_vif *vif, u16 queue,
 	const struct ieee80211_tx_queue_params *params)
 {
 	wiphy_debug(hw->wiphy,
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index ea1395a..2428895 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -4915,7 +4915,8 @@ static int mwl8k_sta_add(struct ieee80211_hw *hw,
 	return ret;
 }
 
-static int mwl8k_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int mwl8k_conf_tx(struct ieee80211_hw *hw,
+			 struct ieee80211_vif *vif, u16 queue,
 			 const struct ieee80211_tx_queue_params *params)
 {
 	struct mwl8k_priv *priv = hw->priv;
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 726a934..ad9ae04 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -404,7 +404,8 @@ static void p54_configure_filter(struct ieee80211_hw *dev,
 		p54_set_groupfilter(priv);
 }
 
-static int p54_conf_tx(struct ieee80211_hw *dev, u16 queue,
+static int p54_conf_tx(struct ieee80211_hw *dev,
+		       struct ieee80211_vif *vif, u16 queue,
 		       const struct ieee80211_tx_queue_params *params)
 {
 	struct p54_common *priv = dev->priv;
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index daa32fc..1946060 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1648,7 +1648,8 @@ static int rt2400pci_probe_hw(struct rt2x00_dev *rt2x00dev)
 /*
  * IEEE80211 stack callback functions.
  */
-static int rt2400pci_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int rt2400pci_conf_tx(struct ieee80211_hw *hw,
+			     struct ieee80211_vif *vif, u16 queue,
 			     const struct ieee80211_tx_queue_params *params)
 {
 	struct rt2x00_dev *rt2x00dev = hw->priv;
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 058ef4b..5438bb4 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2883,7 +2883,8 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
 /*
  * IEEE80211 stack callback functions.
  */
-static int rt61pci_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
+static int rt61pci_conf_tx(struct ieee80211_hw *hw,
+			   struct ieee80211_vif *vif, u16 queue_idx,
 			   const struct ieee80211_tx_queue_params *params)
 {
 	struct rt2x00_dev *rt2x00dev = hw->priv;
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 0baeb89..1a6b68b 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2222,7 +2222,8 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
 /*
  * IEEE80211 stack callback functions.
  */
-static int rt73usb_conf_tx(struct ieee80211_hw *hw, u16 queue_idx,
+static int rt73usb_conf_tx(struct ieee80211_hw *hw,
+			   struct ieee80211_vif *vif, u16 queue_idx,
 			   const struct ieee80211_tx_queue_params *params)
 {
 	struct rt2x00_dev *rt2x00dev = hw->priv;
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 1e0be14..c106742 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -1241,7 +1241,8 @@ static void rtl8187_configure_filter(struct ieee80211_hw *dev,
 	rtl818x_iowrite32_async(priv, &priv->map->RX_CONF, priv->rx_conf);
 }
 
-static int rtl8187_conf_tx(struct ieee80211_hw *dev, u16 queue,
+static int rtl8187_conf_tx(struct ieee80211_hw *dev,
+			   struct ieee80211_vif *vif, u16 queue,
 			   const struct ieee80211_tx_queue_params *params)
 {
 	struct rtl8187_priv *priv = dev->priv;
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 04c4e9e..05c27c9 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -504,7 +504,8 @@ static int _rtl_get_hal_qnum(u16 queue)
  *for mac80211 VO=0, VI=1, BE=2, BK=3
  *for rtl819x  BE=0, BK=1, VI=2, VO=3
  */
-static int rtl_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int rtl_op_conf_tx(struct ieee80211_hw *hw,
+		   struct ieee80211_vif *vif, u16 queue,
 		   const struct ieee80211_tx_queue_params *param)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index a14a48c..ba3268e 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -1158,7 +1158,8 @@ static struct ieee80211_channel wl1251_channels[] = {
 	{ .hw_value = 13, .center_freq = 2472},
 };
 
-static int wl1251_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int wl1251_op_conf_tx(struct ieee80211_hw *hw,
+			     struct ieee80211_vif *vif, u16 queue,
 			     const struct ieee80211_tx_queue_params *params)
 {
 	enum wl1251_acx_ps_scheme ps_scheme;
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index a51dd0e..60e2869 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -3744,7 +3744,8 @@ out:
 	mutex_unlock(&wl->mutex);
 }
 
-static int wl1271_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
+static int wl1271_op_conf_tx(struct ieee80211_hw *hw,
+			     struct ieee80211_vif *vif, u16 queue,
 			     const struct ieee80211_tx_queue_params *params)
 {
 	struct wl1271 *wl = hw->priv;
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index d6de44e..d03f0cf 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -140,8 +140,9 @@ static void brcms_ops_sta_notify(struct ieee80211_hw *hw,
 			      struct ieee80211_vif *vif,
 			      enum sta_notify_cmd cmd,
 			      struct ieee80211_sta *sta);
-static int brcms_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
-			  const struct ieee80211_tx_queue_params *params);
+static int brcms_ops_conf_tx(struct ieee80211_hw *hw,
+			     struct ieee80211_vif *vif, u16 queue,
+			     const struct ieee80211_tx_queue_params *params);
 static u64 brcms_ops_get_tsf(struct ieee80211_hw *hw);
 static int brcms_ops_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		      struct ieee80211_sta *sta);
@@ -553,7 +554,7 @@ brcms_ops_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 }
 
 static int
-brcms_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
+brcms_ops_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue,
 	       const struct ieee80211_tx_queue_params *params)
 {
 	struct brcms_info *wl = hw->priv;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c0f63fd..b8ecba7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1998,7 +1998,8 @@ struct ieee80211_ops {
 			  struct ieee80211_sta *sta);
 	void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 			enum sta_notify_cmd, struct ieee80211_sta *sta);
-	int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
+	int (*conf_tx)(struct ieee80211_hw *hw,
+		       struct ieee80211_vif *vif, u16 queue,
 		       const struct ieee80211_tx_queue_params *params);
 	u64 (*get_tsf)(struct ieee80211_hw *hw);
 	void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf);
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 5315a5d..d998b24 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -423,7 +423,8 @@ static inline int drv_conf_tx(struct ieee80211_local *local,
 
 	trace_drv_conf_tx(local, sdata, queue, params);
 	if (local->ops->conf_tx)
-		ret = local->ops->conf_tx(&local->hw, queue, params);
+		ret = local->ops->conf_tx(&local->hw, &sdata->vif,
+					  queue, params);
 	trace_drv_return_int(local, ret);
 	return ret;
 }
-- 
1.7.6.401.g6a319


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params()
  2011-09-25 17:06 [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params() Eliad Peller
  2011-09-25 17:06 ` [PATCH 2/3] mac80211: save tx params per sdata Eliad Peller
  2011-09-25 17:06 ` [PATCH 3/3] mac80211: pass vif param to conf_tx() callback Eliad Peller
@ 2011-09-26  9:34 ` Johannes Berg
  2 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2011-09-26  9:34 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Sun, 2011-09-25 at 20:06 +0300, Eliad Peller wrote:

> +++ b/net/wireless/nl80211.c
> @@ -1235,6 +1235,11 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
>  			goto bad_res;
>  		}
>  
> +		if (!netdev) {
> +			result = -EINVAL;
> +			goto bad_res;
> +		}
> +

I'm a little worried about this change, but I don't think we have a
choice. Technically, it is an API change. I believe that no existing
applications (hostapd is probably the only using this) make use of this
with just the phy (and not the netdev).

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] mac80211: pass vif param to conf_tx() callback
  2011-09-25 17:06 ` [PATCH 3/3] mac80211: pass vif param to conf_tx() callback Eliad Peller
@ 2011-09-26  9:36   ` Johannes Berg
  2011-09-28 13:48   ` Johannes Berg
  2011-09-30 19:57   ` John W. Linville
  2 siblings, 0 replies; 9+ messages in thread
From: Johannes Berg @ 2011-09-26  9:36 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Sun, 2011-09-25 at 20:06 +0300, Eliad Peller wrote:
> tx params should be configured per interface.
> Add ieee80211_vif param to the conf_tx callback,
> and update all the drivers that use this callback.
> 
> The following spatch was used:
> @rule1@
> struct ieee80211_ops ops;
> identifier conf_tx_op;
> @@
> 	ops.conf_tx = conf_tx_op;
> 
> @rule2@
> identifier rule1.conf_tx_op;
> identifier hw, queue, params;
> @@
> 	conf_tx_op (
> -		struct ieee80211_hw *hw,
> +		struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> 		u16 queue,
> 		const struct ieee80211_tx_queue_params *params) {...}

Nice :-)

Looks good to me. (all 3)

johannes



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] mac80211: pass vif param to conf_tx() callback
  2011-09-25 17:06 ` [PATCH 3/3] mac80211: pass vif param to conf_tx() callback Eliad Peller
  2011-09-26  9:36   ` Johannes Berg
@ 2011-09-28 13:48   ` Johannes Berg
  2011-09-30 18:43     ` John W. Linville
  2011-09-30 19:57   ` John W. Linville
  2 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2011-09-28 13:48 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Sun, 2011-09-25 at 20:06 +0300, Eliad Peller wrote:
> tx params should be configured per interface.
> Add ieee80211_vif param to the conf_tx callback,
> and update all the drivers that use this callback.

I see patches 1 and 2 in the tree, but not this. I suspect the reason is
that it was actually incomplete, not updating for example iwlwifi
because there the function is defined in another file and the spatch
failed?

johannes


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] mac80211: pass vif param to conf_tx() callback
  2011-09-28 13:48   ` Johannes Berg
@ 2011-09-30 18:43     ` John W. Linville
  0 siblings, 0 replies; 9+ messages in thread
From: John W. Linville @ 2011-09-30 18:43 UTC (permalink / raw)
  To: Johannes Berg; +Cc: Eliad Peller, linux-wireless

On Wed, Sep 28, 2011 at 03:48:28PM +0200, Johannes Berg wrote:
> On Sun, 2011-09-25 at 20:06 +0300, Eliad Peller wrote:
> > tx params should be configured per interface.
> > Add ieee80211_vif param to the conf_tx callback,
> > and update all the drivers that use this callback.
> 
> I see patches 1 and 2 in the tree, but not this. I suspect the reason is
> that it was actually incomplete, not updating for example iwlwifi
> because there the function is defined in another file and the spatch
> failed?

It didn't apply.  I thought I might try again now that I pulled
wireless into wireless-next...

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] mac80211: pass vif param to conf_tx() callback
  2011-09-25 17:06 ` [PATCH 3/3] mac80211: pass vif param to conf_tx() callback Eliad Peller
  2011-09-26  9:36   ` Johannes Berg
  2011-09-28 13:48   ` Johannes Berg
@ 2011-09-30 19:57   ` John W. Linville
  2011-10-02  7:55     ` Eliad Peller
  2 siblings, 1 reply; 9+ messages in thread
From: John W. Linville @ 2011-09-30 19:57 UTC (permalink / raw)
  To: Eliad Peller; +Cc: Johannes Berg, linux-wireless

On Sun, Sep 25, 2011 at 08:06:55PM +0300, Eliad Peller wrote:
> tx params should be configured per interface.
> Add ieee80211_vif param to the conf_tx callback,
> and update all the drivers that use this callback.
> 
> The following spatch was used:
> @rule1@
> struct ieee80211_ops ops;
> identifier conf_tx_op;
> @@
> 	ops.conf_tx = conf_tx_op;
> 
> @rule2@
> identifier rule1.conf_tx_op;
> identifier hw, queue, params;
> @@
> 	conf_tx_op (
> -		struct ieee80211_hw *hw,
> +		struct ieee80211_hw *hw, struct ieee80211_vif *vif,
> 		u16 queue,
> 		const struct ieee80211_tx_queue_params *params) {...}
> 
> Signed-off-by: Eliad Peller <eliad@wizery.com>

You really need to compile patches before submitting them...

  CC [M]  drivers/net/wireless/iwlegacy/iwl3945-base.o
drivers/net/wireless/iwlegacy/iwl3945-base.c:3522:2: warning: initialization from incompatible pointer type

  CC [M]  drivers/net/wireless/iwlegacy/iwl-4965.o
drivers/net/wireless/iwlegacy/iwl-4965.c:2125:2: warning: initialization from incompatible pointer type

  CC [M]  drivers/net/wireless/iwlwifi/iwl-agn.o
drivers/net/wireless/iwlwifi/iwl-agn.c:3092:2: warning: initialization from incompatible pointer type

  CC [M]  drivers/net/wireless/rt2x00/rt2500pci.o
drivers/net/wireless/rt2x00/rt2500pci.c:2005:2: warning: initialization from incompatible pointer type

  CC [M]  drivers/net/wireless/rt2x00/rt2800pci.o
drivers/net/wireless/rt2x00/rt2800pci.c:1021:2: warning: initialization from incompatible pointer type

  CC [M]  drivers/net/wireless/rt2x00/rt2500usb.o
drivers/net/wireless/rt2x00/rt2500usb.c:1824:2: warning: initialization from incompatible pointer type

  CC [M]  drivers/net/wireless/rt2x00/rt2800usb.o
drivers/net/wireless/rt2x00/rt2800usb.c:766:2: warning: initialization from incompatible pointer type

  CC [M]  drivers/net/wireless/mwl8k.o
drivers/net/wireless/mwl8k.c: In function ‘mwl8k_reload_firmware’:
drivers/net/wireless/mwl8k.c:5466:3: warning: passing argument 2 of ‘mwl8k_conf_tx’ makes pointer from integer without a cast
drivers/net/wireless/mwl8k.c:4918:12: note: expected ‘struct ieee80211_vif *’ but argument is of type ‘int’
drivers/net/wireless/mwl8k.c:5466:3: warning: passing argument 3 of ‘mwl8k_conf_tx’ makes integer from pointer without a cast
drivers/net/wireless/mwl8k.c:4918:12: note: expected ‘u16’ but argument is of type ‘struct ieee80211_tx_queue_params *’
drivers/net/wireless/mwl8k.c:5466:3: error: too few arguments to function ‘mwl8k_conf_tx’
drivers/net/wireless/mwl8k.c:4918:12: note: declared here
make[1]: *** [drivers/net/wireless/mwl8k.o] Error 1
make: *** [drivers/net/wireless/] Error 2

Feel free to submit a new patch that doesn't introduce warnings or break the build...

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] mac80211: pass vif param to conf_tx() callback
  2011-09-30 19:57   ` John W. Linville
@ 2011-10-02  7:55     ` Eliad Peller
  0 siblings, 0 replies; 9+ messages in thread
From: Eliad Peller @ 2011-10-02  7:55 UTC (permalink / raw)
  To: John W. Linville; +Cc: Johannes Berg, linux-wireless

On Fri, Sep 30, 2011 at 10:57 PM, John W. Linville
<linville@tuxdriver.com> wrote:
> On Sun, Sep 25, 2011 at 08:06:55PM +0300, Eliad Peller wrote:
>> tx params should be configured per interface.
>> Add ieee80211_vif param to the conf_tx callback,
>> and update all the drivers that use this callback.
>>
>> The following spatch was used:
>> @rule1@
>> struct ieee80211_ops ops;
>> identifier conf_tx_op;
>> @@
>>       ops.conf_tx = conf_tx_op;
>>
>> @rule2@
>> identifier rule1.conf_tx_op;
>> identifier hw, queue, params;
>> @@
>>       conf_tx_op (
>> -             struct ieee80211_hw *hw,
>> +             struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>>               u16 queue,
>>               const struct ieee80211_tx_queue_params *params) {...}
>>
>> Signed-off-by: Eliad Peller <eliad@wizery.com>
>
>  CC [M]  drivers/net/wireless/mwl8k.o
> drivers/net/wireless/mwl8k.c: In function ‘mwl8k_reload_firmware’:
> drivers/net/wireless/mwl8k.c:5466:3: warning: passing argument 2 of ‘mwl8k_conf_tx’ makes pointer from integer without a cast
> drivers/net/wireless/mwl8k.c:4918:12: note: expected ‘struct ieee80211_vif *’ but argument is of type ‘int’
> drivers/net/wireless/mwl8k.c:5466:3: warning: passing argument 3 of ‘mwl8k_conf_tx’ makes integer from pointer without a cast
> drivers/net/wireless/mwl8k.c:4918:12: note: expected ‘u16’ but argument is of type ‘struct ieee80211_tx_queue_params *’
> drivers/net/wireless/mwl8k.c:5466:3: error: too few arguments to function ‘mwl8k_conf_tx’
> drivers/net/wireless/mwl8k.c:4918:12: note: declared here
> make[1]: *** [drivers/net/wireless/mwl8k.o] Error 1
> make: *** [drivers/net/wireless/] Error 2
>
> Feel free to submit a new patch that doesn't introduce warnings or break the build...
>
sorry for the mess.
in fact, i did selected and compile-tested all the drivers, but as my
.config didn't define CONFIG_PCI, i missed some of them...

as Johannes noted, the actual problem was that spatch failed where the
function definition and the function use span over multiple files.

i'll rebase, fix it, and send a new version soon.

Eliad.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-02  7:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-25 17:06 [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params() Eliad Peller
2011-09-25 17:06 ` [PATCH 2/3] mac80211: save tx params per sdata Eliad Peller
2011-09-25 17:06 ` [PATCH 3/3] mac80211: pass vif param to conf_tx() callback Eliad Peller
2011-09-26  9:36   ` Johannes Berg
2011-09-28 13:48   ` Johannes Berg
2011-09-30 18:43     ` John W. Linville
2011-09-30 19:57   ` John W. Linville
2011-10-02  7:55     ` Eliad Peller
2011-09-26  9:34 ` [PATCH 1/3] cfg80211/mac80211: add netdev param to set_txq_params() Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.