aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-11-24 09:37:22 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-24 10:10:23 -0500
commit1af6f60368b3f5be6a89350ccd23e218120fd3d1 (patch)
treec4b834193158f3c8f7834265090d68e73774a247
parenta1a75b35fc47dede004fb579f86bf1ac12e2bff5 (diff)
esp_scsi: debug event and command
Add new debug definitions for event and command logging. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/esp_scsi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
index d85f2392c6ae..800ff3ea501d 100644
--- a/drivers/scsi/esp_scsi.c
+++ b/drivers/scsi/esp_scsi.c
@@ -49,6 +49,8 @@ static u32 esp_debug;
49#define ESP_DEBUG_DATADONE 0x00000100 49#define ESP_DEBUG_DATADONE 0x00000100
50#define ESP_DEBUG_RECONNECT 0x00000200 50#define ESP_DEBUG_RECONNECT 0x00000200
51#define ESP_DEBUG_AUTOSENSE 0x00000400 51#define ESP_DEBUG_AUTOSENSE 0x00000400
52#define ESP_DEBUG_EVENT 0x00000800
53#define ESP_DEBUG_COMMAND 0x00001000
52 54
53#define esp_log_intr(f, a...) \ 55#define esp_log_intr(f, a...) \
54do { if (esp_debug & ESP_DEBUG_INTR) \ 56do { if (esp_debug & ESP_DEBUG_INTR) \
@@ -100,6 +102,16 @@ do { if (esp_debug & ESP_DEBUG_AUTOSENSE) \
100 shost_printk(KERN_DEBUG, esp->host, f, ## a); \ 102 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
101} while (0) 103} while (0)
102 104
105#define esp_log_event(f, a...) \
106do { if (esp_debug & ESP_DEBUG_EVENT) \
107 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
108} while (0)
109
110#define esp_log_command(f, a...) \
111do { if (esp_debug & ESP_DEBUG_COMMAND) \
112 shost_printk(KERN_DEBUG, esp->host, f, ## a); \
113} while (0)
114
103#define esp_read8(REG) esp->ops->esp_read8(esp, REG) 115#define esp_read8(REG) esp->ops->esp_read8(esp, REG)
104#define esp_write8(VAL,REG) esp->ops->esp_write8(esp, VAL, REG) 116#define esp_write8(VAL,REG) esp->ops->esp_write8(esp, VAL, REG)
105 117
@@ -126,6 +138,7 @@ void scsi_esp_cmd(struct esp *esp, u8 val)
126 138
127 esp->esp_event_cur = (idx + 1) & (ESP_EVENT_LOG_SZ - 1); 139 esp->esp_event_cur = (idx + 1) & (ESP_EVENT_LOG_SZ - 1);
128 140
141 esp_log_command("cmd[%02x]\n", val);
129 esp_write8(val, ESP_CMD); 142 esp_write8(val, ESP_CMD);
130} 143}
131EXPORT_SYMBOL(scsi_esp_cmd); 144EXPORT_SYMBOL(scsi_esp_cmd);
@@ -1638,6 +1651,8 @@ static int esp_process_event(struct esp *esp)
1638 1651
1639again: 1652again:
1640 write = 0; 1653 write = 0;
1654 esp_log_event("process event %d phase %x\n",
1655 esp->event, esp->sreg & ESP_STAT_PMASK);
1641 switch (esp->event) { 1656 switch (esp->event) {
1642 case ESP_EVENT_CHECK_PHASE: 1657 case ESP_EVENT_CHECK_PHASE:
1643 switch (esp->sreg & ESP_STAT_PMASK) { 1658 switch (esp->sreg & ESP_STAT_PMASK) {