]> git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/dpdk/drivers/bus/fslmc/mc/fsl_dpdmai_cmd.h
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / spdk / dpdk / drivers / bus / fslmc / mc / fsl_dpdmai_cmd.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2018 NXP
3 */
4
5 #ifndef _FSL_DPDMAI_CMD_H
6 #define _FSL_DPDMAI_CMD_H
7
8 /* DPDMAI Version */
9 #define DPDMAI_VER_MAJOR 3
10 #define DPDMAI_VER_MINOR 2
11
12 /* Command versioning */
13 #define DPDMAI_CMD_BASE_VERSION 1
14 #define DPDMAI_CMD_ID_OFFSET 4
15
16 #define DPDMAI_CMD(id) ((id << DPDMAI_CMD_ID_OFFSET) | DPDMAI_CMD_BASE_VERSION)
17
18 /* Command IDs */
19 #define DPDMAI_CMDID_CLOSE DPDMAI_CMD(0x800)
20 #define DPDMAI_CMDID_OPEN DPDMAI_CMD(0x80E)
21 #define DPDMAI_CMDID_CREATE DPDMAI_CMD(0x90E)
22 #define DPDMAI_CMDID_DESTROY DPDMAI_CMD(0x98E)
23 #define DPDMAI_CMDID_GET_API_VERSION DPDMAI_CMD(0xa0E)
24
25 #define DPDMAI_CMDID_ENABLE DPDMAI_CMD(0x002)
26 #define DPDMAI_CMDID_DISABLE DPDMAI_CMD(0x003)
27 #define DPDMAI_CMDID_GET_ATTR DPDMAI_CMD(0x004)
28 #define DPDMAI_CMDID_RESET DPDMAI_CMD(0x005)
29 #define DPDMAI_CMDID_IS_ENABLED DPDMAI_CMD(0x006)
30
31 #define DPDMAI_CMDID_SET_RX_QUEUE DPDMAI_CMD(0x1A0)
32 #define DPDMAI_CMDID_GET_RX_QUEUE DPDMAI_CMD(0x1A1)
33 #define DPDMAI_CMDID_GET_TX_QUEUE DPDMAI_CMD(0x1A2)
34
35 /* Macros for accessing command fields smaller than 1byte */
36 #define DPDMAI_MASK(field) \
37 GENMASK(DPDMAI_##field##_SHIFT + DPDMAI_##field##_SIZE - 1, \
38 DPDMAI_##field##_SHIFT)
39 #define dpdmai_set_field(var, field, val) \
40 ((var) |= (((val) << DPDMAI_##field##_SHIFT) & DPDMAI_MASK(field)))
41 #define dpdmai_get_field(var, field) \
42 (((var) & DPDMAI_MASK(field)) >> DPDMAI_##field##_SHIFT)
43
44 #pragma pack(push, 1)
45 struct dpdmai_cmd_open {
46 uint32_t dpdmai_id;
47 };
48
49 struct dpdmai_cmd_create {
50 uint8_t pad;
51 uint8_t priorities[2];
52 };
53
54 struct dpdmai_cmd_destroy {
55 uint32_t dpdmai_id;
56 };
57
58 #define DPDMAI_ENABLE_SHIFT 0
59 #define DPDMAI_ENABLE_SIZE 1
60
61 struct dpdmai_rsp_is_enabled {
62 /* only the LSB bit */
63 uint8_t en;
64 };
65
66 struct dpdmai_rsp_get_attr {
67 uint32_t id;
68 uint8_t num_of_priorities;
69 };
70
71 #define DPDMAI_DEST_TYPE_SHIFT 0
72 #define DPDMAI_DEST_TYPE_SIZE 4
73
74 struct dpdmai_cmd_set_rx_queue {
75 uint32_t dest_id;
76 uint8_t dest_priority;
77 uint8_t priority;
78 /* from LSB: dest_type:4 */
79 uint8_t dest_type;
80 uint8_t pad;
81 uint64_t user_ctx;
82 uint32_t options;
83 };
84
85 struct dpdmai_cmd_get_queue {
86 uint8_t pad[5];
87 uint8_t priority;
88 };
89
90 struct dpdmai_rsp_get_rx_queue {
91 uint32_t dest_id;
92 uint8_t dest_priority;
93 uint8_t pad1;
94 /* from LSB: dest_type:4 */
95 uint8_t dest_type;
96 uint8_t pad2;
97 uint64_t user_ctx;
98 uint32_t fqid;
99 };
100
101 struct dpdmai_rsp_get_tx_queue {
102 uint64_t pad;
103 uint32_t fqid;
104 };
105
106 #pragma pack(pop)
107 #endif /* _FSL_DPDMAI_CMD_H */