aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2008-10-13 15:39:35 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:35 -0400
commite1c7c4641aae8d278fca62b3b5cffad3a8dcb0a4 (patch)
tree5fee46f00db24a3ca301dca5fb2d3baddfdd2938 /include/linux/ide.h
parentb22b2ca4ff0730b14d14bcc36bd1b84873557512 (diff)
ide: add a driver-wide debugging macro
Add __ide_debug_log() debugging macro which is controlled by drive->debug_mask. The macro has to have the macro DRV_NAME defined in each driver before use. Also, add different debugging levels depending on the functionality debugged. Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index fcd98e1d1863..02c4c642e6a5 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -927,6 +927,26 @@ static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *
927#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; 927#define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0;
928#endif 928#endif
929 929
930enum {
931 /* enter/exit functions */
932 IDE_DBG_FUNC = (1 << 0),
933 /* sense key/asc handling */
934 IDE_DBG_SENSE = (1 << 1),
935 /* packet commands handling */
936 IDE_DBG_PC = (1 << 2),
937 /* request handling */
938 IDE_DBG_RQ = (1 << 3),
939 /* driver probing/setup */
940 IDE_DBG_PROBE = (1 << 4),
941};
942
943/* DRV_NAME has to be defined in the driver before using the macro below */
944#define __ide_debug_log(lvl, fmt, args...) \
945{ \
946 if (unlikely(drive->debug_mask & lvl)) \
947 printk(KERN_INFO DRV_NAME ": " fmt, ## args); \
948}
949
930/* 950/*
931 * Power Management step value (rq->pm->pm_step). 951 * Power Management step value (rq->pm->pm_step).
932 * 952 *