drivers/scsi/csiostor/csio_defs.h

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

File Facts

System
Linux kernel
Corpus path
drivers/scsi/csiostor/csio_defs.h
Extension
.h
Size
3644 bytes
Lines
136
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 csio_sm {
	struct list_head	sm_list;
	csio_sm_state_t		sm_state;
};

static inline void
csio_set_state(void *smp, void *state)
{
	((struct csio_sm *)smp)->sm_state = state;
}

static inline void
csio_init_state(struct csio_sm *smp, void *state)
{
	csio_set_state(smp, state);
}

static inline void
csio_post_event(void *smp, uint32_t evt)
{
	((struct csio_sm *)smp)->sm_state(smp, evt);
}

static inline csio_sm_state_t
csio_get_state(void *smp)
{
	return ((struct csio_sm *)smp)->sm_state;
}

static inline bool
csio_match_state(void *smp, void *state)
{
	return (csio_get_state(smp) == (csio_sm_state_t)state);
}

#define	CSIO_ASSERT(cond)		BUG_ON(!(cond))

#ifdef __CSIO_DEBUG__
#define CSIO_DB_ASSERT(__c)		CSIO_ASSERT((__c))
#else
#define CSIO_DB_ASSERT(__c)
#endif

#endif /* ifndef __CSIO_DEFS_H__ */

Annotation

Implementation Notes