|
@@ -13067,6 +13067,80 @@ static QDF_STATUS send_wlan_ts_qtime_cmd_tlv(wmi_unified_t wmi,
|
|
|
|
|
|
return QDF_STATUS_SUCCESS;
|
|
|
}
|
|
|
+
|
|
|
+static QDF_STATUS extract_time_sync_ftm_start_stop_event_tlv(
|
|
|
+ wmi_unified_t wmi, void *buf,
|
|
|
+ struct ftm_time_sync_start_stop_params *param)
|
|
|
+{
|
|
|
+ WMI_VDEV_AUDIO_SYNC_START_STOP_EVENTID_param_tlvs *param_buf;
|
|
|
+ wmi_audio_sync_start_stop_event_fixed_param *resp_event;
|
|
|
+
|
|
|
+ param_buf = (WMI_VDEV_AUDIO_SYNC_START_STOP_EVENTID_param_tlvs *)buf;
|
|
|
+ if (!param_buf) {
|
|
|
+ WMI_LOGE("Invalid audio sync start stop event buffer");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ resp_event = param_buf->fixed_param;
|
|
|
+ if (!resp_event) {
|
|
|
+ WMI_LOGE("Invalid audio sync start stop fixed param buffer");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ param->vdev_id = resp_event->vdev_id;
|
|
|
+ param->timer_interval = resp_event->periodicity;
|
|
|
+ param->num_reads = resp_event->reads_needed;
|
|
|
+ param->qtime = ((uint64_t)resp_event->qtimer_u32 << 32) |
|
|
|
+ resp_event->qtimer_l32;
|
|
|
+ param->mac_time = ((uint64_t)resp_event->mac_timer_u32 << 32) |
|
|
|
+ resp_event->mac_timer_l32;
|
|
|
+
|
|
|
+ WMI_LOGI("%s: FTM time sync time_interval %d, num_reads %d", __func__,
|
|
|
+ param->timer_interval, param->num_reads);
|
|
|
+
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
+
|
|
|
+static QDF_STATUS
|
|
|
+extract_time_sync_ftm_offset_event_tlv(wmi_unified_t wmi, void *buf,
|
|
|
+ struct ftm_time_sync_offset *param)
|
|
|
+{
|
|
|
+ WMI_VDEV_AUDIO_SYNC_Q_MASTER_SLAVE_OFFSET_EVENTID_param_tlvs *param_buf;
|
|
|
+ wmi_audio_sync_q_master_slave_offset_event_fixed_param *resp_event;
|
|
|
+ wmi_audio_sync_q_master_slave_times *q_pair;
|
|
|
+ int iter;
|
|
|
+
|
|
|
+ param_buf =
|
|
|
+ (WMI_VDEV_AUDIO_SYNC_Q_MASTER_SLAVE_OFFSET_EVENTID_param_tlvs *)buf;
|
|
|
+ if (!param_buf) {
|
|
|
+ WMI_LOGE("Invalid timesync ftm offset event buffer");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ resp_event = param_buf->fixed_param;
|
|
|
+ if (!resp_event) {
|
|
|
+ WMI_LOGE("Invalid timesync ftm offset fixed param buffer");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ param->vdev_id = resp_event->vdev_id;
|
|
|
+ param->num_qtime = param_buf->num_audio_sync_q_master_slave_times;
|
|
|
+ q_pair = param_buf->audio_sync_q_master_slave_times;
|
|
|
+ if (!q_pair) {
|
|
|
+ WMI_LOGE("Invalid q_master_slave_times buffer");
|
|
|
+ return QDF_STATUS_E_FAILURE;
|
|
|
+ }
|
|
|
+
|
|
|
+ for (iter = 0; iter < param->num_qtime; iter++) {
|
|
|
+ param->pairs[iter].qtime_master = (
|
|
|
+ (uint64_t)q_pair[iter].qmaster_u32 << 32) |
|
|
|
+ q_pair[iter].qmaster_l32;
|
|
|
+ param->pairs[iter].qtime_slave = (
|
|
|
+ (uint64_t)q_pair[iter].qslave_u32 << 32) |
|
|
|
+ q_pair[iter].qslave_l32;
|
|
|
+ }
|
|
|
+ return QDF_STATUS_SUCCESS;
|
|
|
+}
|
|
|
#endif /* FEATURE_WLAN_TIME_SYNC_FTM */
|
|
|
|
|
|
struct wmi_ops tlv_ops = {
|
|
@@ -13387,6 +13461,10 @@ struct wmi_ops tlv_ops = {
|
|
|
#ifdef FEATURE_WLAN_TIME_SYNC_FTM
|
|
|
.send_wlan_time_sync_ftm_trigger_cmd = send_wlan_ts_ftm_trigger_cmd_tlv,
|
|
|
.send_wlan_ts_qtime_cmd = send_wlan_ts_qtime_cmd_tlv,
|
|
|
+ .extract_time_sync_ftm_start_stop_event =
|
|
|
+ extract_time_sync_ftm_start_stop_event_tlv,
|
|
|
+ .extract_time_sync_ftm_offset_event =
|
|
|
+ extract_time_sync_ftm_offset_event_tlv,
|
|
|
#endif /* FEATURE_WLAN_TIME_SYNC_FTM */
|
|
|
};
|
|
|
|