Lines Matching full:ap
41 struct ata_port *ap = link->ap; in sata_scr_valid() local
43 return (ap->flags & ATA_FLAG_SATA) && ap->ops->scr_read; in sata_scr_valid()
54 * guaranteed to succeed if @link is ap->link, the cable type of
58 * None if @link is ap->link. Kernel thread context otherwise.
67 return link->ap->ops->scr_read(link, reg, val); in sata_scr_read()
82 * guaranteed to succeed if @link is ap->link, the cable type of
86 * None if @link is ap->link. Kernel thread context otherwise.
95 return link->ap->ops->scr_write(link, reg, val); in sata_scr_write()
113 * None if @link is ap->link. Kernel thread context otherwise.
124 rc = link->ap->ops->scr_write(link, reg, val); in sata_scr_write_flush()
126 rc = link->ap->ops->scr_read(link, reg, &val); in sata_scr_write_flush()
254 ata_msleep(link->ap, interval); in sata_link_debounce()
321 ata_msleep(link->ap, 200); in sata_link_resume()
426 struct ata_link *host_link = &link->ap->link; in __sata_set_spd_needed()
568 ata_msleep(link->ap, 1); in sata_link_hardreset()
582 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) { in sata_link_hardreset()
617 * @ap: port in question
622 * requests normally. ap->qc_active and @qc_active is compared
635 int ata_qc_complete_multiple(struct ata_port *ap, u64 qc_active) in ata_qc_complete_multiple() argument
637 u64 done_mask, ap_qc_active = ap->qc_active; in ata_qc_complete_multiple()
641 * If the internal tag is set on ap->qc_active, then we care about in ata_qc_complete_multiple()
653 ata_port_err(ap, "illegal qc_active transition (%08llx->%08llx)\n", in ata_qc_complete_multiple()
654 ap->qc_active, qc_active); in ata_qc_complete_multiple()
662 qc = ata_qc_from_tag(ap, tag); in ata_qc_complete_multiple()
676 * @ap: port to initialize slave link for
678 * Create and initialize slave link for @ap. This enables slave
701 * handling, separate @ap->slave_link is used. All dirty details
720 int ata_slave_link_init(struct ata_port *ap) in ata_slave_link_init() argument
724 WARN_ON(ap->slave_link); in ata_slave_link_init()
725 WARN_ON(ap->flags & ATA_FLAG_PMP); in ata_slave_link_init()
731 ata_link_init(ap, link, 1); in ata_slave_link_init()
732 ap->slave_link = link; in ata_slave_link_init()
783 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_lpm_store() local
800 spin_lock_irqsave(ap->lock, flags); in ata_scsi_lpm_store()
802 ata_for_each_link(link, ap, EDGE) { in ata_scsi_lpm_store()
803 ata_for_each_dev(dev, &ap->link, ENABLED) { in ata_scsi_lpm_store()
811 ap->target_lpm_policy = policy; in ata_scsi_lpm_store()
812 ata_port_schedule_eh(ap); in ata_scsi_lpm_store()
814 spin_unlock_irqrestore(ap->lock, flags); in ata_scsi_lpm_store()
822 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_lpm_show() local
824 if (ap->target_lpm_policy >= ARRAY_SIZE(ata_lpm_policy_names)) in ata_scsi_lpm_show()
828 ata_lpm_policy_names[ap->target_lpm_policy]); in ata_scsi_lpm_show()
839 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_supported_show() local
844 spin_lock_irq(ap->lock); in ata_ncq_prio_supported_show()
845 dev = ata_scsi_find_dev(ap, sdev); in ata_ncq_prio_supported_show()
850 spin_unlock_irq(ap->lock); in ata_ncq_prio_supported_show()
863 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_enable_show() local
868 spin_lock_irq(ap->lock); in ata_ncq_prio_enable_show()
869 dev = ata_scsi_find_dev(ap, sdev); in ata_ncq_prio_enable_show()
874 spin_unlock_irq(ap->lock); in ata_ncq_prio_enable_show()
884 struct ata_port *ap; in ata_ncq_prio_enable_store() local
895 ap = ata_shost_to_port(sdev->host); in ata_ncq_prio_enable_store()
896 dev = ata_scsi_find_dev(ap, sdev); in ata_ncq_prio_enable_store()
900 spin_lock_irq(ap->lock); in ata_ncq_prio_enable_store()
913 spin_unlock_irq(ap->lock); in ata_ncq_prio_enable_store()
944 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_em_message_store() local
945 if (ap->ops->em_store && (ap->flags & ATA_FLAG_EM)) in ata_scsi_em_message_store()
946 return ap->ops->em_store(ap, buf, count); in ata_scsi_em_message_store()
955 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_em_message_show() local
957 if (ap->ops->em_show && (ap->flags & ATA_FLAG_EM)) in ata_scsi_em_message_show()
958 return ap->ops->em_show(ap, buf); in ata_scsi_em_message_show()
970 struct ata_port *ap = ata_shost_to_port(shost); in ata_scsi_em_message_type_show() local
972 return sysfs_emit(buf, "%d\n", ap->em_message_type); in ata_scsi_em_message_type_show()
983 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_show() local
984 struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); in ata_scsi_activity_show()
986 if (atadev && ap->ops->sw_activity_show && in ata_scsi_activity_show()
987 (ap->flags & ATA_FLAG_SW_ACTIVITY)) in ata_scsi_activity_show()
988 return ap->ops->sw_activity_show(atadev, buf); in ata_scsi_activity_show()
997 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_activity_store() local
998 struct ata_device *atadev = ata_scsi_find_dev(ap, sdev); in ata_scsi_activity_store()
1002 if (atadev && ap->ops->sw_activity_store && in ata_scsi_activity_store()
1003 (ap->flags & ATA_FLAG_SW_ACTIVITY)) { in ata_scsi_activity_store()
1007 rc = ap->ops->sw_activity_store(atadev, val); in ata_scsi_activity_store()
1022 * @ap: ATA port of the target device
1031 int ata_change_queue_depth(struct ata_port *ap, struct ata_device *dev, in ata_change_queue_depth() argument
1043 spin_lock_irqsave(ap->lock, flags); in ata_change_queue_depth()
1049 spin_unlock_irqrestore(ap->lock, flags); in ata_change_queue_depth()
1080 struct ata_port *ap = ata_shost_to_port(sdev->host); in ata_scsi_change_queue_depth() local
1082 return ata_change_queue_depth(ap, ata_scsi_find_dev(ap, sdev), in ata_scsi_change_queue_depth()
1104 struct ata_port *ap; in ata_sas_port_alloc() local
1106 ap = ata_port_alloc(host); in ata_sas_port_alloc()
1107 if (!ap) in ata_sas_port_alloc()
1110 ap->port_no = 0; in ata_sas_port_alloc()
1111 ap->lock = &host->lock; in ata_sas_port_alloc()
1112 ap->pio_mask = port_info->pio_mask; in ata_sas_port_alloc()
1113 ap->mwdma_mask = port_info->mwdma_mask; in ata_sas_port_alloc()
1114 ap->udma_mask = port_info->udma_mask; in ata_sas_port_alloc()
1115 ap->flags |= port_info->flags; in ata_sas_port_alloc()
1116 ap->ops = port_info->port_ops; in ata_sas_port_alloc()
1117 ap->cbl = ATA_CBL_SATA; in ata_sas_port_alloc()
1119 return ap; in ata_sas_port_alloc()
1125 * @ap: Port to initialize
1135 int ata_sas_port_start(struct ata_port *ap) in ata_sas_port_start() argument
1141 if (!ap->ops->error_handler) in ata_sas_port_start()
1142 ap->pflags &= ~ATA_PFLAG_FROZEN; in ata_sas_port_start()
1149 * @ap: Port to shut down
1157 void ata_sas_port_stop(struct ata_port *ap) in ata_sas_port_stop() argument
1164 * @ap: Port to probe
1169 void ata_sas_async_probe(struct ata_port *ap) in ata_sas_async_probe() argument
1171 __ata_port_probe(ap); in ata_sas_async_probe()
1175 int ata_sas_sync_probe(struct ata_port *ap) in ata_sas_sync_probe() argument
1177 return ata_port_probe(ap); in ata_sas_sync_probe()
1184 * @ap: SATA port to initialize
1193 int ata_sas_port_init(struct ata_port *ap) in ata_sas_port_init() argument
1195 int rc = ap->ops->port_start(ap); in ata_sas_port_init()
1199 ap->print_id = atomic_inc_return(&ata_print_id); in ata_sas_port_init()
1204 int ata_sas_tport_add(struct device *parent, struct ata_port *ap) in ata_sas_tport_add() argument
1206 return ata_tport_add(parent, ap); in ata_sas_tport_add()
1210 void ata_sas_tport_delete(struct ata_port *ap) in ata_sas_tport_delete() argument
1212 ata_tport_delete(ap); in ata_sas_tport_delete()
1218 * @ap: SATA port to destroy
1222 void ata_sas_port_destroy(struct ata_port *ap) in ata_sas_port_destroy() argument
1224 if (ap->ops->port_stop) in ata_sas_port_destroy()
1225 ap->ops->port_stop(ap); in ata_sas_port_destroy()
1226 kfree(ap); in ata_sas_port_destroy()
1233 * @ap: ATA port to which SCSI device is attached
1239 int ata_sas_slave_configure(struct scsi_device *sdev, struct ata_port *ap) in ata_sas_slave_configure() argument
1242 ata_scsi_dev_config(sdev, ap->link.device); in ata_sas_slave_configure()
1250 * @ap: ATA port to which the command is being sent
1257 int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap) in ata_sas_queuecmd() argument
1261 if (likely(ata_dev_enabled(ap->link.device))) in ata_sas_queuecmd()
1262 rc = __ata_scsi_queuecmd(cmd, ap->link.device); in ata_sas_queuecmd()
1273 * @ap: ATA port where async notification is received
1284 int sata_async_notification(struct ata_port *ap) in sata_async_notification() argument
1289 if (!(ap->flags & ATA_FLAG_AN)) in sata_async_notification()
1292 rc = sata_scr_read(&ap->link, SCR_NOTIFICATION, &sntf); in sata_async_notification()
1294 sata_scr_write(&ap->link, SCR_NOTIFICATION, sntf); in sata_async_notification()
1296 if (!sata_pmp_attached(ap) || rc) { in sata_async_notification()
1298 if (!sata_pmp_attached(ap)) { in sata_async_notification()
1303 struct ata_device *dev = ap->link.device; in sata_async_notification()
1315 ata_port_schedule_eh(ap); in sata_async_notification()
1323 ata_for_each_link(link, ap, EDGE) { in sata_async_notification()
1336 ata_port_schedule_eh(ap); in sata_async_notification()
1363 u8 *buf = dev->link->ap->sector_buf; in ata_eh_read_log_10h()
1415 struct ata_port *ap = link->ap; in ata_eh_analyze_ncq_error() local
1423 if (ap->pflags & ATA_PFLAG_FROZEN) in ata_eh_analyze_ncq_error()
1431 ata_qc_for_each_raw(ap, qc, tag) { in ata_eh_analyze_ncq_error()
1455 qc = __ata_qc_from_tag(ap, tag); in ata_eh_analyze_ncq_error()