TDLS: Pass peer's AID information to kernel

The information of the peer's AID is required for the driver to
construct partial AID in VHT PPDU's. Pass this information to the driver
during add/set station operations (well, as soon as the information is
available, i.e., with set station operation currently).

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Sunil Dutt 2013-05-06 15:47:44 +03:00 committed by Jouni Malinen
parent 4d471ca55a
commit 785336998d
6 changed files with 19 additions and 8 deletions

View file

@ -127,6 +127,8 @@ struct wpa_tdls_peer {
u8 qos_info; u8 qos_info;
u16 aid;
u8 *ext_capab; u8 *ext_capab;
size_t ext_capab_len; size_t ext_capab_len;
}; };
@ -1558,6 +1560,8 @@ static int wpa_tdls_process_tpk_m1(struct wpa_sm *sm, const u8 *src_addr,
peer->qos_info = kde.qosinfo; peer->qos_info = kde.qosinfo;
peer->aid = kde.aid;
#ifdef CONFIG_TDLS_TESTING #ifdef CONFIG_TDLS_TESTING
if (tdls_testing & TDLS_TESTING_CONCURRENT_INIT) { if (tdls_testing & TDLS_TESTING_CONCURRENT_INIT) {
peer = wpa_tdls_add_peer(sm, src_addr, NULL); peer = wpa_tdls_add_peer(sm, src_addr, NULL);
@ -1735,7 +1739,7 @@ skip_rsn:
skip_rsn_check: skip_rsn_check:
/* add the peer to the driver as a "setup in progress" peer */ /* add the peer to the driver as a "setup in progress" peer */
wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, NULL, 0, NULL, NULL, 0, wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL, NULL, 0,
NULL, 0); NULL, 0);
wpa_printf(MSG_DEBUG, "TDLS: Sending TDLS Setup Response / TPK M2"); wpa_printf(MSG_DEBUG, "TDLS: Sending TDLS Setup Response / TPK M2");
@ -1777,7 +1781,8 @@ static int wpa_tdls_enable_link(struct wpa_sm *sm, struct wpa_tdls_peer *peer)
} }
/* add supported rates, capabilities, and qos_info to the TDLS peer */ /* add supported rates, capabilities, and qos_info to the TDLS peer */
if (wpa_sm_tdls_peer_addset(sm, peer->addr, 0, peer->capability, if (wpa_sm_tdls_peer_addset(sm, peer->addr, 0, peer->aid,
peer->capability,
peer->supp_rates, peer->supp_rates_len, peer->supp_rates, peer->supp_rates_len,
peer->ht_capabilities, peer->ht_capabilities,
peer->vht_capabilities, peer->vht_capabilities,
@ -1908,6 +1913,8 @@ static int wpa_tdls_process_tpk_m2(struct wpa_sm *sm, const u8 *src_addr,
peer->qos_info = kde.qosinfo; peer->qos_info = kde.qosinfo;
peer->aid = kde.aid;
if (!wpa_tdls_get_privacy(sm)) { if (!wpa_tdls_get_privacy(sm)) {
peer->rsnie_p_len = 0; peer->rsnie_p_len = 0;
peer->cipher = WPA_CIPHER_NONE; peer->cipher = WPA_CIPHER_NONE;
@ -2235,7 +2242,7 @@ int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr)
peer->initiator = 1; peer->initiator = 1;
/* add the peer to the driver as a "setup in progress" peer */ /* add the peer to the driver as a "setup in progress" peer */
wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, NULL, 0, NULL, NULL, 0, wpa_sm_tdls_peer_addset(sm, peer->addr, 1, 0, 0, NULL, 0, NULL, NULL, 0,
NULL, 0); NULL, 0);
if (wpa_tdls_send_tpk_m1(sm, peer) < 0) { if (wpa_tdls_send_tpk_m1(sm, peer) < 0) {

View file

@ -56,7 +56,7 @@ struct wpa_sm_ctx {
u8 action_code, u8 dialog_token, u8 action_code, u8 dialog_token,
u16 status_code, const u8 *buf, size_t len); u16 status_code, const u8 *buf, size_t len);
int (*tdls_oper)(void *ctx, int oper, const u8 *peer); int (*tdls_oper)(void *ctx, int oper, const u8 *peer);
int (*tdls_peer_addset)(void *ctx, const u8 *addr, int add, int (*tdls_peer_addset)(void *ctx, const u8 *addr, int add, u16 aid,
u16 capability, const u8 *supp_rates, u16 capability, const u8 *supp_rates,
size_t supp_rates_len, size_t supp_rates_len,
const struct ieee80211_ht_capabilities *ht_capab, const struct ieee80211_ht_capabilities *ht_capab,

View file

@ -282,7 +282,7 @@ static inline int wpa_sm_tdls_oper(struct wpa_sm *sm, int oper,
static inline int static inline int
wpa_sm_tdls_peer_addset(struct wpa_sm *sm, const u8 *addr, int add, wpa_sm_tdls_peer_addset(struct wpa_sm *sm, const u8 *addr, int add,
u16 capability, const u8 *supp_rates, u16 aid, u16 capability, const u8 *supp_rates,
size_t supp_rates_len, size_t supp_rates_len,
const struct ieee80211_ht_capabilities *ht_capab, const struct ieee80211_ht_capabilities *ht_capab,
const struct ieee80211_vht_capabilities *vht_capab, const struct ieee80211_vht_capabilities *vht_capab,
@ -290,7 +290,7 @@ wpa_sm_tdls_peer_addset(struct wpa_sm *sm, const u8 *addr, int add,
{ {
if (sm->ctx->tdls_peer_addset) if (sm->ctx->tdls_peer_addset)
return sm->ctx->tdls_peer_addset(sm->ctx->ctx, addr, add, return sm->ctx->tdls_peer_addset(sm->ctx->ctx, addr, add,
capability, supp_rates, aid, capability, supp_rates,
supp_rates_len, ht_capab, supp_rates_len, ht_capab,
vht_capab, qosinfo, vht_capab, qosinfo,
ext_capab, ext_capab_len); ext_capab, ext_capab_len);

View file

@ -430,6 +430,9 @@ int wpa_supplicant_parse_ies(const u8 *buf, size_t len,
} else if (*pos == WLAN_EID_HT_CAP) { } else if (*pos == WLAN_EID_HT_CAP) {
ie->ht_capabilities = pos + 2; ie->ht_capabilities = pos + 2;
ie->ht_capabilities_len = pos[1]; ie->ht_capabilities_len = pos[1];
} else if (*pos == WLAN_EID_VHT_AID) {
if (pos[1] >= 2)
ie->aid = WPA_GET_LE16(pos + 2);
} else if (*pos == WLAN_EID_VHT_CAP) { } else if (*pos == WLAN_EID_VHT_CAP) {
ie->vht_capabilities = pos + 2; ie->vht_capabilities = pos + 2;
ie->vht_capabilities_len = pos[1]; ie->vht_capabilities_len = pos[1];

View file

@ -54,6 +54,7 @@ struct wpa_eapol_ie_parse {
const u8 *vht_capabilities; const u8 *vht_capabilities;
size_t vht_capabilities_len; size_t vht_capabilities_len;
u8 qosinfo; u8 qosinfo;
u16 aid;
}; };
int wpa_supplicant_parse_ies(const u8 *buf, size_t len, int wpa_supplicant_parse_ies(const u8 *buf, size_t len,

View file

@ -551,7 +551,7 @@ static int wpa_supplicant_tdls_oper(void *ctx, int oper, const u8 *peer)
static int wpa_supplicant_tdls_peer_addset( static int wpa_supplicant_tdls_peer_addset(
void *ctx, const u8 *peer, int add, u16 capability, void *ctx, const u8 *peer, int add, u16 aid, u16 capability,
const u8 *supp_rates, size_t supp_rates_len, const u8 *supp_rates, size_t supp_rates_len,
const struct ieee80211_ht_capabilities *ht_capab, const struct ieee80211_ht_capabilities *ht_capab,
const struct ieee80211_vht_capabilities *vht_capab, const struct ieee80211_vht_capabilities *vht_capab,
@ -563,7 +563,7 @@ static int wpa_supplicant_tdls_peer_addset(
os_memset(&params, 0, sizeof(params)); os_memset(&params, 0, sizeof(params));
params.addr = peer; params.addr = peer;
params.aid = 1; params.aid = add ? 1 : aid;
params.capability = capability; params.capability = capability;
params.flags = WPA_STA_TDLS_PEER | WPA_STA_AUTHORIZED; params.flags = WPA_STA_TDLS_PEER | WPA_STA_AUTHORIZED;