1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>scsi_probe_and_add_lun</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="mid_layer.html#scsi_scan.c" title="drivers/scsi/scsi_scan.c"><link rel="prev" href="API-scsi-inq-str.html" title="scsi_inq_str"><link rel="next" href="API-scsi-sequential-lun-scan.html" title="scsi_sequential_lun_scan"></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"><span class="phrase">scsi_probe_and_add_lun</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-scsi-inq-str.html">Prev</a>&#160;</td><th width="60%" align="center">drivers/scsi/scsi_scan.c</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-scsi-sequential-lun-scan.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-scsi-probe-and-add-lun"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>scsi_probe_and_add_lun &#8212; 
2     probe a LUN, if a LUN is found add it
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">scsi_probe_and_add_lun </b>(</code></td><td>struct scsi_target * <var class="pdparam">starget</var>, </td></tr><tr><td>&#160;</td><td>u64 <var class="pdparam">lun</var>, </td></tr><tr><td>&#160;</td><td>int * <var class="pdparam">bflagsp</var>, </td></tr><tr><td>&#160;</td><td>struct scsi_device ** <var class="pdparam">sdevp</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">rescan</var>, </td></tr><tr><td>&#160;</td><td>void * <var class="pdparam">hostdata</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1124208980"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>starget</code></em></span></dt><dd><p>
4     pointer to target device structure
5    </p></dd><dt><span class="term"><em class="parameter"><code>lun</code></em></span></dt><dd><p>
6     LUN of target device
7    </p></dd><dt><span class="term"><em class="parameter"><code>bflagsp</code></em></span></dt><dd><p>
8     store bflags here if not NULL
9    </p></dd><dt><span class="term"><em class="parameter"><code>sdevp</code></em></span></dt><dd><p>
10     probe the LUN corresponding to this scsi_device
11    </p></dd><dt><span class="term"><em class="parameter"><code>rescan</code></em></span></dt><dd><p>
12     if nonzero skip some code only needed on first scan
13    </p></dd><dt><span class="term"><em class="parameter"><code>hostdata</code></em></span></dt><dd><p>
14     passed to <code class="function">scsi_alloc_sdev</code>
15    </p></dd></dl></div></div><div class="refsect1"><a name="idp1124215860"></a><h2>Description</h2><p>
16   Call scsi_probe_lun, if a LUN with an attached device is found,
17   allocate and set it up by calling scsi_add_lun.
18</p></div><div class="refsect1"><a name="idp1124216564"></a><h2>SCSI_SCAN_NO_RESPONSE</h2><p>
19   could not allocate or setup a scsi_device
20</p></div><div class="refsect1"><a name="idp1124217196"></a><h2>SCSI_SCAN_TARGET_PRESENT</h2><p>
21   target responded, but no device is
22   attached at the LUN
23</p></div><div class="refsect1"><a name="idp1124217844"></a><h2>SCSI_SCAN_LUN_PRESENT</h2><p>
24   a new scsi_device was allocated and initialized
25</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-scsi-inq-str.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="mid_layer.html#scsi_scan.c">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-scsi-sequential-lun-scan.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">scsi_inq_str</span>&#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">scsi_sequential_lun_scan</span></td></tr></table></div></body></html>
26