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

Commit 94b85dec authored by Jyoti Kumari's avatar Jyoti Kumari Committed by Gerrit - the friendly Code Review server
Browse files

qcacmn: Add support for TWT ack event

In case if TWT command (i.e setup, terminate, pause, resume,
nudge) comes from userspace and if the firmware is in below mode
1. scan in progress
2. roam in progress
3. CSA is in progress or
4. Any other error
then the command needs to be rejected in userspace context.

Synchronize the TWT command so that whenever command goes from
driver to firmware, then driver will receive ack event first
followed by respective event (i.e add dialog, delete dialog,
pause, resume, nudge) with below condition
1. If driver receives the ack event as successful then driver
   waits for this ack event, respective event with status of the
   TWT action frame over the air is expected.
2. If driver receives the ack event as failure then it will
   rejects the TWT command in userspace context.

Change-Id: Ie885d98ecf2dad98d34676d889fd70e4c84f0a05
CRs-Fixed: 2987904
parent 8fd69cb2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4631,6 +4631,7 @@ typedef enum {
	wmi_twt_nudge_dialog_complete_event_id,
	wmi_twt_session_stats_event_id,
	wmi_twt_notify_event_id,
	wmi_twt_ack_complete_event_id,
#endif
	wmi_apf_get_vdev_work_memory_resp_event_id,
	wmi_roam_scan_stats_event_id,
+3 −0
Original line number Diff line number Diff line
@@ -2271,6 +2271,9 @@ QDF_STATUS (*extract_twt_resume_dialog_comp_event)(wmi_unified_t wmi_handle,
QDF_STATUS (*extract_twt_notify_event)(wmi_unified_t wmi_handle,
		uint8_t *evt_buf,
		struct wmi_twt_notify_event_param *params);
QDF_STATUS (*extract_twt_ack_comp_event)(wmi_unified_t wmi_handle,
		uint8_t *evt_buf,
		struct wmi_twt_ack_complete_event_param *params);
#ifdef WLAN_SUPPORT_BCAST_TWT
QDF_STATUS (*extract_twt_btwt_invite_sta_comp_event)(wmi_unified_t wmi_handle,
		uint8_t *evt_buf,
+14 −0
Original line number Diff line number Diff line
@@ -341,4 +341,18 @@ QDF_STATUS wmi_extract_twt_cap_service_ready_ext2(
			uint8_t *evt_buf,
			struct wmi_twt_cap_bitmap_params *params);

/**
 * wmi_extract_twt_ack_comp_event() - Extract WMI event params for TWT ack event
 *
 * @wmi_handle: wmi handle
 * @evt_buf: Pointer event buffer
 * @params: Parameters to extract
 *
 * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
 */
QDF_STATUS wmi_extract_twt_ack_comp_event(
			wmi_unified_t wmi_handle,
			uint8_t *evt_buf,
			struct wmi_twt_ack_complete_event_param *param);

#endif /* _WMI_UNIFIED_TWT_API_H_ */
+33 −0
Original line number Diff line number Diff line
@@ -161,6 +161,22 @@ struct wmi_twt_disable_complete_event {
	uint32_t pdev_id;
};

/**
 * wmi_twt_ack_complete_event_param:
 * @vdev_id: vdev id
 * @peer_macaddr: peer mac address
 * @dialog_id: dialog id
 * @twt_cmd_ack: ack event to the corresponding twt command
 * @status: twt command status
 */
struct wmi_twt_ack_complete_event_param {
	uint32_t vdev_id;
	struct qdf_mac_addr peer_macaddr;
	uint32_t dialog_id;
	uint32_t twt_cmd_ack;
	uint32_t status;
};

/* TWT event types
 *  refer to wmi_unified.h enum wmi_twt_session_stats_type
 */
@@ -762,4 +778,21 @@ struct wmi_twt_btwt_remove_sta_complete_event_param {
};
#endif

/**
 * enum WMI_HOST_TWT_CMD_FOR_ACK_EVENT - Ack event for different TWT command
 * WMI_HOST_TWT_ADD_DIALOG_CMDID: Ack event for add dialog command
 * WMI_HOST_TWT_DEL_DIALOG_CMDID: Ack event for delete dialog command
 * WMI_HOST_TWT_PAUSE_DIALOG_CMDID: Ack event for pause command
 * WMI_HOST_TWT_RESUME_DIALOG_CMDID: Ack event for resume command
 * WMI_HOST_TWT_NUDGE_DIALOG_CMDID: Ack event for nudge command
 * WMI_HOST_TWT_UNKNOWN_CMDID: Ack event for unknown TWT command
 */
enum WMI_HOST_TWT_CMD_FOR_ACK_EVENT {
	WMI_HOST_TWT_ADD_DIALOG_CMDID = 0,
	WMI_HOST_TWT_DEL_DIALOG_CMDID,
	WMI_HOST_TWT_PAUSE_DIALOG_CMDID,
	WMI_HOST_TWT_RESUME_DIALOG_CMDID,
	WMI_HOST_TWT_NUDGE_DIALOG_CMDID,
	WMI_HOST_TWT_UNKNOWN_CMDID,
};
#endif /* _WMI_UNIFIED_TWT_PARAM_H_ */
+2 −0
Original line number Diff line number Diff line
@@ -15259,6 +15259,8 @@ static void populate_tlv_events_id(uint32_t *event_ids)
		WMI_TWT_SESSION_STATS_EVENTID;
	event_ids[wmi_twt_notify_event_id] =
		WMI_TWT_NOTIFY_EVENTID;
	event_ids[wmi_twt_ack_complete_event_id] =
		WMI_TWT_ACK_EVENTID;
#endif
	event_ids[wmi_apf_get_vdev_work_memory_resp_event_id] =
		WMI_BPF_GET_VDEV_WORK_MEMORY_RESP_EVENTID;
Loading