aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sata_vsc.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-03-21 22:14:17 -0500
committerJeff Garzik <jeff@garzik.org>2006-03-21 22:14:17 -0500
commit55cca65e1995ad604ee87e22c76c17d5cbceb9d0 (patch)
tree0a691ff7c1b9320e942e78f6f46bf65df5570d9f /drivers/scsi/sata_vsc.c
parentc962990a38167aacac91738501815deffa3afbd6 (diff)
[libata sata_vsc, sata_svw] Convert #define'd constants to enums
Also, bump sata_vsc version.
Diffstat (limited to 'drivers/scsi/sata_vsc.c')
-rw-r--r--drivers/scsi/sata_vsc.c95
1 files changed, 49 insertions, 46 deletions
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c
index b7b6c807346d..fbf0713f9aba 100644
--- a/drivers/scsi/sata_vsc.c
+++ b/drivers/scsi/sata_vsc.c
@@ -47,52 +47,55 @@
47#include <linux/libata.h> 47#include <linux/libata.h>
48 48
49#define DRV_NAME "sata_vsc" 49#define DRV_NAME "sata_vsc"
50#define DRV_VERSION "1.1" 50#define DRV_VERSION "1.2"
51 51
52/* Interrupt register offsets (from chip base address) */ 52enum {
53#define VSC_SATA_INT_STAT_OFFSET 0x00 53 /* Interrupt register offsets (from chip base address) */
54#define VSC_SATA_INT_MASK_OFFSET 0x04 54 VSC_SATA_INT_STAT_OFFSET = 0x00,
55 55 VSC_SATA_INT_MASK_OFFSET = 0x04,
56/* Taskfile registers offsets */ 56
57#define VSC_SATA_TF_CMD_OFFSET 0x00 57 /* Taskfile registers offsets */
58#define VSC_SATA_TF_DATA_OFFSET 0x00 58 VSC_SATA_TF_CMD_OFFSET = 0x00,
59#define VSC_SATA_TF_ERROR_OFFSET 0x04 59 VSC_SATA_TF_DATA_OFFSET = 0x00,
60#define VSC_SATA_TF_FEATURE_OFFSET 0x06 60 VSC_SATA_TF_ERROR_OFFSET = 0x04,
61#define VSC_SATA_TF_NSECT_OFFSET 0x08 61 VSC_SATA_TF_FEATURE_OFFSET = 0x06,
62#define VSC_SATA_TF_LBAL_OFFSET 0x0c 62 VSC_SATA_TF_NSECT_OFFSET = 0x08,
63#define VSC_SATA_TF_LBAM_OFFSET 0x10 63 VSC_SATA_TF_LBAL_OFFSET = 0x0c,
64#define VSC_SATA_TF_LBAH_OFFSET 0x14 64 VSC_SATA_TF_LBAM_OFFSET = 0x10,
65#define VSC_SATA_TF_DEVICE_OFFSET 0x18 65 VSC_SATA_TF_LBAH_OFFSET = 0x14,
66#define VSC_SATA_TF_STATUS_OFFSET 0x1c 66 VSC_SATA_TF_DEVICE_OFFSET = 0x18,
67#define VSC_SATA_TF_COMMAND_OFFSET 0x1d 67 VSC_SATA_TF_STATUS_OFFSET = 0x1c,
68#define VSC_SATA_TF_ALTSTATUS_OFFSET 0x28 68 VSC_SATA_TF_COMMAND_OFFSET = 0x1d,
69#define VSC_SATA_TF_CTL_OFFSET 0x29 69 VSC_SATA_TF_ALTSTATUS_OFFSET = 0x28,
70 70 VSC_SATA_TF_CTL_OFFSET = 0x29,
71/* DMA base */ 71
72#define VSC_SATA_UP_DESCRIPTOR_OFFSET 0x64 72 /* DMA base */
73#define VSC_SATA_UP_DATA_BUFFER_OFFSET 0x6C 73 VSC_SATA_UP_DESCRIPTOR_OFFSET = 0x64,
74#define VSC_SATA_DMA_CMD_OFFSET 0x70 74 VSC_SATA_UP_DATA_BUFFER_OFFSET = 0x6C,
75 75 VSC_SATA_DMA_CMD_OFFSET = 0x70,
76/* SCRs base */ 76
77#define VSC_SATA_SCR_STATUS_OFFSET 0x100 77 /* SCRs base */
78#define VSC_SATA_SCR_ERROR_OFFSET 0x104 78 VSC_SATA_SCR_STATUS_OFFSET = 0x100,
79#define VSC_SATA_SCR_CONTROL_OFFSET 0x108 79 VSC_SATA_SCR_ERROR_OFFSET = 0x104,
80 80 VSC_SATA_SCR_CONTROL_OFFSET = 0x108,
81/* Port stride */ 81
82#define VSC_SATA_PORT_OFFSET 0x200 82 /* Port stride */
83 83 VSC_SATA_PORT_OFFSET = 0x200,
84/* Error interrupt status bit offsets */ 84
85#define VSC_SATA_INT_ERROR_CRC 0x40 85 /* Error interrupt status bit offsets */
86#define VSC_SATA_INT_ERROR_T 0x20 86 VSC_SATA_INT_ERROR_CRC = 0x40,
87#define VSC_SATA_INT_ERROR_P 0x10 87 VSC_SATA_INT_ERROR_T = 0x20,
88#define VSC_SATA_INT_ERROR_R 0x8 88 VSC_SATA_INT_ERROR_P = 0x10,
89#define VSC_SATA_INT_ERROR_E 0x4 89 VSC_SATA_INT_ERROR_R = 0x8,
90#define VSC_SATA_INT_ERROR_M 0x2 90 VSC_SATA_INT_ERROR_E = 0x4,
91#define VSC_SATA_INT_PHY_CHANGE 0x1 91 VSC_SATA_INT_ERROR_M = 0x2,
92#define VSC_SATA_INT_ERROR (VSC_SATA_INT_ERROR_CRC | VSC_SATA_INT_ERROR_T | \ 92 VSC_SATA_INT_PHY_CHANGE = 0x1,
93 VSC_SATA_INT_ERROR_P | VSC_SATA_INT_ERROR_R | \ 93 VSC_SATA_INT_ERROR = (VSC_SATA_INT_ERROR_CRC | VSC_SATA_INT_ERROR_T | \
94 VSC_SATA_INT_ERROR_E | VSC_SATA_INT_ERROR_M | \ 94 VSC_SATA_INT_ERROR_P | VSC_SATA_INT_ERROR_R | \
95 VSC_SATA_INT_PHY_CHANGE) 95 VSC_SATA_INT_ERROR_E | VSC_SATA_INT_ERROR_M | \
96 VSC_SATA_INT_PHY_CHANGE),
97};
98
96 99
97#define is_vsc_sata_int_err(port_idx, int_status) \ 100#define is_vsc_sata_int_err(port_idx, int_status) \
98 (int_status & (VSC_SATA_INT_ERROR << (8 * port_idx))) 101 (int_status & (VSC_SATA_INT_ERROR << (8 * port_idx)))