drivers/ntb/hw/idt/ntb_hw_idt.h

Source file repositories/reference/linux-study-clean/drivers/ntb/hw/idt/ntb_hw_idt.h

File Facts

System
Linux kernel
Corpus path
drivers/ntb/hw/idt/ntb_hw_idt.h
Extension
.h
Size
45551 bytes
Lines
1227
Domain
Driver Families
Bucket
drivers/ntb
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct idt_89hpes_cfg {
	char *name;
	unsigned char port_cnt;
	unsigned char ports[];
};

/*
 * Memory window configuration structure
 * @type:	Type of the memory window (direct address translation or lookup
 *		table)
 *
 * @bar:	PCIe BAR the memory window referenced to
 * @idx:	Index of the memory window within the BAR
 *
 * @addr_align:	Alignment of translated address
 * @size_align:	Alignment of memory window size
 * @size_max:	Maximum size of memory window
 */
struct idt_mw_cfg {
	enum idt_mw_type type;

	unsigned char bar;
	unsigned char idx;

	u64 addr_align;
	u64 size_align;
	u64 size_max;
};

/*
 * Description structure of peer IDT NT-functions:
 * @port:		NT-function port
 * @part:		NT-function partition
 *
 * @mw_cnt:		Number of memory windows supported by NT-function
 * @mws:		Array of memory windows descriptors
 */
struct idt_ntb_peer {
	unsigned char port;
	unsigned char part;

	unsigned char mw_cnt;
	struct idt_mw_cfg *mws;
};

/*
 * Description structure of local IDT NT-function:
 * @ntb:		Linux NTB-device description structure
 * @swcfg:		Pointer to the structure of local IDT PCIe-switch
 *			specific cofnfigurations
 *
 * @port:		Local NT-function port
 * @part:		Local NT-function partition
 *
 * @peer_cnt:		Number of peers with activated NTB-function
 * @peers:		Array of peers descripting structures
 * @port_idx_map:	Map of port number -> peer index
 * @part_idx_map:	Map of partition number -> peer index
 *
 * @mtbl_lock:		Mapping table access lock
 *
 * @mw_cnt:		Number of memory windows supported by NT-function
 * @mws:		Array of memory windows descriptors
 * @lut_lock:		Lookup table access lock
 *
 * @msg_locks:		Message registers mapping table lockers
 *
 * @cfgspc:		Virtual address of the memory mapped configuration
 *			space of the NT-function
 * @db_mask_lock:	Doorbell mask register lock
 * @msg_mask_lock:	Message mask register lock
 * @gasa_lock:		GASA registers access lock
 *
 * @hwmon_mtx:		Temperature sensor interface update mutex
 *
 * @dbgfs_info:		DebugFS info node
 */
struct idt_ntb_dev {
	struct ntb_dev ntb;
	struct idt_89hpes_cfg *swcfg;

	unsigned char port;
	unsigned char part;

	unsigned char peer_cnt;
	struct idt_ntb_peer peers[IDT_MAX_NR_PEERS];
	char port_idx_map[IDT_MAX_NR_PORTS];
	char part_idx_map[IDT_MAX_NR_PARTS];

	spinlock_t mtbl_lock;

Annotation

Implementation Notes