1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>__starget_for_each_device</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.c" title="drivers/scsi/scsi.c"><link rel="prev" href="API-starget-for-each-device.html" title="starget_for_each_device"><link rel="next" href="API---scsi-device-lookup-by-target.html" title="__scsi_device_lookup_by_target"></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">__starget_for_each_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-starget-for-each-device.html">Prev</a>&#160;</td><th width="60%" align="center">drivers/scsi/scsi.c</th><td width="20%" align="right">&#160;<a accesskey="n" href="API---scsi-device-lookup-by-target.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API---starget-for-each-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>__starget_for_each_device &#8212; 
2     helper to walk all devices of a target (UNLOCKED)
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">void <b class="fsfunc">__starget_for_each_device </b>(</code></td><td>struct scsi_target * <var class="pdparam">starget</var>, </td></tr><tr><td>&#160;</td><td>void * <var class="pdparam">data</var>, </td></tr><tr><td>&#160;</td><td>void (*<var class="pdparam">fn</var>)
4     <code>(</code>struct scsi_device *, void *<code>)</code><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1123573732"></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>
5     target whose devices we want to iterate over.
6    </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p>
7     parameter for callback <em class="parameter"><code>fn</code></em>()
8    </p></dd><dt><span class="term"><em class="parameter"><code>fn</code></em></span></dt><dd><p>
9     callback function that is invoked for each device
10    </p></dd></dl></div></div><div class="refsect1"><a name="idp1123577652"></a><h2>Description</h2><p>
11   This traverses over each device of <em class="parameter"><code>starget</code></em>.  It does _not_
12   take a reference on the scsi_device, so the whole loop must be
13   protected by shost-&gt;host_lock.
14</p></div><div class="refsect1"><a name="idp1123578812"></a><h2>Note</h2><p>
15   The only reason why drivers would want to use this is because
16   they need to access the device list in irq context.  Otherwise you
17   really want to use starget_for_each_device instead.
18</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-starget-for-each-device.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="mid_layer.html#scsi.c">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API---scsi-device-lookup-by-target.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">starget_for_each_device</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_device_lookup_by_target</span></td></tr></table></div></body></html>
19