aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h31
1 files changed, 3 insertions, 28 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index bc5a8d0c7090..a05f60013642 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -138,6 +138,7 @@ enum {
138 ATA_DFLAG_AN = (1 << 7), /* AN configured */ 138 ATA_DFLAG_AN = (1 << 7), /* AN configured */
139 ATA_DFLAG_HIPM = (1 << 8), /* device supports HIPM */ 139 ATA_DFLAG_HIPM = (1 << 8), /* device supports HIPM */
140 ATA_DFLAG_DIPM = (1 << 9), /* device supports DIPM */ 140 ATA_DFLAG_DIPM = (1 << 9), /* device supports DIPM */
141 ATA_DFLAG_DMADIR = (1 << 10), /* device requires DMADIR */
141 ATA_DFLAG_CFG_MASK = (1 << 12) - 1, 142 ATA_DFLAG_CFG_MASK = (1 << 12) - 1,
142 143
143 ATA_DFLAG_PIO = (1 << 12), /* device limited to PIO mode */ 144 ATA_DFLAG_PIO = (1 << 12), /* device limited to PIO mode */
@@ -278,7 +279,6 @@ enum {
278 279
279 /* size of buffer to pad xfers ending on unaligned boundaries */ 280 /* size of buffer to pad xfers ending on unaligned boundaries */
280 ATA_DMA_PAD_SZ = 4, 281 ATA_DMA_PAD_SZ = 4,
281 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
282 282
283 /* ering size */ 283 /* ering size */
284 ATA_ERING_SIZE = 32, 284 ATA_ERING_SIZE = 32,
@@ -457,24 +457,18 @@ struct ata_queued_cmd {
457 unsigned long flags; /* ATA_QCFLAG_xxx */ 457 unsigned long flags; /* ATA_QCFLAG_xxx */
458 unsigned int tag; 458 unsigned int tag;
459 unsigned int n_elem; 459 unsigned int n_elem;
460 unsigned int mapped_n_elem;
461 460
462 int dma_dir; 461 int dma_dir;
463 462
464 unsigned int pad_len;
465 unsigned int sect_size; 463 unsigned int sect_size;
466 464
467 unsigned int nbytes; 465 unsigned int nbytes;
468 unsigned int raw_nbytes;
469 unsigned int curbytes; 466 unsigned int curbytes;
470 467
471 struct scatterlist *cursg; 468 struct scatterlist *cursg;
472 unsigned int cursg_ofs; 469 unsigned int cursg_ofs;
473 470
474 struct scatterlist *last_sg;
475 struct scatterlist saved_last_sg;
476 struct scatterlist sgent; 471 struct scatterlist sgent;
477 struct scatterlist extra_sg[2];
478 472
479 struct scatterlist *sg; 473 struct scatterlist *sg;
480 474
@@ -619,9 +613,6 @@ struct ata_port {
619 struct ata_prd *prd; /* our SG list */ 613 struct ata_prd *prd; /* our SG list */
620 dma_addr_t prd_dma; /* and its DMA mapping */ 614 dma_addr_t prd_dma; /* and its DMA mapping */
621 615
622 void *pad; /* array of DMA pad buffers */
623 dma_addr_t pad_dma;
624
625 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ 616 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
626 617
627 u8 ctl; /* cache of ATA control register */ 618 u8 ctl; /* cache of ATA control register */
@@ -1207,7 +1198,7 @@ static inline struct ata_link *ata_port_next_link(struct ata_link *link)
1207 return ap->pmp_link; 1198 return ap->pmp_link;
1208 } 1199 }
1209 1200
1210 if (++link - ap->pmp_link < ap->nr_pmp_links) 1201 if (++link < ap->nr_pmp_links + ap->pmp_link)
1211 return link; 1202 return link;
1212 return NULL; 1203 return NULL;
1213} 1204}
@@ -1363,12 +1354,9 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
1363 qc->flags = 0; 1354 qc->flags = 0;
1364 qc->cursg = NULL; 1355 qc->cursg = NULL;
1365 qc->cursg_ofs = 0; 1356 qc->cursg_ofs = 0;
1366 qc->nbytes = qc->raw_nbytes = qc->curbytes = 0; 1357 qc->nbytes = qc->curbytes = 0;
1367 qc->n_elem = 0; 1358 qc->n_elem = 0;
1368 qc->mapped_n_elem = 0;
1369 qc->err_mask = 0; 1359 qc->err_mask = 0;
1370 qc->pad_len = 0;
1371 qc->last_sg = NULL;
1372 qc->sect_size = ATA_SECT_SIZE; 1360 qc->sect_size = ATA_SECT_SIZE;
1373 1361
1374 ata_tf_init(qc->dev, &qc->tf); 1362 ata_tf_init(qc->dev, &qc->tf);
@@ -1423,19 +1411,6 @@ static inline unsigned int __ac_err_mask(u8 status)
1423 return mask; 1411 return mask;
1424} 1412}
1425 1413
1426static inline int ata_pad_alloc(struct ata_port *ap, struct device *dev)
1427{
1428 ap->pad_dma = 0;
1429 ap->pad = dmam_alloc_coherent(dev, ATA_DMA_PAD_BUF_SZ,
1430 &ap->pad_dma, GFP_KERNEL);
1431 return (ap->pad == NULL) ? -ENOMEM : 0;
1432}
1433
1434static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
1435{
1436 dmam_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
1437}
1438
1439static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) 1414static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
1440{ 1415{
1441 return *(struct ata_port **)&host->hostdata[0]; 1416 return *(struct ata_port **)&host->hostdata[0];