1*1da177e4SLinus Torvalds /* Driver for USB Mass Storage compliant devices 2*1da177e4SLinus Torvalds * Debugging Functions Header File 3*1da177e4SLinus Torvalds * 4*1da177e4SLinus Torvalds * $Id: debug.h,v 1.6 2001/01/12 23:51:04 mdharm Exp $ 5*1da177e4SLinus Torvalds * 6*1da177e4SLinus Torvalds * Current development and maintenance by: 7*1da177e4SLinus Torvalds * (c) 1999-2002 Matthew Dharm ([email protected]) 8*1da177e4SLinus Torvalds * 9*1da177e4SLinus Torvalds * Initial work by: 10*1da177e4SLinus Torvalds * (c) 1999 Michael Gee ([email protected]) 11*1da177e4SLinus Torvalds * 12*1da177e4SLinus Torvalds * This driver is based on the 'USB Mass Storage Class' document. This 13*1da177e4SLinus Torvalds * describes in detail the protocol used to communicate with such 14*1da177e4SLinus Torvalds * devices. Clearly, the designers had SCSI and ATAPI commands in 15*1da177e4SLinus Torvalds * mind when they created this document. The commands are all very 16*1da177e4SLinus Torvalds * similar to commands in the SCSI-II and ATAPI specifications. 17*1da177e4SLinus Torvalds * 18*1da177e4SLinus Torvalds * It is important to note that in a number of cases this class 19*1da177e4SLinus Torvalds * exhibits class-specific exemptions from the USB specification. 20*1da177e4SLinus Torvalds * Notably the usage of NAK, STALL and ACK differs from the norm, in 21*1da177e4SLinus Torvalds * that they are used to communicate wait, failed and OK on commands. 22*1da177e4SLinus Torvalds * 23*1da177e4SLinus Torvalds * Also, for certain devices, the interrupt endpoint is used to convey 24*1da177e4SLinus Torvalds * status of a command. 25*1da177e4SLinus Torvalds * 26*1da177e4SLinus Torvalds * Please see http://www.one-eyed-alien.net/~mdharm/linux-usb for more 27*1da177e4SLinus Torvalds * information about this driver. 28*1da177e4SLinus Torvalds * 29*1da177e4SLinus Torvalds * This program is free software; you can redistribute it and/or modify it 30*1da177e4SLinus Torvalds * under the terms of the GNU General Public License as published by the 31*1da177e4SLinus Torvalds * Free Software Foundation; either version 2, or (at your option) any 32*1da177e4SLinus Torvalds * later version. 33*1da177e4SLinus Torvalds * 34*1da177e4SLinus Torvalds * This program is distributed in the hope that it will be useful, but 35*1da177e4SLinus Torvalds * WITHOUT ANY WARRANTY; without even the implied warranty of 36*1da177e4SLinus Torvalds * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 37*1da177e4SLinus Torvalds * General Public License for more details. 38*1da177e4SLinus Torvalds * 39*1da177e4SLinus Torvalds * You should have received a copy of the GNU General Public License along 40*1da177e4SLinus Torvalds * with this program; if not, write to the Free Software Foundation, Inc., 41*1da177e4SLinus Torvalds * 675 Mass Ave, Cambridge, MA 02139, USA. 42*1da177e4SLinus Torvalds */ 43*1da177e4SLinus Torvalds 44*1da177e4SLinus Torvalds #ifndef _DEBUG_H_ 45*1da177e4SLinus Torvalds #define _DEBUG_H_ 46*1da177e4SLinus Torvalds 47*1da177e4SLinus Torvalds #include <linux/config.h> 48*1da177e4SLinus Torvalds #include <linux/kernel.h> 49*1da177e4SLinus Torvalds 50*1da177e4SLinus Torvalds #define USB_STORAGE "usb-storage: " 51*1da177e4SLinus Torvalds 52*1da177e4SLinus Torvalds #ifdef CONFIG_USB_STORAGE_DEBUG 53*1da177e4SLinus Torvalds void usb_stor_show_command(struct scsi_cmnd *srb); 54*1da177e4SLinus Torvalds void usb_stor_show_sense( unsigned char key, 55*1da177e4SLinus Torvalds unsigned char asc, unsigned char ascq ); 56*1da177e4SLinus Torvalds #define US_DEBUGP(x...) printk( KERN_DEBUG USB_STORAGE x ) 57*1da177e4SLinus Torvalds #define US_DEBUGPX(x...) printk( x ) 58*1da177e4SLinus Torvalds #define US_DEBUG(x) x 59*1da177e4SLinus Torvalds #else 60*1da177e4SLinus Torvalds #define US_DEBUGP(x...) 61*1da177e4SLinus Torvalds #define US_DEBUGPX(x...) 62*1da177e4SLinus Torvalds #define US_DEBUG(x) 63*1da177e4SLinus Torvalds #endif 64*1da177e4SLinus Torvalds 65*1da177e4SLinus Torvalds #endif 66