1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>cfg80211_testmode_alloc_reply_skb</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="The 802.11 subsystems &#8211; for kernel developers"><link rel="up" href="bk01ch08.html" title="Chapter&#160;8.&#160;Test mode"><link rel="prev" href="bk01ch08.html" title="Chapter&#160;8.&#160;Test mode"><link rel="next" href="API-cfg80211-testmode-reply.html" title="cfg80211_testmode_reply"></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">cfg80211_testmode_alloc_reply_skb</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01ch08.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;8.&#160;Test mode</th><td width="20%" align="right">&#160;<a accesskey="n" href="API-cfg80211-testmode-reply.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-cfg80211-testmode-alloc-reply-skb"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>cfg80211_testmode_alloc_reply_skb &#8212; 
2  allocate testmode reply
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">struct sk_buff * <b class="fsfunc">cfg80211_testmode_alloc_reply_skb </b>(</code></td><td>struct wiphy * <var class="pdparam">wiphy</var>, </td></tr><tr><td>&#160;</td><td>int <var class="pdparam">approxlen</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1"><a name="idp1113246268"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>wiphy</code></em></span></dt><dd><p>
4     the wiphy
5    </p></dd><dt><span class="term"><em class="parameter"><code>approxlen</code></em></span></dt><dd><p>
6     an upper bound of the length of the data that will
7     be put into the skb
8    </p></dd></dl></div></div><div class="refsect1"><a name="idp1113248908"></a><h2>Description</h2><p>
9   This function allocates and pre-fills an skb for a reply to
10   the testmode command. Since it is intended for a reply, calling
11   it outside of the <em class="parameter"><code>testmode_cmd</code></em> operation is invalid.
12   </p><p>
13
14   The returned skb is pre-filled with the wiphy index and set up in
15   a way that any data that is put into the skb (with <code class="function">skb_put</code>,
16   <code class="function">nla_put</code> or similar) will end up being within the
17   <code class="constant">NL80211_ATTR_TESTDATA</code> attribute, so all that needs to be done
18   with the skb is adding data for the corresponding userspace tool
19   which can then read that data out of the testdata attribute. You
20   must not modify the skb in any other way.
21   </p><p>
22
23   When done, call <code class="function">cfg80211_testmode_reply</code> with the skb and return
24   its error code as the result of the <em class="parameter"><code>testmode_cmd</code></em> operation.
25</p></div><div class="refsect1"><a name="idp1113252492"></a><h2>Return</h2><p>
26   An allocated and pre-filled skb. <code class="constant">NULL</code> if any errors happen.
27</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01ch08.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="bk01ch08.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="API-cfg80211-testmode-reply.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;8.&#160;Test mode&#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">cfg80211_testmode_reply</span></td></tr></table></div></body></html>
28