|
@@ -152,6 +152,7 @@
|
|
|
#include "os_if_nan.h"
|
|
|
#include "wlan_hdd_apf.h"
|
|
|
#include "wlan_hdd_cfr.h"
|
|
|
+#include "wlan_hdd_ioctl.h"
|
|
|
|
|
|
#define g_mode_rates_size (12)
|
|
|
#define a_mode_rates_size (8)
|
|
@@ -5034,6 +5035,16 @@ hdd_roam_control_config_buf_size(struct hdd_context *hdd_ctx,
|
|
|
if (tb[QCA_ATTR_ROAM_CONTROL_FULL_SCAN_PERIOD])
|
|
|
skb_len += NLA_HDRLEN + sizeof(uint32_t);
|
|
|
|
|
|
+ if (tb[QCA_ATTR_ROAM_CONTROL_FREQ_LIST_SCHEME])
|
|
|
+ /*
|
|
|
+ * Response has 3 nests, 1 atrribure value and a
|
|
|
+ * attribute list of frequencies.
|
|
|
+ */
|
|
|
+ skb_len += 3 * nla_total_size(0) +
|
|
|
+ nla_total_size(sizeof(uint32_t)) +
|
|
|
+ (nla_total_size(sizeof(uint32_t)) *
|
|
|
+ NUM_CHANNELS);
|
|
|
+
|
|
|
return skb_len;
|
|
|
}
|
|
|
|
|
@@ -5055,8 +5066,11 @@ hdd_roam_control_config_fill_data(struct hdd_context *hdd_ctx, uint8_t vdev_id,
|
|
|
{
|
|
|
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
|
|
uint8_t roam_control;
|
|
|
- struct nlattr *config;
|
|
|
+ struct nlattr *config, *get_freq_scheme, *get_freq;
|
|
|
uint32_t full_roam_scan_period;
|
|
|
+ uint8_t num_channels = 0;
|
|
|
+ uint32_t i = 0, freq_list[NUM_CHANNELS] = { 0 };
|
|
|
+ struct hdd_adapter *hdd_adapter = NULL;
|
|
|
|
|
|
config = nla_nest_start(skb, PARAM_ROAM_CONTROL_CONFIG);
|
|
|
if (!config) {
|
|
@@ -5094,7 +5108,54 @@ hdd_roam_control_config_fill_data(struct hdd_context *hdd_ctx, uint8_t vdev_id,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (tb[QCA_ATTR_ROAM_CONTROL_FREQ_LIST_SCHEME]) {
|
|
|
+ hdd_adapter = hdd_get_adapter_by_vdev(hdd_ctx, vdev_id);
|
|
|
+ if (!hdd_adapter) {
|
|
|
+ hdd_info("HDD adapter is NULL");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ hdd_debug("Get roam scan frequencies req received");
|
|
|
+ status = hdd_get_roam_scan_freq(hdd_adapter,
|
|
|
+ hdd_ctx->mac_handle,
|
|
|
+ freq_list, &num_channels);
|
|
|
+ if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
+ hdd_info("failed to get roam scan freq");
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ hdd_debug("num_channels %d", num_channels);
|
|
|
+ get_freq_scheme = nla_nest_start(
|
|
|
+ skb, QCA_ATTR_ROAM_CONTROL_FREQ_LIST_SCHEME);
|
|
|
+ if (!get_freq_scheme) {
|
|
|
+ hdd_info("failed to nest start for roam scan freq");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nla_put_u32(skb, PARAM_SCAN_FREQ_LIST_TYPE, 0)) {
|
|
|
+ hdd_info("failed to put list type");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ get_freq = nla_nest_start(
|
|
|
+ skb, QCA_ATTR_ROAM_CONTROL_SCAN_FREQ_LIST);
|
|
|
+ if (!get_freq) {
|
|
|
+ hdd_info("failed to nest start for roam scan freq");
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (i = 0; i < num_channels; i++) {
|
|
|
+ if (nla_put_u32(skb, PARAM_SCAN_FREQ_LIST,
|
|
|
+ freq_list[i])) {
|
|
|
+ hdd_info("failed to put freq at index %d", i);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ nla_nest_end(skb, get_freq);
|
|
|
+ nla_nest_end(skb, get_freq_scheme);
|
|
|
+ }
|
|
|
nla_nest_end(skb, config);
|
|
|
+
|
|
|
out:
|
|
|
return qdf_status_to_os_return(status);
|
|
|
}
|