/* SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef MARS_FRAME_QUEUE_H #define MARS_FRAME_QUEUE_H #define MARS_RING_SIZE 64 #define MARS_FRAME_MAX 1514 struct mars_slot {unsigned short len;unsigned char bytes[MARS_FRAME_MAX];}; struct mars_ring {unsigned head,count;struct mars_slot slot[MARS_RING_SIZE];}; /* Caller serializes all access. No allocation, no overwrite, no partial pop. */ int mars_ring_push(struct mars_ring*,const unsigned char*,unsigned); int mars_ring_pop(struct mars_ring*,unsigned char*,unsigned); void mars_ring_clear(struct mars_ring*); #endif