drivers/message/fusion/mptdebug.h

Source file repositories/reference/linux-study-clean/drivers/message/fusion/mptdebug.h

File Facts

System
Linux kernel
Corpus path
drivers/message/fusion/mptdebug.h
Extension
.h
Size
7200 bytes
Lines
294
Domain
Driver Families
Bucket
drivers/message
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

#ifndef MPTDEBUG_H_INCLUDED
#define MPTDEBUG_H_INCLUDED

/*
 * debug level can be programmed on the fly via SysFS (hex values)
 *
 * Example:  (programming for MPT_DEBUG_EVENTS on host 5)
 *
 * echo 8 > /sys/class/scsi_host/host5/debug_level
 *
 * --------------------------------------------------------
 * mpt_debug_level - command line parameter
 * this allow enabling debug at driver load time (for all iocs)
 *
 * Example  (programming for MPT_DEBUG_EVENTS)
 *
 * insmod mptbase.ko mpt_debug_level=8
 *
 * --------------------------------------------------------
 * CONFIG_FUSION_LOGGING - enables compiling debug into driver
 * this can be enabled in the driver Makefile
 *
 *
 * --------------------------------------------------------
 * Please note most debug prints are set to logging priority = debug
 * This is the lowest level, and most verbose.  Please refer to manual
 * pages for syslogd or syslogd-ng on how to configure this.
 */

#define MPT_DEBUG			0x00000001
#define MPT_DEBUG_MSG_FRAME		0x00000002
#define MPT_DEBUG_SG			0x00000004
#define MPT_DEBUG_EVENTS		0x00000008
#define MPT_DEBUG_VERBOSE_EVENTS	0x00000010
#define MPT_DEBUG_INIT			0x00000020
#define MPT_DEBUG_EXIT			0x00000040
#define MPT_DEBUG_FAIL			0x00000080
#define MPT_DEBUG_TM			0x00000100
#define MPT_DEBUG_DV			0x00000200
#define MPT_DEBUG_REPLY			0x00000400
#define MPT_DEBUG_HANDSHAKE		0x00000800
#define MPT_DEBUG_CONFIG		0x00001000
#define MPT_DEBUG_DL			0x00002000
#define MPT_DEBUG_RESET			0x00008000
#define MPT_DEBUG_SCSI			0x00010000
#define MPT_DEBUG_IOCTL			0x00020000
#define MPT_DEBUG_FC			0x00080000
#define MPT_DEBUG_SAS			0x00100000
#define MPT_DEBUG_SAS_WIDE		0x00200000
#define MPT_DEBUG_36GB_MEM              0x00400000

/*
 * CONFIG_FUSION_LOGGING - enabled in Kconfig
 */

#ifdef CONFIG_FUSION_LOGGING
#define MPT_CHECK_LOGGING(IOC, CMD, BITS)			\
do {								\
	if (IOC->debug_level & BITS)				\
		CMD;						\
} while (0)
#else
#define MPT_CHECK_LOGGING(IOC, CMD, BITS)			\
do { } while (0)
#endif


/*
 * debug macros
 */

#define dprintk(IOC, CMD)			\
	MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG)

#define dsgprintk(IOC, CMD)			\
	MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_SG)

#define devtprintk(IOC, CMD)			\
	MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_EVENTS)

#define devtverboseprintk(IOC, CMD)		\
	MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_VERBOSE_EVENTS)

#define dinitprintk(IOC, CMD)			\
	MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_INIT)

#define dexitprintk(IOC, CMD)			\
	MPT_CHECK_LOGGING(IOC, CMD, MPT_DEBUG_EXIT)

#define dfailprintk(IOC, CMD)			\

Annotation

Implementation Notes