mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-19 23:08:34 +03:00
req_ctx: Convert from hand-coded linked lists to linuxlist.h
This also removes the actual queuing code from req_ctx, and leaves this to the caller. Only tw out of the existing states actually required the ordering requirement enforced by the qeue, and in the future we will need to have per-endpoint queues anyway. Both means it is better to manage queues outside the req_ctx, and leve that as a pure memory allocator.
This commit is contained in:
@@ -5,8 +5,7 @@
|
||||
#define MAX_HDRSIZE sizeof(struct openpcd_hdr)
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define REQ_CTX_LISTS
|
||||
#include "linuxlist.h"
|
||||
|
||||
#define __ramfunc
|
||||
|
||||
@@ -37,12 +36,12 @@ enum req_ctx_state {
|
||||
};
|
||||
|
||||
struct req_ctx {
|
||||
/* if this req_ctx is on a queue... */
|
||||
struct llist_head list;
|
||||
uint32_t ep;
|
||||
|
||||
/* enum req_ctx_state */
|
||||
volatile uint32_t state;
|
||||
#ifdef REQ_CTX_LISTS
|
||||
/* pointers for queues */
|
||||
volatile struct req_ctx *prev, *next;
|
||||
#endif
|
||||
/* size of th 'data' buffer */
|
||||
uint16_t size;
|
||||
/* total number of used bytes in buffer */
|
||||
|
||||
Reference in New Issue
Block a user