summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSwarn Singh <swarnkum@codeaurora.org>2020-11-25 13:42:57 +0530
committerSwarn Singh <swarnkum@codeaurora.org>2020-12-02 22:22:03 +0530
commit5613b91482242f73ad3e6cfa8163c7d3ab3cd493 (patch)
treedd734af869c15d62aa966c1b182d3b6fae87f0ac
parentbb0f006bd456d1953b312905d3c20c031555d4f8 (diff)
Feature capability to fetch concurrent sessions on Wi-Fi Bands
This commit fetch concurrent sessions info from driver to know if the device supports concurrent network sessions on different Wi-Fi Bands. and reply back to upper layer. Change-Id: Ic0a6a57a64617d0831013a0ceeb723e3b8de8cc4 CRs-Fixed: 2831141
-rw-r--r--qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c52
-rw-r--r--qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h1
2 files changed, 53 insertions, 0 deletions
diff --git a/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c b/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c
index a0a1c6e..5ee1119 100644
--- a/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c
+++ b/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c
@@ -453,6 +453,31 @@ parse_beacon_ies:
return 0;
}
+static int parse_get_feature_info(struct resp_info *info, struct nlattr *vendata,
+ int datalen)
+{
+ struct nlattr *tb_vendor[NUM_QCA_WLAN_VENDOR_FEATURES + 1];
+ struct nlattr *attr;
+ char *result = NULL;
+ nla_parse(tb_vendor, NUM_QCA_WLAN_VENDOR_FEATURES,
+ vendata, datalen, NULL);
+ attr = tb_vendor[QCA_WLAN_VENDOR_ATTR_FEATURE_FLAGS];
+ if (attr) {
+ int length = snprintf( NULL, 0, "%d", nla_get_u32(attr));
+ result = (char *)malloc(length + 1);
+ if (result != NULL) {
+ memset(result, 0, length + 1);
+ snprintf(result, length + 1, "%d", nla_get_u32(attr));
+ snprintf(info->reply_buf, info->reply_buf_len,
+ "%s", result);
+ wpa_printf(MSG_DEBUG, "%s: driver supported feature info = %s", __func__, result);
+ }
+ } else {
+ snprintf(info->reply_buf, info->reply_buf_len, "FAIL");
+ return -1;
+ }
+ return 0;
+}
static int handle_response(struct resp_info *info, struct nlattr *vendata,
int datalen)
{
@@ -464,6 +489,10 @@ static int handle_response(struct resp_info *info, struct nlattr *vendata,
wpa_printf(MSG_INFO,"STAINFO: %s", info->reply_buf);
break;
+ case QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES:
+ os_memset(info->reply_buf, 0, info->reply_buf_len);
+ parse_get_feature_info(info, vendata, datalen);
+ break;
default:
wpa_printf(MSG_ERROR,"Unsupported response type: %d", info->subcmd);
break;
@@ -1398,6 +1427,29 @@ int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
snprintf(buf, buf_len, "%d %d", temperature, thermal_state);
return strlen(buf);
+ } else if (os_strncasecmp(cmd, "GET_DRIVER_SUPPORTED_FEATURES", 29) == 0) {
+ struct resp_info info;
+ struct nl_msg *nlmsg;
+ memset(&info, 0, sizeof(struct resp_info));
+ info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_FEATURES;
+ os_memset(buf, 0, buf_len);
+ info.reply_buf = buf;
+ info.reply_buf_len = buf_len;
+ nlmsg = prepare_vendor_nlmsg(drv, bss->ifname,
+ info.subcmd);
+ if (!nlmsg) {
+ wpa_printf(MSG_ERROR,"Failed to allocate nl message");
+ return -1;
+ }
+
+ status = send_nlmsg((struct nl_sock *)drv->global->nl, nlmsg,
+ response_handler, &info);
+ if (status != 0) {
+ wpa_printf(MSG_ERROR,"Failed to send nl message with err %d", status);
+ return -1;
+ }
+
+ return WPA_DRIVER_OEM_STATUS_SUCCESS;
} else { /* Use private command */
memset(&ifr, 0, sizeof(ifr));
memset(&priv_cmd, 0, sizeof(priv_cmd));
diff --git a/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h b/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h
index ee335ac..d5deec3 100644
--- a/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h
+++ b/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h
@@ -74,6 +74,7 @@ struct bss_info {
enum get_info_cmd {
GETSTATSBSSINFO = 1,
SETCELLSWITCHMODE = 2,
+ GET_DRIVER_SUPPORTED_FEATURES = 3,
};
struct resp_info {