mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-22 22:00:38 +01:00
scan: station: add HS20 indication element to (Re)Association
The HS20 indication element should always be included during (Re)Association per the spec. This removes the need for a dedicated boolean, and now the hs20_ie can be used instead.
This commit is contained in:
parent
4948bfac20
commit
3c27528523
@ -742,7 +742,7 @@ static bool scan_parse_vendor_specific(struct scan_bss *bss, const void *data,
|
|||||||
else if (!bss->osen && is_ie_wfa_ie(data, len, IE_WFA_OI_OSEN))
|
else if (!bss->osen && is_ie_wfa_ie(data, len, IE_WFA_OI_OSEN))
|
||||||
bss->osen = l_memdup(data - 2, len + 2);
|
bss->osen = l_memdup(data - 2, len + 2);
|
||||||
else if (is_ie_wfa_ie(data, len, IE_WFA_OI_HS20_INDICATION))
|
else if (is_ie_wfa_ie(data, len, IE_WFA_OI_HS20_INDICATION))
|
||||||
bss->hs20_capable = true;
|
bss->hs20_ie = l_memdup(data - 2, len + 2);
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -66,6 +66,7 @@ struct scan_bss {
|
|||||||
uint64_t time_stamp;
|
uint64_t time_stamp;
|
||||||
uint8_t hessid[6];
|
uint8_t hessid[6];
|
||||||
uint8_t *rc_ie; /* Roaming consortium IE */
|
uint8_t *rc_ie; /* Roaming consortium IE */
|
||||||
|
uint8_t *hs20_ie;
|
||||||
bool mde_present : 1;
|
bool mde_present : 1;
|
||||||
bool cc_present : 1;
|
bool cc_present : 1;
|
||||||
bool cap_rm_neighbor_report : 1;
|
bool cap_rm_neighbor_report : 1;
|
||||||
@ -73,7 +74,6 @@ struct scan_bss {
|
|||||||
bool ht_capable : 1;
|
bool ht_capable : 1;
|
||||||
bool vht_capable : 1;
|
bool vht_capable : 1;
|
||||||
bool anqp_capable : 1;
|
bool anqp_capable : 1;
|
||||||
bool hs20_capable : 1;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct scan_parameters {
|
struct scan_parameters {
|
||||||
|
@ -458,7 +458,7 @@ static bool station_start_anqp(struct station *station, struct network *network,
|
|||||||
struct anqp_entry *entry;
|
struct anqp_entry *entry;
|
||||||
bool anqp_disabled = true;
|
bool anqp_disabled = true;
|
||||||
|
|
||||||
if (!bss->hs20_capable)
|
if (!bss->hs20_ie)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Network already has ANQP data/HESSID */
|
/* Network already has ANQP data/HESSID */
|
||||||
@ -2181,7 +2181,8 @@ int __station_connect_network(struct station *station, struct network *network,
|
|||||||
const uint8_t *rc = NULL;
|
const uint8_t *rc = NULL;
|
||||||
size_t rc_len = 0;
|
size_t rc_len = 0;
|
||||||
uint8_t rc_buf[32];
|
uint8_t rc_buf[32];
|
||||||
struct iovec iov;
|
struct iovec iov[2];
|
||||||
|
int iov_elems = 0;
|
||||||
struct handshake_state *hs;
|
struct handshake_state *hs;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
@ -2189,7 +2190,12 @@ int __station_connect_network(struct station *station, struct network *network,
|
|||||||
if (!hs)
|
if (!hs)
|
||||||
return -ENOTSUP;
|
return -ENOTSUP;
|
||||||
|
|
||||||
if (bss->hs20_capable) {
|
if (bss->hs20_ie) {
|
||||||
|
/* Include HS20 Indication with (Re)Association */
|
||||||
|
iov[iov_elems].iov_base = bss->hs20_ie;
|
||||||
|
iov[iov_elems].iov_len = bss->hs20_ie[1] + 2;
|
||||||
|
iov_elems++;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If a matching roaming consortium OI is found for the network
|
* If a matching roaming consortium OI is found for the network
|
||||||
* this single RC value will be set in the handshake and used
|
* this single RC value will be set in the handshake and used
|
||||||
@ -2199,13 +2205,14 @@ int __station_connect_network(struct station *station, struct network *network,
|
|||||||
if (rc) {
|
if (rc) {
|
||||||
ie_build_roaming_consortium(rc, rc_len, rc_buf);
|
ie_build_roaming_consortium(rc, rc_len, rc_buf);
|
||||||
|
|
||||||
iov.iov_base = rc_buf;
|
iov[iov_elems].iov_base = rc_buf;
|
||||||
iov.iov_len = rc_buf[1] + 2;
|
iov[iov_elems].iov_len = rc_buf[1] + 2;
|
||||||
|
iov_elems++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
r = netdev_connect(station->netdev, bss, hs, rc ? &iov : NULL,
|
r = netdev_connect(station->netdev, bss, hs, iov_elems ? iov : NULL,
|
||||||
rc ? 1 : 0, station_netdev_event,
|
iov_elems, station_netdev_event,
|
||||||
station_connect_cb, station);
|
station_connect_cb, station);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
handshake_state_free(hs);
|
handshake_state_free(hs);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user