/* -*- linux-c -*- * Copyright (c) 2004-2006 Winbond Electronics Corp. All rights reserved. * * The contents of this file are subject to the Open * Software License version 1.1 that can be found at * http://www.opensource.org/licenses/osl-1.1.txt and is included herein * by reference. * * Alternatively, the contents of this file may be used under the terms * of the GNU General Public License version 2 (the "GPL") as distributed * in the kernel source COPYING file, in which case the provisions of * the GPL are applicable instead of the above. If you wish to allow * the use of your version of this file only under the terms of the * GPL and not to allow others to use your version of this file under * the OSL, indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by the GPL. * If you do not delete the provisions above, a recipient may use your * version of this file under either the OSL or the GPL. * Maintained by: Weiming Shuai Jin Yuan Mu Dezheng Shen $Author: dzshen $ $Id: wbdebug.h,v 1.5.2.3 2006/06/15 01:51:06 dzshen Exp $ --- don't modify lines above --- Description: Enviornments: (1) RedHat 9 on 32-bit Intel UP/32-bit Intel dual-core (2) Fedora Core 4 (2.6.11) on 32-bit Intel/32-bit Intel dual-core/64-bit AMD/64-bit Intel dual-core (3) RedHat Enterprise Workstatin Rel 4 UP2 (2.6.9) on 32-bit Intel 32-bit Intel dual-core/64-bit AMD/64-bit Intel dual-core */ #ifndef _WB_DEBUG_H_ #define _WB_DEBUG_H_ #include #include #include //enable/disable macro for debugging output //#define WB_DEBUG //#define WB_DEBUG_SCSI //#define WB_DEBUG_INTR //#define WB_DEBUG_THREAD #define TRUE 1 #define FALSE 0 #define WB_VENDOR_ID 0x1050 #define WB_DRV_NAME "wbstorage" #define WB_DEBUG_HDR WB_DRV_NAME ":" WB_STRINGIFY(__FILE__) ":"WB_STRINGIFY(__LINE__) ":" #define WB_STRINGIFY_HELPER(n) #n #define WB_STRINGIFY(n) WB_STRINGIFY_HELPER(n) #ifdef WB_DEBUG #define ENTER() printk( WB_DRV_NAME ":" "ENTERING %s\n", __FUNCTION__ ); #define LEAVE() printk( WB_DRV_NAME ":" "LEAVING %s\n",__FUNCTION__ ); #define WB_PRINTK_NEW_LINE() printk("\n") #define WB_PRINTK(...) printk( __VA_ARGS__ ) #define WB_PRINTK_HDR(...) printk( WB_DEBUG_HDR \ __VA_ARGS__ ) #define WB_PRINTK_ERROR(...) printk( WB_DEBUG_HDR \ "ERROR: " __VA_ARGS__ ) #define WB_PRINTK_SCSI(...) printk( WB_DEBUG_HDR \ "SCSI command: " __VA_ARGS__ ) #define WB_PRINTK_ERROR_SCSI(...) printk( WB_DEBUG_HDR \ "ERROR:SCSI command: " __VA_ARGS__ ) #define WB_PRINTK_INTR(...) printk( WB_DEBUG_HDR \ "INTR: " __VA_ARGS__ ) #define WB_PRINTK_ERROR_INTR(...) printk( WB_DEBUG_HDR \ "ERROR:INTR: " __VA_ARGS__ ) #define WB_PRINTK_THREAD(...) printk( WB_DEBUG_HDR \ "THREAD: " __VA_ARGS__ ) #else #define ENTER() #define LEAVE() #define WB_PRINTK_NEW_LINE() #define WB_PRINTK(...) #define WB_PRINTK_HDR(...) #define WB_PRINTK_ERROR(...) printk( WB_DEBUG_HDR \ "ERROR: " __VA_ARGS__ ) #if defined WB_DEBUG_SCSI #define WB_PRINTK_SCSI(...) printk( WB_DEBUG_HDR \ "SCSI: " __VA_ARGS__ ) #else #define WB_PRINTK_SCSI(...) #endif #define WB_PRINTK_ERROR_SCSI(...) printk( WB_DEBUG_HDR \ "ERROR:SCSI command: " __VA_ARGS__ ) #if defined WB_DEBUG_INTR #define WB_PRINTK_INTR(...) printk( WB_DEBUG_HDR \ "INTR: " __VA_ARGS__ ) #else #define WB_PRINTK_INTR(...) #endif #define WB_PRINTK_ERROR_INTR(...) printk( WB_DEBUG_HDR \ "ERROR:INTR: " __VA_ARGS__ ) #if defined WB_DEBUG_THREAD #define WB_PRINTK_THREAD(...) printk( WB_DEBUG_HDR \ "THREAD: " __VA_ARGS__ ) #else #define WB_PRINTK_THREAD(...) #endif #endif #endif /* _WB_DEBUG_H_ */