1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>libATA Developer's Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="libATA Developer's Guide"><link rel="next" href="libataIntroduction.html" title="Chapter 1. Introduction"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">libATA Developer's Guide</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="libataIntroduction.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><div><h1 class="title"><a name="libataDevGuide"></a>libATA Developer's Guide</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Jeff</span> <span class="surname">Garzik</span></h3></div></div></div><div><p class="copyright">Copyright © 2003-2006 Jeff Garzik</p></div><div><div class="legalnotice"><a name="idp1121899724"></a><p> 2 The contents of this file are subject to the Open 3 Software License version 1.1 that can be found at 4 <a class="ulink" href="http://fedoraproject.org/wiki/Licensing:OSL1.1" target="_top">http://fedoraproject.org/wiki/Licensing:OSL1.1</a> 5 and is included herein by reference. 6 </p><p> 7 Alternatively, the contents of this file may be used under the terms 8 of the GNU General Public License version 2 (the "GPL") as distributed 9 in the kernel source COPYING file, in which case the provisions of 10 the GPL are applicable instead of the above. If you wish to allow 11 the use of your version of this file only under the terms of the 12 GPL and not to allow others to use your version of this file under 13 the OSL, indicate your decision by deleting the provisions above and 14 replace them with the notice and other provisions required by the GPL. 15 If you do not delete the provisions above, a recipient may use your 16 version of this file under either the OSL or the GPL. 17 </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="chapter"><a href="libataIntroduction.html">1. Introduction</a></span></dt><dt><span class="chapter"><a href="libataDriverApi.html">2. libata Driver API</a></span></dt><dd><dl><dt><span class="sect1"><a href="libataDriverApi.html#idp1120929892">struct ata_port_operations</a></span></dt><dd><dl><dt><span class="sect2"><a href="libataDriverApi.html#idp1120930260">Disable ATA port</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1122964388">Post-IDENTIFY device configuration</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1122965628">Set PIO/DMA mode</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120732908">Taskfile read/write</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120734212">PIO data read/write</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120735444">ATA command execute</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120736580">Per-cmd ATAPI DMA capabilities filter</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120737956">Read specific ATA shadow registers</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120739172">Write specific ATA shadow register</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120937172">Select ATA device on bus</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120938612">Private tuning method</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120940516">Control PCI IDE BMDMA engine</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120943540">High-level taskfile hooks</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120945644">Exception and probe handling (EH)</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120950892">Hardware interrupt handling</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120608052">SATA phy read/write</a></span></dt><dt><span class="sect2"><a href="libataDriverApi.html#idp1120609308">Init and shutdown</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="libataEH.html">3. Error handling</a></span></dt><dd><dl><dt><span class="sect1"><a href="libataEH.html#idp1120612852">Origins of commands</a></span></dt><dt><span class="sect1"><a href="ch03s02.html">How commands are issued</a></span></dt><dt><span class="sect1"><a href="ch03s03.html">How commands are processed</a></span></dt><dt><span class="sect1"><a href="ch03s04.html">How commands are completed</a></span></dt><dt><span class="sect1"><a href="ch03s05.html">ata_scsi_error()</a></span></dt><dt><span class="sect1"><a href="ch03s06.html">Problems with the current EH</a></span></dt></dl></dd><dt><span class="chapter"><a href="libataExt.html">4. libata Library</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-ata-link-next.html"><span class="phrase">ata_link_next</span></a></span><span class="refpurpose"> — 18 link iteration helper 19 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-next.html"><span class="phrase">ata_dev_next</span></a></span><span class="refpurpose"> — 20 device iteration helper 21 </span></dt><dt><span class="refentrytitle"><a href="API-atapi-cmd-type.html"><span class="phrase">atapi_cmd_type</span></a></span><span class="refpurpose"> — 22 Determine ATAPI command type from SCSI opcode 23 </span></dt><dt><span class="refentrytitle"><a href="API-ata-tf-to-fis.html"><span class="phrase">ata_tf_to_fis</span></a></span><span class="refpurpose"> — 24 Convert ATA taskfile to SATA FIS structure 25 </span></dt><dt><span class="refentrytitle"><a href="API-ata-tf-from-fis.html"><span class="phrase">ata_tf_from_fis</span></a></span><span class="refpurpose"> — 26 Convert SATA FIS to ATA taskfile 27 </span></dt><dt><span class="refentrytitle"><a href="API-ata-pack-xfermask.html"><span class="phrase">ata_pack_xfermask</span></a></span><span class="refpurpose"> — 28 Pack pio, mwdma and udma masks into xfer_mask 29 </span></dt><dt><span class="refentrytitle"><a href="API-ata-unpack-xfermask.html"><span class="phrase">ata_unpack_xfermask</span></a></span><span class="refpurpose"> — 30 Unpack xfer_mask into pio, mwdma and udma masks 31 </span></dt><dt><span class="refentrytitle"><a href="API-ata-xfer-mask2mode.html"><span class="phrase">ata_xfer_mask2mode</span></a></span><span class="refpurpose"> — 32 Find matching XFER_* for the given xfer_mask 33 </span></dt><dt><span class="refentrytitle"><a href="API-ata-xfer-mode2mask.html"><span class="phrase">ata_xfer_mode2mask</span></a></span><span class="refpurpose"> — 34 Find matching xfer_mask for XFER_* 35 </span></dt><dt><span class="refentrytitle"><a href="API-ata-xfer-mode2shift.html"><span class="phrase">ata_xfer_mode2shift</span></a></span><span class="refpurpose"> — 36 Find matching xfer_shift for XFER_* 37 </span></dt><dt><span class="refentrytitle"><a href="API-ata-mode-string.html"><span class="phrase">ata_mode_string</span></a></span><span class="refpurpose"> — 38 convert xfer_mask to string 39 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-classify.html"><span class="phrase">ata_dev_classify</span></a></span><span class="refpurpose"> — 40 determine device type based on ATA-spec signature 41 </span></dt><dt><span class="refentrytitle"><a href="API-ata-id-string.html"><span class="phrase">ata_id_string</span></a></span><span class="refpurpose"> — 42 Convert IDENTIFY DEVICE page into string 43 </span></dt><dt><span class="refentrytitle"><a href="API-ata-id-c-string.html"><span class="phrase">ata_id_c_string</span></a></span><span class="refpurpose"> — 44 Convert IDENTIFY DEVICE page into C string 45 </span></dt><dt><span class="refentrytitle"><a href="API-ata-id-xfermask.html"><span class="phrase">ata_id_xfermask</span></a></span><span class="refpurpose"> — 46 Compute xfermask from the given IDENTIFY data 47 </span></dt><dt><span class="refentrytitle"><a href="API-ata-pio-need-iordy.html"><span class="phrase">ata_pio_need_iordy</span></a></span><span class="refpurpose"> — 48 check if iordy needed 49 </span></dt><dt><span class="refentrytitle"><a href="API-ata-do-dev-read-id.html"><span class="phrase">ata_do_dev_read_id</span></a></span><span class="refpurpose"> — 50 default ID read method 51 </span></dt><dt><span class="refentrytitle"><a href="API-ata-cable-40wire.html"><span class="phrase">ata_cable_40wire</span></a></span><span class="refpurpose"> — 52 return 40 wire cable type 53 </span></dt><dt><span class="refentrytitle"><a href="API-ata-cable-80wire.html"><span class="phrase">ata_cable_80wire</span></a></span><span class="refpurpose"> — 54 return 80 wire cable type 55 </span></dt><dt><span class="refentrytitle"><a href="API-ata-cable-unknown.html"><span class="phrase">ata_cable_unknown</span></a></span><span class="refpurpose"> — 56 return unknown PATA cable. 57 </span></dt><dt><span class="refentrytitle"><a href="API-ata-cable-ignore.html"><span class="phrase">ata_cable_ignore</span></a></span><span class="refpurpose"> — 58 return ignored PATA cable. 59 </span></dt><dt><span class="refentrytitle"><a href="API-ata-cable-sata.html"><span class="phrase">ata_cable_sata</span></a></span><span class="refpurpose"> — 60 return SATA cable type 61 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-pair.html"><span class="phrase">ata_dev_pair</span></a></span><span class="refpurpose"> — 62 return other device on cable 63 </span></dt><dt><span class="refentrytitle"><a href="API-sata-set-spd.html"><span class="phrase">sata_set_spd</span></a></span><span class="refpurpose"> — 64 set SATA spd according to spd limit 65 </span></dt><dt><span class="refentrytitle"><a href="API-ata-timing-cycle2mode.html"><span class="phrase">ata_timing_cycle2mode</span></a></span><span class="refpurpose"> — 66 find xfer mode for the specified cycle duration 67 </span></dt><dt><span class="refentrytitle"><a href="API-ata-do-set-mode.html"><span class="phrase">ata_do_set_mode</span></a></span><span class="refpurpose"> — 68 Program timings and issue SET FEATURES - XFER 69 </span></dt><dt><span class="refentrytitle"><a href="API-ata-wait-after-reset.html"><span class="phrase">ata_wait_after_reset</span></a></span><span class="refpurpose"> — 70 wait for link to become ready after reset 71 </span></dt><dt><span class="refentrytitle"><a href="API-sata-link-debounce.html"><span class="phrase">sata_link_debounce</span></a></span><span class="refpurpose"> — 72 debounce SATA phy status 73 </span></dt><dt><span class="refentrytitle"><a href="API-sata-link-resume.html"><span class="phrase">sata_link_resume</span></a></span><span class="refpurpose"> — 74 resume SATA link 75 </span></dt><dt><span class="refentrytitle"><a href="API-sata-link-scr-lpm.html"><span class="phrase">sata_link_scr_lpm</span></a></span><span class="refpurpose"> — 76 manipulate SControl IPM and SPM fields 77 </span></dt><dt><span class="refentrytitle"><a href="API-ata-std-prereset.html"><span class="phrase">ata_std_prereset</span></a></span><span class="refpurpose"> — 78 prepare for reset 79 </span></dt><dt><span class="refentrytitle"><a href="API-sata-link-hardreset.html"><span class="phrase">sata_link_hardreset</span></a></span><span class="refpurpose"> — 80 reset link via SATA phy reset 81 </span></dt><dt><span class="refentrytitle"><a href="API-sata-std-hardreset.html"><span class="phrase">sata_std_hardreset</span></a></span><span class="refpurpose"> — 82 COMRESET w/o waiting or classification 83 </span></dt><dt><span class="refentrytitle"><a href="API-ata-std-postreset.html"><span class="phrase">ata_std_postreset</span></a></span><span class="refpurpose"> — 84 standard postreset callback 85 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-set-feature.html"><span class="phrase">ata_dev_set_feature</span></a></span><span class="refpurpose"> — 86 Issue SET FEATURES - SATA FEATURES 87 </span></dt><dt><span class="refentrytitle"><a href="API-ata-std-qc-defer.html"><span class="phrase">ata_std_qc_defer</span></a></span><span class="refpurpose"> — 88 Check whether a qc needs to be deferred 89 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sg-init.html"><span class="phrase">ata_sg_init</span></a></span><span class="refpurpose"> — 90 Associate command with scatter-gather table. 91 </span></dt><dt><span class="refentrytitle"><a href="API-ata-qc-complete.html"><span class="phrase">ata_qc_complete</span></a></span><span class="refpurpose"> — 92 Complete an active ATA command 93 </span></dt><dt><span class="refentrytitle"><a href="API-ata-qc-complete-multiple.html"><span class="phrase">ata_qc_complete_multiple</span></a></span><span class="refpurpose"> — 94 Complete multiple qcs successfully 95 </span></dt><dt><span class="refentrytitle"><a href="API-sata-scr-valid.html"><span class="phrase">sata_scr_valid</span></a></span><span class="refpurpose"> — 96 test whether SCRs are accessible 97 </span></dt><dt><span class="refentrytitle"><a href="API-sata-scr-read.html"><span class="phrase">sata_scr_read</span></a></span><span class="refpurpose"> — 98 read SCR register of the specified port 99 </span></dt><dt><span class="refentrytitle"><a href="API-sata-scr-write.html"><span class="phrase">sata_scr_write</span></a></span><span class="refpurpose"> — 100 write SCR register of the specified port 101 </span></dt><dt><span class="refentrytitle"><a href="API-sata-scr-write-flush.html"><span class="phrase">sata_scr_write_flush</span></a></span><span class="refpurpose"> — 102 write SCR register of the specified port and flush 103 </span></dt><dt><span class="refentrytitle"><a href="API-ata-link-online.html"><span class="phrase">ata_link_online</span></a></span><span class="refpurpose"> — 104 test whether the given link is online 105 </span></dt><dt><span class="refentrytitle"><a href="API-ata-link-offline.html"><span class="phrase">ata_link_offline</span></a></span><span class="refpurpose"> — 106 test whether the given link is offline 107 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-suspend.html"><span class="phrase">ata_host_suspend</span></a></span><span class="refpurpose"> — 108 suspend host 109 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-resume.html"><span class="phrase">ata_host_resume</span></a></span><span class="refpurpose"> — 110 resume host 111 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-alloc.html"><span class="phrase">ata_host_alloc</span></a></span><span class="refpurpose"> — 112 allocate and init basic ATA host resources 113 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-alloc-pinfo.html"><span class="phrase">ata_host_alloc_pinfo</span></a></span><span class="refpurpose"> — 114 alloc host and init with port_info array 115 </span></dt><dt><span class="refentrytitle"><a href="API-ata-slave-link-init.html"><span class="phrase">ata_slave_link_init</span></a></span><span class="refpurpose"> — 116 initialize slave link 117 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-start.html"><span class="phrase">ata_host_start</span></a></span><span class="refpurpose"> — 118 start and freeze ports of an ATA host 119 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-init.html"><span class="phrase">ata_host_init</span></a></span><span class="refpurpose"> — 120 Initialize a host struct for sas (ipr, libsas) 121 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-register.html"><span class="phrase">ata_host_register</span></a></span><span class="refpurpose"> — 122 register initialized ATA host 123 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-activate.html"><span class="phrase">ata_host_activate</span></a></span><span class="refpurpose"> — 124 start host, request IRQ and register it 125 </span></dt><dt><span class="refentrytitle"><a href="API-ata-host-detach.html"><span class="phrase">ata_host_detach</span></a></span><span class="refpurpose"> — 126 Detach all ports of an ATA host 127 </span></dt><dt><span class="refentrytitle"><a href="API-ata-pci-remove-one.html"><span class="phrase">ata_pci_remove_one</span></a></span><span class="refpurpose"> — 128 PCI layer callback for device removal 129 </span></dt><dt><span class="refentrytitle"><a href="API-ata-platform-remove-one.html"><span class="phrase">ata_platform_remove_one</span></a></span><span class="refpurpose"> — 130 Platform layer callback for device removal 131 </span></dt><dt><span class="refentrytitle"><a href="API-ata-msleep.html"><span class="phrase">ata_msleep</span></a></span><span class="refpurpose"> — 132 ATA EH owner aware msleep 133 </span></dt><dt><span class="refentrytitle"><a href="API-ata-wait-register.html"><span class="phrase">ata_wait_register</span></a></span><span class="refpurpose"> — 134 wait until register value changes 135 </span></dt><dt><span class="refentrytitle"><a href="API-sata-lpm-ignore-phy-events.html"><span class="phrase">sata_lpm_ignore_phy_events</span></a></span><span class="refpurpose"> — 136 test if PHY event should be ignored 137 </span></dt></dl></dd><dt><span class="chapter"><a href="libataInt.html">5. libata Core Internals</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-ata-dev-phys-link.html"><span class="phrase">ata_dev_phys_link</span></a></span><span class="refpurpose"> — 138 find physical link for a device 139 </span></dt><dt><span class="refentrytitle"><a href="API-ata-force-cbl.html"><span class="phrase">ata_force_cbl</span></a></span><span class="refpurpose"> — 140 force cable type according to libata.force 141 </span></dt><dt><span class="refentrytitle"><a href="API-ata-force-link-limits.html"><span class="phrase">ata_force_link_limits</span></a></span><span class="refpurpose"> — 142 force link limits according to libata.force 143 </span></dt><dt><span class="refentrytitle"><a href="API-ata-force-xfermask.html"><span class="phrase">ata_force_xfermask</span></a></span><span class="refpurpose"> — 144 force xfermask according to libata.force 145 </span></dt><dt><span class="refentrytitle"><a href="API-ata-force-horkage.html"><span class="phrase">ata_force_horkage</span></a></span><span class="refpurpose"> — 146 force horkage according to libata.force 147 </span></dt><dt><span class="refentrytitle"><a href="API-ata-rwcmd-protocol.html"><span class="phrase">ata_rwcmd_protocol</span></a></span><span class="refpurpose"> — 148 set taskfile r/w commands and protocol 149 </span></dt><dt><span class="refentrytitle"><a href="API-ata-tf-read-block.html"><span class="phrase">ata_tf_read_block</span></a></span><span class="refpurpose"> — 150 Read block address from ATA taskfile 151 </span></dt><dt><span class="refentrytitle"><a href="API-ata-build-rw-tf.html"><span class="phrase">ata_build_rw_tf</span></a></span><span class="refpurpose"> — 152 Build ATA taskfile for given read/write request 153 </span></dt><dt><span class="refentrytitle"><a href="API-ata-read-native-max-address.html"><span class="phrase">ata_read_native_max_address</span></a></span><span class="refpurpose"> — 154 Read native max address 155 </span></dt><dt><span class="refentrytitle"><a href="API-ata-set-max-sectors.html"><span class="phrase">ata_set_max_sectors</span></a></span><span class="refpurpose"> — 156 Set max sectors 157 </span></dt><dt><span class="refentrytitle"><a href="API-ata-hpa-resize.html"><span class="phrase">ata_hpa_resize</span></a></span><span class="refpurpose"> — 158 Resize a device with an HPA set 159 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dump-id.html"><span class="phrase">ata_dump_id</span></a></span><span class="refpurpose"> — 160 IDENTIFY DEVICE info debugging output 161 </span></dt><dt><span class="refentrytitle"><a href="API-ata-exec-internal-sg.html"><span class="phrase">ata_exec_internal_sg</span></a></span><span class="refpurpose"> — 162 execute libata internal command 163 </span></dt><dt><span class="refentrytitle"><a href="API-ata-exec-internal.html"><span class="phrase">ata_exec_internal</span></a></span><span class="refpurpose"> — 164 execute libata internal command 165 </span></dt><dt><span class="refentrytitle"><a href="API-ata-pio-mask-no-iordy.html"><span class="phrase">ata_pio_mask_no_iordy</span></a></span><span class="refpurpose"> — 166 Return the non IORDY mask 167 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-read-id.html"><span class="phrase">ata_dev_read_id</span></a></span><span class="refpurpose"> — 168 Read ID data from the specified device 169 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-configure.html"><span class="phrase">ata_dev_configure</span></a></span><span class="refpurpose"> — 170 Configure the specified ATA/ATAPI device 171 </span></dt><dt><span class="refentrytitle"><a href="API-ata-bus-probe.html"><span class="phrase">ata_bus_probe</span></a></span><span class="refpurpose"> — 172 Reset and probe ATA bus 173 </span></dt><dt><span class="refentrytitle"><a href="API-sata-print-link-status.html"><span class="phrase">sata_print_link_status</span></a></span><span class="refpurpose"> — 174 Print SATA link status 175 </span></dt><dt><span class="refentrytitle"><a href="API-sata-down-spd-limit.html"><span class="phrase">sata_down_spd_limit</span></a></span><span class="refpurpose"> — 176 adjust SATA spd limit downward 177 </span></dt><dt><span class="refentrytitle"><a href="API-sata-set-spd-needed.html"><span class="phrase">sata_set_spd_needed</span></a></span><span class="refpurpose"> — 178 is SATA spd configuration needed 179 </span></dt><dt><span class="refentrytitle"><a href="API-ata-down-xfermask-limit.html"><span class="phrase">ata_down_xfermask_limit</span></a></span><span class="refpurpose"> — 180 adjust dev xfer masks downward 181 </span></dt><dt><span class="refentrytitle"><a href="API-ata-wait-ready.html"><span class="phrase">ata_wait_ready</span></a></span><span class="refpurpose"> — 182 wait for link to become ready 183 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-same-device.html"><span class="phrase">ata_dev_same_device</span></a></span><span class="refpurpose"> — 184 Determine whether new ID matches configured device 185 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-reread-id.html"><span class="phrase">ata_dev_reread_id</span></a></span><span class="refpurpose"> — 186 Re-read IDENTIFY data 187 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-revalidate.html"><span class="phrase">ata_dev_revalidate</span></a></span><span class="refpurpose"> — 188 Revalidate ATA device 189 </span></dt><dt><span class="refentrytitle"><a href="API-ata-is-40wire.html"><span class="phrase">ata_is_40wire</span></a></span><span class="refpurpose"> — 190 check drive side detection 191 </span></dt><dt><span class="refentrytitle"><a href="API-cable-is-40wire.html"><span class="phrase">cable_is_40wire</span></a></span><span class="refpurpose"> — 192 40/80/SATA decider 193 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-xfermask.html"><span class="phrase">ata_dev_xfermask</span></a></span><span class="refpurpose"> — 194 Compute supported xfermask of the given device 195 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-set-xfermode.html"><span class="phrase">ata_dev_set_xfermode</span></a></span><span class="refpurpose"> — 196 Issue SET FEATURES - XFER MODE command 197 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-init-params.html"><span class="phrase">ata_dev_init_params</span></a></span><span class="refpurpose"> — 198 Issue INIT DEV PARAMS command 199 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sg-clean.html"><span class="phrase">ata_sg_clean</span></a></span><span class="refpurpose"> — 200 Unmap DMA memory associated with command 201 </span></dt><dt><span class="refentrytitle"><a href="API-atapi-check-dma.html"><span class="phrase">atapi_check_dma</span></a></span><span class="refpurpose"> — 202 Check whether ATAPI DMA can be supported 203 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sg-setup.html"><span class="phrase">ata_sg_setup</span></a></span><span class="refpurpose"> — 204 DMA-map the scatter-gather table associated with a command. 205 </span></dt><dt><span class="refentrytitle"><a href="API-swap-buf-le16.html"><span class="phrase">swap_buf_le16</span></a></span><span class="refpurpose"> — 206 swap halves of 16-bit words in place 207 </span></dt><dt><span class="refentrytitle"><a href="API-ata-qc-new-init.html"><span class="phrase">ata_qc_new_init</span></a></span><span class="refpurpose"> — 208 Request an available ATA command, and initialize it 209 </span></dt><dt><span class="refentrytitle"><a href="API-ata-qc-free.html"><span class="phrase">ata_qc_free</span></a></span><span class="refpurpose"> — 210 free unused ata_queued_cmd 211 </span></dt><dt><span class="refentrytitle"><a href="API-ata-qc-issue.html"><span class="phrase">ata_qc_issue</span></a></span><span class="refpurpose"> — 212 issue taskfile to device 213 </span></dt><dt><span class="refentrytitle"><a href="API-ata-phys-link-online.html"><span class="phrase">ata_phys_link_online</span></a></span><span class="refpurpose"> — 214 test whether the given link is online 215 </span></dt><dt><span class="refentrytitle"><a href="API-ata-phys-link-offline.html"><span class="phrase">ata_phys_link_offline</span></a></span><span class="refpurpose"> — 216 test whether the given link is offline 217 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dev-init.html"><span class="phrase">ata_dev_init</span></a></span><span class="refpurpose"> — 218 Initialize an ata_device structure 219 </span></dt><dt><span class="refentrytitle"><a href="API-ata-link-init.html"><span class="phrase">ata_link_init</span></a></span><span class="refpurpose"> — 220 Initialize an ata_link structure 221 </span></dt><dt><span class="refentrytitle"><a href="API-sata-link-init-spd.html"><span class="phrase">sata_link_init_spd</span></a></span><span class="refpurpose"> — 222 Initialize link->sata_spd_limit 223 </span></dt><dt><span class="refentrytitle"><a href="API-ata-port-alloc.html"><span class="phrase">ata_port_alloc</span></a></span><span class="refpurpose"> — 224 allocate and initialize basic ATA port resources 225 </span></dt><dt><span class="refentrytitle"><a href="API-ata-finalize-port-ops.html"><span class="phrase">ata_finalize_port_ops</span></a></span><span class="refpurpose"> — 226 finalize ata_port_operations 227 </span></dt><dt><span class="refentrytitle"><a href="API-ata-port-detach.html"><span class="phrase">ata_port_detach</span></a></span><span class="refpurpose"> — 228 Detach ATA port in prepration of device removal 229 </span></dt></dl></dd><dt><span class="chapter"><a href="libataScsiInt.html">6. libata SCSI translation/emulation</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-ata-std-bios-param.html"><span class="phrase">ata_std_bios_param</span></a></span><span class="refpurpose"> — 230 generic bios head/sector/cylinder calculator used by sd. 231 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-unlock-native-capacity.html"><span class="phrase">ata_scsi_unlock_native_capacity</span></a></span><span class="refpurpose"> — 232 unlock native capacity 233 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-slave-config.html"><span class="phrase">ata_scsi_slave_config</span></a></span><span class="refpurpose"> — 234 Set SCSI device attributes 235 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-slave-destroy.html"><span class="phrase">ata_scsi_slave_destroy</span></a></span><span class="refpurpose"> — 236 SCSI device is about to be destroyed 237 </span></dt><dt><span class="refentrytitle"><a href="API---ata-change-queue-depth.html"><span class="phrase">__ata_change_queue_depth</span></a></span><span class="refpurpose"> — 238 helper for ata_scsi_change_queue_depth 239 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-change-queue-depth.html"><span class="phrase">ata_scsi_change_queue_depth</span></a></span><span class="refpurpose"> — 240 SCSI callback for queue depth config 241 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-queuecmd.html"><span class="phrase">ata_scsi_queuecmd</span></a></span><span class="refpurpose"> — 242 Issue SCSI cdb to libata-managed device 243 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-simulate.html"><span class="phrase">ata_scsi_simulate</span></a></span><span class="refpurpose"> — 244 simulate SCSI command on ATA device 245 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-port-alloc.html"><span class="phrase">ata_sas_port_alloc</span></a></span><span class="refpurpose"> — 246 Allocate port for a SAS attached SATA device 247 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-port-start.html"><span class="phrase">ata_sas_port_start</span></a></span><span class="refpurpose"> — 248 Set port up for dma. 249 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-port-stop.html"><span class="phrase">ata_sas_port_stop</span></a></span><span class="refpurpose"> — 250 Undo <code class="function">ata_sas_port_start</code> 251 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-async-probe.html"><span class="phrase">ata_sas_async_probe</span></a></span><span class="refpurpose"> — 252 simply schedule probing and return 253 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-port-init.html"><span class="phrase">ata_sas_port_init</span></a></span><span class="refpurpose"> — 254 Initialize a SATA device 255 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-port-destroy.html"><span class="phrase">ata_sas_port_destroy</span></a></span><span class="refpurpose"> — 256 Destroy a SATA port allocated by ata_sas_port_alloc 257 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-slave-configure.html"><span class="phrase">ata_sas_slave_configure</span></a></span><span class="refpurpose"> — 258 Default slave_config routine for libata devices 259 </span></dt><dt><span class="refentrytitle"><a href="API-ata-sas-queuecmd.html"><span class="phrase">ata_sas_queuecmd</span></a></span><span class="refpurpose"> — 260 Issue SCSI cdb to libata-managed device 261 </span></dt><dt><span class="refentrytitle"><a href="API-ata-get-identity.html"><span class="phrase">ata_get_identity</span></a></span><span class="refpurpose"> — 262 Handler for HDIO_GET_IDENTITY ioctl 263 </span></dt><dt><span class="refentrytitle"><a href="API-ata-cmd-ioctl.html"><span class="phrase">ata_cmd_ioctl</span></a></span><span class="refpurpose"> — 264 Handler for HDIO_DRIVE_CMD ioctl 265 </span></dt><dt><span class="refentrytitle"><a href="API-ata-task-ioctl.html"><span class="phrase">ata_task_ioctl</span></a></span><span class="refpurpose"> — 266 Handler for HDIO_DRIVE_TASK ioctl 267 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-qc-new.html"><span class="phrase">ata_scsi_qc_new</span></a></span><span class="refpurpose"> — 268 acquire new ata_queued_cmd reference 269 </span></dt><dt><span class="refentrytitle"><a href="API-ata-dump-status.html"><span class="phrase">ata_dump_status</span></a></span><span class="refpurpose"> — 270 user friendly display of error info 271 </span></dt><dt><span class="refentrytitle"><a href="API-ata-to-sense-error.html"><span class="phrase">ata_to_sense_error</span></a></span><span class="refpurpose"> — 272 convert ATA error to SCSI error 273 </span></dt><dt><span class="refentrytitle"><a href="API-ata-gen-ata-sense.html"><span class="phrase">ata_gen_ata_sense</span></a></span><span class="refpurpose"> — 274 generate a SCSI fixed sense block 275 </span></dt><dt><span class="refentrytitle"><a href="API-atapi-drain-needed.html"><span class="phrase">atapi_drain_needed</span></a></span><span class="refpurpose"> — 276 Check whether data transfer may overflow 277 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-start-stop-xlat.html"><span class="phrase">ata_scsi_start_stop_xlat</span></a></span><span class="refpurpose"> — 278 Translate SCSI START STOP UNIT command 279 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-flush-xlat.html"><span class="phrase">ata_scsi_flush_xlat</span></a></span><span class="refpurpose"> — 280 Translate SCSI SYNCHRONIZE CACHE command 281 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-6-lba-len.html"><span class="phrase">scsi_6_lba_len</span></a></span><span class="refpurpose"> — 282 Get LBA and transfer length 283 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-10-lba-len.html"><span class="phrase">scsi_10_lba_len</span></a></span><span class="refpurpose"> — 284 Get LBA and transfer length 285 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-16-lba-len.html"><span class="phrase">scsi_16_lba_len</span></a></span><span class="refpurpose"> — 286 Get LBA and transfer length 287 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-verify-xlat.html"><span class="phrase">ata_scsi_verify_xlat</span></a></span><span class="refpurpose"> — 288 Translate SCSI VERIFY command into an ATA one 289 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-rw-xlat.html"><span class="phrase">ata_scsi_rw_xlat</span></a></span><span class="refpurpose"> — 290 Translate SCSI r/w command into an ATA one 291 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-translate.html"><span class="phrase">ata_scsi_translate</span></a></span><span class="refpurpose"> — 292 Translate then issue SCSI command to ATA device 293 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-rbuf-get.html"><span class="phrase">ata_scsi_rbuf_get</span></a></span><span class="refpurpose"> — 294 Map response buffer. 295 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-rbuf-put.html"><span class="phrase">ata_scsi_rbuf_put</span></a></span><span class="refpurpose"> — 296 Unmap response buffer. 297 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-rbuf-fill.html"><span class="phrase">ata_scsi_rbuf_fill</span></a></span><span class="refpurpose"> — 298 wrapper for SCSI command simulators 299 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-inq-std.html"><span class="phrase">ata_scsiop_inq_std</span></a></span><span class="refpurpose"> — 300 Simulate INQUIRY command 301 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-inq-00.html"><span class="phrase">ata_scsiop_inq_00</span></a></span><span class="refpurpose"> — 302 Simulate INQUIRY VPD page 0, list of pages 303 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-inq-80.html"><span class="phrase">ata_scsiop_inq_80</span></a></span><span class="refpurpose"> — 304 Simulate INQUIRY VPD page 80, device serial number 305 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-inq-83.html"><span class="phrase">ata_scsiop_inq_83</span></a></span><span class="refpurpose"> — 306 Simulate INQUIRY VPD page 83, device identity 307 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-inq-89.html"><span class="phrase">ata_scsiop_inq_89</span></a></span><span class="refpurpose"> — 308 Simulate INQUIRY VPD page 89, ATA info 309 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-noop.html"><span class="phrase">ata_scsiop_noop</span></a></span><span class="refpurpose"> — 310 Command handler that simply returns success. 311 </span></dt><dt><span class="refentrytitle"><a href="API-modecpy.html"><span class="phrase">modecpy</span></a></span><span class="refpurpose"> — 312 Prepare response for MODE SENSE 313 </span></dt><dt><span class="refentrytitle"><a href="API-ata-msense-caching.html"><span class="phrase">ata_msense_caching</span></a></span><span class="refpurpose"> — 314 Simulate MODE SENSE caching info page 315 </span></dt><dt><span class="refentrytitle"><a href="API-ata-msense-ctl-mode.html"><span class="phrase">ata_msense_ctl_mode</span></a></span><span class="refpurpose"> — 316 Simulate MODE SENSE control mode page 317 </span></dt><dt><span class="refentrytitle"><a href="API-ata-msense-rw-recovery.html"><span class="phrase">ata_msense_rw_recovery</span></a></span><span class="refpurpose"> — 318 Simulate MODE SENSE r/w error recovery page 319 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-mode-sense.html"><span class="phrase">ata_scsiop_mode_sense</span></a></span><span class="refpurpose"> — 320 Simulate MODE SENSE 6, 10 commands 321 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-read-cap.html"><span class="phrase">ata_scsiop_read_cap</span></a></span><span class="refpurpose"> — 322 Simulate READ CAPACITY[ 16] commands 323 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsiop-report-luns.html"><span class="phrase">ata_scsiop_report_luns</span></a></span><span class="refpurpose"> — 324 Simulate REPORT LUNS command 325 </span></dt><dt><span class="refentrytitle"><a href="API-atapi-xlat.html"><span class="phrase">atapi_xlat</span></a></span><span class="refpurpose"> — 326 Initialize PACKET taskfile 327 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-find-dev.html"><span class="phrase">ata_scsi_find_dev</span></a></span><span class="refpurpose"> — 328 lookup ata_device from scsi_cmnd 329 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-pass-thru.html"><span class="phrase">ata_scsi_pass_thru</span></a></span><span class="refpurpose"> — 330 convert ATA pass-thru CDB to taskfile 331 </span></dt><dt><span class="refentrytitle"><a href="API-ata-mselect-caching.html"><span class="phrase">ata_mselect_caching</span></a></span><span class="refpurpose"> — 332 Simulate MODE SELECT for caching info page 333 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-mode-select-xlat.html"><span class="phrase">ata_scsi_mode_select_xlat</span></a></span><span class="refpurpose"> — 334 Simulate MODE SELECT 6, 10 commands 335 </span></dt><dt><span class="refentrytitle"><a href="API-ata-get-xlat-func.html"><span class="phrase">ata_get_xlat_func</span></a></span><span class="refpurpose"> — 336 check if SCSI to ATA translation is possible 337 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-dump-cdb.html"><span class="phrase">ata_scsi_dump_cdb</span></a></span><span class="refpurpose"> — 338 dump SCSI command contents to dmesg 339 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-offline-dev.html"><span class="phrase">ata_scsi_offline_dev</span></a></span><span class="refpurpose"> — 340 offline attached SCSI device 341 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-remove-dev.html"><span class="phrase">ata_scsi_remove_dev</span></a></span><span class="refpurpose"> — 342 remove attached SCSI device 343 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-media-change-notify.html"><span class="phrase">ata_scsi_media_change_notify</span></a></span><span class="refpurpose"> — 344 send media change event 345 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-hotplug.html"><span class="phrase">ata_scsi_hotplug</span></a></span><span class="refpurpose"> — 346 SCSI part of hotplug 347 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-user-scan.html"><span class="phrase">ata_scsi_user_scan</span></a></span><span class="refpurpose"> — 348 indication for user-initiated bus scan 349 </span></dt><dt><span class="refentrytitle"><a href="API-ata-scsi-dev-rescan.html"><span class="phrase">ata_scsi_dev_rescan</span></a></span><span class="refpurpose"> — 350 initiate <code class="function">scsi_rescan_device</code> 351 </span></dt></dl></dd><dt><span class="chapter"><a href="ataExceptions.html">7. ATA errors and exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="ataExceptions.html#excat">Exception categories</a></span></dt><dd><dl><dt><span class="sect2"><a href="ataExceptions.html#excatHSMviolation">HSM violation</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatDevErr">ATA/ATAPI device error (non-NCQ / non-CHECK CONDITION)</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatATAPIcc">ATAPI device CHECK CONDITION</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatNCQerr">ATA device error (NCQ)</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatATAbusErr">ATA bus error</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatPCIbusErr">PCI bus error</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatLateCompletion">Late completion</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatUnknown">Unknown error (timeout)</a></span></dt><dt><span class="sect2"><a href="ataExceptions.html#excatHoplugPM">Hotplug and power management exceptions</a></span></dt></dl></dd><dt><span class="sect1"><a href="exrec.html">EH recovery actions</a></span></dt><dd><dl><dt><span class="sect2"><a href="exrec.html#exrecClr">Clearing error condition</a></span></dt><dt><span class="sect2"><a href="exrec.html#exrecRst">Reset</a></span></dt><dt><span class="sect2"><a href="exrec.html#exrecReconf">Reconfigure transport</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="PiixInt.html">8. ata_piix Internals</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-ich-pata-cable-detect.html"><span class="phrase">ich_pata_cable_detect</span></a></span><span class="refpurpose"> — 352 Probe host controller cable detect info 353 </span></dt><dt><span class="refentrytitle"><a href="API-piix-pata-prereset.html"><span class="phrase">piix_pata_prereset</span></a></span><span class="refpurpose"> — 354 prereset for PATA host controller 355 </span></dt><dt><span class="refentrytitle"><a href="API-piix-set-piomode.html"><span class="phrase">piix_set_piomode</span></a></span><span class="refpurpose"> — 356 Initialize host controller PATA PIO timings 357 </span></dt><dt><span class="refentrytitle"><a href="API-do-pata-set-dmamode.html"><span class="phrase">do_pata_set_dmamode</span></a></span><span class="refpurpose"> — 358 Initialize host controller PATA PIO timings 359 </span></dt><dt><span class="refentrytitle"><a href="API-piix-set-dmamode.html"><span class="phrase">piix_set_dmamode</span></a></span><span class="refpurpose"> — 360 Initialize host controller PATA DMA timings 361 </span></dt><dt><span class="refentrytitle"><a href="API-ich-set-dmamode.html"><span class="phrase">ich_set_dmamode</span></a></span><span class="refpurpose"> — 362 Initialize host controller PATA DMA timings 363 </span></dt><dt><span class="refentrytitle"><a href="API-piix-check-450nx-errata.html"><span class="phrase">piix_check_450nx_errata</span></a></span><span class="refpurpose"> — 364 Check for problem 450NX setup 365 </span></dt><dt><span class="refentrytitle"><a href="API-piix-init-one.html"><span class="phrase">piix_init_one</span></a></span><span class="refpurpose"> — 366 Register PIIX ATA PCI device with kernel services 367 </span></dt></dl></dd><dt><span class="chapter"><a href="SILInt.html">9. sata_sil Internals</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-sil-set-mode.html"><span class="phrase">sil_set_mode</span></a></span><span class="refpurpose"> — 368 wrap set_mode functions 369 </span></dt><dt><span class="refentrytitle"><a href="API-sil-dev-config.html"><span class="phrase">sil_dev_config</span></a></span><span class="refpurpose"> — 370 Apply device/host-specific errata fixups 371 </span></dt></dl></dd><dt><span class="chapter"><a href="libataThanks.html">10. Thanks</a></span></dt></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="libataIntroduction.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. Introduction</td></tr></table></div></body></html> 372