1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>scsi_normalize_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_error.c" title="drivers/scsi/scsi_error.c"><link rel="prev" href="API-scsi-ioctl-reset.html" title="scsi_ioctl_reset"><link rel="next" href="API-scsi-sense-desc-find.html" title="scsi_sense_desc_find"></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_normalize_sense</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-scsi-ioctl-reset.html">Prev</a> </td><th width="60%" align="center">drivers/scsi/scsi_error.c</th><td width="20%" align="right"> <a accesskey="n" href="API-scsi-sense-desc-find.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-scsi-normalize-sense"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>scsi_normalize_sense — 2 normalize main elements from either fixed or descriptor sense data format into a common format. 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">bool <b class="fsfunc">scsi_normalize_sense </b>(</code></td><td>const u8 * <var class="pdparam">sense_buffer</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">sb_len</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="idp1123738772"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>sense_buffer</code></em></span></dt><dd><p> 4 byte array containing sense data returned by device 5 </p></dd><dt><span class="term"><em class="parameter"><code>sb_len</code></em></span></dt><dd><p> 6 number of valid bytes in sense_buffer 7 </p></dd><dt><span class="term"><em class="parameter"><code>sshdr</code></em></span></dt><dd><p> 8 pointer to instance of structure that common 9 elements are written to. 10 </p></dd></dl></div></div><div class="refsect1"><a name="idp1123742428"></a><h2>Notes</h2><p> 11 The <span class="quote">“<span class="quote">main elements</span>”</span> from sense data are: response_code, sense_key, 12 asc, ascq and additional_length (only for descriptor format). 13 </p><p> 14 15 Typically this function can be called after a device has 16 responded to a SCSI command with the CHECK_CONDITION status. 17</p></div><div class="refsect1"><a name="idp1123743588"></a><h2>Return value</h2><p> 18 true if valid sense data information found, else false; 19</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-ioctl-reset.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mid_layer.html#scsi_error.c">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-scsi-sense-desc-find.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">scsi_ioctl_reset</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_sense_desc_find</span></td></tr></table></div></body></html> 20