Lines Matching full:ap

314  * ap->private_data
332 static void sil24_pmp_attach(struct ata_port *ap);
333 static void sil24_pmp_detach(struct ata_port *ap);
334 static void sil24_freeze(struct ata_port *ap);
335 static void sil24_thaw(struct ata_port *ap);
342 static void sil24_error_handler(struct ata_port *ap);
344 static int sil24_port_start(struct ata_port *ap);
350 static int sil24_port_resume(struct ata_port *ap);
462 static unsigned long sil24_port_offset(struct ata_port *ap) in sil24_port_offset() argument
464 return ap->port_no * PORT_REGS_SIZE; in sil24_port_offset()
467 static void __iomem *sil24_port_base(struct ata_port *ap) in sil24_port_base() argument
469 return ap->host->iomap[SIL24_PORT_BAR] + sil24_port_offset(ap); in sil24_port_base()
474 void __iomem *port = sil24_port_base(dev->link->ap); in sil24_dev_config()
482 static void sil24_read_tf(struct ata_port *ap, int tag, struct ata_taskfile *tf) in sil24_read_tf() argument
484 void __iomem *port = sil24_port_base(ap); in sil24_read_tf()
502 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; in sil24_scr_read()
513 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; in sil24_scr_write()
522 static void sil24_config_port(struct ata_port *ap) in sil24_config_port() argument
524 void __iomem *port = sil24_port_base(ap); in sil24_config_port()
527 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) in sil24_config_port()
547 static void sil24_config_pmp(struct ata_port *ap, int attached) in sil24_config_pmp() argument
549 void __iomem *port = sil24_port_base(ap); in sil24_config_pmp()
557 static void sil24_clear_pmp(struct ata_port *ap) in sil24_clear_pmp() argument
559 void __iomem *port = sil24_port_base(ap); in sil24_clear_pmp()
572 static int sil24_init_port(struct ata_port *ap) in sil24_init_port() argument
574 void __iomem *port = sil24_port_base(ap); in sil24_init_port()
575 struct sil24_port_priv *pp = ap->private_data; in sil24_init_port()
579 if (sata_pmp_attached(ap)) in sil24_init_port()
580 sil24_clear_pmp(ap); in sil24_init_port()
583 ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_init_port()
585 tmp = ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_init_port()
590 ap->link.eh_context.i.action |= ATA_EH_RESET; in sil24_init_port()
597 static int sil24_exec_polled_cmd(struct ata_port *ap, int pmp, in sil24_exec_polled_cmd() argument
602 void __iomem *port = sil24_port_base(ap); in sil24_exec_polled_cmd()
603 struct sil24_port_priv *pp = ap->private_data; in sil24_exec_polled_cmd()
625 irq_stat = ata_wait_register(ap, port + PORT_IRQ_STAT, irq_mask, 0x0, in sil24_exec_polled_cmd()
635 sil24_init_port(ap); in sil24_exec_polled_cmd()
652 struct ata_port *ap = link->ap; in sil24_softreset() local
660 if (sil24_init_port(ap)) { in sil24_softreset()
670 rc = sil24_exec_polled_cmd(ap, pmp, &tf, 0, PRB_CTRL_SRST, in sil24_softreset()
680 sil24_read_tf(ap, 0, &tf); in sil24_softreset()
681 *class = ata_port_classify(ap, &tf); in sil24_softreset()
693 struct ata_port *ap = link->ap; in sil24_hardreset() local
694 void __iomem *port = sil24_port_base(ap); in sil24_hardreset()
695 struct sil24_port_priv *pp = ap->private_data; in sil24_hardreset()
706 ata_port_warn(ap, in sil24_hardreset()
710 ata_msleep(ap, 10); in sil24_hardreset()
712 ata_wait_register(ap, port + PORT_CTRL_STAT, PORT_CS_RDY, 0, in sil24_hardreset()
716 sil24_config_port(ap); in sil24_hardreset()
717 sil24_config_pmp(ap, ap->nr_pmp_links); in sil24_hardreset()
731 tmp = ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_hardreset()
791 struct ata_port *ap = link->ap; in sil24_qc_defer() local
816 if (unlikely(ap->excl_link)) { in sil24_qc_defer()
817 if (link == ap->excl_link) { in sil24_qc_defer()
818 if (ap->nr_active_links) in sil24_qc_defer()
824 ap->excl_link = link; in sil24_qc_defer()
825 if (ap->nr_active_links) in sil24_qc_defer()
835 struct ata_port *ap = qc->ap; in sil24_qc_prep() local
836 struct sil24_port_priv *pp = ap->private_data; in sil24_qc_prep()
883 struct ata_port *ap = qc->ap; in sil24_qc_issue() local
884 struct sil24_port_priv *pp = ap->private_data; in sil24_qc_issue()
885 void __iomem *port = sil24_port_base(ap); in sil24_qc_issue()
906 sil24_read_tf(qc->ap, qc->hw_tag, &qc->result_tf); in sil24_qc_fill_rtf()
910 static void sil24_pmp_attach(struct ata_port *ap) in sil24_pmp_attach() argument
912 u32 *gscr = ap->link.device->gscr; in sil24_pmp_attach()
914 sil24_config_pmp(ap, 1); in sil24_pmp_attach()
915 sil24_init_port(ap); in sil24_pmp_attach()
919 ata_port_info(ap, in sil24_pmp_attach()
921 ap->flags &= ~ATA_FLAG_NCQ; in sil24_pmp_attach()
925 static void sil24_pmp_detach(struct ata_port *ap) in sil24_pmp_detach() argument
927 sil24_init_port(ap); in sil24_pmp_detach()
928 sil24_config_pmp(ap, 0); in sil24_pmp_detach()
930 ap->flags |= ATA_FLAG_NCQ; in sil24_pmp_detach()
938 rc = sil24_init_port(link->ap); in sil24_pmp_hardreset()
947 static void sil24_freeze(struct ata_port *ap) in sil24_freeze() argument
949 void __iomem *port = sil24_port_base(ap); in sil24_freeze()
957 static void sil24_thaw(struct ata_port *ap) in sil24_thaw() argument
959 void __iomem *port = sil24_port_base(ap); in sil24_thaw()
970 static void sil24_error_intr(struct ata_port *ap) in sil24_error_intr() argument
972 void __iomem *port = sil24_port_base(ap); in sil24_error_intr()
973 struct sil24_port_priv *pp = ap->private_data; in sil24_error_intr()
985 link = &ap->link; in sil24_error_intr()
993 sata_async_notification(ap); in sil24_error_intr()
1025 if (ap->nr_active_links >= 3) { in sil24_error_intr()
1034 if (sata_pmp_attached(ap)) { in sil24_error_intr()
1038 if (pmp < ap->nr_pmp_links) { in sil24_error_intr()
1039 link = &ap->pmp_link[pmp]; in sil24_error_intr()
1041 qc = ata_qc_from_tag(ap, link->active_tag); in sil24_error_intr()
1052 qc = ata_qc_from_tag(ap, link->active_tag); in sil24_error_intr()
1082 if (sata_pmp_attached(ap)) in sil24_error_intr()
1088 ata_port_freeze(ap); in sil24_error_intr()
1093 ata_port_abort(ap); in sil24_error_intr()
1097 static inline void sil24_host_intr(struct ata_port *ap) in sil24_host_intr() argument
1099 void __iomem *port = sil24_port_base(ap); in sil24_host_intr()
1110 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) in sil24_host_intr()
1116 sil24_error_intr(ap); in sil24_host_intr()
1121 rc = ata_qc_complete_multiple(ap, qc_active); in sil24_host_intr()
1125 struct ata_eh_info *ehi = &ap->link.eh_info; in sil24_host_intr()
1128 ata_port_freeze(ap); in sil24_host_intr()
1133 if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) in sil24_host_intr()
1134 ata_port_info(ap, in sil24_host_intr()
1136 slot_stat, ap->link.active_tag, ap->link.sactive); in sil24_host_intr()
1171 static void sil24_error_handler(struct ata_port *ap) in sil24_error_handler() argument
1173 struct sil24_port_priv *pp = ap->private_data; in sil24_error_handler()
1175 if (sil24_init_port(ap)) in sil24_error_handler()
1176 ata_eh_freeze_port(ap); in sil24_error_handler()
1178 sata_pmp_error_handler(ap); in sil24_error_handler()
1185 struct ata_port *ap = qc->ap; in sil24_post_internal_cmd() local
1188 if ((qc->flags & ATA_QCFLAG_FAILED) && sil24_init_port(ap)) in sil24_post_internal_cmd()
1189 ata_eh_freeze_port(ap); in sil24_post_internal_cmd()
1192 static int sil24_port_start(struct ata_port *ap) in sil24_port_start() argument
1194 struct device *dev = ap->host->dev; in sil24_port_start()
1211 ap->private_data = pp; in sil24_port_start()
1213 ata_port_pbar_desc(ap, SIL24_HOST_BAR, -1, "host"); in sil24_port_start()
1214 ata_port_pbar_desc(ap, SIL24_PORT_BAR, sil24_port_offset(ap), "port"); in sil24_port_start()
1233 struct ata_port *ap = host->ports[i]; in sil24_init_controller() local
1234 void __iomem *port = sil24_port_base(ap); in sil24_init_controller()
1253 sil24_config_port(ap); in sil24_init_controller()
1352 static int sil24_port_resume(struct ata_port *ap) in sil24_port_resume() argument
1354 sil24_config_pmp(ap, ap->nr_pmp_links); in sil24_port_resume()