• Home
  • Raw
  • Download

Lines Matching refs:ap

342 static void sil24_pmp_attach(struct ata_port *ap);
343 static void sil24_pmp_detach(struct ata_port *ap);
344 static void sil24_freeze(struct ata_port *ap);
345 static void sil24_thaw(struct ata_port *ap);
352 static void sil24_error_handler(struct ata_port *ap);
354 static int sil24_port_start(struct ata_port *ap);
360 static int sil24_port_resume(struct ata_port *ap);
468 static unsigned long sil24_port_offset(struct ata_port *ap) in sil24_port_offset() argument
470 return ap->port_no * PORT_REGS_SIZE; in sil24_port_offset()
473 static void __iomem *sil24_port_base(struct ata_port *ap) in sil24_port_base() argument
475 return ap->host->iomap[SIL24_PORT_BAR] + sil24_port_offset(ap); in sil24_port_base()
480 void __iomem *port = sil24_port_base(dev->link->ap); in sil24_dev_config()
488 static void sil24_read_tf(struct ata_port *ap, int tag, struct ata_taskfile *tf) in sil24_read_tf() argument
490 void __iomem *port = sil24_port_base(ap); in sil24_read_tf()
508 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; in sil24_scr_read()
519 void __iomem *scr_addr = sil24_port_base(link->ap) + PORT_SCONTROL; in sil24_scr_write()
528 static void sil24_config_port(struct ata_port *ap) in sil24_config_port() argument
530 void __iomem *port = sil24_port_base(ap); in sil24_config_port()
533 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) in sil24_config_port()
553 static void sil24_config_pmp(struct ata_port *ap, int attached) in sil24_config_pmp() argument
555 void __iomem *port = sil24_port_base(ap); in sil24_config_pmp()
563 static void sil24_clear_pmp(struct ata_port *ap) in sil24_clear_pmp() argument
565 void __iomem *port = sil24_port_base(ap); in sil24_clear_pmp()
578 static int sil24_init_port(struct ata_port *ap) in sil24_init_port() argument
580 void __iomem *port = sil24_port_base(ap); in sil24_init_port()
581 struct sil24_port_priv *pp = ap->private_data; in sil24_init_port()
585 if (sata_pmp_attached(ap)) in sil24_init_port()
586 sil24_clear_pmp(ap); in sil24_init_port()
589 ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_init_port()
591 tmp = ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_init_port()
596 ap->link.eh_context.i.action |= ATA_EH_RESET; in sil24_init_port()
603 static int sil24_exec_polled_cmd(struct ata_port *ap, int pmp, in sil24_exec_polled_cmd() argument
608 void __iomem *port = sil24_port_base(ap); in sil24_exec_polled_cmd()
609 struct sil24_port_priv *pp = ap->private_data; in sil24_exec_polled_cmd()
631 irq_stat = ata_wait_register(ap, port + PORT_IRQ_STAT, irq_mask, 0x0, in sil24_exec_polled_cmd()
641 sil24_init_port(ap); in sil24_exec_polled_cmd()
658 struct ata_port *ap = link->ap; in sil24_softreset() local
668 if (sil24_init_port(ap)) { in sil24_softreset()
678 rc = sil24_exec_polled_cmd(ap, pmp, &tf, 0, PRB_CTRL_SRST, in sil24_softreset()
688 sil24_read_tf(ap, 0, &tf); in sil24_softreset()
702 struct ata_port *ap = link->ap; in sil24_hardreset() local
703 void __iomem *port = sil24_port_base(ap); in sil24_hardreset()
704 struct sil24_port_priv *pp = ap->private_data; in sil24_hardreset()
715 ata_port_warn(ap, in sil24_hardreset()
719 ata_msleep(ap, 10); in sil24_hardreset()
721 ata_wait_register(ap, port + PORT_CTRL_STAT, PORT_CS_RDY, 0, in sil24_hardreset()
725 sil24_config_port(ap); in sil24_hardreset()
726 sil24_config_pmp(ap, ap->nr_pmp_links); in sil24_hardreset()
740 tmp = ata_wait_register(ap, port + PORT_CTRL_STAT, in sil24_hardreset()
800 struct ata_port *ap = link->ap; in sil24_qc_defer() local
825 if (unlikely(ap->excl_link)) { in sil24_qc_defer()
826 if (link == ap->excl_link) { in sil24_qc_defer()
827 if (ap->nr_active_links) in sil24_qc_defer()
833 ap->excl_link = link; in sil24_qc_defer()
834 if (ap->nr_active_links) in sil24_qc_defer()
844 struct ata_port *ap = qc->ap; in sil24_qc_prep() local
845 struct sil24_port_priv *pp = ap->private_data; in sil24_qc_prep()
890 struct ata_port *ap = qc->ap; in sil24_qc_issue() local
891 struct sil24_port_priv *pp = ap->private_data; in sil24_qc_issue()
892 void __iomem *port = sil24_port_base(ap); in sil24_qc_issue()
913 sil24_read_tf(qc->ap, qc->tag, &qc->result_tf); in sil24_qc_fill_rtf()
917 static void sil24_pmp_attach(struct ata_port *ap) in sil24_pmp_attach() argument
919 u32 *gscr = ap->link.device->gscr; in sil24_pmp_attach()
921 sil24_config_pmp(ap, 1); in sil24_pmp_attach()
922 sil24_init_port(ap); in sil24_pmp_attach()
926 ata_port_info(ap, in sil24_pmp_attach()
928 ap->flags &= ~ATA_FLAG_NCQ; in sil24_pmp_attach()
932 static void sil24_pmp_detach(struct ata_port *ap) in sil24_pmp_detach() argument
934 sil24_init_port(ap); in sil24_pmp_detach()
935 sil24_config_pmp(ap, 0); in sil24_pmp_detach()
937 ap->flags |= ATA_FLAG_NCQ; in sil24_pmp_detach()
945 rc = sil24_init_port(link->ap); in sil24_pmp_hardreset()
954 static void sil24_freeze(struct ata_port *ap) in sil24_freeze() argument
956 void __iomem *port = sil24_port_base(ap); in sil24_freeze()
964 static void sil24_thaw(struct ata_port *ap) in sil24_thaw() argument
966 void __iomem *port = sil24_port_base(ap); in sil24_thaw()
977 static void sil24_error_intr(struct ata_port *ap) in sil24_error_intr() argument
979 void __iomem *port = sil24_port_base(ap); in sil24_error_intr()
980 struct sil24_port_priv *pp = ap->private_data; in sil24_error_intr()
992 link = &ap->link; in sil24_error_intr()
1000 sata_async_notification(ap); in sil24_error_intr()
1032 if (ap->nr_active_links >= 3) { in sil24_error_intr()
1041 if (sata_pmp_attached(ap)) { in sil24_error_intr()
1045 if (pmp < ap->nr_pmp_links) { in sil24_error_intr()
1046 link = &ap->pmp_link[pmp]; in sil24_error_intr()
1048 qc = ata_qc_from_tag(ap, link->active_tag); in sil24_error_intr()
1059 qc = ata_qc_from_tag(ap, link->active_tag); in sil24_error_intr()
1089 if (sata_pmp_attached(ap)) in sil24_error_intr()
1095 ata_port_freeze(ap); in sil24_error_intr()
1100 ata_port_abort(ap); in sil24_error_intr()
1104 static inline void sil24_host_intr(struct ata_port *ap) in sil24_host_intr() argument
1106 void __iomem *port = sil24_port_base(ap); in sil24_host_intr()
1117 if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) in sil24_host_intr()
1123 sil24_error_intr(ap); in sil24_host_intr()
1128 rc = ata_qc_complete_multiple(ap, qc_active); in sil24_host_intr()
1132 struct ata_eh_info *ehi = &ap->link.eh_info; in sil24_host_intr()
1135 ata_port_freeze(ap); in sil24_host_intr()
1140 if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) in sil24_host_intr()
1141 ata_port_info(ap, in sil24_host_intr()
1143 slot_stat, ap->link.active_tag, ap->link.sactive); in sil24_host_intr()
1178 static void sil24_error_handler(struct ata_port *ap) in sil24_error_handler() argument
1180 struct sil24_port_priv *pp = ap->private_data; in sil24_error_handler()
1182 if (sil24_init_port(ap)) in sil24_error_handler()
1183 ata_eh_freeze_port(ap); in sil24_error_handler()
1185 sata_pmp_error_handler(ap); in sil24_error_handler()
1192 struct ata_port *ap = qc->ap; in sil24_post_internal_cmd() local
1195 if ((qc->flags & ATA_QCFLAG_FAILED) && sil24_init_port(ap)) in sil24_post_internal_cmd()
1196 ata_eh_freeze_port(ap); in sil24_post_internal_cmd()
1199 static int sil24_port_start(struct ata_port *ap) in sil24_port_start() argument
1201 struct device *dev = ap->host->dev; in sil24_port_start()
1219 ap->private_data = pp; in sil24_port_start()
1221 ata_port_pbar_desc(ap, SIL24_HOST_BAR, -1, "host"); in sil24_port_start()
1222 ata_port_pbar_desc(ap, SIL24_PORT_BAR, sil24_port_offset(ap), "port"); in sil24_port_start()
1241 struct ata_port *ap = host->ports[i]; in sil24_init_controller() local
1242 void __iomem *port = sil24_port_base(ap); in sil24_init_controller()
1261 sil24_config_port(ap); in sil24_init_controller()
1378 static int sil24_port_resume(struct ata_port *ap) in sil24_port_resume() argument
1380 sil24_config_pmp(ap, ap->nr_pmp_links); in sil24_port_resume()