Commit 5fadd053 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'upstream' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev

parents e5dfa928 26ba2a7a
This diff is collapsed.
...@@ -489,11 +489,11 @@ config SCSI_SATA_NV ...@@ -489,11 +489,11 @@ config SCSI_SATA_NV
If unsure, say N. If unsure, say N.
config SCSI_SATA_PROMISE config SCSI_PDC_ADMA
tristate "Promise SATA TX2/TX4 support" tristate "Pacific Digital ADMA support"
depends on SCSI_SATA && PCI depends on SCSI_SATA && PCI
help help
This option enables support for Promise Serial ATA TX2/TX4. This option enables support for Pacific Digital ADMA controllers
If unsure, say N. If unsure, say N.
...@@ -505,6 +505,14 @@ config SCSI_SATA_QSTOR ...@@ -505,6 +505,14 @@ config SCSI_SATA_QSTOR
If unsure, say N. If unsure, say N.
config SCSI_SATA_PROMISE
tristate "Promise SATA TX2/TX4 support"
depends on SCSI_SATA && PCI
help
This option enables support for Promise Serial ATA TX2/TX4.
If unsure, say N.
config SCSI_SATA_SX4 config SCSI_SATA_SX4
tristate "Promise SATA SX4 support" tristate "Promise SATA SX4 support"
depends on SCSI_SATA && PCI && EXPERIMENTAL depends on SCSI_SATA && PCI && EXPERIMENTAL
...@@ -521,6 +529,14 @@ config SCSI_SATA_SIL ...@@ -521,6 +529,14 @@ config SCSI_SATA_SIL
If unsure, say N. If unsure, say N.
config SCSI_SATA_SIL24
tristate "Silicon Image 3124/3132 SATA support"
depends on SCSI_SATA && PCI && EXPERIMENTAL
help
This option enables support for Silicon Image 3124/3132 Serial ATA.
If unsure, say N.
config SCSI_SATA_SIS config SCSI_SATA_SIS
tristate "SiS 964/180 SATA support" tristate "SiS 964/180 SATA support"
depends on SCSI_SATA && PCI && EXPERIMENTAL depends on SCSI_SATA && PCI && EXPERIMENTAL
......
...@@ -130,6 +130,7 @@ obj-$(CONFIG_SCSI_ATA_PIIX) += libata.o ata_piix.o ...@@ -130,6 +130,7 @@ obj-$(CONFIG_SCSI_ATA_PIIX) += libata.o ata_piix.o
obj-$(CONFIG_SCSI_SATA_PROMISE) += libata.o sata_promise.o obj-$(CONFIG_SCSI_SATA_PROMISE) += libata.o sata_promise.o
obj-$(CONFIG_SCSI_SATA_QSTOR) += libata.o sata_qstor.o obj-$(CONFIG_SCSI_SATA_QSTOR) += libata.o sata_qstor.o
obj-$(CONFIG_SCSI_SATA_SIL) += libata.o sata_sil.o obj-$(CONFIG_SCSI_SATA_SIL) += libata.o sata_sil.o
obj-$(CONFIG_SCSI_SATA_SIL24) += libata.o sata_sil24.o
obj-$(CONFIG_SCSI_SATA_VIA) += libata.o sata_via.o obj-$(CONFIG_SCSI_SATA_VIA) += libata.o sata_via.o
obj-$(CONFIG_SCSI_SATA_VITESSE) += libata.o sata_vsc.o obj-$(CONFIG_SCSI_SATA_VITESSE) += libata.o sata_vsc.o
obj-$(CONFIG_SCSI_SATA_SIS) += libata.o sata_sis.o obj-$(CONFIG_SCSI_SATA_SIS) += libata.o sata_sis.o
...@@ -137,6 +138,7 @@ obj-$(CONFIG_SCSI_SATA_SX4) += libata.o sata_sx4.o ...@@ -137,6 +138,7 @@ obj-$(CONFIG_SCSI_SATA_SX4) += libata.o sata_sx4.o
obj-$(CONFIG_SCSI_SATA_NV) += libata.o sata_nv.o obj-$(CONFIG_SCSI_SATA_NV) += libata.o sata_nv.o
obj-$(CONFIG_SCSI_SATA_ULI) += libata.o sata_uli.o obj-$(CONFIG_SCSI_SATA_ULI) += libata.o sata_uli.o
obj-$(CONFIG_SCSI_SATA_MV) += libata.o sata_mv.o obj-$(CONFIG_SCSI_SATA_MV) += libata.o sata_mv.o
obj-$(CONFIG_SCSI_PDC_ADMA) += libata.o pdc_adma.o
obj-$(CONFIG_ARM) += arm/ obj-$(CONFIG_ARM) += arm/
......
...@@ -216,7 +216,7 @@ static Scsi_Host_Template ahci_sht = { ...@@ -216,7 +216,7 @@ static Scsi_Host_Template ahci_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations ahci_ops = { static const struct ata_port_operations ahci_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.check_status = ahci_check_status, .check_status = ahci_check_status,
...@@ -407,7 +407,7 @@ static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg_in) ...@@ -407,7 +407,7 @@ static u32 ahci_scr_read (struct ata_port *ap, unsigned int sc_reg_in)
return 0xffffffffU; return 0xffffffffU;
} }
return readl((void *) ap->ioaddr.scr_addr + (sc_reg * 4)); return readl((void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
} }
...@@ -425,7 +425,7 @@ static void ahci_scr_write (struct ata_port *ap, unsigned int sc_reg_in, ...@@ -425,7 +425,7 @@ static void ahci_scr_write (struct ata_port *ap, unsigned int sc_reg_in,
return; return;
} }
writel(val, (void *) ap->ioaddr.scr_addr + (sc_reg * 4)); writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
} }
static void ahci_phy_reset(struct ata_port *ap) static void ahci_phy_reset(struct ata_port *ap)
...@@ -453,14 +453,14 @@ static void ahci_phy_reset(struct ata_port *ap) ...@@ -453,14 +453,14 @@ static void ahci_phy_reset(struct ata_port *ap)
static u8 ahci_check_status(struct ata_port *ap) static u8 ahci_check_status(struct ata_port *ap)
{ {
void *mmio = (void *) ap->ioaddr.cmd_addr; void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr;
return readl(mmio + PORT_TFDATA) & 0xFF; return readl(mmio + PORT_TFDATA) & 0xFF;
} }
static u8 ahci_check_err(struct ata_port *ap) static u8 ahci_check_err(struct ata_port *ap)
{ {
void *mmio = (void *) ap->ioaddr.cmd_addr; void __iomem *mmio = (void __iomem *) ap->ioaddr.cmd_addr;
return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF; return (readl(mmio + PORT_TFDATA) >> 8) & 0xFF;
} }
...@@ -672,19 +672,38 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs * ...@@ -672,19 +672,38 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs *
for (i = 0; i < host_set->n_ports; i++) { for (i = 0; i < host_set->n_ports; i++) {
struct ata_port *ap; struct ata_port *ap;
u32 tmp;
VPRINTK("port %u\n", i); if (!(irq_stat & (1 << i)))
continue;
ap = host_set->ports[i]; ap = host_set->ports[i];
tmp = irq_stat & (1 << i); if (ap) {
if (tmp && ap) {
struct ata_queued_cmd *qc; struct ata_queued_cmd *qc;
qc = ata_qc_from_tag(ap, ap->active_tag); qc = ata_qc_from_tag(ap, ap->active_tag);
if (ahci_host_intr(ap, qc)) if (!ahci_host_intr(ap, qc))
irq_ack |= (1 << i); if (ata_ratelimit()) {
struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev);
printk(KERN_WARNING
"ahci(%s): unhandled interrupt on port %u\n",
pci_name(pdev), i);
}
VPRINTK("port %u\n", i);
} else {
VPRINTK("port %u (no irq)\n", i);
if (ata_ratelimit()) {
struct pci_dev *pdev =
to_pci_dev(ap->host_set->dev);
printk(KERN_WARNING
"ahci(%s): interrupt on disabled port %u\n",
pci_name(pdev), i);
} }
} }
irq_ack |= (1 << i);
}
if (irq_ack) { if (irq_ack) {
writel(irq_ack, mmio + HOST_IRQ_STAT); writel(irq_ack, mmio + HOST_IRQ_STAT);
handled = 1; handled = 1;
......
...@@ -147,7 +147,7 @@ static Scsi_Host_Template piix_sht = { ...@@ -147,7 +147,7 @@ static Scsi_Host_Template piix_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations piix_pata_ops = { static const struct ata_port_operations piix_pata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.set_piomode = piix_set_piomode, .set_piomode = piix_set_piomode,
.set_dmamode = piix_set_dmamode, .set_dmamode = piix_set_dmamode,
...@@ -177,7 +177,7 @@ static struct ata_port_operations piix_pata_ops = { ...@@ -177,7 +177,7 @@ static struct ata_port_operations piix_pata_ops = {
.host_stop = ata_host_stop, .host_stop = ata_host_stop,
}; };
static struct ata_port_operations piix_sata_ops = { static const struct ata_port_operations piix_sata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = ata_tf_load, .tf_load = ata_tf_load,
......
This diff is collapsed.
This diff is collapsed.
...@@ -39,18 +39,23 @@ struct ata_scsi_args { ...@@ -39,18 +39,23 @@ struct ata_scsi_args {
/* libata-core.c */ /* libata-core.c */
extern int atapi_enabled; extern int atapi_enabled;
extern int ata_qc_complete_noop(struct ata_queued_cmd *qc, u8 drv_stat);
extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap,
struct ata_device *dev); struct ata_device *dev);
extern void ata_rwcmd_protocol(struct ata_queued_cmd *qc);
extern void ata_qc_free(struct ata_queued_cmd *qc); extern void ata_qc_free(struct ata_queued_cmd *qc);
extern int ata_qc_issue(struct ata_queued_cmd *qc); extern int ata_qc_issue(struct ata_queued_cmd *qc);
extern int ata_check_atapi_dma(struct ata_queued_cmd *qc); extern int ata_check_atapi_dma(struct ata_queued_cmd *qc);
extern void ata_dev_select(struct ata_port *ap, unsigned int device, extern void ata_dev_select(struct ata_port *ap, unsigned int device,
unsigned int wait, unsigned int can_sleep); unsigned int wait, unsigned int can_sleep);
extern void ata_tf_to_host_nolock(struct ata_port *ap, struct ata_taskfile *tf); extern void ata_tf_to_host_nolock(struct ata_port *ap, const struct ata_taskfile *tf);
extern void swap_buf_le16(u16 *buf, unsigned int buf_words); extern void swap_buf_le16(u16 *buf, unsigned int buf_words);
/* libata-scsi.c */ /* libata-scsi.c */
extern void atapi_request_sense(struct ata_port *ap, struct ata_device *dev,
struct scsi_cmnd *cmd);
extern void ata_scsi_scan_host(struct ata_port *ap);
extern void ata_to_sense_error(struct ata_queued_cmd *qc, u8 drv_stat); extern void ata_to_sense_error(struct ata_queued_cmd *qc, u8 drv_stat);
extern int ata_scsi_error(struct Scsi_Host *host); extern int ata_scsi_error(struct Scsi_Host *host);
extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf, extern unsigned int ata_scsiop_inq_std(struct ata_scsi_args *args, u8 *rbuf,
...@@ -76,18 +81,10 @@ extern unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf, ...@@ -76,18 +81,10 @@ extern unsigned int ata_scsiop_report_luns(struct ata_scsi_args *args, u8 *rbuf,
extern void ata_scsi_badcmd(struct scsi_cmnd *cmd, extern void ata_scsi_badcmd(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *), void (*done)(struct scsi_cmnd *),
u8 asc, u8 ascq); u8 asc, u8 ascq);
extern void ata_scsi_set_sense(struct scsi_cmnd *cmd,
u8 sk, u8 asc, u8 ascq);
extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args, extern void ata_scsi_rbuf_fill(struct ata_scsi_args *args,
unsigned int (*actor) (struct ata_scsi_args *args, unsigned int (*actor) (struct ata_scsi_args *args,
u8 *rbuf, unsigned int buflen)); u8 *rbuf, unsigned int buflen));
static inline void ata_bad_scsiop(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{
ata_scsi_badcmd(cmd, done, 0x20, 0x00);
}
static inline void ata_bad_cdb(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
{
ata_scsi_badcmd(cmd, done, 0x24, 0x00);
}
#endif /* __LIBATA_H__ */ #endif /* __LIBATA_H__ */
This diff is collapsed.
This diff is collapsed.
...@@ -238,7 +238,7 @@ static Scsi_Host_Template nv_sht = { ...@@ -238,7 +238,7 @@ static Scsi_Host_Template nv_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations nv_ops = { static const struct ata_port_operations nv_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = ata_tf_load, .tf_load = ata_tf_load,
.tf_read = ata_tf_read, .tf_read = ata_tf_read,
...@@ -331,7 +331,7 @@ static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg) ...@@ -331,7 +331,7 @@ static u32 nv_scr_read (struct ata_port *ap, unsigned int sc_reg)
return 0xffffffffU; return 0xffffffffU;
if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO)
return readl((void*)ap->ioaddr.scr_addr + (sc_reg * 4)); return readl((void __iomem *)ap->ioaddr.scr_addr + (sc_reg * 4));
else else
return inl(ap->ioaddr.scr_addr + (sc_reg * 4)); return inl(ap->ioaddr.scr_addr + (sc_reg * 4));
} }
...@@ -345,7 +345,7 @@ static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) ...@@ -345,7 +345,7 @@ static void nv_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
return; return;
if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO) if (host->host_flags & NV_HOST_FLAGS_SCR_MMIO)
writel(val, (void*)ap->ioaddr.scr_addr + (sc_reg * 4)); writel(val, (void __iomem *)ap->ioaddr.scr_addr + (sc_reg * 4));
else else
outl(val, ap->ioaddr.scr_addr + (sc_reg * 4)); outl(val, ap->ioaddr.scr_addr + (sc_reg * 4));
} }
...@@ -405,7 +405,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -405,7 +405,7 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
rc = -ENOMEM; rc = -ENOMEM;
ppi = &nv_port_info; ppi = &nv_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) if (!probe_ent)
goto err_out_regions; goto err_out_regions;
......
...@@ -87,8 +87,8 @@ static void pdc_port_stop(struct ata_port *ap); ...@@ -87,8 +87,8 @@ static void pdc_port_stop(struct ata_port *ap);
static void pdc_pata_phy_reset(struct ata_port *ap); static void pdc_pata_phy_reset(struct ata_port *ap);
static void pdc_sata_phy_reset(struct ata_port *ap); static void pdc_sata_phy_reset(struct ata_port *ap);
static void pdc_qc_prep(struct ata_queued_cmd *qc); static void pdc_qc_prep(struct ata_queued_cmd *qc);
static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static void pdc_irq_clear(struct ata_port *ap); static void pdc_irq_clear(struct ata_port *ap);
static int pdc_qc_issue_prot(struct ata_queued_cmd *qc); static int pdc_qc_issue_prot(struct ata_queued_cmd *qc);
...@@ -113,7 +113,7 @@ static Scsi_Host_Template pdc_ata_sht = { ...@@ -113,7 +113,7 @@ static Scsi_Host_Template pdc_ata_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations pdc_sata_ops = { static const struct ata_port_operations pdc_sata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = pdc_tf_load_mmio, .tf_load = pdc_tf_load_mmio,
.tf_read = ata_tf_read, .tf_read = ata_tf_read,
...@@ -136,7 +136,7 @@ static struct ata_port_operations pdc_sata_ops = { ...@@ -136,7 +136,7 @@ static struct ata_port_operations pdc_sata_ops = {
.host_stop = ata_pci_host_stop, .host_stop = ata_pci_host_stop,
}; };
static struct ata_port_operations pdc_pata_ops = { static const struct ata_port_operations pdc_pata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = pdc_tf_load_mmio, .tf_load = pdc_tf_load_mmio,
.tf_read = ata_tf_read, .tf_read = ata_tf_read,
...@@ -324,7 +324,7 @@ static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) ...@@ -324,7 +324,7 @@ static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
{ {
if (sc_reg > SCR_CONTROL) if (sc_reg > SCR_CONTROL)
return 0xffffffffU; return 0xffffffffU;
return readl((void *) ap->ioaddr.scr_addr + (sc_reg * 4)); return readl((void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
} }
...@@ -333,7 +333,7 @@ static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, ...@@ -333,7 +333,7 @@ static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
{ {
if (sc_reg > SCR_CONTROL) if (sc_reg > SCR_CONTROL)
return; return;
writel(val, (void *) ap->ioaddr.scr_addr + (sc_reg * 4)); writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
} }
static void pdc_qc_prep(struct ata_queued_cmd *qc) static void pdc_qc_prep(struct ata_queued_cmd *qc)
...@@ -523,8 +523,8 @@ static inline void pdc_packet_start(struct ata_queued_cmd *qc) ...@@ -523,8 +523,8 @@ static inline void pdc_packet_start(struct ata_queued_cmd *qc)
pp->pkt[2] = seq; pp->pkt[2] = seq;
wmb(); /* flush PRD, pkt writes */ wmb(); /* flush PRD, pkt writes */
writel(pp->pkt_dma, (void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); writel(pp->pkt_dma, (void __iomem *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); /* flush */ readl((void __iomem *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); /* flush */
} }
static int pdc_qc_issue_prot(struct ata_queued_cmd *qc) static int pdc_qc_issue_prot(struct ata_queued_cmd *qc)
...@@ -546,7 +546,7 @@ static int pdc_qc_issue_prot(struct ata_queued_cmd *qc) ...@@ -546,7 +546,7 @@ static int pdc_qc_issue_prot(struct ata_queued_cmd *qc)
return ata_qc_issue_prot(qc); return ata_qc_issue_prot(qc);
} }
static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
{ {
WARN_ON (tf->protocol == ATA_PROT_DMA || WARN_ON (tf->protocol == ATA_PROT_DMA ||
tf->protocol == ATA_PROT_NODATA); tf->protocol == ATA_PROT_NODATA);
...@@ -554,7 +554,7 @@ static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) ...@@ -554,7 +554,7 @@ static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
} }
static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
{ {
WARN_ON (tf->protocol == ATA_PROT_DMA || WARN_ON (tf->protocol == ATA_PROT_DMA ||
tf->protocol == ATA_PROT_NODATA); tf->protocol == ATA_PROT_NODATA);
......
...@@ -51,8 +51,6 @@ enum { ...@@ -51,8 +51,6 @@ enum {
QS_PRD_BYTES = QS_MAX_PRD * 16, QS_PRD_BYTES = QS_MAX_PRD * 16,
QS_PKT_BYTES = QS_CPB_BYTES + QS_PRD_BYTES, QS_PKT_BYTES = QS_CPB_BYTES + QS_PRD_BYTES,
QS_DMA_BOUNDARY = ~0UL,
/* global register offsets */ /* global register offsets */
QS_HCF_CNFG3 = 0x0003, /* host configuration offset */ QS_HCF_CNFG3 = 0x0003, /* host configuration offset */
QS_HID_HPHY = 0x0004, /* host physical interface info */ QS_HID_HPHY = 0x0004, /* host physical interface info */
...@@ -101,6 +99,10 @@ enum { ...@@ -101,6 +99,10 @@ enum {
board_2068_idx = 0, /* QStor 4-port SATA/RAID */ board_2068_idx = 0, /* QStor 4-port SATA/RAID */
}; };
enum {
QS_DMA_BOUNDARY = ~0UL
};
typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t; typedef enum { qs_state_idle, qs_state_pkt, qs_state_mmio } qs_state_t;
struct qs_port_priv { struct qs_port_priv {
...@@ -145,7 +147,7 @@ static Scsi_Host_Template qs_ata_sht = { ...@@ -145,7 +147,7 @@ static Scsi_Host_Template qs_ata_sht = {
.bios_param = ata_std_bios_param, .bios_param = ata_std_bios_param,
}; };
static struct ata_port_operations qs_ata_ops = { static const struct ata_port_operations qs_ata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = ata_tf_load, .tf_load = ata_tf_load,
.tf_read = ata_tf_read, .tf_read = ata_tf_read,
......
...@@ -150,7 +150,7 @@ static Scsi_Host_Template sil_sht = { ...@@ -150,7 +150,7 @@ static Scsi_Host_Template sil_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations sil_ops = { static const struct ata_port_operations sil_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.dev_config = sil_dev_config, .dev_config = sil_dev_config,
.tf_load = ata_tf_load, .tf_load = ata_tf_load,
...@@ -289,7 +289,7 @@ static inline unsigned long sil_scr_addr(struct ata_port *ap, unsigned int sc_re ...@@ -289,7 +289,7 @@ static inline unsigned long sil_scr_addr(struct ata_port *ap, unsigned int sc_re
static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg) static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg)
{ {
void *mmio = (void *) sil_scr_addr(ap, sc_reg); void __iomem *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg);
if (mmio) if (mmio)
return readl(mmio); return readl(mmio);
return 0xffffffffU; return 0xffffffffU;
...@@ -297,7 +297,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg) ...@@ -297,7 +297,7 @@ static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg)
static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val) static void sil_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val)
{ {
void *mmio = (void *) sil_scr_addr(ap, sc_reg); void *mmio = (void __iomem *) sil_scr_addr(ap, sc_reg);
if (mmio) if (mmio)
writel(val, mmio); writel(val, mmio);
} }
......
This diff is collapsed.
...@@ -102,7 +102,7 @@ static Scsi_Host_Template sis_sht = { ...@@ -102,7 +102,7 @@ static Scsi_Host_Template sis_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations sis_ops = { static const struct ata_port_operations sis_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = ata_tf_load, .tf_load = ata_tf_load,
.tf_read = ata_tf_read, .tf_read = ata_tf_read,
...@@ -263,7 +263,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -263,7 +263,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_regions; goto err_out_regions;
ppi = &sis_port_info; ppi = &sis_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) { if (!probe_ent) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_regions; goto err_out_regions;
......
...@@ -102,7 +102,7 @@ static void k2_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, ...@@ -102,7 +102,7 @@ static void k2_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
} }
static void k2_sata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
{ {
struct ata_ioports *ioaddr = &ap->ioaddr; struct ata_ioports *ioaddr = &ap->ioaddr;
unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
...@@ -297,7 +297,7 @@ static Scsi_Host_Template k2_sata_sht = { ...@@ -297,7 +297,7 @@ static Scsi_Host_Template k2_sata_sht = {
}; };
static struct ata_port_operations k2_sata_ops = { static const struct ata_port_operations k2_sata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = k2_sata_tf_load, .tf_load = k2_sata_tf_load,
.tf_read = k2_sata_tf_read, .tf_read = k2_sata_tf_read,
......
...@@ -137,7 +137,7 @@ struct pdc_port_priv { ...@@ -137,7 +137,7 @@ struct pdc_port_priv {
}; };
struct pdc_host_priv { struct pdc_host_priv {
void *dimm_mmio; void __iomem *dimm_mmio;
unsigned int doing_hdma; unsigned int doing_hdma;
unsigned int hdma_prod; unsigned int hdma_prod;
...@@ -157,8 +157,8 @@ static void pdc_20621_phy_reset (struct ata_port *ap); ...@@ -157,8 +157,8 @@ static void pdc_20621_phy_reset (struct ata_port *ap);
static int pdc_port_start(struct ata_port *ap); static int pdc_port_start(struct ata_port *ap);
static void pdc_port_stop(struct ata_port *ap); static void pdc_port_stop(struct ata_port *ap);
static void pdc20621_qc_prep(struct ata_queued_cmd *qc); static void pdc20621_qc_prep(struct ata_queued_cmd *qc);
static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf); static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf); static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf);
static void pdc20621_host_stop(struct ata_host_set *host_set); static void pdc20621_host_stop(struct ata_host_set *host_set);
static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe); static unsigned int pdc20621_dimm_init(struct ata_probe_ent *pe);
static int pdc20621_detect_dimm(struct ata_probe_ent *pe); static int pdc20621_detect_dimm(struct ata_probe_ent *pe);
...@@ -196,7 +196,7 @@ static Scsi_Host_Template pdc_sata_sht = { ...@@ -196,7 +196,7 @@ static Scsi_Host_Template pdc_sata_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations pdc_20621_ops = { static const struct ata_port_operations pdc_20621_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = pdc_tf_load_mmio, .tf_load = pdc_tf_load_mmio,
.tf_read = ata_tf_read, .tf_read = ata_tf_read,
...@@ -247,7 +247,7 @@ static void pdc20621_host_stop(struct ata_host_set *host_set) ...@@ -247,7 +247,7 @@ static void pdc20621_host_stop(struct ata_host_set *host_set)
{ {
struct pci_dev *pdev = to_pci_dev(host_set->dev); struct pci_dev *pdev = to_pci_dev(host_set->dev);
struct pdc_host_priv *hpriv = host_set->private_data; struct pdc_host_priv *hpriv = host_set->private_data;
void *dimm_mmio = hpriv->dimm_mmio; void __iomem *dimm_mmio = hpriv->dimm_mmio;
pci_iounmap(pdev, dimm_mmio); pci_iounmap(pdev, dimm_mmio);
kfree(hpriv); kfree(hpriv);
...@@ -669,8 +669,8 @@ static void pdc20621_packet_start(struct ata_queued_cmd *qc) ...@@ -669,8 +669,8 @@ static void pdc20621_packet_start(struct ata_queued_cmd *qc)
readl(mmio + PDC_20621_SEQCTL + (seq * 4)); /* flush */ readl(mmio + PDC_20621_SEQCTL + (seq * 4)); /* flush */
writel(port_ofs + PDC_DIMM_ATA_PKT, writel(port_ofs + PDC_DIMM_ATA_PKT,
(void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); (void __iomem *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); readl((void __iomem *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
VPRINTK("submitted ofs 0x%x (%u), seq %u\n", VPRINTK("submitted ofs 0x%x (%u), seq %u\n",
port_ofs + PDC_DIMM_ATA_PKT, port_ofs + PDC_DIMM_ATA_PKT,
port_ofs + PDC_DIMM_ATA_PKT, port_ofs + PDC_DIMM_ATA_PKT,
...@@ -747,8 +747,8 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap, ...@@ -747,8 +747,8 @@ static inline unsigned int pdc20621_host_intr( struct ata_port *ap,
writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4)); writel(0x00000001, mmio + PDC_20621_SEQCTL + (seq * 4));
readl(mmio + PDC_20621_SEQCTL + (seq * 4)); readl(mmio + PDC_20621_SEQCTL + (seq * 4));
writel(port_ofs + PDC_DIMM_ATA_PKT, writel(port_ofs + PDC_DIMM_ATA_PKT,
(void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); (void __iomem *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
readl((void *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT); readl((void __iomem *) ap->ioaddr.cmd_addr + PDC_PKT_SUBMIT);
} }
/* step two - execute ATA command */ /* step two - execute ATA command */
...@@ -899,7 +899,7 @@ out: ...@@ -899,7 +899,7 @@ out:
DPRINTK("EXIT\n"); DPRINTK("EXIT\n");
} }
static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void pdc_tf_load_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
{ {
WARN_ON (tf->protocol == ATA_PROT_DMA || WARN_ON (tf->protocol == ATA_PROT_DMA ||
tf->protocol == ATA_PROT_NODATA); tf->protocol == ATA_PROT_NODATA);
...@@ -907,7 +907,7 @@ static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf) ...@@ -907,7 +907,7 @@ static void pdc_tf_load_mmio(struct ata_port *ap, struct ata_taskfile *tf)
} }
static void pdc_exec_command_mmio(struct ata_port *ap, struct ata_taskfile *tf) static void pdc_exec_command_mmio(struct ata_port *ap, const struct ata_taskfile *tf)
{ {
WARN_ON (tf->protocol == ATA_PROT_DMA || WARN_ON (tf->protocol == ATA_PROT_DMA ||
tf->protocol == ATA_PROT_NODATA); tf->protocol == ATA_PROT_NODATA);
...@@ -1014,7 +1014,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource, ...@@ -1014,7 +1014,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource,
idx++; idx++;
dist = ((long)(s32)(window_size - (offset + size))) >= 0 ? size : dist = ((long)(s32)(window_size - (offset + size))) >= 0 ? size :
(long) (window_size - offset); (long) (window_size - offset);
memcpy_toio((char *) (dimm_mmio + offset / 4), (char *) psource, dist); memcpy_toio(dimm_mmio + offset / 4, psource, dist);
writel(0x01, mmio + PDC_GENERAL_CTLR); writel(0x01, mmio + PDC_GENERAL_CTLR);
readl(mmio + PDC_GENERAL_CTLR); readl(mmio + PDC_GENERAL_CTLR);
...@@ -1023,8 +1023,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource, ...@@ -1023,8 +1023,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource,
for (; (long) size >= (long) window_size ;) { for (; (long) size >= (long) window_size ;) {
writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR); writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
readl(mmio + PDC_DIMM_WINDOW_CTLR); readl(mmio + PDC_DIMM_WINDOW_CTLR);
memcpy_toio((char *) (dimm_mmio), (char *) psource, memcpy_toio(dimm_mmio, psource, window_size / 4);
window_size / 4);
writel(0x01, mmio + PDC_GENERAL_CTLR); writel(0x01, mmio + PDC_GENERAL_CTLR);
readl(mmio + PDC_GENERAL_CTLR); readl(mmio + PDC_GENERAL_CTLR);
psource += window_size; psource += window_size;
...@@ -1035,7 +1034,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource, ...@@ -1035,7 +1034,7 @@ static void pdc20621_put_to_dimm(struct ata_probe_ent *pe, void *psource,
if (size) { if (size) {
writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR); writel(((idx) << page_mask), mmio + PDC_DIMM_WINDOW_CTLR);
readl(mmio + PDC_DIMM_WINDOW_CTLR); readl(mmio + PDC_DIMM_WINDOW_CTLR);
memcpy_toio((char *) (dimm_mmio), (char *) psource, size / 4); memcpy_toio(dimm_mmio, psource, size / 4);
writel(0x01, mmio + PDC_GENERAL_CTLR); writel(0x01, mmio + PDC_GENERAL_CTLR);
readl(mmio + PDC_GENERAL_CTLR); readl(mmio + PDC_GENERAL_CTLR);
} }
......
...@@ -90,7 +90,7 @@ static Scsi_Host_Template uli_sht = { ...@@ -90,7 +90,7 @@ static Scsi_Host_Template uli_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations uli_ops = { static const struct ata_port_operations uli_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = ata_tf_load, .tf_load = ata_tf_load,
...@@ -202,7 +202,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -202,7 +202,7 @@ static int uli_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_regions; goto err_out_regions;
ppi = &uli_port_info; ppi = &uli_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) { if (!probe_ent) {
rc = -ENOMEM; rc = -ENOMEM;
goto err_out_regions; goto err_out_regions;
......
...@@ -109,7 +109,7 @@ static Scsi_Host_Template svia_sht = { ...@@ -109,7 +109,7 @@ static Scsi_Host_Template svia_sht = {
.ordered_flush = 1, .ordered_flush = 1,
}; };
static struct ata_port_operations svia_sata_ops = { static const struct ata_port_operations svia_sata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = ata_tf_load, .tf_load = ata_tf_load,
...@@ -212,7 +212,7 @@ static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev) ...@@ -212,7 +212,7 @@ static struct ata_probe_ent *vt6420_init_probe_ent(struct pci_dev *pdev)
struct ata_probe_ent *probe_ent; struct ata_probe_ent *probe_ent;
struct ata_port_info *ppi = &svia_port_info; struct ata_port_info *ppi = &svia_port_info;
probe_ent = ata_pci_init_native_mode(pdev, &ppi); probe_ent = ata_pci_init_native_mode(pdev, &ppi, ATA_PORT_PRIMARY | ATA_PORT_SECONDARY);
if (!probe_ent) if (!probe_ent)
return NULL; return NULL;
......
...@@ -86,7 +86,7 @@ static u32 vsc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg) ...@@ -86,7 +86,7 @@ static u32 vsc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg)
{ {
if (sc_reg > SCR_CONTROL) if (sc_reg > SCR_CONTROL)
return 0xffffffffU; return 0xffffffffU;
return readl((void *) ap->ioaddr.scr_addr + (sc_reg * 4)); return readl((void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
} }
...@@ -95,16 +95,16 @@ static void vsc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, ...@@ -95,16 +95,16 @@ static void vsc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
{ {
if (sc_reg > SCR_CONTROL) if (sc_reg > SCR_CONTROL)
return; return;
writel(val, (void *) ap->ioaddr.scr_addr + (sc_reg * 4)); writel(val, (void __iomem *) ap->ioaddr.scr_addr + (sc_reg * 4));
} }
static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl) static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl)
{ {
unsigned long mask_addr; void __iomem *mask_addr;
u8 mask; u8 mask;
mask_addr = (unsigned long) ap->host_set->mmio_base + mask_addr = ap->host_set->mmio_base +
VSC_SATA_INT_MASK_OFFSET + ap->port_no; VSC_SATA_INT_MASK_OFFSET + ap->port_no;
mask = readb(mask_addr); mask = readb(mask_addr);
if (ctl & ATA_NIEN) if (ctl & ATA_NIEN)
...@@ -115,7 +115,7 @@ static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl) ...@@ -115,7 +115,7 @@ static void vsc_intr_mask_update(struct ata_port *ap, u8 ctl)
} }
static void vsc_sata_tf_load(struct ata_port *ap, struct ata_taskfile *tf) static void vsc_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
{ {
struct ata_ioports *ioaddr = &ap->ioaddr; struct ata_ioports *ioaddr = &ap->ioaddr;
unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR;
...@@ -231,7 +231,7 @@ static Scsi_Host_Template vsc_sata_sht = { ...@@ -231,7 +231,7 @@ static Scsi_Host_Template vsc_sata_sht = {
}; };
static struct ata_port_operations vsc_sata_ops = { static const struct ata_port_operations vsc_sata_ops = {
.port_disable = ata_port_disable, .port_disable = ata_port_disable,
.tf_load = vsc_sata_tf_load, .tf_load = vsc_sata_tf_load,
.tf_read = vsc_sata_tf_read, .tf_read = vsc_sata_tf_read,
...@@ -283,7 +283,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d ...@@ -283,7 +283,7 @@ static int __devinit vsc_sata_init_one (struct pci_dev *pdev, const struct pci_d
struct ata_probe_ent *probe_ent = NULL; struct ata_probe_ent *probe_ent = NULL;
unsigned long base; unsigned long base;
int pci_dev_busy = 0; int pci_dev_busy = 0;
void *mmio_base; void __iomem *mmio_base;
int rc; int rc;
if (!printed_version++) if (!printed_version++)
......
...@@ -42,13 +42,18 @@ enum { ...@@ -42,13 +42,18 @@ enum {
ATA_SECT_SIZE = 512, ATA_SECT_SIZE = 512,
ATA_ID_WORDS = 256, ATA_ID_WORDS = 256,
ATA_ID_PROD_OFS = 27,
ATA_ID_FW_REV_OFS = 23,
ATA_ID_SERNO_OFS = 10, ATA_ID_SERNO_OFS = 10,
ATA_ID_MAJOR_VER = 80, ATA_ID_FW_REV_OFS = 23,
ATA_ID_PIO_MODES = 64, ATA_ID_PROD_OFS = 27,
ATA_ID_OLD_PIO_MODES = 51,
ATA_ID_FIELD_VALID = 53,
ATA_ID_MWDMA_MODES = 63, ATA_ID_MWDMA_MODES = 63,
ATA_ID_PIO_MODES = 64,
ATA_ID_EIDE_DMA_MIN = 65,
ATA_ID_EIDE_PIO = 67,
ATA_ID_EIDE_PIO_IORDY = 68,
ATA_ID_UDMA_MODES = 88, ATA_ID_UDMA_MODES = 88,
ATA_ID_MAJOR_VER = 80,
ATA_ID_PIO4 = (1 << 1), ATA_ID_PIO4 = (1 << 1),
ATA_PCI_CTL_OFS = 2, ATA_PCI_CTL_OFS = 2,
...@@ -128,10 +133,15 @@ enum { ...@@ -128,10 +133,15 @@ enum {
ATA_CMD_PIO_READ_EXT = 0x24, ATA_CMD_PIO_READ_EXT = 0x24,
ATA_CMD_PIO_WRITE = 0x30, ATA_CMD_PIO_WRITE = 0x30,
ATA_CMD_PIO_WRITE_EXT = 0x34, ATA_CMD_PIO_WRITE_EXT = 0x34,
ATA_CMD_READ_MULTI = 0xC4,
ATA_CMD_READ_MULTI_EXT = 0x29,
ATA_CMD_WRITE_MULTI = 0xC5,
ATA_CMD_WRITE_MULTI_EXT = 0x39,
ATA_CMD_SET_FEATURES = 0xEF, ATA_CMD_SET_FEATURES = 0xEF,
ATA_CMD_PACKET = 0xA0, ATA_CMD_PACKET = 0xA0,
ATA_CMD_VERIFY = 0x40, ATA_CMD_VERIFY = 0x40,
ATA_CMD_VERIFY_EXT = 0x42, ATA_CMD_VERIFY_EXT = 0x42,
ATA_CMD_INIT_DEV_PARAMS = 0x91,
/* SETFEATURES stuff */ /* SETFEATURES stuff */
SETFEATURES_XFER = 0x03, SETFEATURES_XFER = 0x03,
...@@ -146,14 +156,14 @@ enum { ...@@ -146,14 +156,14 @@ enum {
XFER_MW_DMA_2 = 0x22, XFER_MW_DMA_2 = 0x22,
XFER_MW_DMA_1 = 0x21, XFER_MW_DMA_1 = 0x21,
XFER_MW_DMA_0 = 0x20, XFER_MW_DMA_0 = 0x20,
XFER_SW_DMA_2 = 0x12,
XFER_SW_DMA_1 = 0x11,
XFER_SW_DMA_0 = 0x10,
XFER_PIO_4 = 0x0C, XFER_PIO_4 = 0x0C,
XFER_PIO_3 = 0x0B, XFER_PIO_3 = 0x0B,
XFER_PIO_2 = 0x0A, XFER_PIO_2 = 0x0A,
XFER_PIO_1 = 0x09, XFER_PIO_1 = 0x09,
XFER_PIO_0 = 0x08, XFER_PIO_0 = 0x08,
XFER_SW_DMA_2 = 0x12,
XFER_SW_DMA_1 = 0x11,
XFER_SW_DMA_0 = 0x10,
XFER_PIO_SLOW = 0x00, XFER_PIO_SLOW = 0x00,
/* ATAPI stuff */ /* ATAPI stuff */
...@@ -181,6 +191,7 @@ enum { ...@@ -181,6 +191,7 @@ enum {
ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
}; };
enum ata_tf_protocols { enum ata_tf_protocols {
...@@ -250,7 +261,19 @@ struct ata_taskfile { ...@@ -250,7 +261,19 @@ struct ata_taskfile {
((u64) (id)[(n) + 1] << 16) | \ ((u64) (id)[(n) + 1] << 16) | \
((u64) (id)[(n) + 0]) ) ((u64) (id)[(n) + 0]) )
static inline int atapi_cdb_len(u16 *dev_id) static inline int ata_id_current_chs_valid(const u16 *id)
{
/* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
has not been issued to the device then the values of
id[54] to id[56] are vendor specific. */
return (id[53] & 0x01) && /* Current translation valid */
id[54] && /* cylinders in current translation */
id[55] && /* heads in current translation */
id[55] <= 16 &&
id[56]; /* sectors in current translation */
}
static inline int atapi_cdb_len(const u16 *dev_id)
{ {
u16 tmp = dev_id[0] & 0x3; u16 tmp = dev_id[0] & 0x3;
switch (tmp) { switch (tmp) {
...@@ -260,7 +283,7 @@ static inline int atapi_cdb_len(u16 *dev_id) ...@@ -260,7 +283,7 @@ static inline int atapi_cdb_len(u16 *dev_id)
} }
} }
static inline int is_atapi_taskfile(struct ata_taskfile *tf) static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
{ {
return (tf->protocol == ATA_PROT_ATAPI) || return (tf->protocol == ATA_PROT_ATAPI) ||
(tf->protocol == ATA_PROT_ATAPI_NODATA) || (tf->protocol == ATA_PROT_ATAPI_NODATA) ||
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment