1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>scsi_mode_sense</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_lib.c" title="drivers/scsi/scsi_lib.c"><link rel="prev" href="API-scsi-mode-select.html" title="scsi_mode_select"><link rel="next" href="API-scsi-test-unit-ready.html" title="scsi_test_unit_ready"></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_mode_sense</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-scsi-mode-select.html">Prev</a> </td><th width="60%" align="center">drivers/scsi/scsi_lib.c</th><td width="20%" align="right"> <a accesskey="n" href="API-scsi-test-unit-ready.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-scsi-mode-sense"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>scsi_mode_sense — 2 issue a mode sense, falling back from 10 to six bytes if necessary. 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_mode_sense </b>(</code></td><td>struct scsi_device * <var class="pdparam">sdev</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">dbd</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">modepage</var>, </td></tr><tr><td> </td><td>unsigned char * <var class="pdparam">buffer</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">len</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">timeout</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">retries</var>, </td></tr><tr><td> </td><td>struct scsi_mode_data * <var class="pdparam">data</var>, </td></tr><tr><td> </td><td>struct scsi_sense_hdr * <var class="pdparam">sshdr</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1123880348"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>sdev</code></em></span></dt><dd><p> 4 SCSI device to be queried 5 </p></dd><dt><span class="term"><em class="parameter"><code>dbd</code></em></span></dt><dd><p> 6 set if mode sense will allow block descriptors to be returned 7 </p></dd><dt><span class="term"><em class="parameter"><code>modepage</code></em></span></dt><dd><p> 8 mode page being requested 9 </p></dd><dt><span class="term"><em class="parameter"><code>buffer</code></em></span></dt><dd><p> 10 request buffer (may not be smaller than eight bytes) 11 </p></dd><dt><span class="term"><em class="parameter"><code>len</code></em></span></dt><dd><p> 12 length of request buffer. 13 </p></dd><dt><span class="term"><em class="parameter"><code>timeout</code></em></span></dt><dd><p> 14 command timeout 15 </p></dd><dt><span class="term"><em class="parameter"><code>retries</code></em></span></dt><dd><p> 16 number of retries before failing 17 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p> 18 returns a structure abstracting the mode header data 19 </p></dd><dt><span class="term"><em class="parameter"><code>sshdr</code></em></span></dt><dd><p> 20 place to put sense data (or NULL if no sense to be collected). 21 must be SCSI_SENSE_BUFFERSIZE big. 22 </p></dd></dl></div></div><div class="refsect1"><a name="idp1123890028"></a><h2>Description</h2><p> 23 Returns zero if unsuccessful, or the header offset (either 4 24 or 8 depending on whether a six or ten byte command was 25 issued) if successful. 26</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-mode-select.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mid_layer.html#scsi_lib.c">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-scsi-test-unit-ready.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">scsi_mode_select</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">scsi_test_unit_ready</span></td></tr></table></div></body></html> 27