1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter&#160;3.&#160;SCSI mid layer</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="SCSI Interfaces Guide"><link rel="up" href="index.html" title="SCSI Interfaces Guide"><link rel="prev" href="ch.html" title="ch (SCSI Media Changer)"><link rel="next" href="API-shost-for-each-device.html" title="shost_for_each_device"></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">Chapter&#160;3.&#160;SCSI mid layer</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-shost-for-each-device.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="mid_layer"></a>Chapter&#160;3.&#160;SCSI mid layer</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="mid_layer.html#midlayer_implementation">SCSI midlayer implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="mid_layer.html#scsi_device.h">include/scsi/scsi_device.h</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi.c">drivers/scsi/scsi.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsicam.c">drivers/scsi/scsicam.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_error.c">drivers/scsi/scsi_error.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_devinfo.c">drivers/scsi/scsi_devinfo.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_ioctl.c">drivers/scsi/scsi_ioctl.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_lib.c">drivers/scsi/scsi_lib.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_lib_dma.c">drivers/scsi/scsi_lib_dma.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_module.c">drivers/scsi/scsi_module.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_proc.c">drivers/scsi/scsi_proc.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_netlink.c">drivers/scsi/scsi_netlink.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_scan.c">drivers/scsi/scsi_scan.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_sysctl.c">drivers/scsi/scsi_sysctl.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_sysfs.c">drivers/scsi/scsi_sysfs.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#hosts.c">drivers/scsi/hosts.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#constants.c">drivers/scsi/constants.c</a></span></dt></dl></dd><dt><span class="sect1"><a href="Transport_classes.html">Transport classes</a></span></dt><dd><dl><dt><span class="sect2"><a href="Transport_classes.html#Fibre_Channel_transport">Fibre Channel transport</a></span></dt><dt><span class="sect2"><a href="Transport_classes.html#iSCSI_transport">iSCSI transport class</a></span></dt><dt><span class="sect2"><a href="Transport_classes.html#SAS_transport">Serial Attached SCSI (SAS) transport class</a></span></dt><dt><span class="sect2"><a href="Transport_classes.html#SATA_transport">SATA transport class</a></span></dt><dt><span class="sect2"><a href="Transport_classes.html#SPI_transport">Parallel SCSI (SPI) transport class</a></span></dt><dt><span class="sect2"><a href="Transport_classes.html#SRP_transport">SCSI RDMA (SRP) transport class</a></span></dt></dl></dd></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="midlayer_implementation"></a>SCSI midlayer implementation</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="sect2"><a href="mid_layer.html#scsi_device.h">include/scsi/scsi_device.h</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi.c">drivers/scsi/scsi.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsicam.c">drivers/scsi/scsicam.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_error.c">drivers/scsi/scsi_error.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_devinfo.c">drivers/scsi/scsi_devinfo.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_ioctl.c">drivers/scsi/scsi_ioctl.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_lib.c">drivers/scsi/scsi_lib.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_lib_dma.c">drivers/scsi/scsi_lib_dma.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_module.c">drivers/scsi/scsi_module.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_proc.c">drivers/scsi/scsi_proc.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_netlink.c">drivers/scsi/scsi_netlink.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_scan.c">drivers/scsi/scsi_scan.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_sysctl.c">drivers/scsi/scsi_sysctl.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#scsi_sysfs.c">drivers/scsi/scsi_sysfs.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#hosts.c">drivers/scsi/hosts.c</a></span></dt><dt><span class="sect2"><a href="mid_layer.html#constants.c">drivers/scsi/constants.c</a></span></dt></dl></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_device.h"></a>include/scsi/scsi_device.h</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-shost-for-each-device.html"><span class="phrase">shost_for_each_device</span></a></span><span class="refpurpose"> &#8212; 
2  iterate over all devices of a host
3 </span></dt><dt><span class="refentrytitle"><a href="API---shost-for-each-device.html"><span class="phrase">__shost_for_each_device</span></a></span><span class="refpurpose"> &#8212; 
4     iterate over all devices of a host (UNLOCKED)
5 </span></dt></dl></div><p>
6        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi.c"></a>drivers/scsi/scsi.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-device-type.html"><span class="phrase">scsi_device_type</span></a></span><span class="refpurpose"> &#8212; 
7  Return 17 char string indicating device type.
8 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-cmd-get-serial.html"><span class="phrase">scsi_cmd_get_serial</span></a></span><span class="refpurpose"> &#8212; 
9     Assign a serial number to a command
10 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-change-queue-depth.html"><span class="phrase">scsi_change_queue_depth</span></a></span><span class="refpurpose"> &#8212; 
11     change a device's queue depth
12 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-track-queue-full.html"><span class="phrase">scsi_track_queue_full</span></a></span><span class="refpurpose"> &#8212; 
13     track QUEUE_FULL events to adjust queue depth
14 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-get-vpd-page.html"><span class="phrase">scsi_get_vpd_page</span></a></span><span class="refpurpose"> &#8212; 
15     Get Vital Product Data from a SCSI device
16 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-report-opcode.html"><span class="phrase">scsi_report_opcode</span></a></span><span class="refpurpose"> &#8212; 
17     Find out if a given command opcode is supported
18 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-device-get.html"><span class="phrase">scsi_device_get</span></a></span><span class="refpurpose"> &#8212; 
19     get an additional reference to a scsi_device
20 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-device-put.html"><span class="phrase">scsi_device_put</span></a></span><span class="refpurpose"> &#8212; 
21     release a reference to a scsi_device
22 </span></dt><dt><span class="refentrytitle"><a href="API-starget-for-each-device.html"><span class="phrase">starget_for_each_device</span></a></span><span class="refpurpose"> &#8212; 
23     helper to walk all devices of a target
24 </span></dt><dt><span class="refentrytitle"><a href="API---starget-for-each-device.html"><span class="phrase">__starget_for_each_device</span></a></span><span class="refpurpose"> &#8212; 
25     helper to walk all devices of a target (UNLOCKED)
26 </span></dt><dt><span class="refentrytitle"><a href="API---scsi-device-lookup-by-target.html"><span class="phrase">__scsi_device_lookup_by_target</span></a></span><span class="refpurpose"> &#8212; 
27     find a device given the target (UNLOCKED)
28 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-device-lookup-by-target.html"><span class="phrase">scsi_device_lookup_by_target</span></a></span><span class="refpurpose"> &#8212; 
29     find a device given the target
30 </span></dt><dt><span class="refentrytitle"><a href="API---scsi-device-lookup.html"><span class="phrase">__scsi_device_lookup</span></a></span><span class="refpurpose"> &#8212; 
31     find a device given the host (UNLOCKED)
32 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-device-lookup.html"><span class="phrase">scsi_device_lookup</span></a></span><span class="refpurpose"> &#8212; 
33     find a device given the host
34 </span></dt></dl></div><p>Main file for the SCSI midlayer.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsicam.c"></a>drivers/scsi/scsicam.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-bios-ptable.html"><span class="phrase">scsi_bios_ptable</span></a></span><span class="refpurpose"> &#8212; 
35  Read PC partition table out of first sector of device.
36 </span></dt><dt><span class="refentrytitle"><a href="API-scsicam-bios-param.html"><span class="phrase">scsicam_bios_param</span></a></span><span class="refpurpose"> &#8212; 
37     Determine geometry of a disk in cylinders/heads/sectors.
38 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-partsize.html"><span class="phrase">scsi_partsize</span></a></span><span class="refpurpose"> &#8212; 
39     Parse cylinders/heads/sectors from PC partition table
40 </span></dt></dl></div><p>
41          <a class="ulink" href="http://www.t10.org/ftp/t10/drafts/cam/cam-r12b.pdf" target="_top">SCSI
42          Common Access Method</a> support functions, for use with
43          HDIO_GETGEO, etc.
44        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_error.c"></a>drivers/scsi/scsi_error.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-schedule-eh.html"><span class="phrase">scsi_schedule_eh</span></a></span><span class="refpurpose"> &#8212; 
45  schedule EH for SCSI host
46 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-block-when-processing-errors.html"><span class="phrase">scsi_block_when_processing_errors</span></a></span><span class="refpurpose"> &#8212; 
47     Prevent cmds from being queued.
48 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-eh-prep-cmnd.html"><span class="phrase">scsi_eh_prep_cmnd</span></a></span><span class="refpurpose"> &#8212; 
49     Save a scsi command info as part of error recovery
50 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-eh-restore-cmnd.html"><span class="phrase">scsi_eh_restore_cmnd</span></a></span><span class="refpurpose"> &#8212; 
51     Restore a scsi command info as part of error recovery
52 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-eh-finish-cmd.html"><span class="phrase">scsi_eh_finish_cmd</span></a></span><span class="refpurpose"> &#8212; 
53     Handle a cmd that eh is finished with.
54 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-eh-get-sense.html"><span class="phrase">scsi_eh_get_sense</span></a></span><span class="refpurpose"> &#8212; 
55     Get device sense data.
56 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-eh-ready-devs.html"><span class="phrase">scsi_eh_ready_devs</span></a></span><span class="refpurpose"> &#8212; 
57     check device ready state and recover if not.
58 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-eh-flush-done-q.html"><span class="phrase">scsi_eh_flush_done_q</span></a></span><span class="refpurpose"> &#8212; 
59     finish processed commands or retry them.
60 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-ioctl-reset.html"><span class="phrase">scsi_ioctl_reset</span></a></span><span class="refpurpose"> &#8212; 
61   </span></dt><dt><span class="refentrytitle"><a href="API-scsi-normalize-sense.html"><span class="phrase">scsi_normalize_sense</span></a></span><span class="refpurpose"> &#8212; 
62     normalize main elements from either fixed or descriptor sense data format into a common format.
63 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-sense-desc-find.html"><span class="phrase">scsi_sense_desc_find</span></a></span><span class="refpurpose"> &#8212; 
64     search for a given descriptor type in descriptor sense data format.
65 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-get-sense-info-fld.html"><span class="phrase">scsi_get_sense_info_fld</span></a></span><span class="refpurpose"> &#8212; 
66     get information field from sense data (either fixed or descriptor format)
67 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-build-sense-buffer.html"><span class="phrase">scsi_build_sense_buffer</span></a></span><span class="refpurpose"> &#8212; 
68     build sense data in a buffer
69 </span></dt></dl></div><p>Common SCSI error/timeout handling routines.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_devinfo.c"></a>drivers/scsi/scsi_devinfo.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-dev-info-list-add.html"><span class="phrase">scsi_dev_info_list_add</span></a></span><span class="refpurpose"> &#8212; 
70  add one dev_info list entry.
71 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-dev-info-list-add-str.html"><span class="phrase">scsi_dev_info_list_add_str</span></a></span><span class="refpurpose"> &#8212; 
72     parse dev_list and add to the scsi_dev_info_list.
73 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-get-device-flags.html"><span class="phrase">scsi_get_device_flags</span></a></span><span class="refpurpose"> &#8212; 
74     get device specific flags from the dynamic device list.
75 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-exit-devinfo.html"><span class="phrase">scsi_exit_devinfo</span></a></span><span class="refpurpose"> &#8212; 
76     remove /proc/scsi/device_info &amp; the scsi_dev_info_list
77 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-init-devinfo.html"><span class="phrase">scsi_init_devinfo</span></a></span><span class="refpurpose"> &#8212; 
78     set up the dynamic device list.
79 </span></dt></dl></div><p>
80          Manage scsi_dev_info_list, which tracks blacklisted and whitelisted
81          devices.
82        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_ioctl.c"></a>drivers/scsi/scsi_ioctl.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-ioctl.html"><span class="phrase">scsi_ioctl</span></a></span><span class="refpurpose"> &#8212; 
83  Dispatch ioctl to scsi device
84 </span></dt></dl></div><p>
85          Handle ioctl() calls for SCSI devices.
86        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_lib.c"></a>drivers/scsi/scsi_lib.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-execute.html"><span class="phrase">scsi_execute</span></a></span><span class="refpurpose"> &#8212; 
87  insert request and wait for the result
88 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-mode-select.html"><span class="phrase">scsi_mode_select</span></a></span><span class="refpurpose"> &#8212; 
89     issue a mode select
90 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-mode-sense.html"><span class="phrase">scsi_mode_sense</span></a></span><span class="refpurpose"> &#8212; 
91     issue a mode sense, falling back from 10 to six bytes if necessary.
92 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-test-unit-ready.html"><span class="phrase">scsi_test_unit_ready</span></a></span><span class="refpurpose"> &#8212; 
93     test if unit is ready
94 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-device-set-state.html"><span class="phrase">scsi_device_set_state</span></a></span><span class="refpurpose"> &#8212; 
95     Take the given device through the device state model.
96 </span></dt><dt><span class="refentrytitle"><a href="API-sdev-evt-send.html"><span class="phrase">sdev_evt_send</span></a></span><span class="refpurpose"> &#8212; 
97     send asserted event to uevent thread
98 </span></dt><dt><span class="refentrytitle"><a href="API-sdev-evt-alloc.html"><span class="phrase">sdev_evt_alloc</span></a></span><span class="refpurpose"> &#8212; 
99     allocate a new scsi event
100 </span></dt><dt><span class="refentrytitle"><a href="API-sdev-evt-send-simple.html"><span class="phrase">sdev_evt_send_simple</span></a></span><span class="refpurpose"> &#8212; 
101     send asserted event to uevent thread
102 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-device-quiesce.html"><span class="phrase">scsi_device_quiesce</span></a></span><span class="refpurpose"> &#8212; 
103     Block user issued commands.
104 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-device-resume.html"><span class="phrase">scsi_device_resume</span></a></span><span class="refpurpose"> &#8212; 
105     Restart user issued commands to a quiesced device.
106 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-internal-device-block.html"><span class="phrase">scsi_internal_device_block</span></a></span><span class="refpurpose"> &#8212; 
107     internal function to put a device temporarily into the SDEV_BLOCK state
108 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-internal-device-unblock.html"><span class="phrase">scsi_internal_device_unblock</span></a></span><span class="refpurpose"> &#8212; 
109     resume a device after a block request
110 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-kmap-atomic-sg.html"><span class="phrase">scsi_kmap_atomic_sg</span></a></span><span class="refpurpose"> &#8212; 
111     find and atomically map an sg-elemnt
112 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-kunmap-atomic-sg.html"><span class="phrase">scsi_kunmap_atomic_sg</span></a></span><span class="refpurpose"> &#8212; 
113     atomically unmap a virtual address, previously mapped with scsi_kmap_atomic_sg
114 </span></dt></dl></div><p>
115          SCSI queuing library.
116        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_lib_dma.c"></a>drivers/scsi/scsi_lib_dma.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-dma-map.html"><span class="phrase">scsi_dma_map</span></a></span><span class="refpurpose"> &#8212; 
117  perform DMA mapping against command's sg lists
118 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-dma-unmap.html"><span class="phrase">scsi_dma_unmap</span></a></span><span class="refpurpose"> &#8212; 
119     unmap command's sg lists mapped by scsi_dma_map
120 </span></dt></dl></div><p>
121          SCSI library functions depending on DMA
122          (map and unmap scatter-gather lists).
123        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_module.c"></a>drivers/scsi/scsi_module.c</h3></div></div></div><p>
124          The file drivers/scsi/scsi_module.c contains legacy support for
125          old-style host templates.  It should never be used by any new driver.
126        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_proc.c"></a>drivers/scsi/scsi_proc.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-proc-hostdir-add.html"><span class="phrase">scsi_proc_hostdir_add</span></a></span><span class="refpurpose"> &#8212; 
127  Create directory in /proc for a scsi host
128 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-proc-hostdir-rm.html"><span class="phrase">scsi_proc_hostdir_rm</span></a></span><span class="refpurpose"> &#8212; 
129     remove directory in /proc for a scsi host
130 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-proc-host-add.html"><span class="phrase">scsi_proc_host_add</span></a></span><span class="refpurpose"> &#8212; 
131     Add entry for this host to appropriate /proc dir
132 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-proc-host-rm.html"><span class="phrase">scsi_proc_host_rm</span></a></span><span class="refpurpose"> &#8212; 
133     remove this host's entry from /proc
134 </span></dt><dt><span class="refentrytitle"><a href="API-proc-print-scsidevice.html"><span class="phrase">proc_print_scsidevice</span></a></span><span class="refpurpose"> &#8212; 
135     return data about this host
136 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-add-single-device.html"><span class="phrase">scsi_add_single_device</span></a></span><span class="refpurpose"> &#8212; 
137     Respond to user request to probe for/add device
138 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-remove-single-device.html"><span class="phrase">scsi_remove_single_device</span></a></span><span class="refpurpose"> &#8212; 
139     Respond to user request to remove a device
140 </span></dt><dt><span class="refentrytitle"><a href="API-proc-scsi-write.html"><span class="phrase">proc_scsi_write</span></a></span><span class="refpurpose"> &#8212; 
141     handle writes to /proc/scsi/scsi
142 </span></dt><dt><span class="refentrytitle"><a href="API-proc-scsi-open.html"><span class="phrase">proc_scsi_open</span></a></span><span class="refpurpose"> &#8212; 
143     glue function
144 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-init-procfs.html"><span class="phrase">scsi_init_procfs</span></a></span><span class="refpurpose"> &#8212; 
145     create scsi and scsi/scsi in procfs
146 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-exit-procfs.html"><span class="phrase">scsi_exit_procfs</span></a></span><span class="refpurpose"> &#8212; 
147     Remove scsi/scsi and scsi from procfs
148 </span></dt></dl></div><p>
149          The functions in this file provide an interface between
150          the PROC file system and the SCSI device drivers
151          It is mainly used for debugging, statistics and to pass
152          information directly to the lowlevel driver.
153
154          I.E. plumbing to manage /proc/scsi/*
155        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_netlink.c"></a>drivers/scsi/scsi_netlink.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-nl-rcv-msg.html"><span class="phrase">scsi_nl_rcv_msg</span></a></span><span class="refpurpose"> &#8212; 
156  Receive message handler.
157 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-netlink-init.html"><span class="phrase">scsi_netlink_init</span></a></span><span class="refpurpose"> &#8212; 
158     Called by SCSI subsystem to initialize the SCSI transport netlink interface
159 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-netlink-exit.html"><span class="phrase">scsi_netlink_exit</span></a></span><span class="refpurpose"> &#8212; 
160     Called by SCSI subsystem to disable the SCSI transport netlink interface
161 </span></dt></dl></div><p>
162          Infrastructure to provide async events from transports to userspace
163          via netlink, using a single NETLINK_SCSITRANSPORT protocol for all
164          transports.
165
166          See <a class="ulink" href="http://marc.info/?l=linux-scsi&m=115507374832500&w=2" target="_top">the
167          original patch submission</a> for more details.
168        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_scan.c"></a>drivers/scsi/scsi_scan.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-complete-async-scans.html"><span class="phrase">scsi_complete_async_scans</span></a></span><span class="refpurpose"> &#8212; 
169  Wait for asynchronous scans to complete
170 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-unlock-floptical.html"><span class="phrase">scsi_unlock_floptical</span></a></span><span class="refpurpose"> &#8212; 
171     unlock device via a special MODE SENSE command
172 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-alloc-sdev.html"><span class="phrase">scsi_alloc_sdev</span></a></span><span class="refpurpose"> &#8212; 
173     allocate and setup a scsi_Device
174 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-target-reap-ref-release.html"><span class="phrase">scsi_target_reap_ref_release</span></a></span><span class="refpurpose"> &#8212; 
175     remove target from visibility
176 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-alloc-target.html"><span class="phrase">scsi_alloc_target</span></a></span><span class="refpurpose"> &#8212; 
177     allocate a new or find an existing target
178 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-target-reap.html"><span class="phrase">scsi_target_reap</span></a></span><span class="refpurpose"> &#8212; 
179     check to see if target is in use and destroy if not
180 </span></dt><dt><span class="refentrytitle"><a href="API-sanitize-inquiry-string.html"><span class="phrase">sanitize_inquiry_string</span></a></span><span class="refpurpose"> &#8212; 
181     remove non-graphical chars from an INQUIRY result string
182 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-probe-lun.html"><span class="phrase">scsi_probe_lun</span></a></span><span class="refpurpose"> &#8212; 
183     probe a single LUN using a SCSI INQUIRY
184 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-add-lun.html"><span class="phrase">scsi_add_lun</span></a></span><span class="refpurpose"> &#8212; 
185     allocate and fully initialze a scsi_device
186 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-inq-str.html"><span class="phrase">scsi_inq_str</span></a></span><span class="refpurpose"> &#8212; 
187     print INQUIRY data from min to max index, strip trailing whitespace
188 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-probe-and-add-lun.html"><span class="phrase">scsi_probe_and_add_lun</span></a></span><span class="refpurpose"> &#8212; 
189     probe a LUN, if a LUN is found add it
190 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-sequential-lun-scan.html"><span class="phrase">scsi_sequential_lun_scan</span></a></span><span class="refpurpose"> &#8212; 
191     sequentially scan a SCSI target
192 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-report-lun-scan.html"><span class="phrase">scsi_report_lun_scan</span></a></span><span class="refpurpose"> &#8212; 
193     Scan using SCSI REPORT LUN results
194 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-prep-async-scan.html"><span class="phrase">scsi_prep_async_scan</span></a></span><span class="refpurpose"> &#8212; 
195     prepare for an async scan
196 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-finish-async-scan.html"><span class="phrase">scsi_finish_async_scan</span></a></span><span class="refpurpose"> &#8212; 
197     asynchronous scan has finished
198 </span></dt></dl></div><p>
199          Scan a host to determine which (if any) devices are attached.
200
201          The general scanning/probing algorithm is as follows, exceptions are
202          made to it depending on device specific flags, compilation options,
203          and global variable (boot or module load time) settings.
204
205          A specific LUN is scanned via an INQUIRY command; if the LUN has a
206          device attached, a scsi_device is allocated and setup for it.
207
208          For every id of every channel on the given host, start by scanning
209          LUN 0.  Skip hosts that don't respond at all to a scan of LUN 0.
210          Otherwise, if LUN 0 has a device attached, allocate and setup a
211          scsi_device for it.  If target is SCSI-3 or up, issue a REPORT LUN,
212          and scan all of the LUNs returned by the REPORT LUN; else,
213          sequentially scan LUNs up until some maximum is reached, or a LUN is
214          seen that cannot have a device attached to it.
215        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_sysctl.c"></a>drivers/scsi/scsi_sysctl.c</h3></div></div></div><p>
216          Set up the sysctl entry: "/dev/scsi/logging_level"
217          (DEV_SCSI_LOGGING_LEVEL) which sets/returns scsi_logging_level.
218        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="scsi_sysfs.c"></a>drivers/scsi/scsi_sysfs.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-remove-device.html"><span class="phrase">scsi_remove_device</span></a></span><span class="refpurpose"> &#8212; 
219  unregister a device from the scsi bus
220 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-remove-target.html"><span class="phrase">scsi_remove_target</span></a></span><span class="refpurpose"> &#8212; 
221     try to remove a target and all its devices
222 </span></dt></dl></div><p>
223          SCSI sysfs interface routines.
224        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="hosts.c"></a>drivers/scsi/hosts.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="API-scsi-host-set-state.html"><span class="phrase">scsi_host_set_state</span></a></span><span class="refpurpose"> &#8212; 
225  Take the given host through the host state model.
226 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-remove-host.html"><span class="phrase">scsi_remove_host</span></a></span><span class="refpurpose"> &#8212; 
227     remove a scsi host
228 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-add-host-with-dma.html"><span class="phrase">scsi_add_host_with_dma</span></a></span><span class="refpurpose"> &#8212; 
229     add a scsi host with dma device
230 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-host-alloc.html"><span class="phrase">scsi_host_alloc</span></a></span><span class="refpurpose"> &#8212; 
231     register a scsi host adapter instance.
232 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-host-lookup.html"><span class="phrase">scsi_host_lookup</span></a></span><span class="refpurpose"> &#8212; 
233     get a reference to a Scsi_Host by host no
234 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-host-get.html"><span class="phrase">scsi_host_get</span></a></span><span class="refpurpose"> &#8212; 
235     inc a Scsi_Host ref count
236 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-host-put.html"><span class="phrase">scsi_host_put</span></a></span><span class="refpurpose"> &#8212; 
237     dec a Scsi_Host ref count
238 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-queue-work.html"><span class="phrase">scsi_queue_work</span></a></span><span class="refpurpose"> &#8212; 
239     Queue work to the Scsi_Host workqueue.
240 </span></dt><dt><span class="refentrytitle"><a href="API-scsi-flush-work.html"><span class="phrase">scsi_flush_work</span></a></span><span class="refpurpose"> &#8212; 
241     Flush a Scsi_Host's workqueue.
242 </span></dt></dl></div><p>
243          mid to lowlevel SCSI driver interface
244        </p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="constants.c"></a>drivers/scsi/constants.c</h3></div></div></div><div class="toc"><dl class="toc"><dt><span class="refentrytitle"><a href="re95.html">
245   .//drivers/scsi/constants.c
246  </a></span><span class="refpurpose"> &#8212; 
247   Document generation inconsistency
248  </span></dt></dl></div><p>
249          mid to lowlevel SCSI driver interface
250        </p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="API-shost-for-each-device.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ch (SCSI Media Changer)&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span class="phrase">shost_for_each_device</span></td></tr></table></div></body></html>
251