Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 309ff81b authored by Abhinav Kumar's avatar Abhinav Kumar Committed by snandini
Browse files

qcacmn: Extract roam message information

Extract btm response and initial roaming stats coming
from FW through WMI_ROAM_STATS_EVENTID event as
wmi_roam_msg_info_tlv_param.

Change-Id: I9a9b768d09a45ba70066cacb4aa420a90a39a76d
Crs-Fixed: 2826323
parent 42eff2c4
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -636,6 +636,18 @@ QDF_STATUS
wmi_unified_extract_roam_11kv_stats(wmi_unified_t wmi, void *evt_buf,
				    struct wmi_neighbor_report_data *dst,
				    uint8_t idx, uint8_t rpt_idx);
/**
 * wmi_unified_extract_roam_msg_info() - Extract Roam msg stats
 * @wmi:       wmi handle
 * @evt_buf:   Pointer to the event buffer
 * @dst:       Pointer to destination structure to fill data
 * @idx:       TLV id
 *
 * Return: QDF_STATUS
 */
QDF_STATUS
wmi_unified_extract_roam_msg_info(wmi_unified_t wmi, void *evt_buf,
				   struct wmi_roam_msg_info *dst, uint8_t idx);

/**
 * wmi_unified_vdev_create_send() - send VDEV create command to fw
+19 −0
Original line number Diff line number Diff line
@@ -7723,6 +7723,25 @@ struct wmi_neighbor_report_data {
	uint32_t freq[MAX_ROAM_SCAN_CHAN];
};

/**
 * struct wmi_roam_msg_info - Roam message related information
 * @present:    Flag to check if the roam msg info tlv is present
 * @timestamp:  Timestamp is the absolute time w.r.t host timer which is
 * synchronized between the host and target
 * @msg_id:     Message ID from WMI_ROAM_MSG_ID
 * @msg_param1: msg_param1, values is based on the host & FW
 * understanding and depend on the msg ID
 * @msg_param2: msg_param2 value is based on the host & FW understanding
 * and depend on the msg ID
 */
struct wmi_roam_msg_info {
	bool present;
	uint32_t timestamp;
	uint32_t msg_id;
	uint32_t msg_param1;
	uint32_t msg_param2;
};

/**
 * struct wmi_roam_trigger_info() - Roam trigger related details
 * @present:            Flag to check if the roam_trigger_info tlv is present
+3 −0
Original line number Diff line number Diff line
@@ -2009,6 +2009,9 @@ QDF_STATUS
			   void *evt_buf,
			   struct wmi_neighbor_report_data *dst,
			   uint8_t idx, uint8_t rpt_idx);
QDF_STATUS
(*extract_roam_msg_info)(wmi_unified_t wmi_handle, void *evt_buf,
			struct wmi_roam_msg_info *dst, uint8_t idx);

void (*wmi_pdev_id_conversion_enable)(wmi_unified_t wmi_handle,
				      uint32_t *pdev_map,
+10 −0
Original line number Diff line number Diff line
@@ -3124,6 +3124,16 @@ wmi_unified_extract_roam_11kv_stats(wmi_unified_t wmi, void *evt_buf,
	return QDF_STATUS_E_FAILURE;
}

QDF_STATUS
wmi_unified_extract_roam_msg_info(wmi_unified_t wmi, void *evt_buf,
				   struct wmi_roam_msg_info *dst, uint8_t idx)
{
	if (wmi->ops->extract_roam_msg_info)
		return wmi->ops->extract_roam_msg_info(wmi, evt_buf, dst, idx);

	return QDF_STATUS_E_FAILURE;
}

#ifdef FEATURE_WLAN_TIME_SYNC_FTM
QDF_STATUS wmi_unified_send_wlan_time_sync_ftm_trigger(wmi_unified_t wmi_handle,
						       uint32_t vdev_id,
+45 −0
Original line number Diff line number Diff line
@@ -13046,6 +13046,42 @@ extract_roam_11kv_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,

	return QDF_STATUS_SUCCESS;
}

/**
 * extract_roam_msg_info_tlv() - Extract the roam message info
 * from the WMI_ROAM_STATS_EVENTID
 * @wmi_handle: wmi handle
 * @evt_buf:    Pointer to the event buffer
 * @dst:        Pointer to destination structure to fill data
 * @idx:        TLV id
 */
static QDF_STATUS
extract_roam_msg_info_tlv(wmi_unified_t wmi_handle, void *evt_buf,
			  struct wmi_roam_msg_info *dst, uint8_t idx)
{
	WMI_ROAM_STATS_EVENTID_param_tlvs *param_buf;
	wmi_roam_msg_info *src_data = NULL;

	param_buf = (WMI_ROAM_STATS_EVENTID_param_tlvs *)evt_buf;

	if (!param_buf || !param_buf->roam_msg_info ||
	    !param_buf->num_roam_msg_info ||
	    idx >= param_buf->num_roam_msg_info) {
		wmi_debug("Empty roam_msg_info param buf");
		return QDF_STATUS_SUCCESS;
	}

	src_data = &param_buf->roam_msg_info[idx];

	dst->present = true;
	dst->timestamp = src_data->timestamp;
	dst->msg_id = src_data->msg_id;
	dst->msg_param1 = src_data->msg_param1;
	dst->msg_param2 = src_data->msg_param2;

	return QDF_STATUS_SUCCESS;
}

#else
static inline QDF_STATUS
extract_roam_trigger_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
@@ -13076,6 +13112,14 @@ extract_roam_scan_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
{
	return QDF_STATUS_E_NOSUPPORT;
}

static inline QDF_STATUS
extract_roam_msg_info_tlv(wmi_unified_t wmi_handle, void *evt_buf,
			  struct wmi_roam_msg_info *dst, uint8_t idx)
{
	return QDF_STATUS_E_NOSUPPORT;
}

#endif

#ifdef FEATURE_WLAN_TIME_SYNC_FTM
@@ -13538,6 +13582,7 @@ struct wmi_ops tlv_ops = {
	.extract_roam_scan_stats = extract_roam_scan_stats_tlv,
	.extract_roam_result_stats = extract_roam_result_stats_tlv,
	.extract_roam_11kv_stats = extract_roam_11kv_stats_tlv,
	.extract_roam_msg_info = extract_roam_msg_info_tlv,

#ifdef FEATURE_WLAN_TIME_SYNC_FTM
	.send_wlan_time_sync_ftm_trigger_cmd = send_wlan_ts_ftm_trigger_cmd_tlv,