bus/fslmc: fix mempool ops registration
[dpdk.git] / drivers / bus / fslmc / mc / fsl_dpbp_cmd.h
1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
2  *
3  * Copyright 2013-2016 Freescale Semiconductor Inc.
4  * Copyright 2016-2017 NXP
5  *
6  */
7 #ifndef _FSL_DPBP_CMD_H
8 #define _FSL_DPBP_CMD_H
9
10 /* DPBP Version */
11 #define DPBP_VER_MAJOR                          3
12 #define DPBP_VER_MINOR                          3
13
14 /* Command versioning */
15 #define DPBP_CMD_BASE_VERSION                   1
16 #define DPBP_CMD_ID_OFFSET                      4
17
18 #define DPBP_CMD(id)    ((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
19
20 /* Command IDs */
21 #define DPBP_CMDID_CLOSE                DPBP_CMD(0x800)
22 #define DPBP_CMDID_OPEN                 DPBP_CMD(0x804)
23 #define DPBP_CMDID_CREATE               DPBP_CMD(0x904)
24 #define DPBP_CMDID_DESTROY              DPBP_CMD(0x984)
25 #define DPBP_CMDID_GET_API_VERSION      DPBP_CMD(0xa04)
26
27 #define DPBP_CMDID_ENABLE               DPBP_CMD(0x002)
28 #define DPBP_CMDID_DISABLE              DPBP_CMD(0x003)
29 #define DPBP_CMDID_GET_ATTR             DPBP_CMD(0x004)
30 #define DPBP_CMDID_RESET                DPBP_CMD(0x005)
31 #define DPBP_CMDID_IS_ENABLED           DPBP_CMD(0x006)
32
33 #define DPBP_CMDID_SET_IRQ_ENABLE       DPBP_CMD(0x012)
34 #define DPBP_CMDID_GET_IRQ_ENABLE       DPBP_CMD(0x013)
35 #define DPBP_CMDID_SET_IRQ_MASK         DPBP_CMD(0x014)
36 #define DPBP_CMDID_GET_IRQ_MASK         DPBP_CMD(0x015)
37 #define DPBP_CMDID_GET_IRQ_STATUS       DPBP_CMD(0x016)
38 #define DPBP_CMDID_CLEAR_IRQ_STATUS     DPBP_CMD(0x017)
39
40 #define DPBP_CMDID_SET_NOTIFICATIONS    DPBP_CMD(0x1b0)
41 #define DPBP_CMDID_GET_NOTIFICATIONS    DPBP_CMD(0x1b1)
42
43 #define DPBP_CMDID_GET_FREE_BUFFERS_NUM DPBP_CMD(0x1b2)
44
45 #pragma pack(push, 1)
46 struct dpbp_cmd_open {
47         uint32_t dpbp_id;
48 };
49
50 struct dpbp_cmd_destroy {
51         uint32_t object_id;
52 };
53
54 #define DPBP_ENABLE                     0x1
55
56 struct dpbp_rsp_is_enabled {
57         uint8_t enabled;
58 };
59
60 struct dpbp_rsp_get_attributes {
61         uint16_t pad;
62         uint16_t bpid;
63         uint32_t id;
64 };
65
66 struct dpbp_cmd_set_notifications {
67         uint32_t depletion_entry;
68         uint32_t depletion_exit;
69         uint32_t surplus_entry;
70         uint32_t surplus_exit;
71         uint16_t options;
72         uint16_t pad[3];
73         uint64_t message_ctx;
74         uint64_t message_iova;
75 };
76
77 struct dpbp_rsp_get_notifications {
78         uint32_t depletion_entry;
79         uint32_t depletion_exit;
80         uint32_t surplus_entry;
81         uint32_t surplus_exit;
82         uint16_t options;
83         uint16_t pad[3];
84         uint64_t message_ctx;
85         uint64_t message_iova;
86 };
87
88 struct dpbp_rsp_get_api_version {
89         uint16_t major;
90         uint16_t minor;
91 };
92
93 struct dpbp_rsp_get_num_free_bufs {
94         uint32_t num_free_bufs;
95 };
96
97 #pragma pack(pop)
98 #endif /* _FSL_DPBP_CMD_H */