Who can help explain the XMOS AVB interface function?

If you have a simple question and just want an answer.
Heirun
Member
Posts: 15
Joined: Thu Jun 04, 2015 11:37 am

Who can help explain the XMOS AVB interface function?

Post by Heirun »

Who can help explain the XMOS interface function? such as:

Code: Select all

interface srp_interface {
  short register_stream_request(avb_srp_info_t stream_info);
  void deregister_stream_request(unsigned stream_id[2]);
  short register_attach_request(unsigned stream_id[2], short vlan_id);
  void deregister_attach_request(unsigned stream_id[2]);
These functions are not specifically defined, how do you know what functions?

Thanks for any help!
Last edited by Heirun on Thu May 05, 2016 11:01 am, edited 1 time in total.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

These interface calls are defined in avb.h, lines 969-997

Code: Select all

/** An interface used to register and deregister stream reservations via MSRP */
interface srp_interface {
  /** Used by a Talker application entity to issue a request to the MSRP Participant
   *  to initiate the advertisement of an available Stream
   *
   *  \param stream_info Struct of type avb_srp_info_t containing parameters of the stream to register
   */
  short register_stream_request(avb_srp_info_t stream_info);

  /** Used by a Talker application entity to request removal of the Talker’s advertisement declaration,
   *  and thus remove the advertisement of a Stream, from the network.
   *
   *  \param stream_id two int array containing the Stream ID of the stream to deregister
   */
  void deregister_stream_request(unsigned stream_id[2]);

  /** Used by a Listener application entity to issue a request to attach to the referenced Stream.
   *
   *  \param stream_id two int array containing the Stream ID of the stream to register
   *  \param vlan_id   the VLAN ID associated with the stream. If 0 the current VID from the SRP domain will be used.
   */
  short register_attach_request(unsigned stream_id[2], short vlan_id);

  /** Used by a Listener application entity to remove the request to attach to the referenced Stream.
   *
   *  \param stream_id two int array containing the Stream ID of the stream to deregister
   */
  void deregister_attach_request(unsigned stream_id[2]);
};
Last edited by peter on Thu May 05, 2016 12:33 pm, edited 1 time in total.
User avatar
ers35
Active Member
Posts: 62
Joined: Mon Jun 10, 2013 2:14 pm

Post by ers35 »

peter wrote:These interface calls are defined in avb.h, lines 969-997

https://github.com/xmos/lib_tsn/blob/ma ... /api/avb.h
I get a 404 from that link. Is the lib_tsn GitHub repository private?
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

Sorry, forgot about that. Updated post with contents.
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Modified your topic title to include "AVB" to avoid ambiguity with XC interfaces.
Heirun
Member
Posts: 15
Joined: Thu Jun 04, 2015 11:37 am

Post by Heirun »

I have to see this, I just looked again, did not figure out is how to determine the return value, such as:

Code: Select all

interface srp_interface {
  /** Used by a Talker application entity to issue a request to the MSRP Participant
   *  to initiate the advertisement of an available Stream
   *
   *  \param stream_info Struct of type avb_srp_info_t containing parameters of the stream to register
   *  \returns The VLAN ID actually joined
   */
  short register_stream_request(avb_srp_info_t stream_info);
how to set returns vlan ID。

Thanks!
Heirun
Member
Posts: 15
Joined: Thu Jun 04, 2015 11:37 am

Post by Heirun »

Modified your topic title to include "AVB" to avoid ambiguity with XC interfaces.
Thanks for your reminder!
Last edited by Heirun on Fri May 06, 2016 9:52 am, edited 1 time in total.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

I'm not quite sure what your question is. Looking at lib_tsn 7.0.2 downloaded from xmos.com I found that the register_stream_request() function is used when the AVB source is being used when a talker stream is being turned on (avb.xc:383):

Code: Select all

          source->reservation.vlan_id = i_srp.register_stream_request(source->reservation);
The function is being called on the SRP interface to get a VLAN ID for this stream reservation.

The VLAN ID is allocated by the SRP process (avb_srp.xc:120):

Code: Select all

        vid_joined = avb_srp_create_and_join_talker_advertise_attrs(&local_stream_info);
so the AVB SRP code will provide the VLAN ID - it is not something the user needs to set.

A bit about the XC interface, the syntax (avb_src.xc:116):

Code: Select all

      case i_srp.register_stream_request(avb_srp_info_t stream_info) -> short vid_joined:
means that the the return value of the call to register_stream_request() is done by assigning to the vid_joined variable.
Heirun
Member
Posts: 15
Joined: Thu Jun 04, 2015 11:37 am

Post by Heirun »

Thank you peter, I think I have understood how XC of interface functions are used, and thank you very much for your help, thank you!