Browse Source

qcacmn: Add WMI MLO params for peer create command

New TLVs for MLO flags are introduced in peer create WMI
command. Add WMI changes to add these TLV in the peer create
command.

Change-Id: I38a129b30b366b6e3939231699f210d1bac362a1
CRs-Fixed: 2958849
Kiran Venkatappa 4 years ago
parent
commit
9b1509ec99

+ 28 - 0
wmi/inc/wmi_unified_11be_tlv.h

@@ -58,6 +58,22 @@ uint8_t *vdev_start_add_mlo_params(uint8_t *buf_ptr,
  */
 uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
 					 struct vdev_start_params *req);
+/**
+ *  peer_create_add_mlo_params() - Add MLO params in peer create cmd
+ *  @buf_ptr: pointer to peer create cmd buffer.
+ *  @req: pointer to peer create request param
+ *
+ *  Return: pointer to new offset of cmd buffer
+ */
+uint8_t *peer_create_add_mlo_params(uint8_t *buf_ptr,
+				    struct peer_create_params *req);
+/**
+ *  peer_create_mlo_params_size() - Get ML params size in peer create
+ *  @req: pointer to peer create request param
+ *
+ *  Return: size of ML params in peer create cmd
+ */
+size_t peer_create_mlo_params_size(struct peer_create_params *req);
 #else
 static uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr,
 					   struct vdev_create_params *param)
@@ -89,5 +105,17 @@ static uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
 	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
 	return buf_ptr + WMI_TLV_HDR_SIZE;
 }
+
+static uint8_t *peer_create_add_mlo_params(uint8_t *buf_ptr,
+					  struct peer_create_params *req)
+{
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0);
+	return buf_ptr + WMI_TLV_HDR_SIZE;
+}
+
+static size_t peer_create_mlo_params_size(struct peer_create_params *req)
+{
+	return WMI_TLV_HDR_SIZE;
+}
 #endif /*WLAN_FEATURE_11BE_MLO*/
 #endif /*_WMI_UNIFIED_11BE_TLV_H_*/

+ 4 - 0
wmi/inc/wmi_unified_param.h

@@ -794,11 +794,15 @@ struct peer_set_params {
  * @peer_addr: peer mac addr
  * @peer_type: peer type
  * @vdev_id: vdev id
+ * @mlo_enable: Indicates MLO is enabled
  */
 struct peer_create_params {
 	const uint8_t *peer_addr;
 	uint32_t peer_type;
 	uint32_t vdev_id;
+#ifdef WLAN_FEATURE_11BE_MLO
+	bool mlo_enabled;
+#endif
 };
 
 /**

+ 26 - 0
wmi/src/wmi_unified_11be_tlv.c

@@ -112,3 +112,29 @@ uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr,
 		(req->mlo_partner.num_links *
 		 sizeof(wmi_partner_link_params));
 }
+
+size_t peer_create_mlo_params_size(struct peer_create_params *req)
+{
+	return sizeof(wmi_peer_create_mlo_params) + WMI_TLV_HDR_SIZE;
+}
+
+uint8_t *peer_create_add_mlo_params(uint8_t *buf_ptr,
+				    struct peer_create_params *req)
+{
+	wmi_peer_create_mlo_params *mlo_params;
+
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+		       sizeof(wmi_peer_create_mlo_params));
+	buf_ptr += sizeof(uint32_t);
+
+	mlo_params = (wmi_peer_create_mlo_params *)buf_ptr;
+	WMITLV_SET_HDR(&mlo_params->tlv_header,
+		       WMITLV_TAG_STRUC_wmi_peer_create_mlo_params,
+		       WMITLV_GET_STRUCT_TLVLEN(wmi_peer_create_mlo_params));
+
+	mlo_params->mlo_flags.mlo_flags = 0;
+	WMI_MLO_FLAGS_SET_ENABLED(mlo_params->mlo_flags.mlo_flags,
+				  req->mlo_enabled);
+
+	return buf_ptr + sizeof(wmi_peer_create_mlo_params);
+}

+ 5 - 0
wmi/src/wmi_unified_tlv.c

@@ -1430,8 +1430,10 @@ static QDF_STATUS send_peer_create_cmd_tlv(wmi_unified_t wmi,
 {
 	wmi_peer_create_cmd_fixed_param *cmd;
 	wmi_buf_t buf;
+	uint8_t *buf_ptr;
 	int32_t len = sizeof(*cmd);
 
+	len += peer_create_mlo_params_size(param);
 	buf = wmi_buf_alloc(wmi, len);
 	if (!buf)
 		return QDF_STATUS_E_NOMEM;
@@ -1445,6 +1447,9 @@ static QDF_STATUS send_peer_create_cmd_tlv(wmi_unified_t wmi,
 	cmd->peer_type = param->peer_type;
 	cmd->vdev_id = param->vdev_id;
 
+	buf_ptr = (uint8_t *)wmi_buf_data(buf);
+	buf_ptr += sizeof(*cmd);
+	buf_ptr = peer_create_add_mlo_params(buf_ptr, param);
 	wmi_mtrace(WMI_PEER_CREATE_CMDID, cmd->vdev_id, 0);
 	if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_CREATE_CMDID)) {
 		wmi_err("Failed to send WMI_PEER_CREATE_CMDID");