aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2018-12-31 14:41:24 (GMT)
committerJouni Malinen <j@w1.fi>2018-12-31 14:41:24 (GMT)
commitfea49f8f93c4032bbbe89ba262e92f8858a89352 (patch)
tree9b5e69a7ee3f1d46ae8dcfa21df30a0c30728326 /src
parent02d53ac351df612250e9c165683f96d10b8f8678 (diff)
downloadhostap-fea49f8f93c4032bbbe89ba262e92f8858a89352.zip
hostap-fea49f8f93c4032bbbe89ba262e92f8858a89352.tar.gz
hostap-fea49f8f93c4032bbbe89ba262e92f8858a89352.tar.bz2
nl82011: Make wiphy-specific country (alpha2) available in STATUS-DRIVER
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index b887eb2..4cf2bda 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -8688,6 +8688,8 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
struct wpa_driver_nl80211_data *drv = bss->drv;
int res;
char *pos, *end;
+ struct nl_msg *msg;
+ char alpha2[3] = { 0, 0, 0 };
pos = buf;
end = buf + buflen;
@@ -8832,6 +8834,23 @@ static int wpa_driver_nl80211_status(void *priv, char *buf, size_t buflen)
pos += res;
}
+ msg = nlmsg_alloc();
+ if (msg &&
+ nl80211_cmd(drv, msg, 0, NL80211_CMD_GET_REG) &&
+ nla_put_u32(msg, NL80211_ATTR_WIPHY, drv->wiphy_idx) == 0) {
+ if (send_and_recv_msgs(drv, msg, nl80211_get_country,
+ alpha2) == 0 &&
+ alpha2[0]) {
+ res = os_snprintf(pos, end - pos, "country=%s\n",
+ alpha2);
+ if (os_snprintf_error(end - pos, res))
+ return pos - buf;
+ pos += res;
+ }
+ } else {
+ nlmsg_free(msg);
+ }
+
return pos - buf;
}