include/linux/dibs.h

Source file repositories/reference/linux-study-clean/include/linux/dibs.h

File Facts

System
Linux kernel
Corpus path
include/linux/dibs.h
Extension
.h
Size
15560 bytes
Lines
465
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct dibs_dmb {
	/* tok - Token for this dmb
	 * Used by remote and local devices and clients to address this dmb.
	 * Provided by dibs fabric. Unique per dibs fabric.
	 */
	u64 dmb_tok;
	/* rgid - GID of designated remote sending device */
	uuid_t rgid;
	/* cpu_addr - buffer address */
	void *cpu_addr;
	/* len - buffer length */
	u32 dmb_len;
	/* idx - Index of this DMB on this receiving device */
	u32 idx;
	/* VLAN support (deprecated)
	 * In order to write into a vlan-tagged dmb, the remote device needs
	 * to belong to the this vlan
	 */
	u32 vlan_valid;
	u32 vlan_id;
	/* optional, used by device driver */
	dma_addr_t dma_addr;
};

/* DIBS events
 * -----------
 * Dibs devices can optionally notify dibs clients about events that happened
 * in the fabric or at the remote device or remote dmb.
 */
enum dibs_event_type {
	/* Buffer event, e.g. a remote dmb was unregistered */
	DIBS_BUF_EVENT,
	/* Device event, e.g. a remote dibs device was disabled */
	DIBS_DEV_EVENT,
	/* Software event, a dibs client can send an event signal to a
	 * remote dibs device.
	 */
	DIBS_SW_EVENT,
	DIBS_OTHER_TYPE };

enum dibs_event_subtype {
	DIBS_BUF_UNREGISTERED,
	DIBS_DEV_DISABLED,
	DIBS_DEV_ERR_STATE,
	DIBS_OTHER_SUBTYPE
};

struct dibs_event {
	u32 type;
	u32 subtype;
	/* uuid_null if invalid */
	uuid_t gid;
	/* zero if invalid */
	u64 buffer_tok;
	u64 time;
	/* additional data or zero */
	u64 data;
};

struct dibs_dev;

/* DIBS client
 * -----------
 */
#define MAX_DIBS_CLIENTS	8
#define NO_DIBS_CLIENT		0xff
/* All dibs clients have access to all dibs devices.
 * A dibs client provides the following functions to be called by dibs layer or
 * dibs device drivers:
 */
struct dibs_client_ops {
	/**
	 *  add_dev() - add a dibs device
	 *  @dev: device that was added
	 *
	 * Will be called during dibs_register_client() for all existing
	 * dibs devices and whenever a new dibs device is registered.
	 * dev is usable until dibs_client.remove() is called.
	 * *dev is protected by device refcounting.
	 */
	void (*add_dev)(struct dibs_dev *dev);
	/**
	 * del_dev() - remove a dibs device
	 * @dev: device to be removed
	 *
	 * Will be called whenever a dibs device is removed.
	 * Will be called during dibs_unregister_client() for all existing
	 * dibs devices and whenever a dibs device is unregistered.
	 * The device has already stopped initiative for this client:
	 * No new handlers will be started.

Annotation

Implementation Notes