diff options
author | Brant Thomsen <brant.thomsen@harman.com> | 2017-07-20 16:39:50 -0600 |
---|---|---|
committer | Brant Thomsen <brant.thomsen@harman.com> | 2017-07-20 16:39:50 -0600 |
commit | 69d48dde608ffd8585111b33c7f88025a6f9567d (patch) | |
tree | 52c9960a68c1e58d608ab33f154e2e0039e7eece | |
parent | 5c2d2ac3902dfb2aa25a363fe13592981781ebec (diff) | |
download | Open-AVB-69d48dde608ffd8585111b33c7f88025a6f9567d.tar.gz |
AVDECC Sharing Values Updates
The Talker/Listener will send invalid values to the AVDECC Msg support, which
can then reflect those values in GET_STREAM_INFO.
Removed all VLAN_NULL references, and made 0 the default VLAN value instead.
This makes the code easier to work with, as 0 is being treated as "use the
appropriate default".
7 files changed, 21 insertions, 31 deletions
diff --git a/lib/avtp_pipeline/acmp/openavb_acmp_sm_talker.c b/lib/avtp_pipeline/acmp/openavb_acmp_sm_talker.c index 37495ce1..f0818a24 100644 --- a/lib/avtp_pipeline/acmp/openavb_acmp_sm_talker.c +++ b/lib/avtp_pipeline/acmp/openavb_acmp_sm_talker.c @@ -630,6 +630,13 @@ void openavbAcmpSMTalker_updateStreamInfo(openavb_tl_data_cfg_t *pCfg) openavb_aem_descriptor_stream_io_t *pDescriptorStreamOutput = openavbAemGetDescriptor(configIdx, OPENAVB_AEM_DESCRIPTOR_STREAM_OUTPUT, talker_unique_id);
if (pDescriptorStreamOutput && pDescriptorStreamOutput->stream == pCfg) {
+ // Verify that the destination address is valid.
+ if (pCfg->dest_addr.mac == NULL ||
+ memcmp(pCfg->dest_addr.buffer.ether_addr_octet, "\x00\x00\x00\x00\x00\x00", 6) == 0) {
+ AVB_LOG_DEBUG("stream_dest_mac not yet valid. Continue to wait.");
+ continue;
+ }
+
// We will handle the GET_TX_CONNECTION_RESPONSE command response here.
AVB_LOGF_DEBUG("Received an update for talker_unique_id %d", talker_unique_id);
openavb_acmp_ACMPCommandResponse_t *response = pTalkerStreamInfo->waiting_on_talker;
diff --git a/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c b/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c index 6a846bfc..e570f654 100644 --- a/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c +++ b/lib/avtp_pipeline/aecp/openavb_aecp_sm_entity_model_entity.c @@ -475,7 +475,7 @@ void processCommand() U8 stream_dest_valid = FALSE;
U8 stream_dest_mac[6] = {0, 0, 0, 0, 0, 0};
U8 stream_vlan_id_valid = FALSE;
- U16 stream_vlan_id = VLAN_NULL;
+ U16 stream_vlan_id = 0;
if ((pCmd->flags & OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_ID_VALID) != 0) {
stream_id_valid = TRUE;
memcpy(stream_src_mac, pCmd->stream_format, 6);
@@ -566,9 +566,8 @@ void processCommand() }
// Get the Stream VLAN ID if the other stream identifiers are valid.
- if (pDescriptorStreamIO->acmp_stream_vlan_id != VLAN_NULL &&
- (pRsp->flags & (OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_ID_VALID | OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_DEST_MAC_VALID)) ==
- (OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_ID_VALID | OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_DEST_MAC_VALID)) {
+ if ((pRsp->flags & (OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_ID_VALID | OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_DEST_MAC_VALID)) ==
+ (OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_ID_VALID | OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_DEST_MAC_VALID)) {
pRsp->stream_vlan_id = pDescriptorStreamIO->acmp_stream_vlan_id;
pRsp->flags |= OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_VLAN_ID_VALID;
}
@@ -595,8 +594,7 @@ void processCommand() }
// Get the Stream VLAN ID.
- if (pDescriptorStreamIO->stream->vlan_id != 0 &&
- pDescriptorStreamIO->stream->vlan_id != VLAN_NULL) {
+ if (pDescriptorStreamIO->stream->vlan_id != 0) {
pRsp->stream_vlan_id = pDescriptorStreamIO->stream->vlan_id;
pRsp->flags |= OPENAVB_AEM_SET_STREAM_INFO_COMMAND_FLAG_STREAM_VLAN_ID_VALID;
}
diff --git a/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_client.c b/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_client.c index 1dc9a27e..01c827f3 100644 --- a/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_client.c +++ b/lib/avtp_pipeline/avdecc_msg/openavb_avdecc_msg_client.c @@ -186,17 +186,10 @@ bool openavbAvdeccMsgClntTalkerStreamID(int avdeccMsgHandle, U8 sr_class, const return false; } - // Verify that the destination address is valid. - if (memcmp(stream_dest_mac, "\x00\x00\x00\x00\x00\x00", 6) == 0) { - AVB_LOG_DEBUG("stream_dest_mac not yet valid. Not sending to AVDECC Msg Server."); - return true; - } - - // Verify that the stream_vlan_id is valid. - if (stream_vlan_id == VLAN_NULL) { - AVB_LOG_DEBUG("stream_vlan_id not yet valid. Not sending to AVDECC Msg Server."); - return true; - } + // Send a default stream_vlan_id value if none specified. + if (stream_vlan_id == 0) { + stream_vlan_id = 2; // SR Class default VLAN Id values per IEEE 802.1Q-2011 Table 9-2 + } // Send the stream information to the server. memset(&msgBuf, 0, OPENAVB_AVDECC_MSG_LEN); @@ -340,7 +333,7 @@ bool openavbAvdeccMsgClntHndlTalkerStreamIDFromServer(int avdeccMsgHandle, ETH_OCTETS(pCfg->dest_addr.buffer.ether_addr_octet)); } } - if (stream_vlan_id_valid && stream_vlan_id != VLAN_NULL) { + if (stream_vlan_id_valid) { if (stream_vlan_id == 0) { // Restore from the backup value. if (pCfg->backup_vlan_id_valid) { diff --git a/lib/avtp_pipeline/platform/Linux/avdecc/openavb_avdecc_pipeline_interaction.c b/lib/avtp_pipeline/platform/Linux/avdecc/openavb_avdecc_pipeline_interaction.c index 78819ca6..5e6a5051 100644 --- a/lib/avtp_pipeline/platform/Linux/avdecc/openavb_avdecc_pipeline_interaction.c +++ b/lib/avtp_pipeline/platform/Linux/avdecc/openavb_avdecc_pipeline_interaction.c @@ -265,11 +265,6 @@ bool openavbAVDECCGetTalkerStreamInfo(openavb_aem_descriptor_stream_io_t *pDescr (((U16) pTalkerStreamInfo->stream_id[6]) << 8) | (U16) pTalkerStreamInfo->stream_id[7]);
// Get the VLAN ID.
- if (pDescriptorStreamOutput->stream->vlan_id == VLAN_NULL) {
- AVB_LOG_ERROR("openavbAVDECCGetTalkerStreamInfo Invalid stream vlan_id");
- AVB_TRACE_EXIT(AVB_TRACE_AVDECC);
- return FALSE;
- }
pTalkerStreamInfo->stream_vlan_id = pDescriptorStreamOutput->stream->vlan_id;
AVB_TRACE_EXIT(AVB_TRACE_AVDECC);
diff --git a/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c b/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c index 2e9a29d7..03cb8ade 100644 --- a/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c +++ b/lib/avtp_pipeline/tl/openavb_talker_no_endpoint.c @@ -77,14 +77,14 @@ bool openavbTLRunTalkerInit(tl_state_t *pTLState) pTalkerData->srClass = pCfg->sr_class; if (pCfg->sr_class == SR_CLASS_A) { pTalkerData->classRate = 8000; - pTalkerData->vlanID = pCfg->vlan_id == VLAN_NULL ? - SR_CLASS_A_DEFAULT_VID : pCfg->vlan_id; + pTalkerData->vlanID = (pCfg->vlan_id == 0 ? + SR_CLASS_A_DEFAULT_VID : pCfg->vlan_id); pTalkerData->vlanPCP = SR_CLASS_A_DEFAULT_PRIORITY; } else if (pCfg->sr_class == SR_CLASS_B) { pTalkerData->classRate = 4000; - pTalkerData->vlanID = pCfg->vlan_id == VLAN_NULL ? - SR_CLASS_B_DEFAULT_VID : pCfg->vlan_id; + pTalkerData->vlanID = (pCfg->vlan_id == 0 ? + SR_CLASS_B_DEFAULT_VID : pCfg->vlan_id); pTalkerData->vlanPCP = SR_CLASS_B_DEFAULT_PRIORITY; } memcpy(&pTalkerData->destAddr, &pCfg->dest_addr.mac->ether_addr_octet, ETH_ALEN); diff --git a/lib/avtp_pipeline/tl/openavb_tl.c b/lib/avtp_pipeline/tl/openavb_tl.c index 34efccd2..e3e75ad5 100755 --- a/lib/avtp_pipeline/tl/openavb_tl.c +++ b/lib/avtp_pipeline/tl/openavb_tl.c @@ -391,7 +391,7 @@ EXTERN_DLL_EXPORT void openavbTLInitCfg(openavb_tl_cfg_t *pCfg) pCfg->rx_signal_mode = 1; pCfg->pMapInitFn = NULL; pCfg->pIntfInitFn = NULL; - pCfg->vlan_id = VLAN_NULL; + pCfg->vlan_id = 0; pCfg->fixed_timestamp = 0; pCfg->spin_wait = FALSE; pCfg->thread_rt_priority = 0; diff --git a/lib/avtp_pipeline/tl/openavb_tl_pub.h b/lib/avtp_pipeline/tl/openavb_tl_pub.h index 67472d5e..1359da16 100755 --- a/lib/avtp_pipeline/tl/openavb_tl_pub.h +++ b/lib/avtp_pipeline/tl/openavb_tl_pub.h @@ -79,9 +79,6 @@ typedef enum { /// Maximum size of the friendly name #define FRIENDLY_NAME_SIZE 64 -/// Indicates that VLAN ID is not set in configuration -#define VLAN_NULL UINT16_MAX - /// Initial talker/listener state typedef enum { /// Unspecified |