xref: /dpdk/lib/ethdev/rte_dev_info.h (revision 083db2ed9e9ea321f37fb49a9ea118446c04a782)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2015 Intel Corporation
3  */
4 
5 #ifndef _RTE_DEV_INFO_H_
6 #define _RTE_DEV_INFO_H_
7 
8 #include <stdint.h>
9 
10 #define RTE_ETH_REG_NAME_SIZE 64
11 struct rte_eth_reg_name {
12 	char name[RTE_ETH_REG_NAME_SIZE];
13 };
14 
15 /*
16  * Placeholder for accessing device registers
17  */
18 struct rte_dev_reg_info {
19 	void *data; /**< Buffer for return registers */
20 	uint32_t offset; /**< Start register table location for access */
21 	uint32_t length; /**< Number of registers to fetch */
22 	uint32_t width; /**< Size of device register */
23 	uint32_t version; /**< Device version */
24 	/**
25 	 * Name of target module, filter for target subset of registers.
26 	 * This field could affects register selection for data/length/names.
27 	 */
28 	const char *filter;
29 	struct rte_eth_reg_name *names; /**< Registers name saver */
30 };
31 
32 /*
33  * Placeholder for accessing device EEPROM
34  */
35 struct rte_dev_eeprom_info {
36 	void *data; /**< Buffer for return EEPROM */
37 	uint32_t offset; /**< Start EEPROM address for access*/
38 	uint32_t length; /**< Length of EEPROM region to access */
39 	uint32_t magic; /**< Device-specific key, such as device-id */
40 };
41 
42 /**
43  * Placeholder for accessing plugin module EEPROM
44  */
45 struct rte_eth_dev_module_info {
46 	uint32_t type; /**< Type of plugin module EEPROM */
47 	uint32_t eeprom_len; /**< Length of plugin module EEPROM */
48 };
49 
50 /* EEPROM Standards for plug in modules */
51 #define RTE_ETH_MODULE_SFF_8079             0x1
52 #define RTE_ETH_MODULE_SFF_8079_LEN         256
53 #define RTE_ETH_MODULE_SFF_8472             0x2
54 #define RTE_ETH_MODULE_SFF_8472_LEN         512
55 #define RTE_ETH_MODULE_SFF_8636             0x3
56 #define RTE_ETH_MODULE_SFF_8636_LEN         256
57 #define RTE_ETH_MODULE_SFF_8636_MAX_LEN     640
58 #define RTE_ETH_MODULE_SFF_8436             0x4
59 #define RTE_ETH_MODULE_SFF_8436_LEN         256
60 #define RTE_ETH_MODULE_SFF_8436_MAX_LEN     640
61 
62 #endif /* _RTE_DEV_INFO_H_ */
63