milan-avb: split the acmp module into milan and legacy-avb

This commit is contained in:
hackerman-kl 2026-01-15 09:20:24 +01:00 committed by Wim Taymans
parent 9ee0ddf24f
commit ad543e37f5
7 changed files with 136 additions and 376 deletions

View file

@ -2,6 +2,10 @@
/* SPDX-License-Identifier: MIT */
#include "acmp-common.h"
#include "../aecp-aem-descriptors.h"
#include "../aecp-aem-state.h"
#include "../stream.h"
struct pending *pending_find(struct acmp *acmp, uint32_t type, uint16_t sequence_id)
{

View file

@ -4,6 +4,11 @@
#ifndef AVB_ACMP_COMMON_H
#define AVB_ACMP_COMMON_H
#include <stdint.h>
#include <pipewire/pipewire.h>
#include "../acmp.h"
struct pending {
struct spa_list link;
uint64_t last_time;
@ -15,6 +20,17 @@ struct pending {
void *ptr;
};
struct acmp {
struct server *server;
struct spa_hook server_listener;
#define PENDING_TALKER 0
#define PENDING_LISTENER 1
#define PENDING_CONTROLLER 2
struct spa_list pending[3];
uint16_t sequence_id[3];
};
struct pending *pending_find(struct acmp *acmp, uint32_t type, uint16_t sequence_id);
void pending_free(struct acmp *acmp, struct pending *p);
@ -22,9 +38,9 @@ void pending_free(struct acmp *acmp, struct pending *p);
void pending_destroy(struct acmp *acmp);
void *pending_new(struct acmp *acmp, uint32_t type, uint64_t now,
uint32_t timeout_ms, const void *m, size_t size)
uint32_t timeout_ms, const void *m, size_t size);
int retry_pending(struct acmp *acmp, uint64_t now, struct pending *p):
int retry_pending(struct acmp *acmp, uint64_t now, struct pending *p);
struct stream *find_stream(struct server *server, enum spa_direction direction,
uint16_t index);

View file

@ -2,6 +2,9 @@
/* SPDX-FileCopyrightText: Copyright © 2026 Alexandre Malki <alexandre.malki@kebag-logic.com> */
/* SPDX-License-Identifier: MIT */
#include "acmp-common.h"
#include "acmp-legacy-avb.h"
int handle_connect_tx_command_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len)
{
@ -153,7 +156,8 @@ int handle_disconnect_tx_response_legacy_avb(struct acmp *acmp, uint64_t now,
return res;
}
int handle_connect_rx_command_legacy_avb(struct acmp *acmp, uint64_t now, const void *m, int len)
int handle_connect_rx_command_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len)
{
struct server *server = acmp->server;
struct avb_ethernet_header *h;
@ -175,9 +179,7 @@ int handle_connect_rx_command_legacy_avb(struct acmp *acmp, uint64_t now, const
return avb_server_send_packet(server, h->dest, AVB_TSN_ETH, h, len);
}
nt handle_disconnect_rx_command_legacy_avb(struct acmp *acmp, uint64_t now,
int handle_disconnect_rx_command_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len)
{
struct server *server = acmp->server;

View file

@ -4,6 +4,26 @@
#ifndef AVB_ACMP_LEGACY_AVB_H
#define AVB_ACMP_LEGACY_AVB_H
#include <stdint.h>
#include "../acmp.h"
int handle_connect_tx_command_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len);
int handle_connect_tx_response_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len);
int handle_disconnect_tx_command_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len);
int handle_disconnect_tx_response_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len);
int handle_connect_rx_command_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len);
int handle_disconnect_rx_command_legacy_avb(struct acmp *acmp, uint64_t now,
const void *m, int len);
#endif //AVB_ACMP_LEGACY_AVB_H

View file

@ -4,6 +4,8 @@
#ifndef AVB_ACMP_MILAN_V12_H
#define AVB_ACMP_MILAN_V12_H
#include <stdint.h>
#endif //AVB_ACMP_MILAN_V12_H