diff options
author | Ioana Ciornei | 2023-05-31 19:04:30 +0300 |
---|---|---|
committer | Peng Fan | 2023-06-15 17:58:53 +0800 |
commit | 694dc0dd7904f6680f0523f993433e40c4dc1fd9 (patch) | |
tree | 691b3357531b0d845386a37edd5c29b8893a7fe0 /include/fsl-mc/fsl_mc_cmd.h | |
parent | f21d326be420e2710673974d85debd2c345cc0c7 (diff) |
net: fsl-mc: sync DPBP MC APIs
Sync the Data Path Buffer Pool APIs to their latest form, this means the
layout of each command is created based on structures which clearly
describe the endianness of each field rather than some macros.
The command version is kept in place, meaning that the minimum MC
version accepted is not changed in any way.
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'include/fsl-mc/fsl_mc_cmd.h')
-rw-r--r-- | include/fsl-mc/fsl_mc_cmd.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/fsl-mc/fsl_mc_cmd.h b/include/fsl-mc/fsl_mc_cmd.h index 591cda96851..6fe5fa4edda 100644 --- a/include/fsl-mc/fsl_mc_cmd.h +++ b/include/fsl-mc/fsl_mc_cmd.h @@ -19,6 +19,15 @@ static inline uint64_t mc_dec(uint64_t val, int lsoffset, int width) return (uint64_t)((val >> lsoffset) & MAKE_UMASK64(width)); } +struct mc_cmd_header { + u8 src_id; + u8 flags_hw; + u8 status; + u8 flags_sw; + __le16 token; + __le16 cmd_id; +}; + struct mc_command { uint64_t header; uint64_t params[MC_CMD_NUM_OF_PARAMS]; @@ -179,4 +188,19 @@ static inline void mc_cmd_read_api_version(struct mc_command *cmd, *minor_ver = le16_to_cpu(rsp_params->minor_ver); } +static inline uint16_t mc_cmd_hdr_read_token(struct mc_command *cmd) +{ + struct mc_cmd_header *hdr = (struct mc_cmd_header *)&cmd->header; + u16 token = le16_to_cpu(hdr->token); + + return token; +} + +static inline uint32_t mc_cmd_read_object_id(struct mc_command *cmd) +{ + struct mc_rsp_create *rsp_params; + + rsp_params = (struct mc_rsp_create *)cmd->params; + return le32_to_cpu(rsp_params->object_id); +} #endif /* __FSL_MC_CMD_H */ |