Commit ae68ca9f authored by Jean-Claude BAU's avatar Jean-Claude BAU

Fix issue for extended L1SYNC TLV

- When optParamsEnabled is set, the TLV send need to be extended with
extra values. Fix here the length of the TLV and the whole message.
- Fix print issue of the signaling TLV
parent a2ac4298
......@@ -52,6 +52,8 @@
#define TLV_TYPE_L1_SYNC 0x8001
#define MSG_L1SYNC_LEN 50
#define MSG_L1SYNC_TLV_LENGTH 2
#define MSG_L1SYNC_TLV_EXTENDED_LENGTH 40
int l1e_pack_signal(struct pp_instance *ppi)
{
......@@ -63,7 +65,7 @@ int l1e_pack_signal(struct pp_instance *ppi)
memset(&targetPortIdentity,-1,sizeof(targetPortIdentity)); /* cloclk identity and port set all 1's */
/* Generic pack of a signaling message */
msg_pack_signaling_no_fowardable(ppi,&targetPortIdentity,TLV_TYPE_L1_SYNC,2);
msg_pack_signaling_no_fowardable(ppi,&targetPortIdentity,TLV_TYPE_L1_SYNC,MSG_L1SYNC_TLV_LENGTH);
/* Clause O.6.4 */
local_config = l1e_creat_L1Sync_bitmask(bds->txCoherentIsRequired,
......@@ -89,12 +91,13 @@ int l1e_pack_signal(struct pp_instance *ppi)
(ods->frequencyOffsetTxValid ? 4 : 0 );
MSG_SET_TLV_L1SYNC_OPT_CONFIG(buf,local_config);
msgLen+=38;
MSG_SET_TLV_LENGTH_FIELD(buf,MSG_L1SYNC_TLV_EXTENDED_LENGTH);
/* TODO : The extension fields must be filled with L1SyncOptParamsPortDS_t data set */
}
/* header len */
MSG_SET_HEADER_MESSAGE_LENGTH(buf,msgLen);
return MSG_L1SYNC_LEN;
return msgLen;
}
int l1e_unpack_signal(struct pp_instance *ppi, void *buf, int plen)
......
......@@ -281,7 +281,8 @@ static int l1sync_dump_tlv(char *prefix, struct l1sync_tlv *tlv, int totallen)
/* the field includes 6 bytes of the header, excludes 4 of them. Bah! */
int explen = ntohs(tlv->len) + 4;
printf("TLV: type %04x len %i conf %02x act %02x ",
printf("%sTLV: type %04x len %i conf %02x act %02x\n",
prefix,
ntohs(tlv->type), explen,
(int) tlv->config,
(int) tlv->active);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment