* [PATCH v2] mac80211: reconfigure tx on device reconfiguration
@ 2011-07-14 10:40 Eliad Peller
2011-07-14 14:05 ` Stanislaw Gruszka
0 siblings, 1 reply; 3+ messages in thread
From: Eliad Peller @ 2011-07-14 10:40 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
Add tx_conf array to save the current tx queues
configuration, and reconfig it on resume (ieee80211_reconfig).
On resume, the driver is being reconfigured. Without
reconfiguring the tx queues as well, the driver might
configure the device to use wrong ac params (e.g. ps-poll
instead of uapsd).
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v1 -> v2: edit commit message
net/mac80211/ieee80211_i.h | 1 +
net/mac80211/mlme.c | 1 +
net/mac80211/util.c | 7 ++++++-
3 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 4f2e424..a976d8d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -721,6 +721,7 @@ 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 182cda6..6d0883a 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -917,6 +917,7 @@ 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, ¶ms))
wiphy_debug(local->hw.wiphy,
"failed to set TX queue parameters for queue %d\n",
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index faa392e..466ded7 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -799,6 +799,7 @@ 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);
}
@@ -1146,7 +1147,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
struct ieee80211_hw *hw = &local->hw;
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta;
- int res;
+ int res, i;
#ifdef CONFIG_PM
if (local->suspended)
@@ -1219,6 +1220,10 @@ int ieee80211_reconfig(struct ieee80211_local *local)
/* setup RTS threshold */
drv_set_rts_threshold(local, hw->wiphy->rts_threshold);
+ /* reconfigure tx conf */
+ for (i = 0; i < IEEE80211_MAX_QUEUES; i++)
+ drv_conf_tx(local, i, &local->tx_conf[i]);
+
/* reconfigure hardware */
ieee80211_hw_config(local, ~0);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v2] mac80211: reconfigure tx on device reconfiguration
2011-07-14 10:40 [PATCH v2] mac80211: reconfigure tx on device reconfiguration Eliad Peller
@ 2011-07-14 14:05 ` Stanislaw Gruszka
2011-07-14 17:05 ` Eliad Peller
0 siblings, 1 reply; 3+ messages in thread
From: Stanislaw Gruszka @ 2011-07-14 14:05 UTC (permalink / raw)
To: Eliad Peller; +Cc: Johannes Berg, linux-wireless
On Thu, Jul 14, 2011 at 01:40:29PM +0300, Eliad Peller wrote:
> + /* reconfigure tx conf */
> + for (i = 0; i < IEEE80211_MAX_QUEUES; i++)
> + drv_conf_tx(local, i, &local->tx_conf[i]);
Perhaps you should use hw->queues instead of IEEE80211_MAX_QUEUES ...
Stanislaw
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] mac80211: reconfigure tx on device reconfiguration
2011-07-14 14:05 ` Stanislaw Gruszka
@ 2011-07-14 17:05 ` Eliad Peller
0 siblings, 0 replies; 3+ messages in thread
From: Eliad Peller @ 2011-07-14 17:05 UTC (permalink / raw)
To: Stanislaw Gruszka; +Cc: Johannes Berg, linux-wireless
On Thu, Jul 14, 2011 at 5:05 PM, Stanislaw Gruszka <sgruszka@redhat.com> wrote:
> On Thu, Jul 14, 2011 at 01:40:29PM +0300, Eliad Peller wrote:
>> + /* reconfigure tx conf */
>> + for (i = 0; i < IEEE80211_MAX_QUEUES; i++)
>> + drv_conf_tx(local, i, &local->tx_conf[i]);
>
> Perhaps you should use hw->queues instead of IEEE80211_MAX_QUEUES ...
sure.
i also found another place in which drv_conf_tx was called but the new
tx configuration wasn't saved (ieee80211_set_txq_params).
i'll send a new version soon.
thanks,
Eliad.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-14 17:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-14 10:40 [PATCH v2] mac80211: reconfigure tx on device reconfiguration Eliad Peller
2011-07-14 14:05 ` Stanislaw Gruszka
2011-07-14 17:05 ` Eliad Peller
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.