hostapd: Add Min/Max Transmit Power Capability into STA command

This provides access to the Minimum/Maximum Transmit Power Capabilitie
fileds (the nominal minimum/maximum transmit power with which the STA
is capable of transmitting in the current channel; signed integer in
units of decibels relative to 1 mW).

Signed-off-by: bhagavathi perumal s <bperumal@qti.qualcomm.com>
This commit is contained in:
bhagavathi perumal s 2017-10-06 20:33:25 +05:30 committed by Jouni Malinen
parent 33c8bbd8ca
commit ba72b4b126
5 changed files with 27 additions and 0 deletions

View file

@ -245,6 +245,15 @@ static int hostapd_ctrl_iface_sta_mib(struct hostapd_data *hapd,
len += os_snprintf(buf + len, buflen - len, "\n");
}
if (sta->power_capab) {
ret = os_snprintf(buf + len, buflen - len,
"min_txpower=%d\n"
"max_txpower=%d\n",
sta->min_tx_power, sta->max_tx_power);
if (!os_snprintf_error(buflen - len, ret))
len += ret;
}
return len;
}

View file

@ -2599,6 +2599,14 @@ static u16 check_assoc_ies(struct hostapd_data *hapd, struct sta_info *sta,
os_memcpy(sta->rrm_enabled_capa, elems.rrm_enabled,
sizeof(sta->rrm_enabled_capa));
if (elems.power_capab) {
sta->min_tx_power = elems.power_capab[0];
sta->max_tx_power = elems.power_capab[1];
sta->power_capab = 1;
} else {
sta->power_capab = 0;
}
return WLAN_STATUS_SUCCESS;
}

View file

@ -113,6 +113,7 @@ struct sta_info {
unsigned int ecsa_supported:1;
unsigned int added_unassoc:1;
unsigned int pending_wds_enable:1;
unsigned int power_capab:1;
u16 auth_alg;
@ -214,6 +215,9 @@ struct sta_info {
u8 rrm_enabled_capa[5];
s8 min_tx_power;
s8 max_tx_power;
#ifdef CONFIG_TAXONOMY
struct wpabuf *probe_ie_taxonomy;
struct wpabuf *assoc_ie_taxonomy;

View file

@ -352,6 +352,10 @@ ParseRes ieee802_11_parse_elems(const u8 *start, size_t len,
elems->rsn_ie_len = elen;
break;
case WLAN_EID_PWR_CAPABILITY:
if (elen < 2)
break;
elems->power_capab = pos;
elems->power_capab_len = elen;
break;
case WLAN_EID_SUPPORTED_CHANNELS:
elems->supp_channels = pos;

View file

@ -79,6 +79,7 @@ struct ieee802_11_elems {
const u8 *fils_pk;
const u8 *fils_nonce;
const u8 *owe_dh;
const u8 *power_capab;
u8 ssid_len;
u8 supp_rates_len;
@ -122,6 +123,7 @@ struct ieee802_11_elems {
u8 fils_wrapped_data_len;
u8 fils_pk_len;
u8 owe_dh_len;
u8 power_capab_len;
struct mb_ies_info mb_ies;
};