aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_ns87410.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_ns87410.c')
-rw-r--r--drivers/ata/pata_ns87410.c68
1 files changed, 10 insertions, 58 deletions
diff --git a/drivers/ata/pata_ns87410.c b/drivers/ata/pata_ns87410.c
index 9fe66fd75017..76d2455bc453 100644
--- a/drivers/ata/pata_ns87410.c
+++ b/drivers/ata/pata_ns87410.c
@@ -50,21 +50,7 @@ static int ns87410_pre_reset(struct ata_link *link, unsigned long deadline)
50 if (!pci_test_config_bits(pdev, &ns87410_enable_bits[ap->port_no])) 50 if (!pci_test_config_bits(pdev, &ns87410_enable_bits[ap->port_no]))
51 return -ENOENT; 51 return -ENOENT;
52 52
53 return ata_std_prereset(link, deadline); 53 return ata_sff_prereset(link, deadline);
54}
55
56/**
57 * ns87410_error_handler - probe reset
58 * @ap: ATA port
59 *
60 * Perform the ATA probe and bus reset sequence plus specific handling
61 * for this hardware. The MPIIX has the enable bits in a different place
62 * to PIIX4 and friends. As a pure PIO device it has no cable detect
63 */
64
65static void ns87410_error_handler(struct ata_port *ap)
66{
67 ata_bmdma_drive_eh(ap, ns87410_pre_reset, ata_std_softreset, NULL, ata_std_postreset);
68} 54}
69 55
70/** 56/**
@@ -119,7 +105,7 @@ static void ns87410_set_piomode(struct ata_port *ap, struct ata_device *adev)
119} 105}
120 106
121/** 107/**
122 * ns87410_qc_issue_prot - command issue 108 * ns87410_qc_issue - command issue
123 * @qc: command pending 109 * @qc: command pending
124 * 110 *
125 * Called when the libata layer is about to issue a command. We wrap 111 * Called when the libata layer is about to issue a command. We wrap
@@ -127,7 +113,7 @@ static void ns87410_set_piomode(struct ata_port *ap, struct ata_device *adev)
127 * necessary. 113 * necessary.
128 */ 114 */
129 115
130static unsigned int ns87410_qc_issue_prot(struct ata_queued_cmd *qc) 116static unsigned int ns87410_qc_issue(struct ata_queued_cmd *qc)
131{ 117{
132 struct ata_port *ap = qc->ap; 118 struct ata_port *ap = qc->ap;
133 struct ata_device *adev = qc->dev; 119 struct ata_device *adev = qc->dev;
@@ -140,64 +126,30 @@ static unsigned int ns87410_qc_issue_prot(struct ata_queued_cmd *qc)
140 if (adev->pio_mode && adev != ap->private_data) 126 if (adev->pio_mode && adev != ap->private_data)
141 ns87410_set_piomode(ap, adev); 127 ns87410_set_piomode(ap, adev);
142 128
143 return ata_qc_issue_prot(qc); 129 return ata_sff_qc_issue(qc);
144} 130}
145 131
146static struct scsi_host_template ns87410_sht = { 132static struct scsi_host_template ns87410_sht = {
147 .module = THIS_MODULE, 133 ATA_PIO_SHT(DRV_NAME),
148 .name = DRV_NAME,
149 .ioctl = ata_scsi_ioctl,
150 .queuecommand = ata_scsi_queuecmd,
151 .can_queue = ATA_DEF_QUEUE,
152 .this_id = ATA_SHT_THIS_ID,
153 .sg_tablesize = LIBATA_MAX_PRD,
154 .cmd_per_lun = ATA_SHT_CMD_PER_LUN,
155 .emulated = ATA_SHT_EMULATED,
156 .use_clustering = ATA_SHT_USE_CLUSTERING,
157 .proc_name = DRV_NAME,
158 .dma_boundary = ATA_DMA_BOUNDARY,
159 .slave_configure = ata_scsi_slave_config,
160 .slave_destroy = ata_scsi_slave_destroy,
161 .bios_param = ata_std_bios_param,
162}; 134};
163 135
164static struct ata_port_operations ns87410_port_ops = { 136static struct ata_port_operations ns87410_port_ops = {
165 .set_piomode = ns87410_set_piomode, 137 .inherits = &ata_sff_port_ops,
166 138 .qc_issue = ns87410_qc_issue,
167 .tf_load = ata_tf_load,
168 .tf_read = ata_tf_read,
169 .check_status = ata_check_status,
170 .exec_command = ata_exec_command,
171 .dev_select = ata_std_dev_select,
172
173 .freeze = ata_bmdma_freeze,
174 .thaw = ata_bmdma_thaw,
175 .error_handler = ns87410_error_handler,
176 .post_internal_cmd = ata_bmdma_post_internal_cmd,
177 .cable_detect = ata_cable_40wire, 139 .cable_detect = ata_cable_40wire,
178 140 .set_piomode = ns87410_set_piomode,
179 .qc_prep = ata_qc_prep, 141 .prereset = ns87410_pre_reset,
180 .qc_issue = ns87410_qc_issue_prot,
181
182 .data_xfer = ata_data_xfer,
183
184 .irq_handler = ata_interrupt,
185 .irq_clear = ata_bmdma_irq_clear,
186 .irq_on = ata_irq_on,
187
188 .port_start = ata_sff_port_start,
189}; 142};
190 143
191static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id) 144static int ns87410_init_one(struct pci_dev *dev, const struct pci_device_id *id)
192{ 145{
193 static const struct ata_port_info info = { 146 static const struct ata_port_info info = {
194 .sht = &ns87410_sht,
195 .flags = ATA_FLAG_SLAVE_POSS, 147 .flags = ATA_FLAG_SLAVE_POSS,
196 .pio_mask = 0x0F, 148 .pio_mask = 0x0F,
197 .port_ops = &ns87410_port_ops 149 .port_ops = &ns87410_port_ops
198 }; 150 };
199 const struct ata_port_info *ppi[] = { &info, NULL }; 151 const struct ata_port_info *ppi[] = { &info, NULL };
200 return ata_pci_init_one(dev, ppi); 152 return ata_pci_sff_init_one(dev, ppi, &ns87410_sht, NULL);
201} 153}
202 154
203static const struct pci_device_id ns87410[] = { 155static const struct pci_device_id ns87410[] = {