From 621fa0c483e0ea2f4554c6aa9a6815decc0ce27f Mon Sep 17 00:00:00 2001 From: smucognizant <190081706+smucognizant@users.noreply.github.com> Date: Fri, 3 Jan 2025 09:58:59 +0000 Subject: [PATCH] RDKBWIFI-6: Add Profile-2 Error Code TLV --- inc/em_base.h | 18 ++++++++++++++++++ src/em/channel/em_channel.cpp | 13 +++++++++++++ 2 files changed, 31 insertions(+) diff --git a/inc/em_base.h b/inc/em_base.h index 77a6888..eaab64d 100644 --- a/inc/em_base.h +++ b/inc/em_base.h @@ -964,6 +964,24 @@ typedef enum { em_chan_sel_resp_code_type_decline_conflict, } em_chan_sel_resp_code_type_t; +typedef enum { + em_prof2_error_code_reason_code_reserved, + em_prof2_error_code_reason_code_svc_prio_rule_not_found, + em_prof2_error_code_reason_code_svc_prio_rule_max, + em_prof2_error_code_reason_code_pcp_vlan_id_not_provided, + em_prof2_error_code_reason_code_reserved2, + em_prof2_error_code_reason_code_vlan_id_max, + em_prof2_error_code_reason_code_reserved3, + em_prof2_error_code_reason_code_traf_sep_comb_ass_unsupported, + em_prof2_error_code_reason_code_mix_traf_sep_unsupported, + em_prof2_error_code_reason_code_reserved4, + em_prof2_error_code_reason_code_traf_sep_not_supported, + em_prof2_error_code_reason_code_qos_mgmt_policy_not_conf, + em_prof2_error_code_reason_code_qos_mgmt_dscp_policy_rejected, + em_prof2_error_code_reason_code_agent_not_onboard_other, + em_prof2_error_code_reason_code_eht_subchan_bitmap_error, +} em_prof2_error_code_reason_code_type_t; + typedef struct { em_radio_id_t ruid; unsigned char response_code; diff --git a/src/em/channel/em_channel.cpp b/src/em/channel/em_channel.cpp index c65faea..51e9e63 100644 --- a/src/em/channel/em_channel.cpp +++ b/src/em/channel/em_channel.cpp @@ -450,6 +450,7 @@ int em_channel_t::send_channel_sel_response_msg(em_chan_sel_resp_code_type_t cod em_cmdu_t *cmdu; em_tlv_t *tlv; em_channel_sel_rsp_t *resp; + em_prof2_error_t *prof2_error; unsigned char *tmp = buff; dm_easy_mesh_t *dm; unsigned short type = htons(ETH_P_1905); @@ -498,8 +499,20 @@ int em_channel_t::send_channel_sel_response_msg(em_chan_sel_resp_code_type_t cod memcpy(resp->ruid, get_radio_interface_mac(), sizeof(em_radio_id_t)); memcpy(&resp->response_code, (unsigned char *)&code, sizeof(unsigned char)); + tmp += (sizeof(em_tlv_t) + sizeof(em_channel_sel_rsp_t)); len += (sizeof(em_tlv_t) + sizeof(em_channel_sel_rsp_t)); + + //Zero or more Profile-2 Error Code TLV (see section 17.2.51) + tlv = (em_tlv_t *)tmp; + tlv->type = em_tlv_type_profile_2_error_code; + tlv->len = htons(sizeof(em_prof2_error_t)); + prof2_error = (em_prof2_error_t *)tlv->value; + prof2_error->reason_code = em_prof2_error_code_reason_code_reserved; // reason_code = 0x0 + + tmp += (sizeof(em_tlv_t) + sizeof(em_prof2_error_t)); + len += (sizeof(em_tlv_t) + sizeof(em_prof2_error_t)); + // End of message tlv = (em_tlv_t *)tmp; tlv->type = em_tlv_type_eom;