xref: /openbmc/linux/drivers/usb/storage/debug.h (revision 1da177e4)
11da177e4SLinus Torvalds /* Driver for USB Mass Storage compliant devices
21da177e4SLinus Torvalds  * Debugging Functions Header File
31da177e4SLinus Torvalds  *
41da177e4SLinus Torvalds  * $Id: debug.h,v 1.6 2001/01/12 23:51:04 mdharm Exp $
51da177e4SLinus Torvalds  *
61da177e4SLinus Torvalds  * Current development and maintenance by:
71da177e4SLinus Torvalds  *   (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
81da177e4SLinus Torvalds  *
91da177e4SLinus Torvalds  * Initial work by:
101da177e4SLinus Torvalds  *   (c) 1999 Michael Gee (michael@linuxspecific.com)
111da177e4SLinus Torvalds  *
121da177e4SLinus Torvalds  * This driver is based on the 'USB Mass Storage Class' document. This
131da177e4SLinus Torvalds  * describes in detail the protocol used to communicate with such
141da177e4SLinus Torvalds  * devices.  Clearly, the designers had SCSI and ATAPI commands in
151da177e4SLinus Torvalds  * mind when they created this document.  The commands are all very
161da177e4SLinus Torvalds  * similar to commands in the SCSI-II and ATAPI specifications.
171da177e4SLinus Torvalds  *
181da177e4SLinus Torvalds  * It is important to note that in a number of cases this class
191da177e4SLinus Torvalds  * exhibits class-specific exemptions from the USB specification.
201da177e4SLinus Torvalds  * Notably the usage of NAK, STALL and ACK differs from the norm, in
211da177e4SLinus Torvalds  * that they are used to communicate wait, failed and OK on commands.
221da177e4SLinus Torvalds  *
231da177e4SLinus Torvalds  * Also, for certain devices, the interrupt endpoint is used to convey
241da177e4SLinus Torvalds  * status of a command.
251da177e4SLinus Torvalds  *
261da177e4SLinus Torvalds  * Please see http://www.one-eyed-alien.net/~mdharm/linux-usb for more
271da177e4SLinus Torvalds  * information about this driver.
281da177e4SLinus Torvalds  *
291da177e4SLinus Torvalds  * This program is free software; you can redistribute it and/or modify it
301da177e4SLinus Torvalds  * under the terms of the GNU General Public License as published by the
311da177e4SLinus Torvalds  * Free Software Foundation; either version 2, or (at your option) any
321da177e4SLinus Torvalds  * later version.
331da177e4SLinus Torvalds  *
341da177e4SLinus Torvalds  * This program is distributed in the hope that it will be useful, but
351da177e4SLinus Torvalds  * WITHOUT ANY WARRANTY; without even the implied warranty of
361da177e4SLinus Torvalds  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
371da177e4SLinus Torvalds  * General Public License for more details.
381da177e4SLinus Torvalds  *
391da177e4SLinus Torvalds  * You should have received a copy of the GNU General Public License along
401da177e4SLinus Torvalds  * with this program; if not, write to the Free Software Foundation, Inc.,
411da177e4SLinus Torvalds  * 675 Mass Ave, Cambridge, MA 02139, USA.
421da177e4SLinus Torvalds  */
431da177e4SLinus Torvalds 
441da177e4SLinus Torvalds #ifndef _DEBUG_H_
451da177e4SLinus Torvalds #define _DEBUG_H_
461da177e4SLinus Torvalds 
471da177e4SLinus Torvalds #include <linux/config.h>
481da177e4SLinus Torvalds #include <linux/kernel.h>
491da177e4SLinus Torvalds 
501da177e4SLinus Torvalds #define USB_STORAGE "usb-storage: "
511da177e4SLinus Torvalds 
521da177e4SLinus Torvalds #ifdef CONFIG_USB_STORAGE_DEBUG
531da177e4SLinus Torvalds void usb_stor_show_command(struct scsi_cmnd *srb);
541da177e4SLinus Torvalds void usb_stor_show_sense( unsigned char key,
551da177e4SLinus Torvalds 		unsigned char asc, unsigned char ascq );
561da177e4SLinus Torvalds #define US_DEBUGP(x...) printk( KERN_DEBUG USB_STORAGE x )
571da177e4SLinus Torvalds #define US_DEBUGPX(x...) printk( x )
581da177e4SLinus Torvalds #define US_DEBUG(x) x
591da177e4SLinus Torvalds #else
601da177e4SLinus Torvalds #define US_DEBUGP(x...)
611da177e4SLinus Torvalds #define US_DEBUGPX(x...)
621da177e4SLinus Torvalds #define US_DEBUG(x)
631da177e4SLinus Torvalds #endif
641da177e4SLinus Torvalds 
651da177e4SLinus Torvalds #endif
66