Browse Source

qcacmn: Add support for custom aggr size cmd and rate dropdown vdev param

Add support for configuring aggregate size for A-MSDU and A-MPDU
aggregations.

Add support for rate dropdown vdev param to dropdown rates for SU, MU
and MGMT packets.

Change-Id: I033693e1c21c05d06acd7df36eac580be19fe20b
CRs-Fixed: 2138655
Acked-by: Aditya Sathish <[email protected]>
Sathish Kumar 7 years ago
parent
commit
fd134e45dd

+ 10 - 0
wmi/inc/wmi_unified_api.h

@@ -1096,6 +1096,16 @@ QDF_STATUS wmi_unified_vdev_set_fwtest_param_cmd_send(void *wmi_hdl,
 QDF_STATUS wmi_unified_vdev_config_ratemask_cmd_send(void *wmi_hdl,
 				struct config_ratemask_params *param);
 
+/**
+ *  wmi_unified_vdev_set_custom_aggr_size_cmd_send() - WMI set custom aggr
+ *						       size command
+ *  @param wmi_hdl      : handle to WMI.
+ *  @param param        : pointer to hold custom aggr size param
+ *
+ *  @return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS wmi_unified_vdev_set_custom_aggr_size_cmd_send(void *wmi_hdl,
+				struct set_custom_aggr_size_params *param);
 
 QDF_STATUS wmi_unified_pdev_set_regdomain_cmd_send(void *wmi_hdl,
 				struct pdev_set_regdomain_params *param);

+ 32 - 0
wmi/inc/wmi_unified_param.h

@@ -3747,6 +3747,37 @@ struct set_fwtest_params {
 	uint32_t value;
 };
 
+/**
+ * struct set_custom_aggr_size_params - custom aggr size params
+ * @vdev_id      : vdev id
+ * @tx_aggr_size : TX aggr size
+ * @rx_aggr_size : RX aggr size
+ * @enable_bitmap: Bitmap for aggr size check
+ */
+struct set_custom_aggr_size_params {
+	uint32_t  vdev_id;
+	uint32_t tx_aggr_size;
+	uint32_t rx_aggr_size;
+	uint32_t ac:2,
+		 aggr_type:1,
+		 tx_aggr_size_disable:1,
+		 rx_aggr_size_disable:1,
+		 tx_ac_enable:1,
+		 reserved:26;
+};
+
+/**
+ * enum wmi_host_custom_aggr_type_t: custon aggregate type
+ * @WMI_HOST_CUSTOM_AGGR_TYPE_AMPDU: A-MPDU aggregation
+ * @WMI_HOST_CUSTOM_AGGR_TYPE_AMSDU: A-MSDU aggregation
+ * @WMI_HOST_CUSTOM_AGGR_TYPE_MAX: Max type
+ */
+enum wmi_host_custom_aggr_type_t {
+	WMI_HOST_CUSTOM_AGGR_TYPE_AMPDU = 0,
+	WMI_HOST_CUSTOM_AGGR_TYPE_AMSDU = 1,
+	WMI_HOST_CUSTOM_AGGR_TYPE_MAX,
+};
+
 /**
  * struct config_ratemask_params - ratemask config parameters
  * @vdev_id: vdev id
@@ -5668,6 +5699,7 @@ typedef enum {
 	wmi_vdev_param_set_heop,
 	wmi_vdev_param_disable_cabq,
 
+	wmi_vdev_param_rate_dropdown_bmap,
 	wmi_vdev_param_max,
 } wmi_conv_vdev_param_id;
 

+ 2 - 0
wmi/inc/wmi_unified_priv.h

@@ -895,6 +895,8 @@ QDF_STATUS (*send_vdev_set_fwtest_param_cmd)(wmi_unified_t wmi_handle,
 QDF_STATUS (*send_vdev_config_ratemask_cmd)(wmi_unified_t wmi_handle,
 		struct config_ratemask_params *param);
 
+QDF_STATUS (*send_vdev_set_custom_aggr_size_cmd)(wmi_unified_t wmi_handle,
+		struct set_custom_aggr_size_params *param);
 
 QDF_STATUS (*send_wow_wakeup_cmd)(wmi_unified_t wmi_handle);
 

+ 19 - 0
wmi/src/wmi_unified_api.c

@@ -4115,6 +4115,25 @@ QDF_STATUS wmi_unified_vdev_config_ratemask_cmd_send(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 
+/**
+ * wmi_unified_vdev_set_custom_aggr_size_cmd_send() - WMI set custom aggr
+ * size function
+ * @param wmi_handle	: handle to WMI
+ * @param param		: pointer to hold custom aggr size param
+ *
+ * @return QDF_STATUS_SUCCESS on success and QDF_STATUS_R_FAILURE for failure
+ */
+QDF_STATUS wmi_unified_vdev_set_custom_aggr_size_cmd_send(void *wmi_hdl,
+				struct set_custom_aggr_size_params *param)
+{
+	wmi_unified_t wmi = (wmi_unified_t)wmi_hdl;
+
+	if (wmi->ops->send_vdev_set_custom_aggr_size_cmd)
+		return wmi->ops->send_vdev_set_custom_aggr_size_cmd(wmi, param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
 /**
  *  wmi_unified_pdev_set_regdomain_params_cmd_send() - WMI set regdomain function
  *  @param wmi_handle      : handle to WMI.

+ 74 - 0
wmi/src/wmi_unified_tlv.c

@@ -10885,6 +10885,76 @@ static QDF_STATUS send_vdev_config_ratemask_cmd_tlv(wmi_unified_t wmi_handle,
 	return QDF_STATUS_SUCCESS;
 }
 
+/**
+ * copy_custom_aggr_bitmap() - copies host side bitmap using FW APIs
+ * @param: param sent from the host side
+ * @cmd: param to be sent to the fw side
+ */
+static inline void copy_custom_aggr_bitmap(
+		struct set_custom_aggr_size_params *param,
+		wmi_vdev_set_custom_aggr_size_cmd_fixed_param *cmd)
+{
+	WMI_VDEV_CUSTOM_AGGR_AC_SET(cmd->enable_bitmap,
+				    param->ac);
+	WMI_VDEV_CUSTOM_AGGR_TYPE_SET(cmd->enable_bitmap,
+				      param->aggr_type);
+	WMI_VDEV_CUSTOM_TX_AGGR_SZ_DIS_SET(cmd->enable_bitmap,
+					   param->tx_aggr_size_disable);
+	WMI_VDEV_CUSTOM_RX_AGGR_SZ_DIS_SET(cmd->enable_bitmap,
+					   param->rx_aggr_size_disable);
+	WMI_VDEV_CUSTOM_TX_AC_EN_SET(cmd->enable_bitmap,
+				     param->tx_ac_enable);
+}
+
+/**
+ * send_vdev_set_custom_aggr_size_cmd_tlv() - custom aggr size param in fw
+ * @wmi_handle: wmi handle
+ * @param: pointer to hold custom aggr size params
+ *
+ *  @return QDF_STATUS_SUCCESS  on success and -ve on failure.
+ */
+static QDF_STATUS send_vdev_set_custom_aggr_size_cmd_tlv(
+			wmi_unified_t wmi_handle,
+			struct set_custom_aggr_size_params *param)
+{
+	wmi_vdev_set_custom_aggr_size_cmd_fixed_param *cmd;
+	wmi_buf_t buf;
+	int32_t len = sizeof(*cmd);
+
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf) {
+		WMI_LOGE("%s:wmi_buf_alloc failed\n", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+	cmd = (wmi_vdev_set_custom_aggr_size_cmd_fixed_param *)
+		wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		WMITLV_TAG_STRUC_wmi_vdev_set_custom_aggr_size_cmd_fixed_param,
+		WMITLV_GET_STRUCT_TLVLEN(
+		wmi_vdev_set_custom_aggr_size_cmd_fixed_param));
+	cmd->vdev_id = param->vdev_id;
+	cmd->tx_aggr_size = param->tx_aggr_size;
+	cmd->rx_aggr_size = param->rx_aggr_size;
+	copy_custom_aggr_bitmap(param, cmd);
+
+	WMI_LOGD("Set custom aggr: vdev id=0x%X, tx aggr size=0x%X "
+		"rx_aggr_size=0x%X access category=0x%X, agg_type=0x%X "
+		"tx_aggr_size_disable=0x%X, rx_aggr_size_disable=0x%X "
+		"tx_ac_enable=0x%X\n",
+		param->vdev_id, param->tx_aggr_size, param->rx_aggr_size,
+		param->ac, param->aggr_type, param->tx_aggr_size_disable,
+		param->rx_aggr_size_disable, param->tx_ac_enable);
+
+	if (wmi_unified_cmd_send(wmi_handle, buf, len,
+				 WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID)) {
+		WMI_LOGE("Seting custom aggregation size failed\n");
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * send_set_vap_dscp_tid_map_cmd_tlv() - send vap dscp tid map cmd to fw
  * @wmi_handle: wmi handle
@@ -19756,6 +19826,8 @@ struct wmi_ops tlv_ops =  {
 	.send_set_mimogain_table_cmd = send_set_mimogain_table_cmd_tlv,
 	.send_packet_power_info_get_cmd = send_packet_power_info_get_cmd_tlv,
 	.send_vdev_config_ratemask_cmd = send_vdev_config_ratemask_cmd_tlv,
+	.send_vdev_set_custom_aggr_size_cmd =
+		send_vdev_set_custom_aggr_size_cmd_tlv,
 	.send_set_vap_dscp_tid_map_cmd = send_set_vap_dscp_tid_map_cmd_tlv,
 	.send_vdev_set_neighbour_rx_cmd = send_vdev_set_neighbour_rx_cmd_tlv,
 	.send_smart_ant_set_tx_ant_cmd = send_smart_ant_set_tx_ant_cmd_tlv,
@@ -20741,6 +20813,8 @@ static void populate_vdev_param_tlv(uint32_t *vdev_param)
 	vdev_param[wmi_vdev_param_bw_nss_ratemask] =
 					WMI_VDEV_PARAM_BW_NSS_RATEMASK;
 	vdev_param[wmi_vdev_param_set_he_ltf] = WMI_VDEV_PARAM_HE_LTF;
+	vdev_param[wmi_vdev_param_rate_dropdown_bmap] =
+					WMI_VDEV_PARAM_RATE_DROPDOWN_BMAP;
 }
 #endif