diff options
Diffstat (limited to 'xpp/xbus-core.h')
-rw-r--r-- | xpp/xbus-core.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/xpp/xbus-core.h b/xpp/xbus-core.h index f2bac8c..1c1e98e 100644 --- a/xpp/xbus-core.h +++ b/xpp/xbus-core.h @@ -24,18 +24,38 @@ #include "xpd.h" -#define MAX_BUSES 16 +#define MAX_BUSES 32 +#define XFRAME_DATASIZE 512 + +struct xframe { + atomic_t frame_len; + byte *packets; /* max XFRAME_DATASIZE */ +}; + +#define XFRAME_LEN(frame) atomic_read(&(frame)->frame_len) int xbus_core_init(void); /* Initializer */ void xbus_core_shutdown(void); /* Terminator */ -/* Packet handling */ -xpacket_t *xbus_packet_new(xbus_t *xbus, gfp_t flags); -void xbus_packet_free(xbus_t *xbus, xpacket_t *p); +#ifdef XPP_DEBUGFS +/* Debugfs handling */ +int xbus_log(xbus_t *xbus, xpd_t *xpd, int direction, const void *buf, unsigned long len); +#endif + +/* Frame handling */ +xframe_t *xbus_frame_new(xbus_t *xbus, gfp_t flags); +void xbus_frame_free(xbus_t *xbus, xframe_t *p); +void dump_xframe(const char msg[], const xbus_t *xbus, const xframe_t *xframe); + +/* + * Return pointer to next packet slot in the frame + * or NULL if the frame is full. + */ +xpacket_t *xframe_next_packet(xframe_t *xframe, int len); /* XBUS handling */ xbus_t *xbus_of(int xbus_num); -xpd_t *xpd_of(xbus_t *xbus, int xpd_num); +xpd_t *xpd_of(const xbus_t *xbus, int xpd_num); xbus_t *xbus_new(xbus_ops_t *ops); void xbus_remove(xbus_t *xbus); void xbus_activate(xbus_t *xbus); |