xref: /dpdk/lib/ethdev/rte_dev_info.h (revision 083db2ed9e9ea321f37fb49a9ea118446c04a782)
199a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
299a2dd95SBruce Richardson  * Copyright(c) 2015 Intel Corporation
399a2dd95SBruce Richardson  */
499a2dd95SBruce Richardson 
599a2dd95SBruce Richardson #ifndef _RTE_DEV_INFO_H_
699a2dd95SBruce Richardson #define _RTE_DEV_INFO_H_
799a2dd95SBruce Richardson 
899a2dd95SBruce Richardson #include <stdint.h>
999a2dd95SBruce Richardson 
10*083db2edSJie Hai #define RTE_ETH_REG_NAME_SIZE 64
11*083db2edSJie Hai struct rte_eth_reg_name {
12*083db2edSJie Hai 	char name[RTE_ETH_REG_NAME_SIZE];
13*083db2edSJie Hai };
14*083db2edSJie Hai 
1599a2dd95SBruce Richardson /*
1699a2dd95SBruce Richardson  * Placeholder for accessing device registers
1799a2dd95SBruce Richardson  */
1899a2dd95SBruce Richardson struct rte_dev_reg_info {
1999a2dd95SBruce Richardson 	void *data; /**< Buffer for return registers */
2099a2dd95SBruce Richardson 	uint32_t offset; /**< Start register table location for access */
2199a2dd95SBruce Richardson 	uint32_t length; /**< Number of registers to fetch */
2299a2dd95SBruce Richardson 	uint32_t width; /**< Size of device register */
2399a2dd95SBruce Richardson 	uint32_t version; /**< Device version */
24*083db2edSJie Hai 	/**
25*083db2edSJie Hai 	 * Name of target module, filter for target subset of registers.
26*083db2edSJie Hai 	 * This field could affects register selection for data/length/names.
27*083db2edSJie Hai 	 */
28*083db2edSJie Hai 	const char *filter;
29*083db2edSJie Hai 	struct rte_eth_reg_name *names; /**< Registers name saver */
3099a2dd95SBruce Richardson };
3199a2dd95SBruce Richardson 
3299a2dd95SBruce Richardson /*
33bf73419dSAndrew Rybchenko  * Placeholder for accessing device EEPROM
3499a2dd95SBruce Richardson  */
3599a2dd95SBruce Richardson struct rte_dev_eeprom_info {
36bf73419dSAndrew Rybchenko 	void *data; /**< Buffer for return EEPROM */
37bf73419dSAndrew Rybchenko 	uint32_t offset; /**< Start EEPROM address for access*/
38bf73419dSAndrew Rybchenko 	uint32_t length; /**< Length of EEPROM region to access */
3999a2dd95SBruce Richardson 	uint32_t magic; /**< Device-specific key, such as device-id */
4099a2dd95SBruce Richardson };
4199a2dd95SBruce Richardson 
4299a2dd95SBruce Richardson /**
43bf73419dSAndrew Rybchenko  * Placeholder for accessing plugin module EEPROM
4499a2dd95SBruce Richardson  */
4599a2dd95SBruce Richardson struct rte_eth_dev_module_info {
46bf73419dSAndrew Rybchenko 	uint32_t type; /**< Type of plugin module EEPROM */
47bf73419dSAndrew Rybchenko 	uint32_t eeprom_len; /**< Length of plugin module EEPROM */
4899a2dd95SBruce Richardson };
4999a2dd95SBruce Richardson 
5099a2dd95SBruce Richardson /* EEPROM Standards for plug in modules */
5199a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8079             0x1
5299a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8079_LEN         256
5399a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8472             0x2
5499a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8472_LEN         512
5599a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8636             0x3
5699a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8636_LEN         256
5799a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8636_MAX_LEN     640
5899a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8436             0x4
5999a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8436_LEN         256
6099a2dd95SBruce Richardson #define RTE_ETH_MODULE_SFF_8436_MAX_LEN     640
6199a2dd95SBruce Richardson 
6299a2dd95SBruce Richardson #endif /* _RTE_DEV_INFO_H_ */
63