1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>wimax_msg_alloc</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Networking and Network Devices APIs"><link rel="up" href="ch01s06.html" title="WiMAX"><link rel="prev" href="ch01s06.html" title="WiMAX"><link rel="next" href="API-wimax-msg-data-len.html" title="wimax_msg_data_len"></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">wimax_msg_alloc</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01s06.html">Prev</a> </td><th width="60%" align="center">WiMAX</th><td width="20%" align="right"> <a accesskey="n" href="API-wimax-msg-data-len.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-wimax-msg-alloc"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>wimax_msg_alloc — 2 Create a new skb for sending a message to userspace 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">wimax_msg_alloc </b>(</code></td><td>struct wimax_dev * <var class="pdparam">wimax_dev</var>, </td></tr><tr><td> </td><td>const char * <var class="pdparam">pipe_name</var>, </td></tr><tr><td> </td><td>const void * <var class="pdparam">msg</var>, </td></tr><tr><td> </td><td>size_t <var class="pdparam">size</var>, </td></tr><tr><td> </td><td>gfp_t <var class="pdparam">gfp_flags</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1097531620"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>wimax_dev</code></em></span></dt><dd><p> 4 WiMAX device descriptor 5 </p></dd><dt><span class="term"><em class="parameter"><code>pipe_name</code></em></span></dt><dd><p> 6 "named pipe" the message will be sent to 7 </p></dd><dt><span class="term"><em class="parameter"><code>msg</code></em></span></dt><dd><p> 8 pointer to the message data to send 9 </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p> 10 size of the message to send (in bytes), including the header. 11 </p></dd><dt><span class="term"><em class="parameter"><code>gfp_flags</code></em></span></dt><dd><p> 12 flags for memory allocation. 13 </p></dd></dl></div></div><div class="refsect1"><a name="idp1097537396"></a><h2>Returns</h2><p> 14 <code class="constant">0</code> if ok, negative errno code on error 15</p></div><div class="refsect1"><a name="idp1097538228"></a><h2>Description</h2><p> 16 </p><p> 17 18 Allocates an skb that will contain the message to send to user 19 space over the messaging pipe and initializes it, copying the 20 payload. 21 </p><p> 22 23 Once this call is done, you can deliver it with 24 <code class="function">wimax_msg_send</code>. 25</p></div><div class="refsect1"><a name="idp1097539652"></a><h2>IMPORTANT</h2><p> 26 </p><p> 27 28 Don't use <code class="function">skb_push</code>/<code class="function">skb_pull</code>/<code class="function">skb_reserve</code> on the skb, as 29 <code class="function">wimax_msg_send</code> depends on skb->data being placed at the 30 beginning of the user message. 31 </p><p> 32 33 Unlike other WiMAX stack calls, this call can be used way early, 34 even before <code class="function">wimax_dev_add</code> is called, as long as the 35 wimax_dev->net_dev pointer is set to point to a proper 36 net_dev. This is so that drivers can use it early in case they need 37 to send stuff around or communicate with user space. 38</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01s06.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch01s06.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-wimax-msg-data-len.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">WiMAX </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">wimax_msg_data_len</span></td></tr></table></div></body></html> 39