Lines Matching full:ap
43 struct ata_port *ap = link->ap; in sata_scr_valid() local
45 return (ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read; in sata_scr_valid()
56 * guaranteed to succeed if @link is ap->link, the cable type of
60 * None if @link is ap->link. Kernel thread context otherwise.
69 return link->ap->ops->scr_read(link, reg, val); in sata_scr_read()
84 * guaranteed to succeed if @link is ap->link, the cable type of
88 * None if @link is ap->link. Kernel thread context otherwise.
97 return link->ap->ops->scr_write(link, reg, val); in sata_scr_write()
115 * None if @link is ap->link. Kernel thread context otherwise.
126 rc = link->ap->ops->scr_write(link, reg, val); in sata_scr_write_flush()
128 rc = link->ap->ops->scr_read(link, reg, &val); in sata_scr_write_flush()
256 ata_msleep(link->ap, interval); in sata_link_debounce()
323 ata_msleep(link->ap, 200); in sata_link_resume()
407 if (link->ap->host->flags & ATA_HOST_NO_PART) in sata_link_scr_lpm()
410 if (link->ap->host->flags & ATA_HOST_NO_SSC) in sata_link_scr_lpm()
413 if (link->ap->host->flags & ATA_HOST_NO_DEVSLP) in sata_link_scr_lpm()
441 struct ata_link *host_link = &link->ap->link; in __sata_set_spd_needed()
583 ata_msleep(link->ap, 1); in sata_link_hardreset()
597 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) { in sata_link_hardreset()
631 * @ap: port in question
636 * requests normally. ap->qc_active and @qc_active is compared
649 int ata_qc_complete_multiple(struct ata_port *ap, u64 qc_active) in ata_qc_complete_multiple() argument
651 u64 done_mask, ap_qc_active = ap->qc_active; in ata_qc_complete_multiple()
655 * If the internal tag is set on ap->qc_active, then we care about in ata_qc_complete_multiple()
667 ata_port_err(ap, "illegal qc_active transition (%08llx->%08llx)\n", in ata_qc_complete_multiple()
668 ap->qc_active, qc_active); in ata_qc_complete_multiple()
672 if (ap->ops->qc_ncq_fill_rtf) in ata_qc_complete_multiple()
673 ap->ops->qc_ncq_fill_rtf(ap, done_mask); in ata_qc_complete_multiple()
679 qc = ata_qc_from_tag(ap, tag); in ata_qc_complete_multiple()
693 * @ap: port to initialize slave link for
695 * Create and initialize slave link for @ap. This enables slave
718 * handling, separate @ap->slave_link is used. All dirty details
737 int ata_slave_link_init(struct ata_port *ap) in ata_slave_link_init() argument
741 WARN_ON(ap->slave_link); in ata_slave_link_init()
742 WARN_ON(ap->flags & ATA_FLAG_PMP); in ata_slave_link_init()
748 ata_link_init(ap, link, 1); in ata_slave_link_init()
749 ap->slave_link = link; in ata_slave_link_init()
800 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_lpm_store() local
817 spin_lock_irqsave(ap->lock, flags); in ata_scsi_lpm_store()
819 ata_for_each_link(link, ap, EDGE) { in ata_scsi_lpm_store()
820 ata_for_each_dev(dev, &ap->link, ENABLED) { in ata_scsi_lpm_store()
828 ap->target_lpm_policy = policy; in ata_scsi_lpm_store()
829 ata_port_schedule_eh(ap); in ata_scsi_lpm_store()
831 spin_unlock_irqrestore(ap->lock, flags); in ata_scsi_lpm_store()
839 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_lpm_show() local
841 if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names)) in ata_scsi_lpm_show()
845 ata_lpm_policy_names[ap->target_lpm_policy]); in ata_scsi_lpm_show()
856 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_supported_show() local
861 spin_lock_irq(ap->lock); in ata_ncq_prio_supported_show()
862 dev = ata_scsi_find_dev(ap, sdev); in ata_ncq_prio_supported_show()
867 spin_unlock_irq(ap->lock); in ata_ncq_prio_supported_show()
880 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_enable_show() local
885 spin_lock_irq(ap->lock); in ata_ncq_prio_enable_show()
886 dev = ata_scsi_find_dev(ap, sdev); in ata_ncq_prio_enable_show()
891 spin_unlock_irq(ap->lock); in ata_ncq_prio_enable_show()
901 struct ata_port *ap; in ata_ncq_prio_enable_store() local
912 ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_enable_store()
913 dev = ata_scsi_find_dev(ap, sdev); in ata_ncq_prio_enable_store()
917 spin_lock_irq(ap->lock); in ata_ncq_prio_enable_store()
937 spin_unlock_irq(ap->lock); in ata_ncq_prio_enable_store()
968 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_em_message_store() local
969 if (ap->ops->em_store && (ap->flags & ATA_FLAG_EM)) in ata_scsi_em_message_store()
970 return ap->ops->em_store(ap, buf, count); in ata_scsi_em_message_store()
979 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_em_message_show() local
981 if (ap->ops->em_show && (ap->flags & ATA_FLAG_EM)) in ata_scsi_em_message_show()
982 return ap->ops->em_show(ap, buf); in ata_scsi_em_message_show()
994 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_em_message_type_show() local
996 return sysfs_emit(buf, "%d\n", ap->em_message_type); in ata_scsi_em_message_type_show()
1007 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_show() local
1008 struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); in ata_scsi_activity_show()
1010 if (atadev && ap->ops->sw_activity_show && in ata_scsi_activity_show()
1011 (ap->flags & ATA_FLAG_SW_ACTIVITY)) in ata_scsi_activity_show()
1012 return ap->ops->sw_activity_show(atadev, buf); in ata_scsi_activity_show()
1021 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_store() local
1022 struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); in ata_scsi_activity_store()
1026 if (atadev && ap->ops->sw_activity_store && in ata_scsi_activity_store()
1027 (ap->flags & ATA_FLAG_SW_ACTIVITY)) { in ata_scsi_activity_store()
1031 rc = ap->ops->sw_activity_store(atadev, val); in ata_scsi_activity_store()
1046 * @ap: ATA port of the target device
1054 int ata_change_queue_depth(struct ata_port *ap, struct scsi_device *sdev, in ata_change_queue_depth() argument
1061 spin_lock_irqsave(ap->lock, flags); in ata_change_queue_depth()
1063 dev = ata_scsi_find_dev(ap, sdev); in ata_change_queue_depth()
1065 spin_unlock_irqrestore(ap->lock, flags); in ata_change_queue_depth()
1076 spin_unlock_irqrestore(ap->lock, flags); in ata_change_queue_depth()
1091 spin_unlock_irqrestore(ap->lock, flags); in ata_change_queue_depth()
1117 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_change_queue_depth() local
1119 return ata_change_queue_depth(ap, sdev, queue_depth); in ata_scsi_change_queue_depth()
1140 struct ata_port *ap; in ata_sas_port_alloc() local
1142 ap = ata_port_alloc(host); in ata_sas_port_alloc()
1143 if (!ap) in ata_sas_port_alloc()
1146 ap->port_no = 0; in ata_sas_port_alloc()
1147 ap->lock = &host->lock; in ata_sas_port_alloc()
1148 ap->pio_mask = port_info->pio_mask; in ata_sas_port_alloc()
1149 ap->mwdma_mask = port_info->mwdma_mask; in ata_sas_port_alloc()
1150 ap->udma_mask = port_info->udma_mask; in ata_sas_port_alloc()
1151 ap->flags |= port_info->flags; in ata_sas_port_alloc()
1152 ap->ops = port_info->port_ops; in ata_sas_port_alloc()
1153 ap->cbl = ATA_CBL_SATA; in ata_sas_port_alloc()
1154 ap->print_id = atomic_inc_return(&ata_print_id); in ata_sas_port_alloc()
1156 return ap; in ata_sas_port_alloc()
1160 int ata_sas_tport_add(struct device *parent, struct ata_port *ap) in ata_sas_tport_add() argument
1162 return ata_tport_add(parent, ap); in ata_sas_tport_add()
1166 void ata_sas_tport_delete(struct ata_port *ap) in ata_sas_tport_delete() argument
1168 ata_tport_delete(ap); in ata_sas_tport_delete()
1175 * @ap: ATA port to which SCSI device is attached
1181 int ata_sas_slave_configure(struct scsi_device *sdev, struct ata_port *ap) in ata_sas_slave_configure() argument
1185 return ata_scsi_dev_config(sdev, ap->link.device); in ata_sas_slave_configure()
1192 * @ap: ATA port to which the command is being sent
1199 int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap) in ata_sas_queuecmd() argument
1203 if (likely(ata_dev_enabled(ap->link.device))) in ata_sas_queuecmd()
1204 rc = __ata_scsi_queuecmd(cmd, ap->link.device); in ata_sas_queuecmd()
1215 * @ap: ATA port where async notification is received
1226 int sata_async_notification(struct ata_port *ap) in sata_async_notification() argument
1231 if (!(ap->flags & ATA_FLAG_AN)) in sata_async_notification()
1234 rc = sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf); in sata_async_notification()
1236 sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf); in sata_async_notification()
1238 if (!sata_pmp_attached(ap) || rc) { in sata_async_notification()
1240 if (!sata_pmp_attached(ap)) { in sata_async_notification()
1245 struct ata_device *dev = ap->link.device; in sata_async_notification()
1257 ata_port_schedule_eh(ap); in sata_async_notification()
1265 ata_for_each_link(link, ap, EDGE) { in sata_async_notification()
1278 ata_port_schedule_eh(ap); in sata_async_notification()
1305 u8 *buf = dev->link->ap->sector_buf; in ata_eh_read_log_10h()
1361 struct ata_port *ap = dev->link->ap; in ata_eh_read_sense_success_ncq_log() local
1362 u8 *buf = ap->ncq_sense_buf; in ata_eh_read_sense_success_ncq_log()
1387 ata_qc_for_each_raw(ap, qc, tag) { in ata_eh_read_sense_success_ncq_log()
1446 struct ata_port *ap = link->ap; in ata_eh_analyze_ncq_error() local
1454 if (ata_port_is_frozen(ap)) in ata_eh_analyze_ncq_error()
1462 ata_qc_for_each_raw(ap, qc, tag) { in ata_eh_analyze_ncq_error()
1486 qc = __ata_qc_from_tag(ap, tag); in ata_eh_analyze_ncq_error()
1510 ata_qc_for_each_raw(ap, qc, tag) { in ata_eh_analyze_ncq_error()