4 #include <linux/slab.h>
11 #define MPS_MSG_HEADER(_rw, _sc, _bc, _cmd, _chan, _mode, _ecmd, _length) \
12 (((_rw) << 31) | ((_sc) << 30) | ((_bc) << 29) | ((_cmd) << 24) | \
13 ((_chan) << 16) | ((_mode) << 13) | ((_ecmd) << 8) | (_length))
15 #define MPS_MSG_INIT(_msg, _rw, _sc, _bc, _cmd, _chan, _mode, _ecmd, _length) \
17 (_msg)->header = MPS_MSG_HEADER(_rw, _sc, _bc, _cmd, _chan, _mode, \
22 static inline void mps_msg_init(struct mps_message
*msg
, uint32_t rw
, uint32_t sc
,
23 uint32_t bc
, uint32_t cmd
, uint32_t chan
, uint32_t mode
, uint32_t ecmd
,
26 msg
->header
= MPS_MSG_HEADER(rw
, sc
, bc
, cmd
, chan
, mode
, ecmd
, length
);
29 #define DECLARE_MESSAGE(_name, _size) struct mps_message _name; \
30 uint32_t __mps_msg_data_ ## __FUNCTION__ ## __LINE__[_size]
32 static inline struct mps_message
*mps_message_alloc(size_t size
)
34 return kmalloc(sizeof(struct mps_message
) + size
* sizeof(uint32_t), GFP_KERNEL
);
37 static inline size_t mps_message_size(const struct mps_message
*msg
)
39 return msg
->header
& 0xff;
57 #define MOD_SIGNALING 2
59 #define MOD_RESOURCE 6
61 #define ECMD_SYS_VER 6
62 #define SYS_CAP_ECMD 7
63 #define ECMD_CIDS_DATA 9
64 #define ECMD_DCCTL_DEBUG 0x0a
66 #define ALI_CHAN_CMD 6
67 #define ALI_CHAN_ECMD 1
69 #define MPS_MSG_HEADER_W(_sc, _bc, _cmd, _chan, _mode, _ecmd, _length) \
70 MPS_MSG_HEADER(MPS_MSG_WRITE, _sc, _bc, _cmd, _chan, _mode, _ecmd, _length)
72 #define MPS_MSG_HEADER_R(_sc, _bc, _cmd, _chan, _mode, _ecmd, _length) \
73 MPS_MSG_HEADER(MPS_MSG_READ, _sc, _bc, _cmd, _chan, _mode, _ecmd, _length)
75 #define MPS_MSG_CMD_EOP(_mode, _ecmd, _length) \
76 MPS_MSG_HEADER_R(0, 0, MPS_CMD_EOP, 0, _mode, _ecmd, _length)
78 #define MPS_MSG_CMD_EOP_SYSTEM(_ecmd, _length) \
79 MPS_MSG_CMD_EOP(MOD_SYSTEM, _ecmd, _length)
81 #define MPS_CMD_GET_VERSION \
82 MPS_MSG_CMD_EOP_SYSTEM(ECMD_SYS_VER, 4)
84 #define MPS_CMD_ALI(_chan) \
85 MPS_MSG_HEADER_W(0, 0, ALI_CHAN_CMD, _chan, MOD_ALI, ALI_CHAN_ECMD, 12)
This page took 0.048521 seconds and 5 git commands to generate.