浏览代码

qcacmn: Changes for PER based roaming

DUT should be able to roam to a better access point if current
AP is having congestion/packet error.

This roam also devise a new selection logic for candidate
selection which considers channel congestion and AP capabilities.

Change-Id: I6cffbf0de059a218e971be32fbdc1a0092ceea9d
CRs-Fixed: 1090934
Kapil Gupta 8 年之前
父节点
当前提交
54ea36ef41
共有 2 个文件被更改,包括 78 次插入0 次删除
  1. 12 0
      wmi_unified_api.c
  2. 66 0
      wmi_unified_tlv.c

+ 12 - 0
wmi_unified_api.c

@@ -3205,6 +3205,18 @@ QDF_STATUS wmi_unified_roam_scan_offload_rssi_change_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
+QDF_STATUS wmi_unified_set_per_roam_config(void *wmi_hdl,
+		struct wmi_per_roam_config_req *req_buf)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
+
+	if (wmi_handle->ops->send_per_roam_config_cmd)
+		return wmi_handle->ops->send_per_roam_config_cmd(wmi_handle,
+				req_buf);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
 /**
  * wmi_unified_get_buf_extscan_hotlist_cmd() - prepare hotlist command
  * @wmi_hdl: wmi handle

+ 66 - 0
wmi_unified_tlv.c

@@ -13123,6 +13123,71 @@ error:
 	return status;
 }
 
+/**
+ * send_per_roam_config_cmd_tlv() - set per roaming config to FW
+ * @wmi_handle: wmi handle
+ * @req_buf: per roam config buffer
+ *
+ * Return: QDF status
+ */
+static QDF_STATUS send_per_roam_config_cmd_tlv(wmi_unified_t wmi_handle,
+		struct wmi_per_roam_config_req *req_buf)
+{
+	wmi_buf_t buf = NULL;
+	QDF_STATUS status;
+	int len;
+	uint8_t *buf_ptr;
+	wmi_roam_per_config_fixed_param *wmi_per_config;
+
+	len = sizeof(wmi_roam_per_config_fixed_param);
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf) {
+		WMI_LOGE("%s : wmi_buf_alloc failed", __func__);
+		return QDF_STATUS_E_NOMEM;
+	}
+
+	buf_ptr = (uint8_t *) wmi_buf_data(buf);
+	wmi_per_config =
+		(wmi_roam_per_config_fixed_param *) buf_ptr;
+	WMITLV_SET_HDR(&wmi_per_config->tlv_header,
+			WMITLV_TAG_STRUC_wmi_roam_per_config_fixed_param,
+			WMITLV_GET_STRUCT_TLVLEN
+			(wmi_roam_per_config_fixed_param));
+
+	/* fill in per roam config values */
+	wmi_per_config->vdev_id = req_buf->vdev_id;
+	if (req_buf->per_config.enable) {
+		/* Enable for both Tx and Rx*/
+		req_buf->per_config.enable = 3;
+	}
+
+	wmi_per_config->enable = req_buf->per_config.enable;
+	wmi_per_config->high_rate_thresh =
+		(req_buf->per_config.tx_high_rate_thresh << 16) |
+		(req_buf->per_config.rx_high_rate_thresh & 0x0000ffff);
+	wmi_per_config->low_rate_thresh =
+		(req_buf->per_config.tx_low_rate_thresh << 16) |
+		(req_buf->per_config.rx_low_rate_thresh & 0x0000ffff);
+	wmi_per_config->pkt_err_rate_thresh_pct =
+		(req_buf->per_config.tx_rate_thresh_percnt << 16) |
+		(req_buf->per_config.rx_rate_thresh_percnt & 0x0000ffff);
+	wmi_per_config->per_rest_time = req_buf->per_config.per_rest_time;
+
+	/* Send per roam config parameters */
+	status = wmi_unified_cmd_send(wmi_handle, buf,
+			len, WMI_ROAM_PER_CONFIG_CMDID);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		WMI_LOGE("WMI_ROAM_PER_CONFIG_CMDID failed, Error %d",
+				status);
+		wmi_buf_free(buf);
+		return status;
+	}
+
+	WMI_LOGI(FL("per roam enable=%d, vdev=%d"),
+			req_buf->per_config.enable, req_buf->vdev_id);
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * send_roam_scan_offload_rssi_change_cmd_tlv() - set roam offload RSSI th
  * @wmi_handle: wmi handle
@@ -15919,6 +15984,7 @@ struct wmi_ops tlv_ops =  {
 	.extract_peer_sta_ps_statechange_ev =
 		extract_peer_sta_ps_statechange_ev_tlv,
 	.extract_inst_rssi_stats_event = extract_inst_rssi_stats_event_tlv,
+	.send_per_roam_config_cmd = send_per_roam_config_cmd_tlv,
 };
 
 #ifndef CONFIG_MCL