13#ifndef __xwmd_isc_xwssc_protocol_h__
14#define __xwmd_isc_xwssc_protocol_h__
36#define XWSSC_SOF ((xwu8_t)0xAA)
37#define XWSSC_EOF (XWSSC_SOF ^ (xwu8_t)0xFF)
38#define XWSSC_SOF_SIZE (2U)
39#define XWSSC_EOF_SIZE (2U)
41#define XWSSC_FRMHEAD_SIZE(size) ((size) & 0xFU)
42#define XWSSC_FRMHEAD_SIZE_MIRROR(size) ((size) & 0xF0U)
43#define XWSSC_FRMHEAD_MAXSIZE (16U)
44#define XWSSC_FRM_ONSTACK_MAXSIZE (64U)
46#define XWSSC_ID_MSK (0xFFU)
47#define XWSSC_ID(id) ((xwu8_t)((xwu8_t)(id) & XWSSC_ID_MSK))
49#define XWSSC_ECSIZE(head) (XWSSC_FRMHEAD_SIZE((head)->headsize) - \
50 sizeof(struct xwssc_frmhead))
51#define XWSSC_SDUPOS(head) (&((head)->ecsdusz[XWSSC_ECSIZE(head)]))
52#define XWSSC_RXSDUSIZE(slot) ((slot)->frmsize - \
53 XWSSC_FRMHEAD_SIZE((slot)->frm.head.headsize) - \
54 XWSSC_CRC32_SIZE - XWSSC_SOF_SIZE - XWSSC_EOF_SIZE)
55#define XWSSC_CRC32_SIZE (4U)
56#define XWSSC_SDU_MAX_SIZE (XWSSC_MEMPOOL_SIZE / 8)
58#define XWSSC_TXTHD_STACK (4096U)
59#define XWSSC_RXTHD_STACK (4096U)
61#if defined(XWMDCFG_isc_xwssc_LOG) && (1 == XWMDCFG_isc_xwssc_LOG)
62# define xwssclogf(xwssc, lv, fmt, ...) xwlogf(lv, "%s", \
63 fmt, xwssc->name, ##__VA_ARGS__)
65# define xwssclogf(xwssc, lv, fmt, ...)
68#define XWSSC_BUG() XWOS_BUG()
69#define XWSSC_BUG_ON(x) XWOS_BUG_ON(x)
71#if defined(XWMDCFG_CHECK_PARAMETERS) && (1 == XWMDCFG_CHECK_PARAMETERS)
72#define XWSSC_VALIDATE(exp, errstr, ...) \
77# define XWSSC_VALIDATE(exp, errstr, ...)
80#define XWSSC_VALIDATE_FORCE(exp, errstr, ...) \
void(* xwssc_ntf_f)(struct xwssc *, xwssc_txh_t, xwer_t, void *)
通知发送结果的回调函数
void xwssc_decode_sdusize(xwu8_t *ecsdusz, xwsz_t *sdusize)
xwer_t xwssc_put(struct xwssc *xwssc)
#define XWSSC_RXTHD_STACK
xwer_t xwssc_grab(struct xwssc *xwssc)
union xwssc_slot * xwssc_rxq_choose(struct xwssc *xwssc, xwu8_t port)
void xwssc_encode_sdusize(xwsz_t sdusize, xwu8_t *ecsdusz, xwu8_t *ecsize)
struct xwssc_carrier * xwssc_txq_choose(struct xwssc *xwssc)
struct xwssc_carrier * xwssc_txq_carrier_alloc(struct xwssc *xwssc)
#define XWSSC_TXTHD_STACK
xwu8_t xwssc_cal_head_chksum(xwu8_t data[], xwsz_t size)
xwer_t xwssc_eq_msg(struct xwssc *xwssc, const xwu8_t sdu[], xwsz_t sdusize, xwu8_t pri, xwu8_t port, xwu8_t qos, xwssc_ntf_f ntfcb, void *cbarg, xwssc_txh_t *txhbuf)
bool xwssc_chk_head(xwu8_t data[], xwsz_t size)
xwer_t xwssc_txthd(struct xwssc *xwssc)
xwer_t xwssc_tx_ack_sdu(struct xwssc *xwssc, xwu8_t port, xwu8_t id, xwu8_t ack)
xwer_t xwssc_rxthd(struct xwssc *xwssc)
void xwssc_txq_carrier_free(struct xwssc *xwssc, struct xwssc_carrier *car)
#define XWMM_BMA_RAWOBJ_DEF(name, blkodr)
定义伙伴算法内存块分配器结构体的RAW内存空间, 用于初始化伙伴算法内存块分配器结构体
#define xwlib_bclst_head
双循环链表头
#define __xwcc_alignl1cache
__xwcc_atomic xwsq_t atomic_xwsq_t
__xwcc_atomic xwu32_t atomic_xwu32_t
#define xwbmpaop_define(name, bits)
XWOS BOPLIB:声明原子位图
#define xwbmpop_define(name, bits)
XWOS BOPLIB:声明位图
struct xwlib_bclst_node node
xwu8_t mempool_bma_raw[sizeof(struct xwmm_bma)+sizeof(struct xwmm_bma_orderlist[(((6U)))+1U])+sizeof(struct xwmm_bma_bcb[1U<<(((6U)))])]
xwu8_t txthd_stack[(4096U)]
xwu8_t rxthd_stack[(4096U)]
const struct xwssc_hwifal_operation * hwifops
struct xwmm_bma * mempool
struct xwssc_carrier * tmp
struct xwssc_slot::@10 rx