1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
3 * Copyright 2010-2011 Freescale Semiconductor, Inc.
13 #include <rte_ethdev.h>
15 /* The process device underlies process-wide user/kernel interactions, such as
16 * mapping dma_mem memory and providing accompanying ioctl()s. (This isn't used
17 * for portals, which use one UIO device each.).
19 #define PROCESS_PATH "/dev/fsl-usdpaa"
21 /* Allocation of resource IDs uses a generic interface. This enum is used to
22 * distinguish between the type of underlying object being manipulated.
29 dpaa_id_max /* <-- not a valid type, represents the number of types */
32 int process_alloc(enum dpaa_id_type id_type, uint32_t *base, uint32_t num,
33 uint32_t align, int partial);
34 void process_release(enum dpaa_id_type id_type, uint32_t base, uint32_t num);
36 int process_reserve(enum dpaa_id_type id_type, uint32_t base, uint32_t num);
38 /* Mapping and using QMan/BMan portals */
39 enum dpaa_portal_type {
44 struct dpaa_portal_map {
49 struct dpaa_ioctl_portal_map {
50 /* Input parameter, is a qman or bman portal required. */
51 enum dpaa_portal_type type;
52 /* Specifes a specific portal index to map or 0xffffffff
57 /* Return value if the map succeeds, this gives the mapped
58 * cache-inhibited (cinh) and cache-enabled (cena) addresses.
60 struct dpaa_portal_map addr;
62 /* Qman-specific return values */
67 int process_portal_map(struct dpaa_ioctl_portal_map *params);
68 int process_portal_unmap(struct dpaa_portal_map *map);
70 struct dpaa_ioctl_irq_map {
71 enum dpaa_portal_type type; /* Type of portal to map */
72 int fd; /* File descriptor that contains the portal */
73 void *portal_cinh; /* Cache inhibited area to identify the portal */
76 int process_portal_irq_map(int fd, struct dpaa_ioctl_irq_map *irq);
77 int process_portal_irq_unmap(int fd);
79 struct usdpaa_ioctl_link_status {
80 char if_name[IF_NAME_MAX_LEN];
85 int dpaa_intr_enable(char *if_name, int efd);
88 int dpaa_intr_disable(char *if_name);
90 struct usdpaa_ioctl_link_status_args_old {
91 /* network device node name */
92 char if_name[IF_NAME_MAX_LEN];
93 /* link status(ETH_LINK_UP/DOWN) */
97 struct usdpaa_ioctl_link_status_args {
98 /* network device node name */
99 char if_name[IF_NAME_MAX_LEN];
100 /* link status(ETH_LINK_UP/DOWN) */
102 /* link speed (ETH_SPEED_NUM_)*/
104 /* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/
106 /* link autoneg (ETH_LINK_AUTONEG/FIXED)*/
111 struct usdpaa_ioctl_update_link_status_args {
112 /* network device node name */
113 char if_name[IF_NAME_MAX_LEN];
114 /* link status(ETH_LINK_UP/DOWN) */
118 struct usdpaa_ioctl_update_link_speed {
119 /* network device node name*/
120 char if_name[IF_NAME_MAX_LEN];
121 /* link speed (ETH_SPEED_NUM_)*/
123 /* link duplex (ETH_LINK_[HALF/FULL]_DUPLEX)*/
128 int dpaa_get_link_status(char *if_name, struct rte_eth_link *link);
130 int dpaa_update_link_status(char *if_name, int link_status);
132 int dpaa_update_link_speed(char *if_name, int speed, int duplex);
134 int dpaa_restart_link_autoneg(char *if_name);
136 int dpaa_get_ioctl_version_number(void);
138 #endif /* __PROCESS_H */