1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ablkcipher_request_set_callback</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Kernel Crypto API"><link rel="up" href="ch05s04.html" title="Asynchronous Cipher Request Handle"><link rel="prev" href="API-ablkcipher-request-free.html" title="ablkcipher_request_free"><link rel="next" href="API-ablkcipher-request-set-crypt.html" title="ablkcipher_request_set_crypt"></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">ablkcipher_request_set_callback</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-ablkcipher-request-free.html">Prev</a> </td><th width="60%" align="center">Asynchronous Cipher Request Handle</th><td width="20%" align="right"> <a accesskey="n" href="API-ablkcipher-request-set-crypt.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-ablkcipher-request-set-callback"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ablkcipher_request_set_callback — 2 set asynchronous callback function 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">ablkcipher_request_set_callback </b>(</code></td><td>struct ablkcipher_request * <var class="pdparam">req</var>, </td></tr><tr><td> </td><td>u32 <var class="pdparam">flags</var>, </td></tr><tr><td> </td><td>crypto_completion_t <var class="pdparam">compl</var>, </td></tr><tr><td> </td><td>void * <var class="pdparam">data</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1097601148"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>req</code></em></span></dt><dd><p> 4 request handle 5 </p></dd><dt><span class="term"><em class="parameter"><code>flags</code></em></span></dt><dd><p> 6 specify zero or an ORing of the flags 7 CRYPTO_TFM_REQ_MAY_BACKLOG the request queue may back log and 8 increase the wait queue beyond the initial maximum size; 9 CRYPTO_TFM_REQ_MAY_SLEEP the request processing may sleep 10 </p></dd><dt><span class="term"><em class="parameter"><code>compl</code></em></span></dt><dd><p> 11 callback function pointer to be registered with the request handle 12 </p></dd><dt><span class="term"><em class="parameter"><code>data</code></em></span></dt><dd><p> 13 The data pointer refers to memory that is not used by the kernel 14 crypto API, but provided to the callback function for it to use. Here, 15 the caller can provide a reference to memory the callback function can 16 operate on. As the callback function is invoked asynchronously to the 17 related functionality, it may need to access data structures of the 18 related functionality which can be referenced using this pointer. The 19 callback function can access the memory via the <span class="quote">“<span class="quote">data</span>”</span> field in the 20 crypto_async_request data structure provided to the callback function. 21 </p></dd></dl></div></div><div class="refsect1"><a name="idp1097606668"></a><h2>Description</h2><p> 22 This function allows setting the callback function that is triggered once the 23 cipher operation completes. 24 </p><p> 25 26 The callback function is registered with the ablkcipher_request handle and 27 must comply with the following template 28 </p><p> 29 30 void callback_function(struct crypto_async_request *req, int error) 31</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-ablkcipher-request-free.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch05s04.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-ablkcipher-request-set-crypt.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">ablkcipher_request_free</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">ablkcipher_request_set_crypt</span></td></tr></table></div></body></html> 32