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

Commit 39425f6b authored by Jyoti Kumari's avatar Jyoti Kumari
Browse files

qcacmn: Add TWT service bit capability support for ack event

Add TWT service bit capability support to check whether firmware
supports ack event or not. If firmware does not support ack event
then service bit capability will become 0 and whenever TWT
command comes, host will not wait for ack event and sends command
in a legacy way.

This support is mainly added to handle new host and old firmware
combination.

Change-Id: I55d373c2e017130b58a4b332da16f0eda8f34eba
CRs-Fixed: 2987749
parent ddeb8d8c
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -2549,4 +2549,40 @@ static inline void target_psoc_get_mu_max_users(
 */
void target_if_set_reg_cc_ext_supp(struct target_psoc_info *tgt_hdl,
				   struct wlan_objmgr_psoc *psoc);

/**
 * target_psoc_set_twt_ack_cap() - Set twt ack capability
 *
 * @psoc_info: Pointer to struct target_psoc_info.
 * @val: twt ack cap value
 *
 * Return: None
 *
 */
static inline
void target_psoc_set_twt_ack_cap(struct target_psoc_info *psoc_info, bool val)
{
	if (!psoc_info)
		return;

	psoc_info->info.service_ext2_param.twt_ack_support_cap = val;
}

/**
 * target_psoc_get_twt_ack_cap() - Get twt ack capability
 *
 * @psoc_info: Pointer to struct target_psoc_info.
 * @val: twt ack cap value
 *
 * Return: None
 *
 */
static inline
void target_psoc_get_twt_ack_cap(struct target_psoc_info *psoc_info, bool *val)
{
	if (!psoc_info)
		return;

	*val = psoc_info->info.service_ext2_param.twt_ack_support_cap;
}
#endif
+2 −0
Original line number Diff line number Diff line
@@ -404,6 +404,7 @@ struct wlan_psoc_host_service_ext_param {
 * @max_users_ul_ofdma: Max number of users per-PPDU for Uplink OFDMA
 * @max_users_dl_mumimo: Max number of users per-PPDU for Downlink MU-MIMO
 * @max_users_ul_mumimo: Max number of users per-PPDU for Uplink MU-MIMO
 * @twt_ack_support_cap: TWT ack capability support
 */
struct wlan_psoc_host_service_ext2_param {
	uint8_t reg_db_version_major;
@@ -419,6 +420,7 @@ struct wlan_psoc_host_service_ext2_param {
	uint16_t max_users_ul_ofdma;
	uint16_t max_users_dl_mumimo;
	uint16_t max_users_ul_mumimo;
	uint32_t twt_ack_support_cap:1;
};

#endif /* _SERVICE_READY_PARAM_H_*/
+26 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
 *
 * Permission to use, copy, modify, and/or distribute this software for
 * any purpose with or without fee is hereby granted, provided that the
@@ -304,6 +304,31 @@ int init_deinit_populate_scan_radio_cap_ext2(wmi_unified_t handle,
					     uint8_t *event,
					     struct tgt_info *info);

#ifdef WLAN_SUPPORT_TWT
/**
 * init_deinit_populate_twt_cap_ext2() - populate twt capabilities from service
 * ready ext2 event
 * @psoc: PSOC object
 * @handle: WMI handle pointer
 * @event: event buffer received from FW
 * @info: tgt_info object
 *
 * API to populate twt capability from service ready ext2 event.
 * Return: zero on successful population of twt capability or failure
 */
int init_deinit_populate_twt_cap_ext2(struct wlan_objmgr_psoc *psoc,
				      wmi_unified_t handle, uint8_t *event,
				      struct tgt_info *info);
#else
static inline
int init_deinit_populate_twt_cap_ext2(struct wlan_objmgr_psoc *psoc,
				      wmi_unified_t handle, uint8_t *event,
				      struct tgt_info *info)
{
	return 0;
}
#endif

/**
 * init_deinit_validate_160_80p80_fw_caps() - validate 160 80p80 fw caps
 * @psoc: PSOC object
+6 −0
Original line number Diff line number Diff line
@@ -312,6 +312,12 @@ static int init_deinit_service_ext2_ready_event_handler(ol_scn_t scn_handle,
		goto exit;
	}

	err_code = init_deinit_populate_twt_cap_ext2(psoc, wmi_handle, event,
						     info);

	if (err_code)
		target_if_debug("failed to populate twt cap ext2");

	target_if_regulatory_set_ext_tpc(psoc);

	target_if_reg_set_lower_6g_edge_ch_info(psoc);
+25 −0
Original line number Diff line number Diff line
@@ -535,6 +535,31 @@ int init_deinit_populate_spectral_bin_scale_params(
	return qdf_status_to_os_return(status);
}

#ifdef WLAN_SUPPORT_TWT
int init_deinit_populate_twt_cap_ext2(struct wlan_objmgr_psoc *psoc,
				      wmi_unified_t handle, uint8_t *event,
				      struct tgt_info *info)
{
	struct wmi_twt_cap_bitmap_params param;
	struct target_psoc_info *psoc_info;
	QDF_STATUS status = QDF_STATUS_SUCCESS;

	status = wmi_extract_twt_cap_service_ready_ext2(handle, event,
							&param);
	if (QDF_IS_STATUS_ERROR(status)) {
		target_if_err("Extraction of twt capability failed");
		goto exit;
	}

	psoc_info = wlan_psoc_get_tgt_if_handle(psoc);

	target_psoc_set_twt_ack_cap(psoc_info, param.twt_ack_support_cap);

exit:
	return qdf_status_to_os_return(status);
}
#endif

QDF_STATUS init_deinit_dbr_ring_cap_free(
		struct target_psoc_info *tgt_psoc_info)
{
Loading