diff options
Diffstat (limited to 'drivers/scsi/sata_vsc.c')
-rw-r--r-- | drivers/scsi/sata_vsc.c | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/drivers/scsi/sata_vsc.c b/drivers/scsi/sata_vsc.c index cf94e0158a8d..bb84ba0c7e83 100644 --- a/drivers/scsi/sata_vsc.c +++ b/drivers/scsi/sata_vsc.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/delay.h> | 42 | #include <linux/delay.h> |
43 | #include <linux/interrupt.h> | 43 | #include <linux/interrupt.h> |
44 | #include <linux/dma-mapping.h> | 44 | #include <linux/dma-mapping.h> |
45 | #include <linux/device.h> | ||
45 | #include "scsi.h" | 46 | #include "scsi.h" |
46 | #include <scsi/scsi_host.h> | 47 | #include <scsi/scsi_host.h> |
47 | #include <linux/libata.h> | 48 | #include <linux/libata.h> |
@@ -86,7 +87,7 @@ static u32 vsc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) | |||
86 | { | 87 | { |
87 | if (sc_reg > SCR_CONTROL) | 88 | if (sc_reg > SCR_CONTROL) |
88 | return 0xffffffffU; | 89 | return 0xffffffffU; |
89 | return readl((void *) ap->ioaddr.scr_addr + (sc_reg * 4)); | 90 | return readl((void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4)); |
90 | } | 91 | } |
91 | 92 | ||
92 | 93 | ||
@@ -95,16 +96,16 @@ static void vsc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, | |||
95 | { | 96 | { |
96 | if (sc_reg > SCR_CONTROL) | 97 | if (sc_reg > SCR_CONTROL) |
97 | return; | 98 | return; |
98 | writel(val, (void *) ap->ioaddr.scr_addr + (sc_reg * 4)); | 99 | writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4)); |
99 | } | 100 | } |
100 | 101 | ||
101 | 102 | ||
102 | static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl) | 103 | static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl) |
103 | { | 104 | { |
104 | unsigned long mask_addr; | 105 | void __iomem *mask_addr; |
105 | u8 mask; | 106 | u8 mask; |
106 | 107 | ||
107 | mask_addr = (unsigned long) ap->host_set->mmio_base + | 108 | mask_addr = ap->host_set->mmio_base + |
108 | VSC_SATA_INT_MASK_OFFSET + ap->port_no; | 109 | VSC_SATA_INT_MASK_OFFSET + ap->port_no; |
109 | mask = readb(mask_addr); | 110 | mask = readb(mask_addr); |
110 | if (ctl & ATA_NIEN) | 111 | if (ctl & ATA_NIEN) |
@@ -115,7 +116,7 @@ static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl) | |||
115 | } | 116 | } |
116 | 117 | ||
117 | 118 | ||
118 | static void vsc_sata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) | 119 | static void vsc_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) |
119 | { | 120 | { |
120 | struct ata_ioports *ioaddr = &ap->ioaddr; | 121 | struct ata_ioports *ioaddr = &ap->ioaddr; |
121 | unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; | 122 | unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; |
@@ -153,16 +154,24 @@ static void vsc_sata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) | |||
153 | static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) | 154 | static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf) |
154 | { | 155 | { |
155 | struct ata_ioports *ioaddr = &ap->ioaddr; | 156 | struct ata_ioports *ioaddr = &ap->ioaddr; |
156 | u16 nsect, lbal, lbam, lbah; | 157 | u16 nsect, lbal, lbam, lbah, feature; |
157 | 158 | ||
158 | nsect = tf->nsect = readw(ioaddr->nsect_addr); | 159 | tf->command = ata_check_status(ap); |
159 | lbal = tf->lbal = readw(ioaddr->lbal_addr); | ||
160 | lbam = tf->lbam = readw(ioaddr->lbam_addr); | ||
161 | lbah = tf->lbah = readw(ioaddr->lbah_addr); | ||
162 | tf->device = readw(ioaddr->device_addr); | 160 | tf->device = readw(ioaddr->device_addr); |
161 | feature = readw(ioaddr->error_addr); | ||
162 | nsect = readw(ioaddr->nsect_addr); | ||
163 | lbal = readw(ioaddr->lbal_addr); | ||
164 | lbam = readw(ioaddr->lbam_addr); | ||
165 | lbah = readw(ioaddr->lbah_addr); | ||
166 | |||
167 | tf->feature = feature; | ||
168 | tf->nsect = nsect; | ||
169 | tf->lbal = lbal; | ||
170 | tf->lbam = lbam; | ||
171 | tf->lbah = lbah; | ||
163 | 172 | ||
164 | if (tf->flags & ATA_TFLAG_LBA48) { | 173 | if (tf->flags & ATA_TFLAG_LBA48) { |
165 | tf->hob_feature = readb(ioaddr->error_addr); | 174 | tf->hob_feature = feature >> 8; |
166 | tf->hob_nsect = nsect >> 8; | 175 | tf->hob_nsect = nsect >> 8; |
167 | tf->hob_lbal = lbal >> 8; | 176 | tf->hob_lbal = lbal >> 8; |
168 | tf->hob_lbam = lbam >> 8; | 177 | tf->hob_lbam = lbam >> 8; |
@@ -231,7 +240,7 @@ static Scsi_Host_Template vsc_sata_sht = { | |||
231 | }; | 240 | }; |
232 | 241 | ||
233 | 242 | ||
234 | static struct ata_port_operations vsc_sata_ops = { | 243 | static const struct ata_port_operations vsc_sata_ops = { |
235 | .port_disable = ata_port_disable, | 244 | .port_disable = ata_port_disable, |
236 | .tf_load = vsc_sata_tf_load, | 245 | .tf_load = vsc_sata_tf_load, |
237 | .tf_read = vsc_sata_tf_read, | 246 | .tf_read = vsc_sata_tf_read, |
@@ -283,11 +292,11 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d | |||
283 | struct ata_probe_ent *probe_ent = NULL; | 292 | struct ata_probe_ent *probe_ent = NULL; |
284 | unsigned long base; | 293 | unsigned long base; |
285 | int pci_dev_busy = 0; | 294 | int pci_dev_busy = 0; |
286 | void *mmio_base; | 295 | void __iomem *mmio_base; |
287 | int rc; | 296 | int rc; |
288 | 297 | ||
289 | if (!printed_version++) | 298 | if (!printed_version++) |
290 | printk(KERN_DEBUG DRV_NAME " version " DRV_VERSION "\n"); | 299 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
291 | 300 | ||
292 | rc = pci_enable_device(pdev); | 301 | rc = pci_enable_device(pdev); |
293 | if (rc) | 302 | if (rc) |