Skip to content

Commit

Permalink
RDKBWIFI-6: Add Profile-2 Error Code TLV
Browse files Browse the repository at this point in the history
  • Loading branch information
smucognizant committed Jan 3, 2025
1 parent 4ef87d9 commit 621fa0c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
18 changes: 18 additions & 0 deletions inc/em_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
13 changes: 13 additions & 0 deletions src/em/channel/em_channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 621fa0c

Please sign in to comment.