|
@@ -137,6 +137,7 @@
|
|
|
#define HDD_CHANNEL_14 14
|
|
|
|
|
|
#define MAX_TXPOWER_SCALE 4
|
|
|
+#define CDS_MAX_FEATURE_SET 8
|
|
|
|
|
|
static const u32 hdd_cipher_suites[] = {
|
|
|
WLAN_CIPHER_SUITE_WEP40,
|
|
@@ -2020,6 +2021,117 @@ wlan_hdd_cfg80211_set_scanning_mac_oui(struct wiphy *wiphy,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * __wlan_hdd_cfg80211_get_concurrency_matrix() - to retrieve concurrency matrix
|
|
|
+ * @wiphy: pointer phy adapter
|
|
|
+ * @wdev: pointer to wireless device structure
|
|
|
+ * @data: pointer to data buffer
|
|
|
+ * @data_len: length of data
|
|
|
+ *
|
|
|
+ * This routine will give concurrency matrix
|
|
|
+ *
|
|
|
+ * Return: int status code
|
|
|
+ */
|
|
|
+static int __wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy,
|
|
|
+ struct wireless_dev *wdev,
|
|
|
+ const void *data,
|
|
|
+ int data_len)
|
|
|
+{
|
|
|
+ uint32_t feature_set_matrix[CDS_MAX_FEATURE_SET] = {0};
|
|
|
+ uint8_t i, feature_sets, max_feature_sets;
|
|
|
+ struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX + 1];
|
|
|
+ struct sk_buff *reply_skb;
|
|
|
+ hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ ENTER_DEV(wdev->netdev);
|
|
|
+
|
|
|
+ if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
|
+ hdd_err("Command not allowed in FTM mode");
|
|
|
+ return -EPERM;
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = wlan_hdd_validate_context(hdd_ctx);
|
|
|
+ if (0 != ret) {
|
|
|
+ hdd_err("HDD context is not valid");
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nla_parse(tb, QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_MAX,
|
|
|
+ data, data_len, NULL)) {
|
|
|
+ hdd_err("Invalid ATTR");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* Parse and fetch max feature set */
|
|
|
+ if (!tb[QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX]) {
|
|
|
+ hdd_err("Attr max feature set size failed");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+ max_feature_sets = nla_get_u32(tb[
|
|
|
+ QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_CONFIG_PARAM_SET_SIZE_MAX]);
|
|
|
+ hdd_info("Max feature set size: %d", max_feature_sets);
|
|
|
+
|
|
|
+ /* Fill feature combination matrix */
|
|
|
+ feature_sets = 0;
|
|
|
+ feature_set_matrix[feature_sets++] = WIFI_FEATURE_INFRA |
|
|
|
+ WIFI_FEATURE_P2P;
|
|
|
+ /* Add more feature combinations here */
|
|
|
+
|
|
|
+ feature_sets = QDF_MIN(feature_sets, max_feature_sets);
|
|
|
+ hdd_info("Number of feature sets:%d", feature_sets);
|
|
|
+ hdd_info("Feature set matrix");
|
|
|
+ for (i = 0; i < feature_sets; i++)
|
|
|
+ hdd_info("[%d] 0x%02X", i, feature_set_matrix[i]);
|
|
|
+
|
|
|
+ reply_skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u32) +
|
|
|
+ sizeof(u32) * feature_sets + NLMSG_HDRLEN);
|
|
|
+ if (!reply_skb) {
|
|
|
+ hdd_err("Feature set matrix: buffer alloc fail");
|
|
|
+ return -ENOMEM;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nla_put_u32(reply_skb,
|
|
|
+ QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET_SIZE,
|
|
|
+ feature_sets) ||
|
|
|
+ nla_put(reply_skb,
|
|
|
+ QCA_WLAN_VENDOR_ATTR_GET_CONCURRENCY_MATRIX_RESULTS_SET,
|
|
|
+ sizeof(u32) * feature_sets,
|
|
|
+ feature_set_matrix)) {
|
|
|
+ hdd_err("nla put fail");
|
|
|
+ kfree_skb(reply_skb);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+ return cfg80211_vendor_cmd_reply(reply_skb);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * wlan_hdd_cfg80211_get_concurrency_matrix() - get concurrency matrix
|
|
|
+ * @wiphy: pointer to wireless wiphy structure.
|
|
|
+ * @wdev: pointer to wireless_dev structure.
|
|
|
+ * @data: Pointer to the data to be passed via vendor interface
|
|
|
+ * @data_len:Length of the data to be passed
|
|
|
+ *
|
|
|
+ * Retrieves the concurrency feature set matrix
|
|
|
+ *
|
|
|
+ * Return: 0 on success, negative errno on failure
|
|
|
+ */
|
|
|
+static int
|
|
|
+wlan_hdd_cfg80211_get_concurrency_matrix(struct wiphy *wiphy,
|
|
|
+ struct wireless_dev *wdev,
|
|
|
+ const void *data,
|
|
|
+ int data_len)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ cds_ssr_protect(__func__);
|
|
|
+ ret = __wlan_hdd_cfg80211_get_concurrency_matrix(wiphy, wdev,
|
|
|
+ data, data_len);
|
|
|
+ cds_ssr_unprotect(__func__);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* wlan_hdd_cfg80211_set_feature() - Set the bitmask for supported features
|
|
|
* @feature_flags: pointer to the byte array of features.
|
|
@@ -4972,7 +5084,7 @@ const struct wiphy_vendor_command hdd_wiphy_vendor_commands[] = {
|
|
|
.info.vendor_id = QCA_NL80211_VENDOR_ID,
|
|
|
.info.subcmd = QCA_NL80211_VENDOR_SUBCMD_GET_CONCURRENCY_MATRIX,
|
|
|
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
|
|
|
- .doit = cds_cfg80211_get_concurrency_matrix
|
|
|
+ .doit = wlan_hdd_cfg80211_get_concurrency_matrix
|
|
|
},
|
|
|
{
|
|
|
.info.vendor_id = QCA_NL80211_VENDOR_ID,
|