diff options
author | CNSS_WLAN Service <cnssbldsw@qualcomm.com> | 2021-01-22 06:49:42 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2021-01-22 06:49:42 -0800 |
commit | 57612fee4fa6b6e31faf0fa5d74fd2a69aa1a8e5 (patch) | |
tree | b583b0150bd148d5c1cb65c573f08ba19a091aac | |
parent | 907f50448985fb19c517b2e6cd36e18e1be5802c (diff) | |
parent | 5613b91482242f73ad3e6cfa8163c7d3ab3cd493 (diff) |
Merge "Feature capability to fetch concurrent sessions on Wi-Fi Bands" into wlan-aosp.lnx.6.0
-rw-r--r-- | qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c | 52 | ||||
-rw-r--r-- | qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h | 1 |
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 ea62d53..8163fb5 100644 --- a/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c +++ b/qcwcn/wpa_supplicant_8_lib/driver_cmd_nl80211.c @@ -472,6 +472,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) { @@ -483,6 +508,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; @@ -1417,6 +1446,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 d975eec..6249d14 100644 --- a/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h +++ b/qcwcn/wpa_supplicant_8_lib/wpa_driver_common_lib.h @@ -76,6 +76,7 @@ struct bss_info { enum get_info_cmd { GETSTATSBSSINFO = 1, SETCELLSWITCHMODE = 2, + GET_DRIVER_SUPPORTED_FEATURES = 3, }; struct resp_info { |