18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Driver for USB Mass Storage compliant devices
48c2ecf20Sopenharmony_ci * Debugging Functions Header File
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Current development and maintenance by:
78c2ecf20Sopenharmony_ci *   (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Initial work by:
108c2ecf20Sopenharmony_ci *   (c) 1999 Michael Gee (michael@linuxspecific.com)
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci * This driver is based on the 'USB Mass Storage Class' document. This
138c2ecf20Sopenharmony_ci * describes in detail the protocol used to communicate with such
148c2ecf20Sopenharmony_ci * devices.  Clearly, the designers had SCSI and ATAPI commands in
158c2ecf20Sopenharmony_ci * mind when they created this document.  The commands are all very
168c2ecf20Sopenharmony_ci * similar to commands in the SCSI-II and ATAPI specifications.
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * It is important to note that in a number of cases this class
198c2ecf20Sopenharmony_ci * exhibits class-specific exemptions from the USB specification.
208c2ecf20Sopenharmony_ci * Notably the usage of NAK, STALL and ACK differs from the norm, in
218c2ecf20Sopenharmony_ci * that they are used to communicate wait, failed and OK on commands.
228c2ecf20Sopenharmony_ci *
238c2ecf20Sopenharmony_ci * Also, for certain devices, the interrupt endpoint is used to convey
248c2ecf20Sopenharmony_ci * status of a command.
258c2ecf20Sopenharmony_ci */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#ifndef _DEBUG_H_
288c2ecf20Sopenharmony_ci#define _DEBUG_H_
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#include <linux/kernel.h>
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#ifdef CONFIG_USB_STORAGE_DEBUG
338c2ecf20Sopenharmony_civoid usb_stor_show_command(const struct us_data *us, struct scsi_cmnd *srb);
348c2ecf20Sopenharmony_civoid usb_stor_show_sense(const struct us_data *us, unsigned char key,
358c2ecf20Sopenharmony_ci			 unsigned char asc, unsigned char ascq);
368c2ecf20Sopenharmony_ci__printf(2, 3) void usb_stor_dbg(const struct us_data *us,
378c2ecf20Sopenharmony_ci				 const char *fmt, ...);
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#define US_DEBUG(x)		x
408c2ecf20Sopenharmony_ci#else
418c2ecf20Sopenharmony_ci__printf(2, 3)
428c2ecf20Sopenharmony_cistatic inline void _usb_stor_dbg(const struct us_data *us,
438c2ecf20Sopenharmony_ci				 const char *fmt, ...)
448c2ecf20Sopenharmony_ci{
458c2ecf20Sopenharmony_ci}
468c2ecf20Sopenharmony_ci#define usb_stor_dbg(us, fmt, ...)				\
478c2ecf20Sopenharmony_ci	do { if (0) _usb_stor_dbg(us, fmt, ##__VA_ARGS__); } while (0)
488c2ecf20Sopenharmony_ci#define US_DEBUG(x)
498c2ecf20Sopenharmony_ci#endif
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci#endif
52