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

Commit 2cc651c5 authored by Liangwei Dong's avatar Liangwei Dong
Browse files

qcacld-3.0: Add INI to configure MGMT frame HW retry count

Add INI - mgmt_frame_hw_tx_retry_count to configure MGMT
frame HW tx retry count for certain frame types.
The INI String format:
mgmt_frame_hw_tx_retry_count="<frame type>,<retry count>,..."

The supported frame types are defined by enum mlme_cfg_frame_type.
Retry count max value is 127.
For example:
mgmt_frame_hw_tx_retry_count="0,64,2,32"
The above input string means:
For p2p go negotiation request fame, hw retry count 64
For p2p provision discovery request, hw retry count 32

Change-Id: I32f6c7d83ede9b28484c7a0b29824bde32e06422
CRs-Fixed: 3082532
parent aa683667
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
@@ -374,6 +374,49 @@ mlme_init_lpass_support_cfg(struct wlan_objmgr_psoc *psoc,
}
#endif

/**
 * mlme_init_mgmt_hw_tx_retry_count_cfg() - initialize mgmt hw tx retry count
 * @psoc: Pointer to PSOC
 * @gen: pointer to generic CFG items
 *
 * Return: None
 */
static void mlme_init_mgmt_hw_tx_retry_count_cfg(
			struct wlan_objmgr_psoc *psoc,
			struct wlan_mlme_generic *gen)
{
	uint32_t i;
	qdf_size_t out_size = 0;
	uint8_t count_array[MGMT_FRM_HW_TX_RETRY_COUNT_STR_LEN];

	qdf_uint8_array_parse(cfg_get(psoc, CFG_MGMT_FRAME_HW_TX_RETRY_COUNT),
			      count_array,
			      MGMT_FRM_HW_TX_RETRY_COUNT_STR_LEN,
			      &out_size);

	for (i = 0; i + 1 < out_size; i += 2) {
		if (count_array[i] >= CFG_FRAME_TYPE_MAX) {
			mlme_legacy_debug("invalid frm type %d",
					  count_array[i]);
			continue;
		}
		if (count_array[i + 1] >= MAX_MGMT_HW_TX_RETRY_COUNT) {
			mlme_legacy_debug("mgmt hw tx retry count %d for frm %d, limit to %d",
					  count_array[i + 1],
					  count_array[i],
					  MAX_MGMT_HW_TX_RETRY_COUNT);
			gen->mgmt_hw_tx_retry_count[count_array[i]] =
						MAX_MGMT_HW_TX_RETRY_COUNT;
		} else {
			mlme_legacy_debug("mgmt hw tx retry count %d for frm %d",
					  count_array[i + 1],
					  count_array[i]);
			gen->mgmt_hw_tx_retry_count[count_array[i]] =
							count_array[i + 1];
		}
	}
}

static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
				  struct wlan_mlme_generic *gen)
{
@@ -438,6 +481,7 @@ static void mlme_init_generic_cfg(struct wlan_objmgr_psoc *psoc,
	gen->monitor_mode_concurrency =
		cfg_get(psoc, CFG_MONITOR_MODE_CONCURRENCY);
	gen->tx_retry_multiplier = cfg_get(psoc, CFG_TX_RETRY_MULTIPLIER);
	mlme_init_mgmt_hw_tx_retry_count_cfg(psoc, gen);
}

static void mlme_init_edca_ani_cfg(struct wlan_objmgr_psoc *psoc,
+36 −1
Original line number Diff line number Diff line
@@ -879,6 +879,40 @@ enum monitor_mode_concurrency {
	CFG_VALUE_OR_DEFAULT, \
	"percentage of max retry limit")

/*
 * <ini>
 * mgmt_frame_hw_tx_retry_count - Set hw tx retry count for mgmt action
 * frame
 * @Min: N/A
 * @Max: N/A
 * @Default: N/A
 *
 * Set mgmt action frame hw tx retry count, string format looks like below:
 * frame_hw_tx_retry_count="<frame type>,<retry count>,..."
 * frame type is enum value of mlme_cfg_frame_type.
 * Retry count max value is 127.
 * For example:
 * frame_hw_tx_retry_count="0,64,2,32"
 * The above input string means:
 * For p2p go negotiation request fame, hw retry count 64
 * For p2p provision discovery request, hw retry count 32
 *
 * Related: None.
 *
 * Supported Feature: STA/P2P
 *
 * Usage: External
 *
 * </ini>
 */
#define MGMT_FRM_HW_TX_RETRY_COUNT_STR_LEN  (64)
#define CFG_MGMT_FRAME_HW_TX_RETRY_COUNT CFG_INI_STRING( \
		"mgmt_frame_hw_tx_retry_count", \
		0, \
		MGMT_FRM_HW_TX_RETRY_COUNT_STR_LEN, \
		"", \
		"Set mgmt action frame hw tx retry count")

#define CFG_GENERIC_ALL \
	CFG(CFG_ENABLE_DEBUG_PACKET_LOG) \
	CFG(CFG_PMF_SA_QUERY_MAX_RETRIES) \
@@ -914,5 +948,6 @@ enum monitor_mode_concurrency {
	CFG(CFG_SAE_CONNECION_RETRIES) \
	CFG(CFG_WLS_6GHZ_CAPABLE) \
	CFG(CFG_MONITOR_MODE_CONCURRENCY)\
	CFG(CFG_TX_RETRY_MULTIPLIER)
	CFG(CFG_TX_RETRY_MULTIPLIER) \
	CFG(CFG_MGMT_FRAME_HW_TX_RETRY_COUNT)
#endif /* __CFG_MLME_GENERIC_H */
+12 −0
Original line number Diff line number Diff line
@@ -3196,6 +3196,18 @@ QDF_STATUS mlme_set_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 */
bool mlme_get_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);

/**
 * wlan_mlme_get_mgmt_hw_tx_retry_count() - Get mgmt frame hw tx retry count
 *
 * @psoc: pointer to psoc object
 * @frm_type: frame type of the query
 *
 * Return: hw tx retry count
 */
uint8_t
wlan_mlme_get_mgmt_hw_tx_retry_count(struct wlan_objmgr_psoc *psoc,
				     enum mlme_cfg_frame_type frm_type);

/**
 * wlan_mlme_get_tx_retry_multiplier() - Get the tx retry multiplier percentage
 *
+17 −0
Original line number Diff line number Diff line
@@ -1186,6 +1186,21 @@ struct wlan_mlme_ratemask {
	uint32_t higher32_2;
};

/**
 * enum mlme_cfg_frame_type  - frame type to configure mgmt hw tx retry count
 * @CFG_GO_NEGOTIATION_REQ_FRAME_TYPE: p2p go negotiation request fame
 * @CFG_P2P_INVITATION_REQ_FRAME_TYPE: p2p invitation request frame
 * @CFG_PROVISION_DISCOVERY_REQ_FRAME_TYPE: p2p provision discovery request
 */
enum mlme_cfg_frame_type {
	CFG_GO_NEGOTIATION_REQ_FRAME_TYPE = 0,
	CFG_P2P_INVITATION_REQ_FRAME_TYPE = 1,
	CFG_PROVISION_DISCOVERY_REQ_FRAME_TYPE = 2,
	CFG_FRAME_TYPE_MAX,
};

#define MAX_MGMT_HW_TX_RETRY_COUNT 127

/* struct wlan_mlme_generic - Generic CFG config items
 *
 * @band_capability: HW Band Capability - Both or 2.4G only or 5G only
@@ -1234,6 +1249,7 @@ struct wlan_mlme_ratemask {
 * @monitor_mode_concurrency: Monitor mode concurrency supported
 * @ocv_support: FW supports OCV or not
 * @tx_retry_multiplier: TX xretry extension parameter
 * @mgmt_hw_tx_retry_count: MGMT HW tx retry count for frames
 */
struct wlan_mlme_generic {
	uint32_t band_capability;
@@ -1279,6 +1295,7 @@ struct wlan_mlme_generic {
	enum monitor_mode_concurrency monitor_mode_concurrency;
	bool ocv_support;
	uint32_t tx_retry_multiplier;
	uint8_t mgmt_hw_tx_retry_count[CFG_FRAME_TYPE_MAX];
};

/*
+17 −0
Original line number Diff line number Diff line
@@ -4956,6 +4956,23 @@ bool mlme_get_user_ps(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
	return usr_ps_enable;
}

uint8_t
wlan_mlme_get_mgmt_hw_tx_retry_count(struct wlan_objmgr_psoc *psoc,
				     enum mlme_cfg_frame_type frm_type)
{
	struct wlan_mlme_psoc_ext_obj *mlme_obj;

	mlme_obj = mlme_get_psoc_ext_obj(psoc);

	if (!mlme_obj)
		return 0;

	if (frm_type >= CFG_FRAME_TYPE_MAX)
		return 0;

	return mlme_obj->cfg.gen.mgmt_hw_tx_retry_count[frm_type];
}

QDF_STATUS
wlan_mlme_get_tx_retry_multiplier(struct wlan_objmgr_psoc *psoc,
				  uint32_t *tx_retry_multiplier)
Loading