diff options
author | Eliad Peller <eliad@wizery.com> | 2011-08-25 07:26:54 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-09-14 05:09:38 -0400 |
commit | 1ec23f7f709b7ab5552cb9c34089633c384ec657 (patch) | |
tree | 354e20cbe4ecbbd70be6f106a60e08f07b406f91 | |
parent | b6883582a8ea6a7a70d4cc9f4c121ed3d8a75681 (diff) |
wl12xx: declare support for WIPHY_FLAG_AP_UAPSD
Declare support for uapsd when working as AP, and
set psd_type and sp_len whan a station is being added.
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/cmd.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 2 |
3 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c index 9ec2f31b0ecf..084262f169b2 100644 --- a/drivers/net/wireless/wl12xx/cmd.c +++ b/drivers/net/wireless/wl12xx/cmd.c | |||
@@ -1413,7 +1413,7 @@ out: | |||
1413 | int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid) | 1413 | int wl12xx_cmd_add_peer(struct wl1271 *wl, struct ieee80211_sta *sta, u8 hlid) |
1414 | { | 1414 | { |
1415 | struct wl12xx_cmd_add_peer *cmd; | 1415 | struct wl12xx_cmd_add_peer *cmd; |
1416 | int ret; | 1416 | int i, ret; |
1417 | u32 sta_rates; | 1417 | u32 sta_rates; |
1418 | 1418 | ||
1419 | wl1271_debug(DEBUG_CMD, "cmd add peer %d", (int)hlid); | 1419 | 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) | |||
1424 | goto out; | 1424 | goto out; |
1425 | } | 1425 | } |
1426 | 1426 | ||
1427 | /* currently we don't support UAPSD */ | ||
1428 | cmd->sp_len = 0; | ||
1429 | |||
1430 | memcpy(cmd->addr, sta->addr, ETH_ALEN); | 1427 | memcpy(cmd->addr, sta->addr, ETH_ALEN); |
1431 | cmd->bss_index = WL1271_AP_BSS_INDEX; | 1428 | cmd->bss_index = WL1271_AP_BSS_INDEX; |
1432 | cmd->aid = sta->aid; | 1429 | cmd->aid = sta->aid; |
1433 | cmd->hlid = hlid; | 1430 | cmd->hlid = hlid; |
1431 | cmd->sp_len = sta->max_sp; | ||
1434 | cmd->wmm = sta->wme ? 1 : 0; | 1432 | cmd->wmm = sta->wme ? 1 : 0; |
1435 | 1433 | ||
1434 | for (i = 0; i < NUM_ACCESS_CATEGORIES_COPY; i++) | ||
1435 | if (sta->wme && (sta->uapsd_queues & BIT(i))) | ||
1436 | cmd->psd_type[i] = WL1271_PSD_UPSD_TRIGGER; | ||
1437 | else | ||
1438 | cmd->psd_type[i] = WL1271_PSD_LEGACY; | ||
1439 | |||
1436 | sta_rates = sta->supp_rates[wl->band]; | 1440 | sta_rates = sta->supp_rates[wl->band]; |
1437 | if (sta->ht_cap.ht_supported) | 1441 | if (sta->ht_cap.ht_supported) |
1438 | sta_rates |= sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET; | 1442 | 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) | |||
1440 | cmd->supported_rates = | 1444 | cmd->supported_rates = |
1441 | cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates)); | 1445 | cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates)); |
1442 | 1446 | ||
1443 | wl1271_debug(DEBUG_CMD, "new peer rates: 0x%x", cmd->supported_rates); | 1447 | wl1271_debug(DEBUG_CMD, "new peer rates=0x%x queues=0x%x", |
1448 | cmd->supported_rates, sta->uapsd_queues); | ||
1444 | 1449 | ||
1445 | ret = wl1271_cmd_send(wl, CMD_ADD_PEER, cmd, sizeof(*cmd), 0); | 1450 | ret = wl1271_cmd_send(wl, CMD_ADD_PEER, cmd, sizeof(*cmd), 0); |
1446 | if (ret < 0) { | 1451 | if (ret < 0) { |
diff --git a/drivers/net/wireless/wl12xx/cmd.h b/drivers/net/wireless/wl12xx/cmd.h index 22c2f373dd04..8e4d11ec0c55 100644 --- a/drivers/net/wireless/wl12xx/cmd.h +++ b/drivers/net/wireless/wl12xx/cmd.h | |||
@@ -591,6 +591,13 @@ enum wl12xx_ssid_type { | |||
591 | WL12XX_SSID_TYPE_ANY = 2, | 591 | WL12XX_SSID_TYPE_ANY = 2, |
592 | }; | 592 | }; |
593 | 593 | ||
594 | enum wl1271_psd_type { | ||
595 | WL1271_PSD_LEGACY = 0, | ||
596 | WL1271_PSD_UPSD_TRIGGER = 1, | ||
597 | WL1271_PSD_LEGACY_PSPOLL = 2, | ||
598 | WL1271_PSD_SAPSD = 3 | ||
599 | }; | ||
600 | |||
594 | struct wl12xx_cmd_add_peer { | 601 | struct wl12xx_cmd_add_peer { |
595 | struct wl1271_cmd_header header; | 602 | struct wl1271_cmd_header header; |
596 | 603 | ||
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index e5b871c5c521..501a9e408d7a 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -4512,6 +4512,8 @@ int wl1271_init_ieee80211(struct wl1271 *wl) | |||
4512 | wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE - | 4512 | wl->hw->wiphy->max_scan_ie_len = WL1271_CMD_TEMPL_DFLT_SIZE - |
4513 | sizeof(struct ieee80211_header); | 4513 | sizeof(struct ieee80211_header); |
4514 | 4514 | ||
4515 | wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD; | ||
4516 | |||
4515 | /* make sure all our channels fit in the scanned_ch bitmask */ | 4517 | /* make sure all our channels fit in the scanned_ch bitmask */ |
4516 | BUILD_BUG_ON(ARRAY_SIZE(wl1271_channels) + | 4518 | BUILD_BUG_ON(ARRAY_SIZE(wl1271_channels) + |
4517 | ARRAY_SIZE(wl1271_channels_5ghz) > | 4519 | ARRAY_SIZE(wl1271_channels_5ghz) > |