drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h

Source file repositories/reference/linux-study-clean/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h
Extension
.h
Size
10639 bytes
Lines
363
Domain
Driver Families
Bucket
drivers/scsi
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 dma_window {
	u32 liobn;	/* Unique per vdevice */
	u64 tce_base;	/* Physical location of the TCE table */
	u64 tce_size;	/* Size of the TCE table in bytes */
};

struct target_dds {
	u64 unit_id;                /* 64 bit will force alignment */
#define NUM_DMA_WINDOWS 2
#define LOCAL  0
#define REMOTE 1
	struct dma_window  window[NUM_DMA_WINDOWS];

	/* root node property "ibm,partition-no" */
	uint partition_num;
	char partition_name[PARTITION_NAMELEN];
};

#define MAX_NUM_PORTS        1
#define MAX_H_COPY_RDMA      (128 * 1024)

#define MAX_EYE   64

/* Return codes */
#define ADAPT_SUCCESS            0L
/* choose error codes that do not conflict with PHYP */
#define ERROR                   -40L

struct format_code {
	u8 reserved;
	u8 buffers;
};

struct client_info {
#define SRP_VERSION "16.a"
	char srp_version[8];
	/* root node property ibm,partition-name */
	char partition_name[PARTITION_NAMELEN];
	/* root node property ibm,partition-no */
	u32 partition_number;
	/* initially 1 */
	u32 mad_version;
	u32 os_type;
};

/*
 * Changing this constant changes the number of seconds to wait before
 * considering the client will never service its queue again.
 */
#define SECONDS_TO_CONSIDER_FAILED 30
/*
 * These constants set the polling period used to determine if the client
 * has freed at least one element in the response queue.
 */
#define WAIT_SECONDS 1
#define WAIT_NANO_SECONDS 5000
#define MAX_TIMER_POPS ((1000000 / WAIT_NANO_SECONDS) * \
			SECONDS_TO_CONSIDER_FAILED)
/*
 * general purpose timer control block
 * which can be used for multiple functions
 */
struct timer_cb {
	struct hrtimer timer;
	/*
	 * how long has it been since the client
	 * serviced the queue. The variable is incrmented
	 * in the service_wait_q routine and cleared
	 * in send messages
	 */
	int timer_pops;
	/* the timer is started */
	bool started;
};

struct cmd_queue {
	/* kva */
	struct viosrp_crq *base_addr;
	dma_addr_t crq_token;
	/* used to maintain index */
	uint mask;
	/* current element */
	uint index;
	int size;
};

#define SCSOLNT_RESP_SHIFT	1
#define UCSOLNT_RESP_SHIFT	2

#define SCSOLNT         BIT(SCSOLNT_RESP_SHIFT)

Annotation

Implementation Notes