first draft for ACMP/ timeout handling, and communication between SRP/ADP and the ACMP state machine

This commit is contained in:
hackerman-kl 2026-01-19 09:39:49 +01:00 committed by Wim Taymans
parent ad543e37f5
commit 4856f85de2
18 changed files with 2970 additions and 285 deletions

View file

@ -8,6 +8,22 @@
#include "packets.h"
#include "internal.h"
#include "acmp-cmds-resps/acmp-common.h"
#include "aecp-aem-state.h"
/** 1722.1 defines this for the ACMP and the AEM FSMs */
#define AVB_ACMP_FLAG_CLASS_B (1<<0)
#define AVB_ACMP_FLAG_FAST_CONNECT (1<<1)
#define AVB_ACMP_FLAG_SAVED_STATES (1<<2)
#define AVB_ACMP_FLAG_STREAMING_WAIT (1<<3)
#define AVB_ACMP_FLAG_SUPPORTS_ENCRYPTED (1<<4)
#define AVB_ACMP_FLAG_ENCRYPTED_PDU (1<<5)
#define AVB_ACMP_FLAG_SRP_REGISTRATION_FAILED (1<<6)
#define AVB_ACMP_FLAG_CL_ENTRIES_VALID (1<<7)
#define AVB_ACMP_FLAG_NO_SRP (1<<8)
#define AVB_ACMP_FLAG_UDP (1<<9)
#define AVB_ACMP_MESSAGE_TYPE_CONNECT_TX_COMMAND 0
#define AVB_ACMP_MESSAGE_TYPE_CONNECT_TX_RESPONSE 1
#define AVB_ACMP_MESSAGE_TYPE_DISCONNECT_TX_COMMAND 2
@ -52,6 +68,9 @@
#define AVB_ACMP_TIMEOUT_GET_RX_STATE_COMMAND_MS 200
#define AVB_ACMP_TIMEOUT_GET_TX_CONNECTION_COMMAND 200
struct avb_acmp;
struct avb_packet_acmp {
struct avb_packet_header hdr;
uint64_t stream_id;
@ -74,7 +93,22 @@ struct avb_packet_acmp {
#define AVB_PACKET_ACMP_GET_MESSAGE_TYPE(p) AVB_PACKET_GET_SUB1(&(p)->hdr)
#define AVB_PACKET_ACMP_GET_STATUS(p) AVB_PACKET_GET_SUB2(&(p)->hdr)
int acmp_init_listener_stream_output(struct avb_acmp *avb_acmp,
struct aecp_aem_stream_output_state *stream_st);
int acmp_init_listener_stream_input(struct avb_acmp *avb_acmp,
struct aecp_aem_stream_input_state *stream_st);
int acmp_fini_listener_stream(struct avb_acmp *avb_acmp,
struct aecp_aem_stream_input_state *stream_st);
struct avb_acmp *avb_acmp_register(struct server *server);
void avb_acmp_unregister(struct avb_acmp *acmp);
int handle_evt_tk_discovered(struct avb_acmp *avb_acmp, uint64_t entity);
int handle_evt_tk_departed(struct avb_acmp *avb_acmp, uint64_t entity);
int handle_evt_tk_registered(struct avb_acmp *avb_acmp, uint64_t entity);
int handle_evt_tk_unregistered(struct avb_acmp *avb_acmp, uint64_t entity);
#endif /* AVB_ACMP_H */