drivers/usb/storage/debug.h

Source file repositories/reference/linux-study-clean/drivers/usb/storage/debug.h

File Facts

System
Linux kernel
Corpus path
drivers/usb/storage/debug.h
Extension
.h
Size
1677 bytes
Lines
52
Domain
Driver Families
Bucket
drivers/usb
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 _DEBUG_H_
#define _DEBUG_H_

#include <linux/kernel.h>

#ifdef CONFIG_USB_STORAGE_DEBUG
void usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb);
void usb_stor_show_sense(const struct us_data *us, unsigned char key,
			 unsigned char asc, unsigned char ascq);
__printf(2, 3) void usb_stor_dbg(const struct us_data *us,
				 const char *fmt, ...);

#define US_DEBUG(x)		x
#else
__printf(2, 3)
static inline void _usb_stor_dbg(const struct us_data *us,
				 const char *fmt, ...)
{
}
#define usb_stor_dbg(us, fmt, ...)				\
	do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0)
#define US_DEBUG(x)
#endif

#endif

Annotation

Implementation Notes