* [PATCH] wl12xx: set psd_type and sp_len on wl12xx_cmd_add_peer()
@ 2011-08-23 11:51 Eliad Peller
2011-09-14 9:21 ` Luciano Coelho
0 siblings, 1 reply; 2+ messages in thread
From: Eliad Peller @ 2011-08-23 11:51 UTC (permalink / raw)
To: Luciano Coelho; +Cc: linux-wireless
Use the values given by mac80211 in order to configure
WME correctly (AP mode)
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
this patch depends on
"mac80211: add uapsd_queues and max_sp params fields"
drivers/net/wireless/wl12xx/cmd.c | 15 ++++++++++-----
drivers/net/wireless/wl12xx/cmd.h | 7 +++++++
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 817bc18..d5a0ebe 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -1413,7 +1413,7 @@ out:
int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid)
{
struct wl12xx_cmd_add_peer *cmd;
- int ret;
+ int i, ret;
u32 sta_rates;
wl1271_debug(DEBUG_CMD, "cmd add peer %d", (int)hlid);
@@ -1424,15 +1424,19 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid)
goto out;
}
- /* currently we don't support UAPSD */
- cmd->sp_len = 0;
-
memcpy(cmd->addr, sta->addr, ETH_ALEN);
cmd->bss_index = WL1271_AP_BSS_INDEX;
cmd->aid = sta->aid;
cmd->hlid = hlid;
+ cmd->sp_len = sta->max_sp;
cmd->wmm = sta->wme ? 1 : 0;
+ for (i = 0; i < NUM_ACCESS_CATEGORIES_COPY; i++)
+ if (sta->wme && (sta->uapsd_queues & BIT(i)))
+ cmd->psd_type[i] = WL1271_PSD_UPSD_TRIGGER;
+ else
+ cmd->psd_type[i] = WL1271_PSD_LEGACY;
+
sta_rates = sta->supp_rates[wl->band];
if (sta->ht_cap.ht_supported)
sta_rates |= sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET;
@@ -1440,7 +1444,8 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid)
cmd->supported_rates =
cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates));
- wl1271_debug(DEBUG_CMD, "new peer rates: 0x%x", cmd->supported_rates);
+ wl1271_debug(DEBUG_CMD, "new peer rates=0x%x queues=0x%x",
+ cmd->supported_rates, sta->uapsd_queues);
ret = wl1271_cmd_send(wl, CMD_ADD_PEER, cmd, sizeof(*cmd), 0);
if (ret < 0) {
diff --git a/drivers/net/wireless/wl12xx/cmd.h b/drivers/net/wireless/wl12xx/cmd.h
index 22c2f37..8e4d11e 100644
--- a/drivers/net/wireless/wl12xx/cmd.h
+++ b/drivers/net/wireless/wl12xx/cmd.h
@@ -591,6 +591,13 @@ enum wl12xx_ssid_type {
WL12XX_SSID_TYPE_ANY = 2,
};
+enum wl1271_psd_type {
+ WL1271_PSD_LEGACY = 0,
+ WL1271_PSD_UPSD_TRIGGER = 1,
+ WL1271_PSD_LEGACY_PSPOLL = 2,
+ WL1271_PSD_SAPSD = 3
+};
+
struct wl12xx_cmd_add_peer {
struct wl1271_cmd_header header;
--
1.7.6.401.g6a319
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] wl12xx: set psd_type and sp_len on wl12xx_cmd_add_peer()
2011-08-23 11:51 [PATCH] wl12xx: set psd_type and sp_len on wl12xx_cmd_add_peer() Eliad Peller
@ 2011-09-14 9:21 ` Luciano Coelho
0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2011-09-14 9:21 UTC (permalink / raw)
To: Eliad Peller; +Cc: linux-wireless
On Tue, 2011-08-23 at 14:51 +0300, Eliad Peller wrote:
> Use the values given by mac80211 in order to configure
> WME correctly (AP mode)
>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---
I ignored this patch since "wl12xx: declare support for
WIPHY_FLAG_AP_UAPSD" is a superset of this one.
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-14 9:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-23 11:51 [PATCH] wl12xx: set psd_type and sp_len on wl12xx_cmd_add_peer() Eliad Peller
2011-09-14 9:21 ` Luciano Coelho
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).