* [PATCH] ath10k: AP mode, set UAPSD params correctly
@ 2014-01-20 16:20 Janusz Dziedzic
2014-01-20 16:59 ` Kalle Valo
0 siblings, 1 reply; 4+ messages in thread
From: Janusz Dziedzic @ 2014-01-20 16:20 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless, Janusz Dziedzic
Move UAPSD params settings after peer assoc
command. This is required to setup UAPSD
params correctly.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
drivers/net/wireless/ath/ath10k/mac.c | 80 +++++++++++++++++++--------------
1 file changed, 46 insertions(+), 34 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 70fe386..fda146b 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1092,27 +1092,20 @@ static void ath10k_peer_assoc_h_ht(struct ath10k *ar,
arg->peer_num_spatial_streams);
}
-static void ath10k_peer_assoc_h_qos_ap(struct ath10k *ar,
- struct ath10k_vif *arvif,
- struct ieee80211_sta *sta,
- struct ieee80211_bss_conf *bss_conf,
- struct wmi_peer_assoc_complete_arg *arg)
+static int ath10k_peer_assoc_qos_ap(struct ath10k *ar,
+ struct ath10k_vif *arvif,
+ struct ieee80211_sta *sta)
{
u32 uapsd = 0;
u32 max_sp = 0;
+ int ret = 0;
lockdep_assert_held(&ar->conf_mutex);
- if (sta->wme)
- arg->peer_flags |= WMI_PEER_QOS;
-
if (sta->wme && sta->uapsd_queues) {
ath10k_dbg(ATH10K_DBG_MAC, "mac uapsd_queues 0x%x max_sp %d\n",
sta->uapsd_queues, sta->max_sp);
- arg->peer_flags |= WMI_PEER_APSD;
- arg->peer_rate_caps |= WMI_RC_UAPSD_FLAG;
-
if (sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO)
uapsd |= WMI_AP_PS_UAPSD_AC3_DELIVERY_EN |
WMI_AP_PS_UAPSD_AC3_TRIGGER_EN;
@@ -1130,35 +1123,40 @@ static void ath10k_peer_assoc_h_qos_ap(struct ath10k *ar,
if (sta->max_sp < MAX_WMI_AP_PS_PEER_PARAM_MAX_SP)
max_sp = sta->max_sp;
- ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id,
- sta->addr,
- WMI_AP_PS_PEER_PARAM_UAPSD,
- uapsd);
+ ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id,
+ sta->addr,
+ WMI_AP_PS_PEER_PARAM_UAPSD,
+ uapsd);
+ if (ret) {
+ ath10k_warn("failed to set ap ps peer param uapsd: %d\n",
+ ret);
+ return ret;
+ }
- ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id,
- sta->addr,
- WMI_AP_PS_PEER_PARAM_MAX_SP,
- max_sp);
+ ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id,
+ sta->addr,
+ WMI_AP_PS_PEER_PARAM_MAX_SP,
+ max_sp);
+ if (ret) {
+ ath10k_warn("failed to set ap ps peer param max sp: %d\n",
+ ret);
+ return ret;
+ }
/* TODO setup this based on STA listen interval and
beacon interval. Currently we don't know
sta->listen_interval - mac80211 patch required.
Currently use 10 seconds */
- ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id,
- sta->addr,
- WMI_AP_PS_PEER_PARAM_AGEOUT_TIME,
- 10);
+ ret = ath10k_wmi_set_ap_ps_param(ar, arvif->vdev_id, sta->addr,
+ WMI_AP_PS_PEER_PARAM_AGEOUT_TIME, 10);
+ if (ret) {
+ ath10k_warn("failed to set ap ps peer param ageout time: %d\n",
+ ret);
+ return ret;
+ }
}
-}
-static void ath10k_peer_assoc_h_qos_sta(struct ath10k *ar,
- struct ath10k_vif *arvif,
- struct ieee80211_sta *sta,
- struct ieee80211_bss_conf *bss_conf,
- struct wmi_peer_assoc_complete_arg *arg)
-{
- if (bss_conf->qos)
- arg->peer_flags |= WMI_PEER_QOS;
+ return 0;
}
static void ath10k_peer_assoc_h_vht(struct ath10k *ar,
@@ -1211,10 +1209,17 @@ static void ath10k_peer_assoc_h_qos(struct ath10k *ar,
{
switch (arvif->vdev_type) {
case WMI_VDEV_TYPE_AP:
- ath10k_peer_assoc_h_qos_ap(ar, arvif, sta, bss_conf, arg);
+ if (sta->wme)
+ arg->peer_flags |= WMI_PEER_QOS;
+
+ if (sta->wme && sta->uapsd_queues) {
+ arg->peer_flags |= WMI_PEER_APSD;
+ arg->peer_rate_caps |= WMI_RC_UAPSD_FLAG;
+ }
break;
case WMI_VDEV_TYPE_STA:
- ath10k_peer_assoc_h_qos_sta(ar, arvif, sta, bss_conf, arg);
+ if (bss_conf->qos)
+ arg->peer_flags |= WMI_PEER_QOS;
break;
default:
break;
@@ -1412,6 +1417,13 @@ static int ath10k_station_assoc(struct ath10k *ar, struct ath10k_vif *arvif,
return ret;
}
+ ret = ath10k_peer_assoc_qos_ap(ar, arvif, sta);
+ if (ret) {
+ ath10k_warn("could not set qos params for STA %pM, %d\n",
+ sta->addr, ret);
+ return ret;
+ }
+
return ret;
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ath10k: AP mode, set UAPSD params correctly
2014-01-20 16:20 [PATCH] ath10k: AP mode, set UAPSD params correctly Janusz Dziedzic
@ 2014-01-20 16:59 ` Kalle Valo
2014-01-20 18:48 ` Janusz Dziedzic
0 siblings, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2014-01-20 16:59 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: ath10k, linux-wireless
Janusz Dziedzic <janusz.dziedzic@tieto.com> writes:
> Move UAPSD params settings after peer assoc
> command. This is required to setup UAPSD
> params correctly.
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This is a pretty vague description. What is correct today can be totally
wrong tomorrow :)
So I would prefer that you describe a bit more about this change. At
least describe the bug you are fixing (or mention the motivation behind
the change).
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ath10k: AP mode, set UAPSD params correctly
2014-01-20 16:59 ` Kalle Valo
@ 2014-01-20 18:48 ` Janusz Dziedzic
2014-01-21 5:34 ` Kalle Valo
0 siblings, 1 reply; 4+ messages in thread
From: Janusz Dziedzic @ 2014-01-20 18:48 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k, linux-wireless
On 20 January 2014 17:59, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Janusz Dziedzic <janusz.dziedzic@tieto.com> writes:
>
>> Move UAPSD params settings after peer assoc
>> command. This is required to setup UAPSD
>> params correctly.
>>
>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>
> This is a pretty vague description. What is correct today can be totally
> wrong tomorrow :)
>
> So I would prefer that you describe a bit more about this change. At
> least describe the bug you are fixing (or mention the motivation behind
> the change).
ath10k handles UAPSD completly in the firmware.
When works in AP mode we have to configure
UAPSD params for each station. Without this
patch we configure UAPSD params before we
send peer assoc command to the FW, which was
wrong. Next FW didn't know what should be trigger
frame, couse UAPSD didn't work correctly in AP mode.
To configure UAPSD params correctly we have to
send them after peer assoc command.
BR
Janusz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ath10k: AP mode, set UAPSD params correctly
2014-01-20 18:48 ` Janusz Dziedzic
@ 2014-01-21 5:34 ` Kalle Valo
0 siblings, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2014-01-21 5:34 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: ath10k, linux-wireless
Janusz Dziedzic <janusz.dziedzic@tieto.com> writes:
> On 20 January 2014 17:59, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Janusz Dziedzic <janusz.dziedzic@tieto.com> writes:
>>
>>> Move UAPSD params settings after peer assoc
>>> command. This is required to setup UAPSD
>>> params correctly.
>>>
>>> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
>>
>> This is a pretty vague description. What is correct today can be totally
>> wrong tomorrow :)
>>
>> So I would prefer that you describe a bit more about this change. At
>> least describe the bug you are fixing (or mention the motivation behind
>> the change).
>
> ath10k handles UAPSD completly in the firmware.
> When works in AP mode we have to configure
> UAPSD params for each station. Without this
> patch we configure UAPSD params before we
> send peer assoc command to the FW, which was
> wrong. Next FW didn't know what should be trigger
> frame, couse UAPSD didn't work correctly in AP mode.
> To configure UAPSD params correctly we have to
> send them after peer assoc command.
This is much better. Can you send v2 with this description, please?
--
Kalle Valo
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-21 5:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 16:20 [PATCH] ath10k: AP mode, set UAPSD params correctly Janusz Dziedzic
2014-01-20 16:59 ` Kalle Valo
2014-01-20 18:48 ` Janusz Dziedzic
2014-01-21 5:34 ` Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).