diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h index c3f2e3202e..2775ec7e44 100644 --- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h +++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h @@ -438,6 +438,41 @@ struct vdev_scan_nac_rssi_params { uint32_t action; /* WMI_FILTER_NAC_RSSI_ACTION */ }; +#ifdef WLAN_FEATURE_11BE_MLO +/** + * @mlo_enabled: indicate is MLO enabled + * @mlo_assoc_link: indicate is the link used to initialize + * the association of mlo connection + */ +struct mlo_vdev_start_flags { + uint32_t mlo_enabled:1, + mlo_assoc_link:1, + rsvd:30; +}; + +/** + * struct ml_vdev_start_partner_info - partner link info + * @vdev_id: vdev id + * @hw_mld_link_id: unique hw link id across SoCs + * @mac_addr: Partner mac address + */ +struct ml_vdev_start_partner_info { + uint32_t vdev_id; + uint32_t hw_mld_link_id; + uint8_t mac_addr[QDF_MAC_ADDR_SIZE]; +}; + +#define MAX_ML_PARTNER_LINKS 4 +/** + * struct mlo_vdev_start__partner_links - ML partner links + * @num_links: Number of links + * @partner_info: Partner link info + */ +struct mlo_vdev_start_partner_links { + uint8_t num_links; + struct ml_vdev_start_partner_info partner_info[MAX_ML_PARTNER_LINKS]; +}; +#endif /** * struct vdev_start_params - vdev start cmd parameter * @vdev_id: vdev id @@ -484,6 +519,10 @@ struct vdev_start_params { bool ldpc_rx_enabled; uint32_t mbssid_flags; uint8_t vdevid_trans; +#ifdef WLAN_FEATURE_11BE_MLO + struct mlo_vdev_start_flags mlo_flags; + struct mlo_vdev_start_partner_links mlo_partner; +#endif }; /** diff --git a/wmi/inc/wmi_unified_11be_tlv.h b/wmi/inc/wmi_unified_11be_tlv.h index f88f5463c2..761097652d 100644 --- a/wmi/inc/wmi_unified_11be_tlv.h +++ b/wmi/inc/wmi_unified_11be_tlv.h @@ -33,6 +33,31 @@ size_t vdev_create_mlo_params_size(void); */ uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr, struct vdev_create_params *param); +/** + * vdev_start_mlo_params_size() - Get MLO params size in vdev start + * @req: Vdev start request params + * + * Return: size of MLO params in vdev start + */ +size_t vdev_start_mlo_params_size(struct vdev_start_params *req); +/** + * vdev_start_add_mlo_params() - Add MLO params in vdev start cmd + * @buf_ptr: pointer to vdev start buffer. + * @req: ponter to vdev create request param + * + * Return: pointer to new offset of cmd buffer + */ +uint8_t *vdev_start_add_mlo_params(uint8_t *buf_ptr, + struct vdev_start_params *req); +/** + * vdev_start_add_ml_partner_links() - Add MLO partner links in vdev start cmd + * @buf_ptr: pointer to vdev start cmd buffer. + * @req: ponter to vdev start request param + * + * Return: pointer to new offset of cmd buffer + */ +uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr, + struct vdev_start_params *req); #else static uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr, struct vdev_create_params *param) @@ -45,5 +70,24 @@ static size_t vdev_create_mlo_params_size(void) { return WMI_TLV_HDR_SIZE; } + +static uint8_t *vdev_start_add_mlo_params(uint8_t *buf_ptr, + struct vdev_start_params *req) +{ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + return buf_ptr + WMI_TLV_HDR_SIZE; +} + +static size_t vdev_start_mlo_params_size(struct vdev_start_params *req) +{ + return WMI_TLV_HDR_SIZE; +} + +static uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr, + struct vdev_start_params *req) +{ + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, 0); + return buf_ptr + WMI_TLV_HDR_SIZE; +} #endif /*WLAN_FEATURE_11BE_MLO*/ #endif /*_WMI_UNIFIED_11BE_TLV_H_*/ diff --git a/wmi/src/wmi_unified_11be_tlv.c b/wmi/src/wmi_unified_11be_tlv.c index 5d887c54ba..2288a83a20 100644 --- a/wmi/src/wmi_unified_11be_tlv.c +++ b/wmi/src/wmi_unified_11be_tlv.c @@ -45,3 +45,70 @@ uint8_t *vdev_create_add_mlo_params(uint8_t *buf_ptr, QDF_MAC_ADDR_REF(param->mlo_mac)); return buf_ptr + sizeof(wmi_vdev_create_mlo_params); } + +size_t vdev_start_mlo_params_size(struct vdev_start_params *req) +{ + size_t vdev_start_mlo_size; + + vdev_start_mlo_size = sizeof(wmi_vdev_start_mlo_params) + + WMI_TLV_HDR_SIZE + + (req->mlo_partner.num_links * + sizeof(wmi_partner_link_params)) + + WMI_TLV_HDR_SIZE; + + return vdev_start_mlo_size; +} + +uint8_t *vdev_start_add_mlo_params(uint8_t *buf_ptr, + struct vdev_start_params *req) +{ + wmi_vdev_start_mlo_params *mlo_params; + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + sizeof(wmi_vdev_start_mlo_params)); + buf_ptr += sizeof(uint32_t); + + mlo_params = (wmi_vdev_start_mlo_params *)buf_ptr; + WMITLV_SET_HDR(&mlo_params->tlv_header, + WMITLV_TAG_STRUC_wmi_vdev_start_mlo_params, + WMITLV_GET_STRUCT_TLVLEN(wmi_vdev_start_mlo_params)); + + mlo_params->mlo_flags.mlo_flags = 0; + WMI_MLO_FLAGS_SET_ENABLED(mlo_params->mlo_flags.mlo_flags, + req->mlo_flags.mlo_enabled); + WMI_MLO_FLAGS_SET_ASSOC_LINK(mlo_params->mlo_flags.mlo_flags, + req->mlo_flags.mlo_assoc_link); + + return buf_ptr + sizeof(wmi_vdev_start_mlo_params); +} + +uint8_t *vdev_start_add_ml_partner_links(uint8_t *buf_ptr, + struct vdev_start_params *req) +{ + wmi_partner_link_params *ml_partner_link; + struct mlo_vdev_start_partner_links *req_partner; + uint8_t i; + + WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, + (req->mlo_partner.num_links * + sizeof(wmi_partner_link_params))); + buf_ptr += sizeof(uint32_t); + + req_partner = &req->mlo_partner; + ml_partner_link = (wmi_partner_link_params *)buf_ptr; + for (i = 0; i < req->mlo_partner.num_links; i++) { + WMITLV_SET_HDR(&ml_partner_link->tlv_header, + WMITLV_TAG_STRUC_wmi_partner_link_params, + WMITLV_GET_STRUCT_TLVLEN(wmi_partner_link_params)); + ml_partner_link->vdev_id = req_partner->partner_info[i].vdev_id; + ml_partner_link->hw_link_id = + req_partner->partner_info[i].hw_mld_link_id; + WMI_CHAR_ARRAY_TO_MAC_ADDR(req_partner->partner_info[i].mac_addr, + &ml_partner_link->vdev_macaddr); + ml_partner_link++; + } + + return buf_ptr + + (req->mlo_partner.num_links * + sizeof(wmi_partner_link_params)); +} diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 4b4d5e570f..8dec4e0e51 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -1075,6 +1075,7 @@ static QDF_STATUS send_vdev_start_cmd_tlv(wmi_unified_t wmi_handle, uint8_t *buf_ptr; len = sizeof(*cmd) + sizeof(wmi_channel) + WMI_TLV_HDR_SIZE; + len += vdev_start_mlo_params_size(req); buf = wmi_buf_alloc(wmi_handle, len); if (!buf) return QDF_STATUS_E_NOMEM; @@ -1133,6 +1134,11 @@ static QDF_STATUS send_vdev_start_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC, cmd->num_noa_descriptors * sizeof(wmi_p2p_noa_descriptor)); + buf_ptr += WMI_TLV_HDR_SIZE + + (cmd->num_noa_descriptors * sizeof(wmi_p2p_noa_descriptor)); + + buf_ptr = vdev_start_add_mlo_params(buf_ptr, req); + buf_ptr = vdev_start_add_ml_partner_links(buf_ptr, req); wmi_info("vdev_id %d freq %d chanmode %d ch_info: 0x%x is_dfs %d " "beacon interval %d dtim %d center_chan %d center_freq2 %d " "reg_info_1: 0x%x reg_info_2: 0x%x, req->max_txpow: 0x%x "