1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
4
5<book id="LinuxNetworking">
6 <bookinfo>
7  <title>Linux Networking and Network Devices APIs</title>
8
9  <legalnotice>
10   <para>
11     This documentation is free software; you can redistribute
12     it and/or modify it under the terms of the GNU General Public
13     License as published by the Free Software Foundation; either
14     version 2 of the License, or (at your option) any later
15     version.
16   </para>
17
18   <para>
19     This program is distributed in the hope that it will be
20     useful, but WITHOUT ANY WARRANTY; without even the implied
21     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22     See the GNU General Public License for more details.
23   </para>
24
25   <para>
26     You should have received a copy of the GNU General Public
27     License along with this program; if not, write to the Free
28     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29     MA 02111-1307 USA
30   </para>
31
32   <para>
33     For more details see the file COPYING in the source
34     distribution of Linux.
35   </para>
36  </legalnotice>
37 </bookinfo>
38
39<toc></toc>
40
41  <chapter id="netcore">
42     <title>Linux Networking</title>
43     <sect1><title>Networking Base Types</title>
44<!-- include/linux/net.h -->
45<refentry id="API-enum-sock-type">
46<refentryinfo>
47 <title>LINUX</title>
48 <productname>Kernel Hackers Manual</productname>
49 <date>July 2017</date>
50</refentryinfo>
51<refmeta>
52 <refentrytitle><phrase>enum sock_type</phrase></refentrytitle>
53 <manvolnum>9</manvolnum>
54 <refmiscinfo class="version">4.1.27</refmiscinfo>
55</refmeta>
56<refnamediv>
57 <refname>enum sock_type</refname>
58 <refpurpose>
59  Socket types
60 </refpurpose>
61</refnamediv>
62<refsynopsisdiv>
63 <title>Synopsis</title>
64  <programlisting>
65enum sock_type {
66  SOCK_STREAM,
67  SOCK_DGRAM,
68  SOCK_RAW,
69  SOCK_RDM,
70  SOCK_SEQPACKET,
71  SOCK_DCCP,
72  SOCK_PACKET
73};  </programlisting>
74</refsynopsisdiv>
75<refsect1>
76 <title>Constants</title>
77  <variablelist>
78    <varlistentry>      <term>SOCK_STREAM</term>
79      <listitem><para>
80stream (connection) socket
81      </para></listitem>
82    </varlistentry>
83    <varlistentry>      <term>SOCK_DGRAM</term>
84      <listitem><para>
85datagram (conn.less) socket
86      </para></listitem>
87    </varlistentry>
88    <varlistentry>      <term>SOCK_RAW</term>
89      <listitem><para>
90raw socket
91      </para></listitem>
92    </varlistentry>
93    <varlistentry>      <term>SOCK_RDM</term>
94      <listitem><para>
95reliably-delivered message
96      </para></listitem>
97    </varlistentry>
98    <varlistentry>      <term>SOCK_SEQPACKET</term>
99      <listitem><para>
100sequential packet socket
101      </para></listitem>
102    </varlistentry>
103    <varlistentry>      <term>SOCK_DCCP</term>
104      <listitem><para>
105Datagram Congestion Control Protocol socket
106      </para></listitem>
107    </varlistentry>
108    <varlistentry>      <term>SOCK_PACKET</term>
109      <listitem><para>
110linux specific way of getting packets at the dev level.
111For writing rarp and other similar things on the user level.
112      </para></listitem>
113    </varlistentry>
114  </variablelist>
115</refsect1>
116<refsect1>
117<title>Description</title>
118<para>
119   When adding some new socket type please
120   grep ARCH_HAS_SOCKET_TYPE include/asm-* /socket.h, at least MIPS
121   overrides this enum for binary compat reasons.
122</para>
123</refsect1>
124</refentry>
125
126<refentry id="API-struct-socket">
127<refentryinfo>
128 <title>LINUX</title>
129 <productname>Kernel Hackers Manual</productname>
130 <date>July 2017</date>
131</refentryinfo>
132<refmeta>
133 <refentrytitle><phrase>struct socket</phrase></refentrytitle>
134 <manvolnum>9</manvolnum>
135 <refmiscinfo class="version">4.1.27</refmiscinfo>
136</refmeta>
137<refnamediv>
138 <refname>struct socket</refname>
139 <refpurpose>
140     general BSD socket
141 </refpurpose>
142</refnamediv>
143<refsynopsisdiv>
144 <title>Synopsis</title>
145  <programlisting>
146struct socket {
147  socket_state state;
148  short type;
149  unsigned long flags;
150  struct socket_wq __rcu * wq;
151  struct file * file;
152  struct sock * sk;
153  const struct proto_ops * ops;
154};  </programlisting>
155</refsynopsisdiv>
156 <refsect1>
157  <title>Members</title>
158  <variablelist>
159    <varlistentry>      <term>state</term>
160      <listitem><para>
161   socket state (<constant>SS_CONNECTED</constant>, etc)
162      </para></listitem>
163    </varlistentry>
164    <varlistentry>      <term>type</term>
165      <listitem><para>
166   socket type (<constant>SOCK_STREAM</constant>, etc)
167      </para></listitem>
168    </varlistentry>
169    <varlistentry>      <term>flags</term>
170      <listitem><para>
171   socket flags (<constant>SOCK_ASYNC_NOSPACE</constant>, etc)
172      </para></listitem>
173    </varlistentry>
174    <varlistentry>      <term>wq</term>
175      <listitem><para>
176   wait queue for several uses
177      </para></listitem>
178    </varlistentry>
179    <varlistentry>      <term>file</term>
180      <listitem><para>
181   File back pointer for gc
182      </para></listitem>
183    </varlistentry>
184    <varlistentry>      <term>sk</term>
185      <listitem><para>
186   internal networking protocol agnostic socket representation
187      </para></listitem>
188    </varlistentry>
189    <varlistentry>      <term>ops</term>
190      <listitem><para>
191   protocol specific socket operations
192      </para></listitem>
193    </varlistentry>
194  </variablelist>
195 </refsect1>
196</refentry>
197
198     </sect1>
199     <sect1><title>Socket Buffer Functions</title>
200<!-- include/linux/skbuff.h -->
201<refentry id="API-struct-skb-shared-hwtstamps">
202<refentryinfo>
203 <title>LINUX</title>
204 <productname>Kernel Hackers Manual</productname>
205 <date>July 2017</date>
206</refentryinfo>
207<refmeta>
208 <refentrytitle><phrase>struct skb_shared_hwtstamps</phrase></refentrytitle>
209 <manvolnum>9</manvolnum>
210 <refmiscinfo class="version">4.1.27</refmiscinfo>
211</refmeta>
212<refnamediv>
213 <refname>struct skb_shared_hwtstamps</refname>
214 <refpurpose>
215  hardware time stamps
216 </refpurpose>
217</refnamediv>
218<refsynopsisdiv>
219 <title>Synopsis</title>
220  <programlisting>
221struct skb_shared_hwtstamps {
222  ktime_t hwtstamp;
223};  </programlisting>
224</refsynopsisdiv>
225 <refsect1>
226  <title>Members</title>
227  <variablelist>
228    <varlistentry>      <term>hwtstamp</term>
229      <listitem><para>
230hardware time stamp transformed into duration
231since arbitrary point in time
232      </para></listitem>
233    </varlistentry>
234  </variablelist>
235 </refsect1>
236<refsect1>
237<title>Description</title>
238<para>
239   Software time stamps generated by <function>ktime_get_real</function> are stored in
240   skb-&gt;tstamp.
241   </para><para>
242
243   hwtstamps can only be compared against other hwtstamps from
244   the same device.
245   </para><para>
246
247   This structure is attached to packets as part of the
248   <structname>skb_shared_info</structname>. Use <function>skb_hwtstamps</function> to get a pointer.
249</para>
250</refsect1>
251</refentry>
252
253<refentry id="API-struct-skb-mstamp">
254<refentryinfo>
255 <title>LINUX</title>
256 <productname>Kernel Hackers Manual</productname>
257 <date>July 2017</date>
258</refentryinfo>
259<refmeta>
260 <refentrytitle><phrase>struct skb_mstamp</phrase></refentrytitle>
261 <manvolnum>9</manvolnum>
262 <refmiscinfo class="version">4.1.27</refmiscinfo>
263</refmeta>
264<refnamediv>
265 <refname>struct skb_mstamp</refname>
266 <refpurpose>
267     multi resolution time stamps
268 </refpurpose>
269</refnamediv>
270<refsynopsisdiv>
271 <title>Synopsis</title>
272  <programlisting>
273struct skb_mstamp {
274  union {unnamed_union};
275};  </programlisting>
276</refsynopsisdiv>
277 <refsect1>
278  <title>Members</title>
279  <variablelist>
280    <varlistentry>      <term>{unnamed_union}</term>
281      <listitem><para>
282   anonymous
283      </para></listitem>
284    </varlistentry>
285  </variablelist>
286 </refsect1>
287</refentry>
288
289<refentry id="API-skb-mstamp-get">
290<refentryinfo>
291 <title>LINUX</title>
292 <productname>Kernel Hackers Manual</productname>
293 <date>July 2017</date>
294</refentryinfo>
295<refmeta>
296 <refentrytitle><phrase>skb_mstamp_get</phrase></refentrytitle>
297 <manvolnum>9</manvolnum>
298 <refmiscinfo class="version">4.1.27</refmiscinfo>
299</refmeta>
300<refnamediv>
301 <refname>skb_mstamp_get</refname>
302 <refpurpose>
303     get current timestamp
304 </refpurpose>
305</refnamediv>
306<refsynopsisdiv>
307 <title>Synopsis</title>
308  <funcsynopsis><funcprototype>
309   <funcdef>void <function>skb_mstamp_get </function></funcdef>
310   <paramdef>struct skb_mstamp * <parameter>cl</parameter></paramdef>
311  </funcprototype></funcsynopsis>
312</refsynopsisdiv>
313<refsect1>
314 <title>Arguments</title>
315 <variablelist>
316  <varlistentry>
317   <term><parameter>cl</parameter></term>
318   <listitem>
319    <para>
320     place to store timestamps
321    </para>
322   </listitem>
323  </varlistentry>
324 </variablelist>
325</refsect1>
326</refentry>
327
328<refentry id="API-skb-mstamp-us-delta">
329<refentryinfo>
330 <title>LINUX</title>
331 <productname>Kernel Hackers Manual</productname>
332 <date>July 2017</date>
333</refentryinfo>
334<refmeta>
335 <refentrytitle><phrase>skb_mstamp_us_delta</phrase></refentrytitle>
336 <manvolnum>9</manvolnum>
337 <refmiscinfo class="version">4.1.27</refmiscinfo>
338</refmeta>
339<refnamediv>
340 <refname>skb_mstamp_us_delta</refname>
341 <refpurpose>
342     compute the difference in usec between two skb_mstamp
343 </refpurpose>
344</refnamediv>
345<refsynopsisdiv>
346 <title>Synopsis</title>
347  <funcsynopsis><funcprototype>
348   <funcdef>u32 <function>skb_mstamp_us_delta </function></funcdef>
349   <paramdef>const struct skb_mstamp * <parameter>t1</parameter></paramdef>
350   <paramdef>const struct skb_mstamp * <parameter>t0</parameter></paramdef>
351  </funcprototype></funcsynopsis>
352</refsynopsisdiv>
353<refsect1>
354 <title>Arguments</title>
355 <variablelist>
356  <varlistentry>
357   <term><parameter>t1</parameter></term>
358   <listitem>
359    <para>
360     pointer to newest sample
361    </para>
362   </listitem>
363  </varlistentry>
364  <varlistentry>
365   <term><parameter>t0</parameter></term>
366   <listitem>
367    <para>
368     pointer to oldest sample
369    </para>
370   </listitem>
371  </varlistentry>
372 </variablelist>
373</refsect1>
374</refentry>
375
376<refentry id="API-struct-sk-buff">
377<refentryinfo>
378 <title>LINUX</title>
379 <productname>Kernel Hackers Manual</productname>
380 <date>July 2017</date>
381</refentryinfo>
382<refmeta>
383 <refentrytitle><phrase>struct sk_buff</phrase></refentrytitle>
384 <manvolnum>9</manvolnum>
385 <refmiscinfo class="version">4.1.27</refmiscinfo>
386</refmeta>
387<refnamediv>
388 <refname>struct sk_buff</refname>
389 <refpurpose>
390     socket buffer
391 </refpurpose>
392</refnamediv>
393<refsynopsisdiv>
394 <title>Synopsis</title>
395  <programlisting>
396struct sk_buff {
397  union {unnamed_union};
398  __u16 inner_transport_header;
399  __u16 inner_network_header;
400  __u16 inner_mac_header;
401  __be16 protocol;
402  __u16 transport_header;
403  __u16 network_header;
404  __u16 mac_header;
405  sk_buff_data_t tail;
406  sk_buff_data_t end;
407  unsigned char * head;
408  unsigned char * data;
409  unsigned int truesize;
410  atomic_t users;
411};  </programlisting>
412</refsynopsisdiv>
413 <refsect1>
414  <title>Members</title>
415  <variablelist>
416    <varlistentry>      <term>{unnamed_union}</term>
417      <listitem><para>
418   anonymous
419      </para></listitem>
420    </varlistentry>
421    <varlistentry>      <term>inner_transport_header</term>
422      <listitem><para>
423   Inner transport layer header (encapsulation)
424      </para></listitem>
425    </varlistentry>
426    <varlistentry>      <term>inner_network_header</term>
427      <listitem><para>
428   Network layer header (encapsulation)
429      </para></listitem>
430    </varlistentry>
431    <varlistentry>      <term>inner_mac_header</term>
432      <listitem><para>
433   Link layer header (encapsulation)
434      </para></listitem>
435    </varlistentry>
436    <varlistentry>      <term>protocol</term>
437      <listitem><para>
438   Packet protocol from driver
439      </para></listitem>
440    </varlistentry>
441    <varlistentry>      <term>transport_header</term>
442      <listitem><para>
443   Transport layer header
444      </para></listitem>
445    </varlistentry>
446    <varlistentry>      <term>network_header</term>
447      <listitem><para>
448   Network layer header
449      </para></listitem>
450    </varlistentry>
451    <varlistentry>      <term>mac_header</term>
452      <listitem><para>
453   Link layer header
454      </para></listitem>
455    </varlistentry>
456    <varlistentry>      <term>tail</term>
457      <listitem><para>
458   Tail pointer
459      </para></listitem>
460    </varlistentry>
461    <varlistentry>      <term>end</term>
462      <listitem><para>
463   End pointer
464      </para></listitem>
465    </varlistentry>
466    <varlistentry>      <term>head</term>
467      <listitem><para>
468   Head of buffer
469      </para></listitem>
470    </varlistentry>
471    <varlistentry>      <term>data</term>
472      <listitem><para>
473   Data head pointer
474      </para></listitem>
475    </varlistentry>
476    <varlistentry>      <term>truesize</term>
477      <listitem><para>
478   Buffer size
479      </para></listitem>
480    </varlistentry>
481    <varlistentry>      <term>users</term>
482      <listitem><para>
483   User count - see {datagram,tcp}.c
484      </para></listitem>
485    </varlistentry>
486  </variablelist>
487 </refsect1>
488</refentry>
489
490<refentry id="API-skb-dst">
491<refentryinfo>
492 <title>LINUX</title>
493 <productname>Kernel Hackers Manual</productname>
494 <date>July 2017</date>
495</refentryinfo>
496<refmeta>
497 <refentrytitle><phrase>skb_dst</phrase></refentrytitle>
498 <manvolnum>9</manvolnum>
499 <refmiscinfo class="version">4.1.27</refmiscinfo>
500</refmeta>
501<refnamediv>
502 <refname>skb_dst</refname>
503 <refpurpose>
504     returns skb dst_entry
505 </refpurpose>
506</refnamediv>
507<refsynopsisdiv>
508 <title>Synopsis</title>
509  <funcsynopsis><funcprototype>
510   <funcdef>struct dst_entry * <function>skb_dst </function></funcdef>
511   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
512  </funcprototype></funcsynopsis>
513</refsynopsisdiv>
514<refsect1>
515 <title>Arguments</title>
516 <variablelist>
517  <varlistentry>
518   <term><parameter>skb</parameter></term>
519   <listitem>
520    <para>
521     buffer
522    </para>
523   </listitem>
524  </varlistentry>
525 </variablelist>
526</refsect1>
527<refsect1>
528<title>Description</title>
529<para>
530   Returns skb dst_entry, regardless of reference taken or not.
531</para>
532</refsect1>
533</refentry>
534
535<refentry id="API-skb-dst-set">
536<refentryinfo>
537 <title>LINUX</title>
538 <productname>Kernel Hackers Manual</productname>
539 <date>July 2017</date>
540</refentryinfo>
541<refmeta>
542 <refentrytitle><phrase>skb_dst_set</phrase></refentrytitle>
543 <manvolnum>9</manvolnum>
544 <refmiscinfo class="version">4.1.27</refmiscinfo>
545</refmeta>
546<refnamediv>
547 <refname>skb_dst_set</refname>
548 <refpurpose>
549     sets skb dst
550 </refpurpose>
551</refnamediv>
552<refsynopsisdiv>
553 <title>Synopsis</title>
554  <funcsynopsis><funcprototype>
555   <funcdef>void <function>skb_dst_set </function></funcdef>
556   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
557   <paramdef>struct dst_entry * <parameter>dst</parameter></paramdef>
558  </funcprototype></funcsynopsis>
559</refsynopsisdiv>
560<refsect1>
561 <title>Arguments</title>
562 <variablelist>
563  <varlistentry>
564   <term><parameter>skb</parameter></term>
565   <listitem>
566    <para>
567     buffer
568    </para>
569   </listitem>
570  </varlistentry>
571  <varlistentry>
572   <term><parameter>dst</parameter></term>
573   <listitem>
574    <para>
575     dst entry
576    </para>
577   </listitem>
578  </varlistentry>
579 </variablelist>
580</refsect1>
581<refsect1>
582<title>Description</title>
583<para>
584   Sets skb dst, assuming a reference was taken on dst and should
585   be released by <function>skb_dst_drop</function>
586</para>
587</refsect1>
588</refentry>
589
590<refentry id="API-skb-dst-set-noref">
591<refentryinfo>
592 <title>LINUX</title>
593 <productname>Kernel Hackers Manual</productname>
594 <date>July 2017</date>
595</refentryinfo>
596<refmeta>
597 <refentrytitle><phrase>skb_dst_set_noref</phrase></refentrytitle>
598 <manvolnum>9</manvolnum>
599 <refmiscinfo class="version">4.1.27</refmiscinfo>
600</refmeta>
601<refnamediv>
602 <refname>skb_dst_set_noref</refname>
603 <refpurpose>
604     sets skb dst, hopefully, without taking reference
605 </refpurpose>
606</refnamediv>
607<refsynopsisdiv>
608 <title>Synopsis</title>
609  <funcsynopsis><funcprototype>
610   <funcdef>void <function>skb_dst_set_noref </function></funcdef>
611   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
612   <paramdef>struct dst_entry * <parameter>dst</parameter></paramdef>
613  </funcprototype></funcsynopsis>
614</refsynopsisdiv>
615<refsect1>
616 <title>Arguments</title>
617 <variablelist>
618  <varlistentry>
619   <term><parameter>skb</parameter></term>
620   <listitem>
621    <para>
622     buffer
623    </para>
624   </listitem>
625  </varlistentry>
626  <varlistentry>
627   <term><parameter>dst</parameter></term>
628   <listitem>
629    <para>
630     dst entry
631    </para>
632   </listitem>
633  </varlistentry>
634 </variablelist>
635</refsect1>
636<refsect1>
637<title>Description</title>
638<para>
639   Sets skb dst, assuming a reference was not taken on dst.
640   If dst entry is cached, we do not take reference and dst_release
641   will be avoided by refdst_drop. If dst entry is not cached, we take
642   reference, so that last dst_release can destroy the dst immediately.
643</para>
644</refsect1>
645</refentry>
646
647<refentry id="API-skb-dst-is-noref">
648<refentryinfo>
649 <title>LINUX</title>
650 <productname>Kernel Hackers Manual</productname>
651 <date>July 2017</date>
652</refentryinfo>
653<refmeta>
654 <refentrytitle><phrase>skb_dst_is_noref</phrase></refentrytitle>
655 <manvolnum>9</manvolnum>
656 <refmiscinfo class="version">4.1.27</refmiscinfo>
657</refmeta>
658<refnamediv>
659 <refname>skb_dst_is_noref</refname>
660 <refpurpose>
661     Test if skb dst isn't refcounted
662 </refpurpose>
663</refnamediv>
664<refsynopsisdiv>
665 <title>Synopsis</title>
666  <funcsynopsis><funcprototype>
667   <funcdef>bool <function>skb_dst_is_noref </function></funcdef>
668   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
669  </funcprototype></funcsynopsis>
670</refsynopsisdiv>
671<refsect1>
672 <title>Arguments</title>
673 <variablelist>
674  <varlistentry>
675   <term><parameter>skb</parameter></term>
676   <listitem>
677    <para>
678     buffer
679    </para>
680   </listitem>
681  </varlistentry>
682 </variablelist>
683</refsect1>
684</refentry>
685
686<refentry id="API-skb-fclone-busy">
687<refentryinfo>
688 <title>LINUX</title>
689 <productname>Kernel Hackers Manual</productname>
690 <date>July 2017</date>
691</refentryinfo>
692<refmeta>
693 <refentrytitle><phrase>skb_fclone_busy</phrase></refentrytitle>
694 <manvolnum>9</manvolnum>
695 <refmiscinfo class="version">4.1.27</refmiscinfo>
696</refmeta>
697<refnamediv>
698 <refname>skb_fclone_busy</refname>
699 <refpurpose>
700     check if fclone is busy
701 </refpurpose>
702</refnamediv>
703<refsynopsisdiv>
704 <title>Synopsis</title>
705  <funcsynopsis><funcprototype>
706   <funcdef>bool <function>skb_fclone_busy </function></funcdef>
707   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
708   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
709  </funcprototype></funcsynopsis>
710</refsynopsisdiv>
711<refsect1>
712 <title>Arguments</title>
713 <variablelist>
714  <varlistentry>
715   <term><parameter>sk</parameter></term>
716   <listitem>
717    <para>
718     -- undescribed --
719    </para>
720   </listitem>
721  </varlistentry>
722  <varlistentry>
723   <term><parameter>skb</parameter></term>
724   <listitem>
725    <para>
726     buffer
727    </para>
728   </listitem>
729  </varlistentry>
730 </variablelist>
731</refsect1>
732<refsect1>
733<title>Description</title>
734<para>
735   Returns true is skb is a fast clone, and its clone is not freed.
736   Some drivers call <function>skb_orphan</function> in their <function>ndo_start_xmit</function>,
737   so we also check that this didnt happen.
738</para>
739</refsect1>
740</refentry>
741
742<refentry id="API-skb-queue-empty">
743<refentryinfo>
744 <title>LINUX</title>
745 <productname>Kernel Hackers Manual</productname>
746 <date>July 2017</date>
747</refentryinfo>
748<refmeta>
749 <refentrytitle><phrase>skb_queue_empty</phrase></refentrytitle>
750 <manvolnum>9</manvolnum>
751 <refmiscinfo class="version">4.1.27</refmiscinfo>
752</refmeta>
753<refnamediv>
754 <refname>skb_queue_empty</refname>
755 <refpurpose>
756     check if a queue is empty
757 </refpurpose>
758</refnamediv>
759<refsynopsisdiv>
760 <title>Synopsis</title>
761  <funcsynopsis><funcprototype>
762   <funcdef>int <function>skb_queue_empty </function></funcdef>
763   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
764  </funcprototype></funcsynopsis>
765</refsynopsisdiv>
766<refsect1>
767 <title>Arguments</title>
768 <variablelist>
769  <varlistentry>
770   <term><parameter>list</parameter></term>
771   <listitem>
772    <para>
773     queue head
774    </para>
775   </listitem>
776  </varlistentry>
777 </variablelist>
778</refsect1>
779<refsect1>
780<title>Description</title>
781<para>
782   Returns true if the queue is empty, false otherwise.
783</para>
784</refsect1>
785</refentry>
786
787<refentry id="API-skb-queue-is-last">
788<refentryinfo>
789 <title>LINUX</title>
790 <productname>Kernel Hackers Manual</productname>
791 <date>July 2017</date>
792</refentryinfo>
793<refmeta>
794 <refentrytitle><phrase>skb_queue_is_last</phrase></refentrytitle>
795 <manvolnum>9</manvolnum>
796 <refmiscinfo class="version">4.1.27</refmiscinfo>
797</refmeta>
798<refnamediv>
799 <refname>skb_queue_is_last</refname>
800 <refpurpose>
801     check if skb is the last entry in the queue
802 </refpurpose>
803</refnamediv>
804<refsynopsisdiv>
805 <title>Synopsis</title>
806  <funcsynopsis><funcprototype>
807   <funcdef>bool <function>skb_queue_is_last </function></funcdef>
808   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
809   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
810  </funcprototype></funcsynopsis>
811</refsynopsisdiv>
812<refsect1>
813 <title>Arguments</title>
814 <variablelist>
815  <varlistentry>
816   <term><parameter>list</parameter></term>
817   <listitem>
818    <para>
819     queue head
820    </para>
821   </listitem>
822  </varlistentry>
823  <varlistentry>
824   <term><parameter>skb</parameter></term>
825   <listitem>
826    <para>
827     buffer
828    </para>
829   </listitem>
830  </varlistentry>
831 </variablelist>
832</refsect1>
833<refsect1>
834<title>Description</title>
835<para>
836   Returns true if <parameter>skb</parameter> is the last buffer on the list.
837</para>
838</refsect1>
839</refentry>
840
841<refentry id="API-skb-queue-is-first">
842<refentryinfo>
843 <title>LINUX</title>
844 <productname>Kernel Hackers Manual</productname>
845 <date>July 2017</date>
846</refentryinfo>
847<refmeta>
848 <refentrytitle><phrase>skb_queue_is_first</phrase></refentrytitle>
849 <manvolnum>9</manvolnum>
850 <refmiscinfo class="version">4.1.27</refmiscinfo>
851</refmeta>
852<refnamediv>
853 <refname>skb_queue_is_first</refname>
854 <refpurpose>
855     check if skb is the first entry in the queue
856 </refpurpose>
857</refnamediv>
858<refsynopsisdiv>
859 <title>Synopsis</title>
860  <funcsynopsis><funcprototype>
861   <funcdef>bool <function>skb_queue_is_first </function></funcdef>
862   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
863   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
864  </funcprototype></funcsynopsis>
865</refsynopsisdiv>
866<refsect1>
867 <title>Arguments</title>
868 <variablelist>
869  <varlistentry>
870   <term><parameter>list</parameter></term>
871   <listitem>
872    <para>
873     queue head
874    </para>
875   </listitem>
876  </varlistentry>
877  <varlistentry>
878   <term><parameter>skb</parameter></term>
879   <listitem>
880    <para>
881     buffer
882    </para>
883   </listitem>
884  </varlistentry>
885 </variablelist>
886</refsect1>
887<refsect1>
888<title>Description</title>
889<para>
890   Returns true if <parameter>skb</parameter> is the first buffer on the list.
891</para>
892</refsect1>
893</refentry>
894
895<refentry id="API-skb-queue-next">
896<refentryinfo>
897 <title>LINUX</title>
898 <productname>Kernel Hackers Manual</productname>
899 <date>July 2017</date>
900</refentryinfo>
901<refmeta>
902 <refentrytitle><phrase>skb_queue_next</phrase></refentrytitle>
903 <manvolnum>9</manvolnum>
904 <refmiscinfo class="version">4.1.27</refmiscinfo>
905</refmeta>
906<refnamediv>
907 <refname>skb_queue_next</refname>
908 <refpurpose>
909     return the next packet in the queue
910 </refpurpose>
911</refnamediv>
912<refsynopsisdiv>
913 <title>Synopsis</title>
914  <funcsynopsis><funcprototype>
915   <funcdef>struct sk_buff * <function>skb_queue_next </function></funcdef>
916   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
917   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
918  </funcprototype></funcsynopsis>
919</refsynopsisdiv>
920<refsect1>
921 <title>Arguments</title>
922 <variablelist>
923  <varlistentry>
924   <term><parameter>list</parameter></term>
925   <listitem>
926    <para>
927     queue head
928    </para>
929   </listitem>
930  </varlistentry>
931  <varlistentry>
932   <term><parameter>skb</parameter></term>
933   <listitem>
934    <para>
935     current buffer
936    </para>
937   </listitem>
938  </varlistentry>
939 </variablelist>
940</refsect1>
941<refsect1>
942<title>Description</title>
943<para>
944   Return the next packet in <parameter>list</parameter> after <parameter>skb</parameter>.  It is only valid to
945   call this if <function>skb_queue_is_last</function> evaluates to false.
946</para>
947</refsect1>
948</refentry>
949
950<refentry id="API-skb-queue-prev">
951<refentryinfo>
952 <title>LINUX</title>
953 <productname>Kernel Hackers Manual</productname>
954 <date>July 2017</date>
955</refentryinfo>
956<refmeta>
957 <refentrytitle><phrase>skb_queue_prev</phrase></refentrytitle>
958 <manvolnum>9</manvolnum>
959 <refmiscinfo class="version">4.1.27</refmiscinfo>
960</refmeta>
961<refnamediv>
962 <refname>skb_queue_prev</refname>
963 <refpurpose>
964     return the prev packet in the queue
965 </refpurpose>
966</refnamediv>
967<refsynopsisdiv>
968 <title>Synopsis</title>
969  <funcsynopsis><funcprototype>
970   <funcdef>struct sk_buff * <function>skb_queue_prev </function></funcdef>
971   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
972   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
973  </funcprototype></funcsynopsis>
974</refsynopsisdiv>
975<refsect1>
976 <title>Arguments</title>
977 <variablelist>
978  <varlistentry>
979   <term><parameter>list</parameter></term>
980   <listitem>
981    <para>
982     queue head
983    </para>
984   </listitem>
985  </varlistentry>
986  <varlistentry>
987   <term><parameter>skb</parameter></term>
988   <listitem>
989    <para>
990     current buffer
991    </para>
992   </listitem>
993  </varlistentry>
994 </variablelist>
995</refsect1>
996<refsect1>
997<title>Description</title>
998<para>
999   Return the prev packet in <parameter>list</parameter> before <parameter>skb</parameter>.  It is only valid to
1000   call this if <function>skb_queue_is_first</function> evaluates to false.
1001</para>
1002</refsect1>
1003</refentry>
1004
1005<refentry id="API-skb-get">
1006<refentryinfo>
1007 <title>LINUX</title>
1008 <productname>Kernel Hackers Manual</productname>
1009 <date>July 2017</date>
1010</refentryinfo>
1011<refmeta>
1012 <refentrytitle><phrase>skb_get</phrase></refentrytitle>
1013 <manvolnum>9</manvolnum>
1014 <refmiscinfo class="version">4.1.27</refmiscinfo>
1015</refmeta>
1016<refnamediv>
1017 <refname>skb_get</refname>
1018 <refpurpose>
1019     reference buffer
1020 </refpurpose>
1021</refnamediv>
1022<refsynopsisdiv>
1023 <title>Synopsis</title>
1024  <funcsynopsis><funcprototype>
1025   <funcdef>struct sk_buff * <function>skb_get </function></funcdef>
1026   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
1027  </funcprototype></funcsynopsis>
1028</refsynopsisdiv>
1029<refsect1>
1030 <title>Arguments</title>
1031 <variablelist>
1032  <varlistentry>
1033   <term><parameter>skb</parameter></term>
1034   <listitem>
1035    <para>
1036     buffer to reference
1037    </para>
1038   </listitem>
1039  </varlistentry>
1040 </variablelist>
1041</refsect1>
1042<refsect1>
1043<title>Description</title>
1044<para>
1045   Makes another reference to a socket buffer and returns a pointer
1046   to the buffer.
1047</para>
1048</refsect1>
1049</refentry>
1050
1051<refentry id="API-skb-cloned">
1052<refentryinfo>
1053 <title>LINUX</title>
1054 <productname>Kernel Hackers Manual</productname>
1055 <date>July 2017</date>
1056</refentryinfo>
1057<refmeta>
1058 <refentrytitle><phrase>skb_cloned</phrase></refentrytitle>
1059 <manvolnum>9</manvolnum>
1060 <refmiscinfo class="version">4.1.27</refmiscinfo>
1061</refmeta>
1062<refnamediv>
1063 <refname>skb_cloned</refname>
1064 <refpurpose>
1065     is the buffer a clone
1066 </refpurpose>
1067</refnamediv>
1068<refsynopsisdiv>
1069 <title>Synopsis</title>
1070  <funcsynopsis><funcprototype>
1071   <funcdef>int <function>skb_cloned </function></funcdef>
1072   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
1073  </funcprototype></funcsynopsis>
1074</refsynopsisdiv>
1075<refsect1>
1076 <title>Arguments</title>
1077 <variablelist>
1078  <varlistentry>
1079   <term><parameter>skb</parameter></term>
1080   <listitem>
1081    <para>
1082     buffer to check
1083    </para>
1084   </listitem>
1085  </varlistentry>
1086 </variablelist>
1087</refsect1>
1088<refsect1>
1089<title>Description</title>
1090<para>
1091   Returns true if the buffer was generated with <function>skb_clone</function> and is
1092   one of multiple shared copies of the buffer. Cloned buffers are
1093   shared data so must not be written to under normal circumstances.
1094</para>
1095</refsect1>
1096</refentry>
1097
1098<refentry id="API-skb-header-cloned">
1099<refentryinfo>
1100 <title>LINUX</title>
1101 <productname>Kernel Hackers Manual</productname>
1102 <date>July 2017</date>
1103</refentryinfo>
1104<refmeta>
1105 <refentrytitle><phrase>skb_header_cloned</phrase></refentrytitle>
1106 <manvolnum>9</manvolnum>
1107 <refmiscinfo class="version">4.1.27</refmiscinfo>
1108</refmeta>
1109<refnamediv>
1110 <refname>skb_header_cloned</refname>
1111 <refpurpose>
1112     is the header a clone
1113 </refpurpose>
1114</refnamediv>
1115<refsynopsisdiv>
1116 <title>Synopsis</title>
1117  <funcsynopsis><funcprototype>
1118   <funcdef>int <function>skb_header_cloned </function></funcdef>
1119   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
1120  </funcprototype></funcsynopsis>
1121</refsynopsisdiv>
1122<refsect1>
1123 <title>Arguments</title>
1124 <variablelist>
1125  <varlistentry>
1126   <term><parameter>skb</parameter></term>
1127   <listitem>
1128    <para>
1129     buffer to check
1130    </para>
1131   </listitem>
1132  </varlistentry>
1133 </variablelist>
1134</refsect1>
1135<refsect1>
1136<title>Description</title>
1137<para>
1138   Returns true if modifying the header part of the buffer requires
1139   the data to be copied.
1140</para>
1141</refsect1>
1142</refentry>
1143
1144<refentry id="API-skb-header-release">
1145<refentryinfo>
1146 <title>LINUX</title>
1147 <productname>Kernel Hackers Manual</productname>
1148 <date>July 2017</date>
1149</refentryinfo>
1150<refmeta>
1151 <refentrytitle><phrase>skb_header_release</phrase></refentrytitle>
1152 <manvolnum>9</manvolnum>
1153 <refmiscinfo class="version">4.1.27</refmiscinfo>
1154</refmeta>
1155<refnamediv>
1156 <refname>skb_header_release</refname>
1157 <refpurpose>
1158     release reference to header
1159 </refpurpose>
1160</refnamediv>
1161<refsynopsisdiv>
1162 <title>Synopsis</title>
1163  <funcsynopsis><funcprototype>
1164   <funcdef>void <function>skb_header_release </function></funcdef>
1165   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
1166  </funcprototype></funcsynopsis>
1167</refsynopsisdiv>
1168<refsect1>
1169 <title>Arguments</title>
1170 <variablelist>
1171  <varlistentry>
1172   <term><parameter>skb</parameter></term>
1173   <listitem>
1174    <para>
1175     buffer to operate on
1176    </para>
1177   </listitem>
1178  </varlistentry>
1179 </variablelist>
1180</refsect1>
1181<refsect1>
1182<title>Description</title>
1183<para>
1184   Drop a reference to the header part of the buffer.  This is done
1185   by acquiring a payload reference.  You must not read from the header
1186   part of skb-&gt;data after this.
1187</para>
1188</refsect1>
1189<refsect1>
1190<title>Note </title>
1191<para>
1192   Check if you can use <function>__skb_header_release</function> instead.
1193</para>
1194</refsect1>
1195</refentry>
1196
1197<refentry id="API---skb-header-release">
1198<refentryinfo>
1199 <title>LINUX</title>
1200 <productname>Kernel Hackers Manual</productname>
1201 <date>July 2017</date>
1202</refentryinfo>
1203<refmeta>
1204 <refentrytitle><phrase>__skb_header_release</phrase></refentrytitle>
1205 <manvolnum>9</manvolnum>
1206 <refmiscinfo class="version">4.1.27</refmiscinfo>
1207</refmeta>
1208<refnamediv>
1209 <refname>__skb_header_release</refname>
1210 <refpurpose>
1211     release reference to header
1212 </refpurpose>
1213</refnamediv>
1214<refsynopsisdiv>
1215 <title>Synopsis</title>
1216  <funcsynopsis><funcprototype>
1217   <funcdef>void <function>__skb_header_release </function></funcdef>
1218   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
1219  </funcprototype></funcsynopsis>
1220</refsynopsisdiv>
1221<refsect1>
1222 <title>Arguments</title>
1223 <variablelist>
1224  <varlistentry>
1225   <term><parameter>skb</parameter></term>
1226   <listitem>
1227    <para>
1228     buffer to operate on
1229    </para>
1230   </listitem>
1231  </varlistentry>
1232 </variablelist>
1233</refsect1>
1234<refsect1>
1235<title>Description</title>
1236<para>
1237   Variant of <function>skb_header_release</function> assuming skb is private to caller.
1238   We can avoid one atomic operation.
1239</para>
1240</refsect1>
1241</refentry>
1242
1243<refentry id="API-skb-shared">
1244<refentryinfo>
1245 <title>LINUX</title>
1246 <productname>Kernel Hackers Manual</productname>
1247 <date>July 2017</date>
1248</refentryinfo>
1249<refmeta>
1250 <refentrytitle><phrase>skb_shared</phrase></refentrytitle>
1251 <manvolnum>9</manvolnum>
1252 <refmiscinfo class="version">4.1.27</refmiscinfo>
1253</refmeta>
1254<refnamediv>
1255 <refname>skb_shared</refname>
1256 <refpurpose>
1257     is the buffer shared
1258 </refpurpose>
1259</refnamediv>
1260<refsynopsisdiv>
1261 <title>Synopsis</title>
1262  <funcsynopsis><funcprototype>
1263   <funcdef>int <function>skb_shared </function></funcdef>
1264   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
1265  </funcprototype></funcsynopsis>
1266</refsynopsisdiv>
1267<refsect1>
1268 <title>Arguments</title>
1269 <variablelist>
1270  <varlistentry>
1271   <term><parameter>skb</parameter></term>
1272   <listitem>
1273    <para>
1274     buffer to check
1275    </para>
1276   </listitem>
1277  </varlistentry>
1278 </variablelist>
1279</refsect1>
1280<refsect1>
1281<title>Description</title>
1282<para>
1283   Returns true if more than one person has a reference to this
1284   buffer.
1285</para>
1286</refsect1>
1287</refentry>
1288
1289<refentry id="API-skb-share-check">
1290<refentryinfo>
1291 <title>LINUX</title>
1292 <productname>Kernel Hackers Manual</productname>
1293 <date>July 2017</date>
1294</refentryinfo>
1295<refmeta>
1296 <refentrytitle><phrase>skb_share_check</phrase></refentrytitle>
1297 <manvolnum>9</manvolnum>
1298 <refmiscinfo class="version">4.1.27</refmiscinfo>
1299</refmeta>
1300<refnamediv>
1301 <refname>skb_share_check</refname>
1302 <refpurpose>
1303     check if buffer is shared and if so clone it
1304 </refpurpose>
1305</refnamediv>
1306<refsynopsisdiv>
1307 <title>Synopsis</title>
1308  <funcsynopsis><funcprototype>
1309   <funcdef>struct sk_buff * <function>skb_share_check </function></funcdef>
1310   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
1311   <paramdef>gfp_t <parameter>pri</parameter></paramdef>
1312  </funcprototype></funcsynopsis>
1313</refsynopsisdiv>
1314<refsect1>
1315 <title>Arguments</title>
1316 <variablelist>
1317  <varlistentry>
1318   <term><parameter>skb</parameter></term>
1319   <listitem>
1320    <para>
1321     buffer to check
1322    </para>
1323   </listitem>
1324  </varlistentry>
1325  <varlistentry>
1326   <term><parameter>pri</parameter></term>
1327   <listitem>
1328    <para>
1329     priority for memory allocation
1330    </para>
1331   </listitem>
1332  </varlistentry>
1333 </variablelist>
1334</refsect1>
1335<refsect1>
1336<title>Description</title>
1337<para>
1338   If the buffer is shared the buffer is cloned and the old copy
1339   drops a reference. A new clone with a single reference is returned.
1340   If the buffer is not shared the original buffer is returned. When
1341   being called from interrupt status or with spinlocks held pri must
1342   be GFP_ATOMIC.
1343   </para><para>
1344
1345   NULL is returned on a memory allocation failure.
1346</para>
1347</refsect1>
1348</refentry>
1349
1350<refentry id="API-skb-unshare">
1351<refentryinfo>
1352 <title>LINUX</title>
1353 <productname>Kernel Hackers Manual</productname>
1354 <date>July 2017</date>
1355</refentryinfo>
1356<refmeta>
1357 <refentrytitle><phrase>skb_unshare</phrase></refentrytitle>
1358 <manvolnum>9</manvolnum>
1359 <refmiscinfo class="version">4.1.27</refmiscinfo>
1360</refmeta>
1361<refnamediv>
1362 <refname>skb_unshare</refname>
1363 <refpurpose>
1364     make a copy of a shared buffer
1365 </refpurpose>
1366</refnamediv>
1367<refsynopsisdiv>
1368 <title>Synopsis</title>
1369  <funcsynopsis><funcprototype>
1370   <funcdef>struct sk_buff * <function>skb_unshare </function></funcdef>
1371   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
1372   <paramdef>gfp_t <parameter>pri</parameter></paramdef>
1373  </funcprototype></funcsynopsis>
1374</refsynopsisdiv>
1375<refsect1>
1376 <title>Arguments</title>
1377 <variablelist>
1378  <varlistentry>
1379   <term><parameter>skb</parameter></term>
1380   <listitem>
1381    <para>
1382     buffer to check
1383    </para>
1384   </listitem>
1385  </varlistentry>
1386  <varlistentry>
1387   <term><parameter>pri</parameter></term>
1388   <listitem>
1389    <para>
1390     priority for memory allocation
1391    </para>
1392   </listitem>
1393  </varlistentry>
1394 </variablelist>
1395</refsect1>
1396<refsect1>
1397<title>Description</title>
1398<para>
1399   If the socket buffer is a clone then this function creates a new
1400   copy of the data, drops a reference count on the old copy and returns
1401   the new copy with the reference count at 1. If the buffer is not a clone
1402   the original buffer is returned. When called with a spinlock held or
1403   from interrupt state <parameter>pri</parameter> must be <constant>GFP_ATOMIC</constant>
1404   </para><para>
1405
1406   <constant>NULL</constant> is returned on a memory allocation failure.
1407</para>
1408</refsect1>
1409</refentry>
1410
1411<refentry id="API-skb-peek">
1412<refentryinfo>
1413 <title>LINUX</title>
1414 <productname>Kernel Hackers Manual</productname>
1415 <date>July 2017</date>
1416</refentryinfo>
1417<refmeta>
1418 <refentrytitle><phrase>skb_peek</phrase></refentrytitle>
1419 <manvolnum>9</manvolnum>
1420 <refmiscinfo class="version">4.1.27</refmiscinfo>
1421</refmeta>
1422<refnamediv>
1423 <refname>skb_peek</refname>
1424 <refpurpose>
1425     peek at the head of an <structname>sk_buff_head</structname>
1426 </refpurpose>
1427</refnamediv>
1428<refsynopsisdiv>
1429 <title>Synopsis</title>
1430  <funcsynopsis><funcprototype>
1431   <funcdef>struct sk_buff * <function>skb_peek </function></funcdef>
1432   <paramdef>const struct sk_buff_head * <parameter>list_</parameter></paramdef>
1433  </funcprototype></funcsynopsis>
1434</refsynopsisdiv>
1435<refsect1>
1436 <title>Arguments</title>
1437 <variablelist>
1438  <varlistentry>
1439   <term><parameter>list_</parameter></term>
1440   <listitem>
1441    <para>
1442     list to peek at
1443    </para>
1444   </listitem>
1445  </varlistentry>
1446 </variablelist>
1447</refsect1>
1448<refsect1>
1449<title>Description</title>
1450<para>
1451   Peek an <structname>sk_buff</structname>. Unlike most other operations you _MUST_
1452   be careful with this one. A peek leaves the buffer on the
1453   list and someone else may run off with it. You must hold
1454   the appropriate locks or have a private queue to do this.
1455   </para><para>
1456
1457   Returns <constant>NULL</constant> for an empty list or a pointer to the head element.
1458   The reference count is not incremented and the reference is therefore
1459   volatile. Use with caution.
1460</para>
1461</refsect1>
1462</refentry>
1463
1464<refentry id="API-skb-peek-next">
1465<refentryinfo>
1466 <title>LINUX</title>
1467 <productname>Kernel Hackers Manual</productname>
1468 <date>July 2017</date>
1469</refentryinfo>
1470<refmeta>
1471 <refentrytitle><phrase>skb_peek_next</phrase></refentrytitle>
1472 <manvolnum>9</manvolnum>
1473 <refmiscinfo class="version">4.1.27</refmiscinfo>
1474</refmeta>
1475<refnamediv>
1476 <refname>skb_peek_next</refname>
1477 <refpurpose>
1478     peek skb following the given one from a queue
1479 </refpurpose>
1480</refnamediv>
1481<refsynopsisdiv>
1482 <title>Synopsis</title>
1483  <funcsynopsis><funcprototype>
1484   <funcdef>struct sk_buff * <function>skb_peek_next </function></funcdef>
1485   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
1486   <paramdef>const struct sk_buff_head * <parameter>list_</parameter></paramdef>
1487  </funcprototype></funcsynopsis>
1488</refsynopsisdiv>
1489<refsect1>
1490 <title>Arguments</title>
1491 <variablelist>
1492  <varlistentry>
1493   <term><parameter>skb</parameter></term>
1494   <listitem>
1495    <para>
1496     skb to start from
1497    </para>
1498   </listitem>
1499  </varlistentry>
1500  <varlistentry>
1501   <term><parameter>list_</parameter></term>
1502   <listitem>
1503    <para>
1504     list to peek at
1505    </para>
1506   </listitem>
1507  </varlistentry>
1508 </variablelist>
1509</refsect1>
1510<refsect1>
1511<title>Description</title>
1512<para>
1513   Returns <constant>NULL</constant> when the end of the list is met or a pointer to the
1514   next element. The reference count is not incremented and the
1515   reference is therefore volatile. Use with caution.
1516</para>
1517</refsect1>
1518</refentry>
1519
1520<refentry id="API-skb-peek-tail">
1521<refentryinfo>
1522 <title>LINUX</title>
1523 <productname>Kernel Hackers Manual</productname>
1524 <date>July 2017</date>
1525</refentryinfo>
1526<refmeta>
1527 <refentrytitle><phrase>skb_peek_tail</phrase></refentrytitle>
1528 <manvolnum>9</manvolnum>
1529 <refmiscinfo class="version">4.1.27</refmiscinfo>
1530</refmeta>
1531<refnamediv>
1532 <refname>skb_peek_tail</refname>
1533 <refpurpose>
1534     peek at the tail of an <structname>sk_buff_head</structname>
1535 </refpurpose>
1536</refnamediv>
1537<refsynopsisdiv>
1538 <title>Synopsis</title>
1539  <funcsynopsis><funcprototype>
1540   <funcdef>struct sk_buff * <function>skb_peek_tail </function></funcdef>
1541   <paramdef>const struct sk_buff_head * <parameter>list_</parameter></paramdef>
1542  </funcprototype></funcsynopsis>
1543</refsynopsisdiv>
1544<refsect1>
1545 <title>Arguments</title>
1546 <variablelist>
1547  <varlistentry>
1548   <term><parameter>list_</parameter></term>
1549   <listitem>
1550    <para>
1551     list to peek at
1552    </para>
1553   </listitem>
1554  </varlistentry>
1555 </variablelist>
1556</refsect1>
1557<refsect1>
1558<title>Description</title>
1559<para>
1560   Peek an <structname>sk_buff</structname>. Unlike most other operations you _MUST_
1561   be careful with this one. A peek leaves the buffer on the
1562   list and someone else may run off with it. You must hold
1563   the appropriate locks or have a private queue to do this.
1564   </para><para>
1565
1566   Returns <constant>NULL</constant> for an empty list or a pointer to the tail element.
1567   The reference count is not incremented and the reference is therefore
1568   volatile. Use with caution.
1569</para>
1570</refsect1>
1571</refentry>
1572
1573<refentry id="API-skb-queue-len">
1574<refentryinfo>
1575 <title>LINUX</title>
1576 <productname>Kernel Hackers Manual</productname>
1577 <date>July 2017</date>
1578</refentryinfo>
1579<refmeta>
1580 <refentrytitle><phrase>skb_queue_len</phrase></refentrytitle>
1581 <manvolnum>9</manvolnum>
1582 <refmiscinfo class="version">4.1.27</refmiscinfo>
1583</refmeta>
1584<refnamediv>
1585 <refname>skb_queue_len</refname>
1586 <refpurpose>
1587     get queue length
1588 </refpurpose>
1589</refnamediv>
1590<refsynopsisdiv>
1591 <title>Synopsis</title>
1592  <funcsynopsis><funcprototype>
1593   <funcdef>__u32 <function>skb_queue_len </function></funcdef>
1594   <paramdef>const struct sk_buff_head * <parameter>list_</parameter></paramdef>
1595  </funcprototype></funcsynopsis>
1596</refsynopsisdiv>
1597<refsect1>
1598 <title>Arguments</title>
1599 <variablelist>
1600  <varlistentry>
1601   <term><parameter>list_</parameter></term>
1602   <listitem>
1603    <para>
1604     list to measure
1605    </para>
1606   </listitem>
1607  </varlistentry>
1608 </variablelist>
1609</refsect1>
1610<refsect1>
1611<title>Description</title>
1612<para>
1613   Return the length of an <structname>sk_buff</structname> queue.
1614</para>
1615</refsect1>
1616</refentry>
1617
1618<refentry id="API---skb-queue-head-init">
1619<refentryinfo>
1620 <title>LINUX</title>
1621 <productname>Kernel Hackers Manual</productname>
1622 <date>July 2017</date>
1623</refentryinfo>
1624<refmeta>
1625 <refentrytitle><phrase>__skb_queue_head_init</phrase></refentrytitle>
1626 <manvolnum>9</manvolnum>
1627 <refmiscinfo class="version">4.1.27</refmiscinfo>
1628</refmeta>
1629<refnamediv>
1630 <refname>__skb_queue_head_init</refname>
1631 <refpurpose>
1632     initialize non-spinlock portions of sk_buff_head
1633 </refpurpose>
1634</refnamediv>
1635<refsynopsisdiv>
1636 <title>Synopsis</title>
1637  <funcsynopsis><funcprototype>
1638   <funcdef>void <function>__skb_queue_head_init </function></funcdef>
1639   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
1640  </funcprototype></funcsynopsis>
1641</refsynopsisdiv>
1642<refsect1>
1643 <title>Arguments</title>
1644 <variablelist>
1645  <varlistentry>
1646   <term><parameter>list</parameter></term>
1647   <listitem>
1648    <para>
1649     queue to initialize
1650    </para>
1651   </listitem>
1652  </varlistentry>
1653 </variablelist>
1654</refsect1>
1655<refsect1>
1656<title>Description</title>
1657<para>
1658   This initializes only the list and queue length aspects of
1659   an sk_buff_head object.  This allows to initialize the list
1660   aspects of an sk_buff_head without reinitializing things like
1661   the spinlock.  It can also be used for on-stack sk_buff_head
1662   objects where the spinlock is known to not be used.
1663</para>
1664</refsect1>
1665</refentry>
1666
1667<refentry id="API-skb-queue-splice">
1668<refentryinfo>
1669 <title>LINUX</title>
1670 <productname>Kernel Hackers Manual</productname>
1671 <date>July 2017</date>
1672</refentryinfo>
1673<refmeta>
1674 <refentrytitle><phrase>skb_queue_splice</phrase></refentrytitle>
1675 <manvolnum>9</manvolnum>
1676 <refmiscinfo class="version">4.1.27</refmiscinfo>
1677</refmeta>
1678<refnamediv>
1679 <refname>skb_queue_splice</refname>
1680 <refpurpose>
1681     join two skb lists, this is designed for stacks
1682 </refpurpose>
1683</refnamediv>
1684<refsynopsisdiv>
1685 <title>Synopsis</title>
1686  <funcsynopsis><funcprototype>
1687   <funcdef>void <function>skb_queue_splice </function></funcdef>
1688   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
1689   <paramdef>struct sk_buff_head * <parameter>head</parameter></paramdef>
1690  </funcprototype></funcsynopsis>
1691</refsynopsisdiv>
1692<refsect1>
1693 <title>Arguments</title>
1694 <variablelist>
1695  <varlistentry>
1696   <term><parameter>list</parameter></term>
1697   <listitem>
1698    <para>
1699     the new list to add
1700    </para>
1701   </listitem>
1702  </varlistentry>
1703  <varlistentry>
1704   <term><parameter>head</parameter></term>
1705   <listitem>
1706    <para>
1707     the place to add it in the first list
1708    </para>
1709   </listitem>
1710  </varlistentry>
1711 </variablelist>
1712</refsect1>
1713</refentry>
1714
1715<refentry id="API-skb-queue-splice-init">
1716<refentryinfo>
1717 <title>LINUX</title>
1718 <productname>Kernel Hackers Manual</productname>
1719 <date>July 2017</date>
1720</refentryinfo>
1721<refmeta>
1722 <refentrytitle><phrase>skb_queue_splice_init</phrase></refentrytitle>
1723 <manvolnum>9</manvolnum>
1724 <refmiscinfo class="version">4.1.27</refmiscinfo>
1725</refmeta>
1726<refnamediv>
1727 <refname>skb_queue_splice_init</refname>
1728 <refpurpose>
1729     join two skb lists and reinitialise the emptied list
1730 </refpurpose>
1731</refnamediv>
1732<refsynopsisdiv>
1733 <title>Synopsis</title>
1734  <funcsynopsis><funcprototype>
1735   <funcdef>void <function>skb_queue_splice_init </function></funcdef>
1736   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
1737   <paramdef>struct sk_buff_head * <parameter>head</parameter></paramdef>
1738  </funcprototype></funcsynopsis>
1739</refsynopsisdiv>
1740<refsect1>
1741 <title>Arguments</title>
1742 <variablelist>
1743  <varlistentry>
1744   <term><parameter>list</parameter></term>
1745   <listitem>
1746    <para>
1747     the new list to add
1748    </para>
1749   </listitem>
1750  </varlistentry>
1751  <varlistentry>
1752   <term><parameter>head</parameter></term>
1753   <listitem>
1754    <para>
1755     the place to add it in the first list
1756    </para>
1757   </listitem>
1758  </varlistentry>
1759 </variablelist>
1760</refsect1>
1761<refsect1>
1762<title>Description</title>
1763<para>
1764   The list at <parameter>list</parameter> is reinitialised
1765</para>
1766</refsect1>
1767</refentry>
1768
1769<refentry id="API-skb-queue-splice-tail">
1770<refentryinfo>
1771 <title>LINUX</title>
1772 <productname>Kernel Hackers Manual</productname>
1773 <date>July 2017</date>
1774</refentryinfo>
1775<refmeta>
1776 <refentrytitle><phrase>skb_queue_splice_tail</phrase></refentrytitle>
1777 <manvolnum>9</manvolnum>
1778 <refmiscinfo class="version">4.1.27</refmiscinfo>
1779</refmeta>
1780<refnamediv>
1781 <refname>skb_queue_splice_tail</refname>
1782 <refpurpose>
1783     join two skb lists, each list being a queue
1784 </refpurpose>
1785</refnamediv>
1786<refsynopsisdiv>
1787 <title>Synopsis</title>
1788  <funcsynopsis><funcprototype>
1789   <funcdef>void <function>skb_queue_splice_tail </function></funcdef>
1790   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
1791   <paramdef>struct sk_buff_head * <parameter>head</parameter></paramdef>
1792  </funcprototype></funcsynopsis>
1793</refsynopsisdiv>
1794<refsect1>
1795 <title>Arguments</title>
1796 <variablelist>
1797  <varlistentry>
1798   <term><parameter>list</parameter></term>
1799   <listitem>
1800    <para>
1801     the new list to add
1802    </para>
1803   </listitem>
1804  </varlistentry>
1805  <varlistentry>
1806   <term><parameter>head</parameter></term>
1807   <listitem>
1808    <para>
1809     the place to add it in the first list
1810    </para>
1811   </listitem>
1812  </varlistentry>
1813 </variablelist>
1814</refsect1>
1815</refentry>
1816
1817<refentry id="API-skb-queue-splice-tail-init">
1818<refentryinfo>
1819 <title>LINUX</title>
1820 <productname>Kernel Hackers Manual</productname>
1821 <date>July 2017</date>
1822</refentryinfo>
1823<refmeta>
1824 <refentrytitle><phrase>skb_queue_splice_tail_init</phrase></refentrytitle>
1825 <manvolnum>9</manvolnum>
1826 <refmiscinfo class="version">4.1.27</refmiscinfo>
1827</refmeta>
1828<refnamediv>
1829 <refname>skb_queue_splice_tail_init</refname>
1830 <refpurpose>
1831     join two skb lists and reinitialise the emptied list
1832 </refpurpose>
1833</refnamediv>
1834<refsynopsisdiv>
1835 <title>Synopsis</title>
1836  <funcsynopsis><funcprototype>
1837   <funcdef>void <function>skb_queue_splice_tail_init </function></funcdef>
1838   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
1839   <paramdef>struct sk_buff_head * <parameter>head</parameter></paramdef>
1840  </funcprototype></funcsynopsis>
1841</refsynopsisdiv>
1842<refsect1>
1843 <title>Arguments</title>
1844 <variablelist>
1845  <varlistentry>
1846   <term><parameter>list</parameter></term>
1847   <listitem>
1848    <para>
1849     the new list to add
1850    </para>
1851   </listitem>
1852  </varlistentry>
1853  <varlistentry>
1854   <term><parameter>head</parameter></term>
1855   <listitem>
1856    <para>
1857     the place to add it in the first list
1858    </para>
1859   </listitem>
1860  </varlistentry>
1861 </variablelist>
1862</refsect1>
1863<refsect1>
1864<title>Description</title>
1865<para>
1866   Each of the lists is a queue.
1867   The list at <parameter>list</parameter> is reinitialised
1868</para>
1869</refsect1>
1870</refentry>
1871
1872<refentry id="API---skb-queue-after">
1873<refentryinfo>
1874 <title>LINUX</title>
1875 <productname>Kernel Hackers Manual</productname>
1876 <date>July 2017</date>
1877</refentryinfo>
1878<refmeta>
1879 <refentrytitle><phrase>__skb_queue_after</phrase></refentrytitle>
1880 <manvolnum>9</manvolnum>
1881 <refmiscinfo class="version">4.1.27</refmiscinfo>
1882</refmeta>
1883<refnamediv>
1884 <refname>__skb_queue_after</refname>
1885 <refpurpose>
1886     queue a buffer at the list head
1887 </refpurpose>
1888</refnamediv>
1889<refsynopsisdiv>
1890 <title>Synopsis</title>
1891  <funcsynopsis><funcprototype>
1892   <funcdef>void <function>__skb_queue_after </function></funcdef>
1893   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
1894   <paramdef>struct sk_buff * <parameter>prev</parameter></paramdef>
1895   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
1896  </funcprototype></funcsynopsis>
1897</refsynopsisdiv>
1898<refsect1>
1899 <title>Arguments</title>
1900 <variablelist>
1901  <varlistentry>
1902   <term><parameter>list</parameter></term>
1903   <listitem>
1904    <para>
1905     list to use
1906    </para>
1907   </listitem>
1908  </varlistentry>
1909  <varlistentry>
1910   <term><parameter>prev</parameter></term>
1911   <listitem>
1912    <para>
1913     place after this buffer
1914    </para>
1915   </listitem>
1916  </varlistentry>
1917  <varlistentry>
1918   <term><parameter>newsk</parameter></term>
1919   <listitem>
1920    <para>
1921     buffer to queue
1922    </para>
1923   </listitem>
1924  </varlistentry>
1925 </variablelist>
1926</refsect1>
1927<refsect1>
1928<title>Description</title>
1929<para>
1930   Queue a buffer int the middle of a list. This function takes no locks
1931   and you must therefore hold required locks before calling it.
1932   </para><para>
1933
1934   A buffer cannot be placed on two lists at the same time.
1935</para>
1936</refsect1>
1937</refentry>
1938
1939<refentry id="API---skb-fill-page-desc">
1940<refentryinfo>
1941 <title>LINUX</title>
1942 <productname>Kernel Hackers Manual</productname>
1943 <date>July 2017</date>
1944</refentryinfo>
1945<refmeta>
1946 <refentrytitle><phrase>__skb_fill_page_desc</phrase></refentrytitle>
1947 <manvolnum>9</manvolnum>
1948 <refmiscinfo class="version">4.1.27</refmiscinfo>
1949</refmeta>
1950<refnamediv>
1951 <refname>__skb_fill_page_desc</refname>
1952 <refpurpose>
1953     initialise a paged fragment in an skb
1954 </refpurpose>
1955</refnamediv>
1956<refsynopsisdiv>
1957 <title>Synopsis</title>
1958  <funcsynopsis><funcprototype>
1959   <funcdef>void <function>__skb_fill_page_desc </function></funcdef>
1960   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
1961   <paramdef>int <parameter>i</parameter></paramdef>
1962   <paramdef>struct page * <parameter>page</parameter></paramdef>
1963   <paramdef>int <parameter>off</parameter></paramdef>
1964   <paramdef>int <parameter>size</parameter></paramdef>
1965  </funcprototype></funcsynopsis>
1966</refsynopsisdiv>
1967<refsect1>
1968 <title>Arguments</title>
1969 <variablelist>
1970  <varlistentry>
1971   <term><parameter>skb</parameter></term>
1972   <listitem>
1973    <para>
1974     buffer containing fragment to be initialised
1975    </para>
1976   </listitem>
1977  </varlistentry>
1978  <varlistentry>
1979   <term><parameter>i</parameter></term>
1980   <listitem>
1981    <para>
1982     paged fragment index to initialise
1983    </para>
1984   </listitem>
1985  </varlistentry>
1986  <varlistentry>
1987   <term><parameter>page</parameter></term>
1988   <listitem>
1989    <para>
1990     the page to use for this fragment
1991    </para>
1992   </listitem>
1993  </varlistentry>
1994  <varlistentry>
1995   <term><parameter>off</parameter></term>
1996   <listitem>
1997    <para>
1998     the offset to the data with <parameter>page</parameter>
1999    </para>
2000   </listitem>
2001  </varlistentry>
2002  <varlistentry>
2003   <term><parameter>size</parameter></term>
2004   <listitem>
2005    <para>
2006     the length of the data
2007    </para>
2008   </listitem>
2009  </varlistentry>
2010 </variablelist>
2011</refsect1>
2012<refsect1>
2013<title>Description</title>
2014<para>
2015   Initialises the <parameter>i</parameter>'th fragment of <parameter>skb</parameter> to point to <structname>size</structname> bytes at
2016   offset <parameter>off</parameter> within <parameter>page</parameter>.
2017   </para><para>
2018
2019   Does not take any additional reference on the fragment.
2020</para>
2021</refsect1>
2022</refentry>
2023
2024<refentry id="API-skb-fill-page-desc">
2025<refentryinfo>
2026 <title>LINUX</title>
2027 <productname>Kernel Hackers Manual</productname>
2028 <date>July 2017</date>
2029</refentryinfo>
2030<refmeta>
2031 <refentrytitle><phrase>skb_fill_page_desc</phrase></refentrytitle>
2032 <manvolnum>9</manvolnum>
2033 <refmiscinfo class="version">4.1.27</refmiscinfo>
2034</refmeta>
2035<refnamediv>
2036 <refname>skb_fill_page_desc</refname>
2037 <refpurpose>
2038     initialise a paged fragment in an skb
2039 </refpurpose>
2040</refnamediv>
2041<refsynopsisdiv>
2042 <title>Synopsis</title>
2043  <funcsynopsis><funcprototype>
2044   <funcdef>void <function>skb_fill_page_desc </function></funcdef>
2045   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2046   <paramdef>int <parameter>i</parameter></paramdef>
2047   <paramdef>struct page * <parameter>page</parameter></paramdef>
2048   <paramdef>int <parameter>off</parameter></paramdef>
2049   <paramdef>int <parameter>size</parameter></paramdef>
2050  </funcprototype></funcsynopsis>
2051</refsynopsisdiv>
2052<refsect1>
2053 <title>Arguments</title>
2054 <variablelist>
2055  <varlistentry>
2056   <term><parameter>skb</parameter></term>
2057   <listitem>
2058    <para>
2059     buffer containing fragment to be initialised
2060    </para>
2061   </listitem>
2062  </varlistentry>
2063  <varlistentry>
2064   <term><parameter>i</parameter></term>
2065   <listitem>
2066    <para>
2067     paged fragment index to initialise
2068    </para>
2069   </listitem>
2070  </varlistentry>
2071  <varlistentry>
2072   <term><parameter>page</parameter></term>
2073   <listitem>
2074    <para>
2075     the page to use for this fragment
2076    </para>
2077   </listitem>
2078  </varlistentry>
2079  <varlistentry>
2080   <term><parameter>off</parameter></term>
2081   <listitem>
2082    <para>
2083     the offset to the data with <parameter>page</parameter>
2084    </para>
2085   </listitem>
2086  </varlistentry>
2087  <varlistentry>
2088   <term><parameter>size</parameter></term>
2089   <listitem>
2090    <para>
2091     the length of the data
2092    </para>
2093   </listitem>
2094  </varlistentry>
2095 </variablelist>
2096</refsect1>
2097<refsect1>
2098<title>Description</title>
2099<para>
2100   As per <function>__skb_fill_page_desc</function> -- initialises the <parameter>i</parameter>'th fragment of
2101   <parameter>skb</parameter> to point to <parameter>size</parameter> bytes at offset <parameter>off</parameter> within <parameter>page</parameter>. In
2102   addition updates <parameter>skb</parameter> such that <parameter>i</parameter> is the last fragment.
2103   </para><para>
2104
2105   Does not take any additional reference on the fragment.
2106</para>
2107</refsect1>
2108</refentry>
2109
2110<refentry id="API-skb-headroom">
2111<refentryinfo>
2112 <title>LINUX</title>
2113 <productname>Kernel Hackers Manual</productname>
2114 <date>July 2017</date>
2115</refentryinfo>
2116<refmeta>
2117 <refentrytitle><phrase>skb_headroom</phrase></refentrytitle>
2118 <manvolnum>9</manvolnum>
2119 <refmiscinfo class="version">4.1.27</refmiscinfo>
2120</refmeta>
2121<refnamediv>
2122 <refname>skb_headroom</refname>
2123 <refpurpose>
2124     bytes at buffer head
2125 </refpurpose>
2126</refnamediv>
2127<refsynopsisdiv>
2128 <title>Synopsis</title>
2129  <funcsynopsis><funcprototype>
2130   <funcdef>unsigned int <function>skb_headroom </function></funcdef>
2131   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
2132  </funcprototype></funcsynopsis>
2133</refsynopsisdiv>
2134<refsect1>
2135 <title>Arguments</title>
2136 <variablelist>
2137  <varlistentry>
2138   <term><parameter>skb</parameter></term>
2139   <listitem>
2140    <para>
2141     buffer to check
2142    </para>
2143   </listitem>
2144  </varlistentry>
2145 </variablelist>
2146</refsect1>
2147<refsect1>
2148<title>Description</title>
2149<para>
2150   Return the number of bytes of free space at the head of an <structname>sk_buff</structname>.
2151</para>
2152</refsect1>
2153</refentry>
2154
2155<refentry id="API-skb-tailroom">
2156<refentryinfo>
2157 <title>LINUX</title>
2158 <productname>Kernel Hackers Manual</productname>
2159 <date>July 2017</date>
2160</refentryinfo>
2161<refmeta>
2162 <refentrytitle><phrase>skb_tailroom</phrase></refentrytitle>
2163 <manvolnum>9</manvolnum>
2164 <refmiscinfo class="version">4.1.27</refmiscinfo>
2165</refmeta>
2166<refnamediv>
2167 <refname>skb_tailroom</refname>
2168 <refpurpose>
2169     bytes at buffer end
2170 </refpurpose>
2171</refnamediv>
2172<refsynopsisdiv>
2173 <title>Synopsis</title>
2174  <funcsynopsis><funcprototype>
2175   <funcdef>int <function>skb_tailroom </function></funcdef>
2176   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
2177  </funcprototype></funcsynopsis>
2178</refsynopsisdiv>
2179<refsect1>
2180 <title>Arguments</title>
2181 <variablelist>
2182  <varlistentry>
2183   <term><parameter>skb</parameter></term>
2184   <listitem>
2185    <para>
2186     buffer to check
2187    </para>
2188   </listitem>
2189  </varlistentry>
2190 </variablelist>
2191</refsect1>
2192<refsect1>
2193<title>Description</title>
2194<para>
2195   Return the number of bytes of free space at the tail of an sk_buff
2196</para>
2197</refsect1>
2198</refentry>
2199
2200<refentry id="API-skb-availroom">
2201<refentryinfo>
2202 <title>LINUX</title>
2203 <productname>Kernel Hackers Manual</productname>
2204 <date>July 2017</date>
2205</refentryinfo>
2206<refmeta>
2207 <refentrytitle><phrase>skb_availroom</phrase></refentrytitle>
2208 <manvolnum>9</manvolnum>
2209 <refmiscinfo class="version">4.1.27</refmiscinfo>
2210</refmeta>
2211<refnamediv>
2212 <refname>skb_availroom</refname>
2213 <refpurpose>
2214     bytes at buffer end
2215 </refpurpose>
2216</refnamediv>
2217<refsynopsisdiv>
2218 <title>Synopsis</title>
2219  <funcsynopsis><funcprototype>
2220   <funcdef>int <function>skb_availroom </function></funcdef>
2221   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
2222  </funcprototype></funcsynopsis>
2223</refsynopsisdiv>
2224<refsect1>
2225 <title>Arguments</title>
2226 <variablelist>
2227  <varlistentry>
2228   <term><parameter>skb</parameter></term>
2229   <listitem>
2230    <para>
2231     buffer to check
2232    </para>
2233   </listitem>
2234  </varlistentry>
2235 </variablelist>
2236</refsect1>
2237<refsect1>
2238<title>Description</title>
2239<para>
2240   Return the number of bytes of free space at the tail of an sk_buff
2241   allocated by <function>sk_stream_alloc</function>
2242</para>
2243</refsect1>
2244</refentry>
2245
2246<refentry id="API-skb-reserve">
2247<refentryinfo>
2248 <title>LINUX</title>
2249 <productname>Kernel Hackers Manual</productname>
2250 <date>July 2017</date>
2251</refentryinfo>
2252<refmeta>
2253 <refentrytitle><phrase>skb_reserve</phrase></refentrytitle>
2254 <manvolnum>9</manvolnum>
2255 <refmiscinfo class="version">4.1.27</refmiscinfo>
2256</refmeta>
2257<refnamediv>
2258 <refname>skb_reserve</refname>
2259 <refpurpose>
2260     adjust headroom
2261 </refpurpose>
2262</refnamediv>
2263<refsynopsisdiv>
2264 <title>Synopsis</title>
2265  <funcsynopsis><funcprototype>
2266   <funcdef>void <function>skb_reserve </function></funcdef>
2267   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2268   <paramdef>int <parameter>len</parameter></paramdef>
2269  </funcprototype></funcsynopsis>
2270</refsynopsisdiv>
2271<refsect1>
2272 <title>Arguments</title>
2273 <variablelist>
2274  <varlistentry>
2275   <term><parameter>skb</parameter></term>
2276   <listitem>
2277    <para>
2278     buffer to alter
2279    </para>
2280   </listitem>
2281  </varlistentry>
2282  <varlistentry>
2283   <term><parameter>len</parameter></term>
2284   <listitem>
2285    <para>
2286     bytes to move
2287    </para>
2288   </listitem>
2289  </varlistentry>
2290 </variablelist>
2291</refsect1>
2292<refsect1>
2293<title>Description</title>
2294<para>
2295   Increase the headroom of an empty <structname>sk_buff</structname> by reducing the tail
2296   room. This is only allowed for an empty buffer.
2297</para>
2298</refsect1>
2299</refentry>
2300
2301<refentry id="API-pskb-trim-unique">
2302<refentryinfo>
2303 <title>LINUX</title>
2304 <productname>Kernel Hackers Manual</productname>
2305 <date>July 2017</date>
2306</refentryinfo>
2307<refmeta>
2308 <refentrytitle><phrase>pskb_trim_unique</phrase></refentrytitle>
2309 <manvolnum>9</manvolnum>
2310 <refmiscinfo class="version">4.1.27</refmiscinfo>
2311</refmeta>
2312<refnamediv>
2313 <refname>pskb_trim_unique</refname>
2314 <refpurpose>
2315     remove end from a paged unique (not cloned) buffer
2316 </refpurpose>
2317</refnamediv>
2318<refsynopsisdiv>
2319 <title>Synopsis</title>
2320  <funcsynopsis><funcprototype>
2321   <funcdef>void <function>pskb_trim_unique </function></funcdef>
2322   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2323   <paramdef>unsigned int <parameter>len</parameter></paramdef>
2324  </funcprototype></funcsynopsis>
2325</refsynopsisdiv>
2326<refsect1>
2327 <title>Arguments</title>
2328 <variablelist>
2329  <varlistentry>
2330   <term><parameter>skb</parameter></term>
2331   <listitem>
2332    <para>
2333     buffer to alter
2334    </para>
2335   </listitem>
2336  </varlistentry>
2337  <varlistentry>
2338   <term><parameter>len</parameter></term>
2339   <listitem>
2340    <para>
2341     new length
2342    </para>
2343   </listitem>
2344  </varlistentry>
2345 </variablelist>
2346</refsect1>
2347<refsect1>
2348<title>Description</title>
2349<para>
2350   This is identical to pskb_trim except that the caller knows that
2351   the skb is not cloned so we should never get an error due to out-
2352   of-memory.
2353</para>
2354</refsect1>
2355</refentry>
2356
2357<refentry id="API-skb-orphan">
2358<refentryinfo>
2359 <title>LINUX</title>
2360 <productname>Kernel Hackers Manual</productname>
2361 <date>July 2017</date>
2362</refentryinfo>
2363<refmeta>
2364 <refentrytitle><phrase>skb_orphan</phrase></refentrytitle>
2365 <manvolnum>9</manvolnum>
2366 <refmiscinfo class="version">4.1.27</refmiscinfo>
2367</refmeta>
2368<refnamediv>
2369 <refname>skb_orphan</refname>
2370 <refpurpose>
2371     orphan a buffer
2372 </refpurpose>
2373</refnamediv>
2374<refsynopsisdiv>
2375 <title>Synopsis</title>
2376  <funcsynopsis><funcprototype>
2377   <funcdef>void <function>skb_orphan </function></funcdef>
2378   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2379  </funcprototype></funcsynopsis>
2380</refsynopsisdiv>
2381<refsect1>
2382 <title>Arguments</title>
2383 <variablelist>
2384  <varlistentry>
2385   <term><parameter>skb</parameter></term>
2386   <listitem>
2387    <para>
2388     buffer to orphan
2389    </para>
2390   </listitem>
2391  </varlistentry>
2392 </variablelist>
2393</refsect1>
2394<refsect1>
2395<title>Description</title>
2396<para>
2397   If a buffer currently has an owner then we call the owner's
2398   destructor function and make the <parameter>skb</parameter> unowned. The buffer continues
2399   to exist but is no longer charged to its former owner.
2400</para>
2401</refsect1>
2402</refentry>
2403
2404<refentry id="API-skb-orphan-frags">
2405<refentryinfo>
2406 <title>LINUX</title>
2407 <productname>Kernel Hackers Manual</productname>
2408 <date>July 2017</date>
2409</refentryinfo>
2410<refmeta>
2411 <refentrytitle><phrase>skb_orphan_frags</phrase></refentrytitle>
2412 <manvolnum>9</manvolnum>
2413 <refmiscinfo class="version">4.1.27</refmiscinfo>
2414</refmeta>
2415<refnamediv>
2416 <refname>skb_orphan_frags</refname>
2417 <refpurpose>
2418     orphan the frags contained in a buffer
2419 </refpurpose>
2420</refnamediv>
2421<refsynopsisdiv>
2422 <title>Synopsis</title>
2423  <funcsynopsis><funcprototype>
2424   <funcdef>int <function>skb_orphan_frags </function></funcdef>
2425   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2426   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
2427  </funcprototype></funcsynopsis>
2428</refsynopsisdiv>
2429<refsect1>
2430 <title>Arguments</title>
2431 <variablelist>
2432  <varlistentry>
2433   <term><parameter>skb</parameter></term>
2434   <listitem>
2435    <para>
2436     buffer to orphan frags from
2437    </para>
2438   </listitem>
2439  </varlistentry>
2440  <varlistentry>
2441   <term><parameter>gfp_mask</parameter></term>
2442   <listitem>
2443    <para>
2444     allocation mask for replacement pages
2445    </para>
2446   </listitem>
2447  </varlistentry>
2448 </variablelist>
2449</refsect1>
2450<refsect1>
2451<title>Description</title>
2452<para>
2453   For each frag in the SKB which needs a destructor (i.e. has an
2454   owner) create a copy of that frag and release the original
2455   page by calling the destructor.
2456</para>
2457</refsect1>
2458</refentry>
2459
2460<refentry id="API-netdev-alloc-skb">
2461<refentryinfo>
2462 <title>LINUX</title>
2463 <productname>Kernel Hackers Manual</productname>
2464 <date>July 2017</date>
2465</refentryinfo>
2466<refmeta>
2467 <refentrytitle><phrase>netdev_alloc_skb</phrase></refentrytitle>
2468 <manvolnum>9</manvolnum>
2469 <refmiscinfo class="version">4.1.27</refmiscinfo>
2470</refmeta>
2471<refnamediv>
2472 <refname>netdev_alloc_skb</refname>
2473 <refpurpose>
2474     allocate an skbuff for rx on a specific device
2475 </refpurpose>
2476</refnamediv>
2477<refsynopsisdiv>
2478 <title>Synopsis</title>
2479  <funcsynopsis><funcprototype>
2480   <funcdef>struct sk_buff * <function>netdev_alloc_skb </function></funcdef>
2481   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
2482   <paramdef>unsigned int <parameter>length</parameter></paramdef>
2483  </funcprototype></funcsynopsis>
2484</refsynopsisdiv>
2485<refsect1>
2486 <title>Arguments</title>
2487 <variablelist>
2488  <varlistentry>
2489   <term><parameter>dev</parameter></term>
2490   <listitem>
2491    <para>
2492     network device to receive on
2493    </para>
2494   </listitem>
2495  </varlistentry>
2496  <varlistentry>
2497   <term><parameter>length</parameter></term>
2498   <listitem>
2499    <para>
2500     length to allocate
2501    </para>
2502   </listitem>
2503  </varlistentry>
2504 </variablelist>
2505</refsect1>
2506<refsect1>
2507<title>Description</title>
2508<para>
2509   Allocate a new <structname>sk_buff</structname> and assign it a usage count of one. The
2510   buffer has unspecified headroom built in. Users should allocate
2511   the headroom they think they need without accounting for the
2512   built in space. The built in space is used for optimisations.
2513   </para><para>
2514
2515   <constant>NULL</constant> is returned if there is no free memory. Although this function
2516   allocates memory it can be called from an interrupt.
2517</para>
2518</refsect1>
2519</refentry>
2520
2521<refentry id="API---dev-alloc-pages">
2522<refentryinfo>
2523 <title>LINUX</title>
2524 <productname>Kernel Hackers Manual</productname>
2525 <date>July 2017</date>
2526</refentryinfo>
2527<refmeta>
2528 <refentrytitle><phrase>__dev_alloc_pages</phrase></refentrytitle>
2529 <manvolnum>9</manvolnum>
2530 <refmiscinfo class="version">4.1.27</refmiscinfo>
2531</refmeta>
2532<refnamediv>
2533 <refname>__dev_alloc_pages</refname>
2534 <refpurpose>
2535     allocate page for network Rx
2536 </refpurpose>
2537</refnamediv>
2538<refsynopsisdiv>
2539 <title>Synopsis</title>
2540  <funcsynopsis><funcprototype>
2541   <funcdef>struct page * <function>__dev_alloc_pages </function></funcdef>
2542   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
2543   <paramdef>unsigned int <parameter>order</parameter></paramdef>
2544  </funcprototype></funcsynopsis>
2545</refsynopsisdiv>
2546<refsect1>
2547 <title>Arguments</title>
2548 <variablelist>
2549  <varlistentry>
2550   <term><parameter>gfp_mask</parameter></term>
2551   <listitem>
2552    <para>
2553     allocation priority. Set __GFP_NOMEMALLOC if not for network Rx
2554    </para>
2555   </listitem>
2556  </varlistentry>
2557  <varlistentry>
2558   <term><parameter>order</parameter></term>
2559   <listitem>
2560    <para>
2561     size of the allocation
2562    </para>
2563   </listitem>
2564  </varlistentry>
2565 </variablelist>
2566</refsect1>
2567<refsect1>
2568<title>Description</title>
2569<para>
2570   Allocate a new page.
2571   </para><para>
2572
2573   <constant>NULL</constant> is returned if there is no free memory.
2574</para>
2575</refsect1>
2576</refentry>
2577
2578<refentry id="API---dev-alloc-page">
2579<refentryinfo>
2580 <title>LINUX</title>
2581 <productname>Kernel Hackers Manual</productname>
2582 <date>July 2017</date>
2583</refentryinfo>
2584<refmeta>
2585 <refentrytitle><phrase>__dev_alloc_page</phrase></refentrytitle>
2586 <manvolnum>9</manvolnum>
2587 <refmiscinfo class="version">4.1.27</refmiscinfo>
2588</refmeta>
2589<refnamediv>
2590 <refname>__dev_alloc_page</refname>
2591 <refpurpose>
2592     allocate a page for network Rx
2593 </refpurpose>
2594</refnamediv>
2595<refsynopsisdiv>
2596 <title>Synopsis</title>
2597  <funcsynopsis><funcprototype>
2598   <funcdef>struct page * <function>__dev_alloc_page </function></funcdef>
2599   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
2600  </funcprototype></funcsynopsis>
2601</refsynopsisdiv>
2602<refsect1>
2603 <title>Arguments</title>
2604 <variablelist>
2605  <varlistentry>
2606   <term><parameter>gfp_mask</parameter></term>
2607   <listitem>
2608    <para>
2609     allocation priority. Set __GFP_NOMEMALLOC if not for network Rx
2610    </para>
2611   </listitem>
2612  </varlistentry>
2613 </variablelist>
2614</refsect1>
2615<refsect1>
2616<title>Description</title>
2617<para>
2618   Allocate a new page.
2619   </para><para>
2620
2621   <constant>NULL</constant> is returned if there is no free memory.
2622</para>
2623</refsect1>
2624</refentry>
2625
2626<refentry id="API-skb-propagate-pfmemalloc">
2627<refentryinfo>
2628 <title>LINUX</title>
2629 <productname>Kernel Hackers Manual</productname>
2630 <date>July 2017</date>
2631</refentryinfo>
2632<refmeta>
2633 <refentrytitle><phrase>skb_propagate_pfmemalloc</phrase></refentrytitle>
2634 <manvolnum>9</manvolnum>
2635 <refmiscinfo class="version">4.1.27</refmiscinfo>
2636</refmeta>
2637<refnamediv>
2638 <refname>skb_propagate_pfmemalloc</refname>
2639 <refpurpose>
2640     Propagate pfmemalloc if skb is allocated after RX page
2641 </refpurpose>
2642</refnamediv>
2643<refsynopsisdiv>
2644 <title>Synopsis</title>
2645  <funcsynopsis><funcprototype>
2646   <funcdef>void <function>skb_propagate_pfmemalloc </function></funcdef>
2647   <paramdef>struct page * <parameter>page</parameter></paramdef>
2648   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2649  </funcprototype></funcsynopsis>
2650</refsynopsisdiv>
2651<refsect1>
2652 <title>Arguments</title>
2653 <variablelist>
2654  <varlistentry>
2655   <term><parameter>page</parameter></term>
2656   <listitem>
2657    <para>
2658     The page that was allocated from skb_alloc_page
2659    </para>
2660   </listitem>
2661  </varlistentry>
2662  <varlistentry>
2663   <term><parameter>skb</parameter></term>
2664   <listitem>
2665    <para>
2666     The skb that may need pfmemalloc set
2667    </para>
2668   </listitem>
2669  </varlistentry>
2670 </variablelist>
2671</refsect1>
2672</refentry>
2673
2674<refentry id="API-skb-frag-page">
2675<refentryinfo>
2676 <title>LINUX</title>
2677 <productname>Kernel Hackers Manual</productname>
2678 <date>July 2017</date>
2679</refentryinfo>
2680<refmeta>
2681 <refentrytitle><phrase>skb_frag_page</phrase></refentrytitle>
2682 <manvolnum>9</manvolnum>
2683 <refmiscinfo class="version">4.1.27</refmiscinfo>
2684</refmeta>
2685<refnamediv>
2686 <refname>skb_frag_page</refname>
2687 <refpurpose>
2688     retrieve the page referred to by a paged fragment
2689 </refpurpose>
2690</refnamediv>
2691<refsynopsisdiv>
2692 <title>Synopsis</title>
2693  <funcsynopsis><funcprototype>
2694   <funcdef>struct page * <function>skb_frag_page </function></funcdef>
2695   <paramdef>const skb_frag_t * <parameter>frag</parameter></paramdef>
2696  </funcprototype></funcsynopsis>
2697</refsynopsisdiv>
2698<refsect1>
2699 <title>Arguments</title>
2700 <variablelist>
2701  <varlistentry>
2702   <term><parameter>frag</parameter></term>
2703   <listitem>
2704    <para>
2705     the paged fragment
2706    </para>
2707   </listitem>
2708  </varlistentry>
2709 </variablelist>
2710</refsect1>
2711<refsect1>
2712<title>Description</title>
2713<para>
2714   Returns the <structname>struct page</structname> associated with <parameter>frag</parameter>.
2715</para>
2716</refsect1>
2717</refentry>
2718
2719<refentry id="API---skb-frag-ref">
2720<refentryinfo>
2721 <title>LINUX</title>
2722 <productname>Kernel Hackers Manual</productname>
2723 <date>July 2017</date>
2724</refentryinfo>
2725<refmeta>
2726 <refentrytitle><phrase>__skb_frag_ref</phrase></refentrytitle>
2727 <manvolnum>9</manvolnum>
2728 <refmiscinfo class="version">4.1.27</refmiscinfo>
2729</refmeta>
2730<refnamediv>
2731 <refname>__skb_frag_ref</refname>
2732 <refpurpose>
2733     take an addition reference on a paged fragment.
2734 </refpurpose>
2735</refnamediv>
2736<refsynopsisdiv>
2737 <title>Synopsis</title>
2738  <funcsynopsis><funcprototype>
2739   <funcdef>void <function>__skb_frag_ref </function></funcdef>
2740   <paramdef>skb_frag_t * <parameter>frag</parameter></paramdef>
2741  </funcprototype></funcsynopsis>
2742</refsynopsisdiv>
2743<refsect1>
2744 <title>Arguments</title>
2745 <variablelist>
2746  <varlistentry>
2747   <term><parameter>frag</parameter></term>
2748   <listitem>
2749    <para>
2750     the paged fragment
2751    </para>
2752   </listitem>
2753  </varlistentry>
2754 </variablelist>
2755</refsect1>
2756<refsect1>
2757<title>Description</title>
2758<para>
2759   Takes an additional reference on the paged fragment <parameter>frag</parameter>.
2760</para>
2761</refsect1>
2762</refentry>
2763
2764<refentry id="API-skb-frag-ref">
2765<refentryinfo>
2766 <title>LINUX</title>
2767 <productname>Kernel Hackers Manual</productname>
2768 <date>July 2017</date>
2769</refentryinfo>
2770<refmeta>
2771 <refentrytitle><phrase>skb_frag_ref</phrase></refentrytitle>
2772 <manvolnum>9</manvolnum>
2773 <refmiscinfo class="version">4.1.27</refmiscinfo>
2774</refmeta>
2775<refnamediv>
2776 <refname>skb_frag_ref</refname>
2777 <refpurpose>
2778     take an addition reference on a paged fragment of an skb.
2779 </refpurpose>
2780</refnamediv>
2781<refsynopsisdiv>
2782 <title>Synopsis</title>
2783  <funcsynopsis><funcprototype>
2784   <funcdef>void <function>skb_frag_ref </function></funcdef>
2785   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2786   <paramdef>int <parameter>f</parameter></paramdef>
2787  </funcprototype></funcsynopsis>
2788</refsynopsisdiv>
2789<refsect1>
2790 <title>Arguments</title>
2791 <variablelist>
2792  <varlistentry>
2793   <term><parameter>skb</parameter></term>
2794   <listitem>
2795    <para>
2796     the buffer
2797    </para>
2798   </listitem>
2799  </varlistentry>
2800  <varlistentry>
2801   <term><parameter>f</parameter></term>
2802   <listitem>
2803    <para>
2804     the fragment offset.
2805    </para>
2806   </listitem>
2807  </varlistentry>
2808 </variablelist>
2809</refsect1>
2810<refsect1>
2811<title>Description</title>
2812<para>
2813   Takes an additional reference on the <parameter>f</parameter>'th paged fragment of <parameter>skb</parameter>.
2814</para>
2815</refsect1>
2816</refentry>
2817
2818<refentry id="API---skb-frag-unref">
2819<refentryinfo>
2820 <title>LINUX</title>
2821 <productname>Kernel Hackers Manual</productname>
2822 <date>July 2017</date>
2823</refentryinfo>
2824<refmeta>
2825 <refentrytitle><phrase>__skb_frag_unref</phrase></refentrytitle>
2826 <manvolnum>9</manvolnum>
2827 <refmiscinfo class="version">4.1.27</refmiscinfo>
2828</refmeta>
2829<refnamediv>
2830 <refname>__skb_frag_unref</refname>
2831 <refpurpose>
2832     release a reference on a paged fragment.
2833 </refpurpose>
2834</refnamediv>
2835<refsynopsisdiv>
2836 <title>Synopsis</title>
2837  <funcsynopsis><funcprototype>
2838   <funcdef>void <function>__skb_frag_unref </function></funcdef>
2839   <paramdef>skb_frag_t * <parameter>frag</parameter></paramdef>
2840  </funcprototype></funcsynopsis>
2841</refsynopsisdiv>
2842<refsect1>
2843 <title>Arguments</title>
2844 <variablelist>
2845  <varlistentry>
2846   <term><parameter>frag</parameter></term>
2847   <listitem>
2848    <para>
2849     the paged fragment
2850    </para>
2851   </listitem>
2852  </varlistentry>
2853 </variablelist>
2854</refsect1>
2855<refsect1>
2856<title>Description</title>
2857<para>
2858   Releases a reference on the paged fragment <parameter>frag</parameter>.
2859</para>
2860</refsect1>
2861</refentry>
2862
2863<refentry id="API-skb-frag-unref">
2864<refentryinfo>
2865 <title>LINUX</title>
2866 <productname>Kernel Hackers Manual</productname>
2867 <date>July 2017</date>
2868</refentryinfo>
2869<refmeta>
2870 <refentrytitle><phrase>skb_frag_unref</phrase></refentrytitle>
2871 <manvolnum>9</manvolnum>
2872 <refmiscinfo class="version">4.1.27</refmiscinfo>
2873</refmeta>
2874<refnamediv>
2875 <refname>skb_frag_unref</refname>
2876 <refpurpose>
2877     release a reference on a paged fragment of an skb.
2878 </refpurpose>
2879</refnamediv>
2880<refsynopsisdiv>
2881 <title>Synopsis</title>
2882  <funcsynopsis><funcprototype>
2883   <funcdef>void <function>skb_frag_unref </function></funcdef>
2884   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
2885   <paramdef>int <parameter>f</parameter></paramdef>
2886  </funcprototype></funcsynopsis>
2887</refsynopsisdiv>
2888<refsect1>
2889 <title>Arguments</title>
2890 <variablelist>
2891  <varlistentry>
2892   <term><parameter>skb</parameter></term>
2893   <listitem>
2894    <para>
2895     the buffer
2896    </para>
2897   </listitem>
2898  </varlistentry>
2899  <varlistentry>
2900   <term><parameter>f</parameter></term>
2901   <listitem>
2902    <para>
2903     the fragment offset
2904    </para>
2905   </listitem>
2906  </varlistentry>
2907 </variablelist>
2908</refsect1>
2909<refsect1>
2910<title>Description</title>
2911<para>
2912   Releases a reference on the <parameter>f</parameter>'th paged fragment of <parameter>skb</parameter>.
2913</para>
2914</refsect1>
2915</refentry>
2916
2917<refentry id="API-skb-frag-address">
2918<refentryinfo>
2919 <title>LINUX</title>
2920 <productname>Kernel Hackers Manual</productname>
2921 <date>July 2017</date>
2922</refentryinfo>
2923<refmeta>
2924 <refentrytitle><phrase>skb_frag_address</phrase></refentrytitle>
2925 <manvolnum>9</manvolnum>
2926 <refmiscinfo class="version">4.1.27</refmiscinfo>
2927</refmeta>
2928<refnamediv>
2929 <refname>skb_frag_address</refname>
2930 <refpurpose>
2931     gets the address of the data contained in a paged fragment
2932 </refpurpose>
2933</refnamediv>
2934<refsynopsisdiv>
2935 <title>Synopsis</title>
2936  <funcsynopsis><funcprototype>
2937   <funcdef>void * <function>skb_frag_address </function></funcdef>
2938   <paramdef>const skb_frag_t * <parameter>frag</parameter></paramdef>
2939  </funcprototype></funcsynopsis>
2940</refsynopsisdiv>
2941<refsect1>
2942 <title>Arguments</title>
2943 <variablelist>
2944  <varlistentry>
2945   <term><parameter>frag</parameter></term>
2946   <listitem>
2947    <para>
2948     the paged fragment buffer
2949    </para>
2950   </listitem>
2951  </varlistentry>
2952 </variablelist>
2953</refsect1>
2954<refsect1>
2955<title>Description</title>
2956<para>
2957   Returns the address of the data within <parameter>frag</parameter>. The page must already
2958   be mapped.
2959</para>
2960</refsect1>
2961</refentry>
2962
2963<refentry id="API-skb-frag-address-safe">
2964<refentryinfo>
2965 <title>LINUX</title>
2966 <productname>Kernel Hackers Manual</productname>
2967 <date>July 2017</date>
2968</refentryinfo>
2969<refmeta>
2970 <refentrytitle><phrase>skb_frag_address_safe</phrase></refentrytitle>
2971 <manvolnum>9</manvolnum>
2972 <refmiscinfo class="version">4.1.27</refmiscinfo>
2973</refmeta>
2974<refnamediv>
2975 <refname>skb_frag_address_safe</refname>
2976 <refpurpose>
2977     gets the address of the data contained in a paged fragment
2978 </refpurpose>
2979</refnamediv>
2980<refsynopsisdiv>
2981 <title>Synopsis</title>
2982  <funcsynopsis><funcprototype>
2983   <funcdef>void * <function>skb_frag_address_safe </function></funcdef>
2984   <paramdef>const skb_frag_t * <parameter>frag</parameter></paramdef>
2985  </funcprototype></funcsynopsis>
2986</refsynopsisdiv>
2987<refsect1>
2988 <title>Arguments</title>
2989 <variablelist>
2990  <varlistentry>
2991   <term><parameter>frag</parameter></term>
2992   <listitem>
2993    <para>
2994     the paged fragment buffer
2995    </para>
2996   </listitem>
2997  </varlistentry>
2998 </variablelist>
2999</refsect1>
3000<refsect1>
3001<title>Description</title>
3002<para>
3003   Returns the address of the data within <parameter>frag</parameter>. Checks that the page
3004   is mapped and returns <constant>NULL</constant> otherwise.
3005</para>
3006</refsect1>
3007</refentry>
3008
3009<refentry id="API---skb-frag-set-page">
3010<refentryinfo>
3011 <title>LINUX</title>
3012 <productname>Kernel Hackers Manual</productname>
3013 <date>July 2017</date>
3014</refentryinfo>
3015<refmeta>
3016 <refentrytitle><phrase>__skb_frag_set_page</phrase></refentrytitle>
3017 <manvolnum>9</manvolnum>
3018 <refmiscinfo class="version">4.1.27</refmiscinfo>
3019</refmeta>
3020<refnamediv>
3021 <refname>__skb_frag_set_page</refname>
3022 <refpurpose>
3023     sets the page contained in a paged fragment
3024 </refpurpose>
3025</refnamediv>
3026<refsynopsisdiv>
3027 <title>Synopsis</title>
3028  <funcsynopsis><funcprototype>
3029   <funcdef>void <function>__skb_frag_set_page </function></funcdef>
3030   <paramdef>skb_frag_t * <parameter>frag</parameter></paramdef>
3031   <paramdef>struct page * <parameter>page</parameter></paramdef>
3032  </funcprototype></funcsynopsis>
3033</refsynopsisdiv>
3034<refsect1>
3035 <title>Arguments</title>
3036 <variablelist>
3037  <varlistentry>
3038   <term><parameter>frag</parameter></term>
3039   <listitem>
3040    <para>
3041     the paged fragment
3042    </para>
3043   </listitem>
3044  </varlistentry>
3045  <varlistentry>
3046   <term><parameter>page</parameter></term>
3047   <listitem>
3048    <para>
3049     the page to set
3050    </para>
3051   </listitem>
3052  </varlistentry>
3053 </variablelist>
3054</refsect1>
3055<refsect1>
3056<title>Description</title>
3057<para>
3058   Sets the fragment <parameter>frag</parameter> to contain <parameter>page</parameter>.
3059</para>
3060</refsect1>
3061</refentry>
3062
3063<refentry id="API-skb-frag-set-page">
3064<refentryinfo>
3065 <title>LINUX</title>
3066 <productname>Kernel Hackers Manual</productname>
3067 <date>July 2017</date>
3068</refentryinfo>
3069<refmeta>
3070 <refentrytitle><phrase>skb_frag_set_page</phrase></refentrytitle>
3071 <manvolnum>9</manvolnum>
3072 <refmiscinfo class="version">4.1.27</refmiscinfo>
3073</refmeta>
3074<refnamediv>
3075 <refname>skb_frag_set_page</refname>
3076 <refpurpose>
3077     sets the page contained in a paged fragment of an skb
3078 </refpurpose>
3079</refnamediv>
3080<refsynopsisdiv>
3081 <title>Synopsis</title>
3082  <funcsynopsis><funcprototype>
3083   <funcdef>void <function>skb_frag_set_page </function></funcdef>
3084   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3085   <paramdef>int <parameter>f</parameter></paramdef>
3086   <paramdef>struct page * <parameter>page</parameter></paramdef>
3087  </funcprototype></funcsynopsis>
3088</refsynopsisdiv>
3089<refsect1>
3090 <title>Arguments</title>
3091 <variablelist>
3092  <varlistentry>
3093   <term><parameter>skb</parameter></term>
3094   <listitem>
3095    <para>
3096     the buffer
3097    </para>
3098   </listitem>
3099  </varlistentry>
3100  <varlistentry>
3101   <term><parameter>f</parameter></term>
3102   <listitem>
3103    <para>
3104     the fragment offset
3105    </para>
3106   </listitem>
3107  </varlistentry>
3108  <varlistentry>
3109   <term><parameter>page</parameter></term>
3110   <listitem>
3111    <para>
3112     the page to set
3113    </para>
3114   </listitem>
3115  </varlistentry>
3116 </variablelist>
3117</refsect1>
3118<refsect1>
3119<title>Description</title>
3120<para>
3121   Sets the <parameter>f</parameter>'th fragment of <parameter>skb</parameter> to contain <parameter>page</parameter>.
3122</para>
3123</refsect1>
3124</refentry>
3125
3126<refentry id="API-skb-frag-dma-map">
3127<refentryinfo>
3128 <title>LINUX</title>
3129 <productname>Kernel Hackers Manual</productname>
3130 <date>July 2017</date>
3131</refentryinfo>
3132<refmeta>
3133 <refentrytitle><phrase>skb_frag_dma_map</phrase></refentrytitle>
3134 <manvolnum>9</manvolnum>
3135 <refmiscinfo class="version">4.1.27</refmiscinfo>
3136</refmeta>
3137<refnamediv>
3138 <refname>skb_frag_dma_map</refname>
3139 <refpurpose>
3140     maps a paged fragment via the DMA API
3141 </refpurpose>
3142</refnamediv>
3143<refsynopsisdiv>
3144 <title>Synopsis</title>
3145  <funcsynopsis><funcprototype>
3146   <funcdef>dma_addr_t <function>skb_frag_dma_map </function></funcdef>
3147   <paramdef>struct device * <parameter>dev</parameter></paramdef>
3148   <paramdef>const skb_frag_t * <parameter>frag</parameter></paramdef>
3149   <paramdef>size_t <parameter>offset</parameter></paramdef>
3150   <paramdef>size_t <parameter>size</parameter></paramdef>
3151   <paramdef>enum dma_data_direction <parameter>dir</parameter></paramdef>
3152  </funcprototype></funcsynopsis>
3153</refsynopsisdiv>
3154<refsect1>
3155 <title>Arguments</title>
3156 <variablelist>
3157  <varlistentry>
3158   <term><parameter>dev</parameter></term>
3159   <listitem>
3160    <para>
3161     the device to map the fragment to
3162    </para>
3163   </listitem>
3164  </varlistentry>
3165  <varlistentry>
3166   <term><parameter>frag</parameter></term>
3167   <listitem>
3168    <para>
3169     the paged fragment to map
3170    </para>
3171   </listitem>
3172  </varlistentry>
3173  <varlistentry>
3174   <term><parameter>offset</parameter></term>
3175   <listitem>
3176    <para>
3177     the offset within the fragment (starting at the
3178     fragment's own offset)
3179    </para>
3180   </listitem>
3181  </varlistentry>
3182  <varlistentry>
3183   <term><parameter>size</parameter></term>
3184   <listitem>
3185    <para>
3186     the number of bytes to map
3187    </para>
3188   </listitem>
3189  </varlistentry>
3190  <varlistentry>
3191   <term><parameter>dir</parameter></term>
3192   <listitem>
3193    <para>
3194     the direction of the mapping (<constant>PCI_DMA_</constant>*)
3195    </para>
3196   </listitem>
3197  </varlistentry>
3198 </variablelist>
3199</refsect1>
3200<refsect1>
3201<title>Description</title>
3202<para>
3203   Maps the page associated with <parameter>frag</parameter> to <parameter>device</parameter>.
3204</para>
3205</refsect1>
3206</refentry>
3207
3208<refentry id="API-skb-clone-writable">
3209<refentryinfo>
3210 <title>LINUX</title>
3211 <productname>Kernel Hackers Manual</productname>
3212 <date>July 2017</date>
3213</refentryinfo>
3214<refmeta>
3215 <refentrytitle><phrase>skb_clone_writable</phrase></refentrytitle>
3216 <manvolnum>9</manvolnum>
3217 <refmiscinfo class="version">4.1.27</refmiscinfo>
3218</refmeta>
3219<refnamediv>
3220 <refname>skb_clone_writable</refname>
3221 <refpurpose>
3222     is the header of a clone writable
3223 </refpurpose>
3224</refnamediv>
3225<refsynopsisdiv>
3226 <title>Synopsis</title>
3227  <funcsynopsis><funcprototype>
3228   <funcdef>int <function>skb_clone_writable </function></funcdef>
3229   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
3230   <paramdef>unsigned int <parameter>len</parameter></paramdef>
3231  </funcprototype></funcsynopsis>
3232</refsynopsisdiv>
3233<refsect1>
3234 <title>Arguments</title>
3235 <variablelist>
3236  <varlistentry>
3237   <term><parameter>skb</parameter></term>
3238   <listitem>
3239    <para>
3240     buffer to check
3241    </para>
3242   </listitem>
3243  </varlistentry>
3244  <varlistentry>
3245   <term><parameter>len</parameter></term>
3246   <listitem>
3247    <para>
3248     length up to which to write
3249    </para>
3250   </listitem>
3251  </varlistentry>
3252 </variablelist>
3253</refsect1>
3254<refsect1>
3255<title>Description</title>
3256<para>
3257   Returns true if modifying the header part of the cloned buffer
3258   does not requires the data to be copied.
3259</para>
3260</refsect1>
3261</refentry>
3262
3263<refentry id="API-skb-cow">
3264<refentryinfo>
3265 <title>LINUX</title>
3266 <productname>Kernel Hackers Manual</productname>
3267 <date>July 2017</date>
3268</refentryinfo>
3269<refmeta>
3270 <refentrytitle><phrase>skb_cow</phrase></refentrytitle>
3271 <manvolnum>9</manvolnum>
3272 <refmiscinfo class="version">4.1.27</refmiscinfo>
3273</refmeta>
3274<refnamediv>
3275 <refname>skb_cow</refname>
3276 <refpurpose>
3277     copy header of skb when it is required
3278 </refpurpose>
3279</refnamediv>
3280<refsynopsisdiv>
3281 <title>Synopsis</title>
3282  <funcsynopsis><funcprototype>
3283   <funcdef>int <function>skb_cow </function></funcdef>
3284   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3285   <paramdef>unsigned int <parameter>headroom</parameter></paramdef>
3286  </funcprototype></funcsynopsis>
3287</refsynopsisdiv>
3288<refsect1>
3289 <title>Arguments</title>
3290 <variablelist>
3291  <varlistentry>
3292   <term><parameter>skb</parameter></term>
3293   <listitem>
3294    <para>
3295     buffer to cow
3296    </para>
3297   </listitem>
3298  </varlistentry>
3299  <varlistentry>
3300   <term><parameter>headroom</parameter></term>
3301   <listitem>
3302    <para>
3303     needed headroom
3304    </para>
3305   </listitem>
3306  </varlistentry>
3307 </variablelist>
3308</refsect1>
3309<refsect1>
3310<title>Description</title>
3311<para>
3312   If the skb passed lacks sufficient headroom or its data part
3313   is shared, data is reallocated. If reallocation fails, an error
3314   is returned and original skb is not changed.
3315   </para><para>
3316
3317   The result is skb with writable area skb-&gt;head...skb-&gt;tail
3318   and at least <parameter>headroom</parameter> of space at head.
3319</para>
3320</refsect1>
3321</refentry>
3322
3323<refentry id="API-skb-cow-head">
3324<refentryinfo>
3325 <title>LINUX</title>
3326 <productname>Kernel Hackers Manual</productname>
3327 <date>July 2017</date>
3328</refentryinfo>
3329<refmeta>
3330 <refentrytitle><phrase>skb_cow_head</phrase></refentrytitle>
3331 <manvolnum>9</manvolnum>
3332 <refmiscinfo class="version">4.1.27</refmiscinfo>
3333</refmeta>
3334<refnamediv>
3335 <refname>skb_cow_head</refname>
3336 <refpurpose>
3337     skb_cow but only making the head writable
3338 </refpurpose>
3339</refnamediv>
3340<refsynopsisdiv>
3341 <title>Synopsis</title>
3342  <funcsynopsis><funcprototype>
3343   <funcdef>int <function>skb_cow_head </function></funcdef>
3344   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3345   <paramdef>unsigned int <parameter>headroom</parameter></paramdef>
3346  </funcprototype></funcsynopsis>
3347</refsynopsisdiv>
3348<refsect1>
3349 <title>Arguments</title>
3350 <variablelist>
3351  <varlistentry>
3352   <term><parameter>skb</parameter></term>
3353   <listitem>
3354    <para>
3355     buffer to cow
3356    </para>
3357   </listitem>
3358  </varlistentry>
3359  <varlistentry>
3360   <term><parameter>headroom</parameter></term>
3361   <listitem>
3362    <para>
3363     needed headroom
3364    </para>
3365   </listitem>
3366  </varlistentry>
3367 </variablelist>
3368</refsect1>
3369<refsect1>
3370<title>Description</title>
3371<para>
3372   This function is identical to skb_cow except that we replace the
3373   skb_cloned check by skb_header_cloned.  It should be used when
3374   you only need to push on some header and do not need to modify
3375   the data.
3376</para>
3377</refsect1>
3378</refentry>
3379
3380<refentry id="API-skb-padto">
3381<refentryinfo>
3382 <title>LINUX</title>
3383 <productname>Kernel Hackers Manual</productname>
3384 <date>July 2017</date>
3385</refentryinfo>
3386<refmeta>
3387 <refentrytitle><phrase>skb_padto</phrase></refentrytitle>
3388 <manvolnum>9</manvolnum>
3389 <refmiscinfo class="version">4.1.27</refmiscinfo>
3390</refmeta>
3391<refnamediv>
3392 <refname>skb_padto</refname>
3393 <refpurpose>
3394     pad an skbuff up to a minimal size
3395 </refpurpose>
3396</refnamediv>
3397<refsynopsisdiv>
3398 <title>Synopsis</title>
3399  <funcsynopsis><funcprototype>
3400   <funcdef>int <function>skb_padto </function></funcdef>
3401   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3402   <paramdef>unsigned int <parameter>len</parameter></paramdef>
3403  </funcprototype></funcsynopsis>
3404</refsynopsisdiv>
3405<refsect1>
3406 <title>Arguments</title>
3407 <variablelist>
3408  <varlistentry>
3409   <term><parameter>skb</parameter></term>
3410   <listitem>
3411    <para>
3412     buffer to pad
3413    </para>
3414   </listitem>
3415  </varlistentry>
3416  <varlistentry>
3417   <term><parameter>len</parameter></term>
3418   <listitem>
3419    <para>
3420     minimal length
3421    </para>
3422   </listitem>
3423  </varlistentry>
3424 </variablelist>
3425</refsect1>
3426<refsect1>
3427<title>Description</title>
3428<para>
3429   Pads up a buffer to ensure the trailing bytes exist and are
3430   blanked. If the buffer already contains sufficient data it
3431   is untouched. Otherwise it is extended. Returns zero on
3432   success. The skb is freed on error.
3433</para>
3434</refsect1>
3435</refentry>
3436
3437<refentry id="API-skb-put-padto">
3438<refentryinfo>
3439 <title>LINUX</title>
3440 <productname>Kernel Hackers Manual</productname>
3441 <date>July 2017</date>
3442</refentryinfo>
3443<refmeta>
3444 <refentrytitle><phrase>skb_put_padto</phrase></refentrytitle>
3445 <manvolnum>9</manvolnum>
3446 <refmiscinfo class="version">4.1.27</refmiscinfo>
3447</refmeta>
3448<refnamediv>
3449 <refname>skb_put_padto</refname>
3450 <refpurpose>
3451     increase size and pad an skbuff up to a minimal size
3452 </refpurpose>
3453</refnamediv>
3454<refsynopsisdiv>
3455 <title>Synopsis</title>
3456  <funcsynopsis><funcprototype>
3457   <funcdef>int <function>skb_put_padto </function></funcdef>
3458   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3459   <paramdef>unsigned int <parameter>len</parameter></paramdef>
3460  </funcprototype></funcsynopsis>
3461</refsynopsisdiv>
3462<refsect1>
3463 <title>Arguments</title>
3464 <variablelist>
3465  <varlistentry>
3466   <term><parameter>skb</parameter></term>
3467   <listitem>
3468    <para>
3469     buffer to pad
3470    </para>
3471   </listitem>
3472  </varlistentry>
3473  <varlistentry>
3474   <term><parameter>len</parameter></term>
3475   <listitem>
3476    <para>
3477     minimal length
3478    </para>
3479   </listitem>
3480  </varlistentry>
3481 </variablelist>
3482</refsect1>
3483<refsect1>
3484<title>Description</title>
3485<para>
3486   Pads up a buffer to ensure the trailing bytes exist and are
3487   blanked. If the buffer already contains sufficient data it
3488   is untouched. Otherwise it is extended. Returns zero on
3489   success. The skb is freed on error.
3490</para>
3491</refsect1>
3492</refentry>
3493
3494<refentry id="API-skb-linearize">
3495<refentryinfo>
3496 <title>LINUX</title>
3497 <productname>Kernel Hackers Manual</productname>
3498 <date>July 2017</date>
3499</refentryinfo>
3500<refmeta>
3501 <refentrytitle><phrase>skb_linearize</phrase></refentrytitle>
3502 <manvolnum>9</manvolnum>
3503 <refmiscinfo class="version">4.1.27</refmiscinfo>
3504</refmeta>
3505<refnamediv>
3506 <refname>skb_linearize</refname>
3507 <refpurpose>
3508     convert paged skb to linear one
3509 </refpurpose>
3510</refnamediv>
3511<refsynopsisdiv>
3512 <title>Synopsis</title>
3513  <funcsynopsis><funcprototype>
3514   <funcdef>int <function>skb_linearize </function></funcdef>
3515   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3516  </funcprototype></funcsynopsis>
3517</refsynopsisdiv>
3518<refsect1>
3519 <title>Arguments</title>
3520 <variablelist>
3521  <varlistentry>
3522   <term><parameter>skb</parameter></term>
3523   <listitem>
3524    <para>
3525     buffer to linarize
3526    </para>
3527   </listitem>
3528  </varlistentry>
3529 </variablelist>
3530</refsect1>
3531<refsect1>
3532<title>Description</title>
3533<para>
3534   If there is no free memory -ENOMEM is returned, otherwise zero
3535   is returned and the old skb data released.
3536</para>
3537</refsect1>
3538</refentry>
3539
3540<refentry id="API-skb-has-shared-frag">
3541<refentryinfo>
3542 <title>LINUX</title>
3543 <productname>Kernel Hackers Manual</productname>
3544 <date>July 2017</date>
3545</refentryinfo>
3546<refmeta>
3547 <refentrytitle><phrase>skb_has_shared_frag</phrase></refentrytitle>
3548 <manvolnum>9</manvolnum>
3549 <refmiscinfo class="version">4.1.27</refmiscinfo>
3550</refmeta>
3551<refnamediv>
3552 <refname>skb_has_shared_frag</refname>
3553 <refpurpose>
3554     can any frag be overwritten
3555 </refpurpose>
3556</refnamediv>
3557<refsynopsisdiv>
3558 <title>Synopsis</title>
3559  <funcsynopsis><funcprototype>
3560   <funcdef>bool <function>skb_has_shared_frag </function></funcdef>
3561   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
3562  </funcprototype></funcsynopsis>
3563</refsynopsisdiv>
3564<refsect1>
3565 <title>Arguments</title>
3566 <variablelist>
3567  <varlistentry>
3568   <term><parameter>skb</parameter></term>
3569   <listitem>
3570    <para>
3571     buffer to test
3572    </para>
3573   </listitem>
3574  </varlistentry>
3575 </variablelist>
3576</refsect1>
3577<refsect1>
3578<title>Description</title>
3579<para>
3580   Return true if the skb has at least one frag that might be modified
3581   by an external entity (as in <function>vmsplice</function>/<function>sendfile</function>)
3582</para>
3583</refsect1>
3584</refentry>
3585
3586<refentry id="API-skb-linearize-cow">
3587<refentryinfo>
3588 <title>LINUX</title>
3589 <productname>Kernel Hackers Manual</productname>
3590 <date>July 2017</date>
3591</refentryinfo>
3592<refmeta>
3593 <refentrytitle><phrase>skb_linearize_cow</phrase></refentrytitle>
3594 <manvolnum>9</manvolnum>
3595 <refmiscinfo class="version">4.1.27</refmiscinfo>
3596</refmeta>
3597<refnamediv>
3598 <refname>skb_linearize_cow</refname>
3599 <refpurpose>
3600     make sure skb is linear and writable
3601 </refpurpose>
3602</refnamediv>
3603<refsynopsisdiv>
3604 <title>Synopsis</title>
3605  <funcsynopsis><funcprototype>
3606   <funcdef>int <function>skb_linearize_cow </function></funcdef>
3607   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3608  </funcprototype></funcsynopsis>
3609</refsynopsisdiv>
3610<refsect1>
3611 <title>Arguments</title>
3612 <variablelist>
3613  <varlistentry>
3614   <term><parameter>skb</parameter></term>
3615   <listitem>
3616    <para>
3617     buffer to process
3618    </para>
3619   </listitem>
3620  </varlistentry>
3621 </variablelist>
3622</refsect1>
3623<refsect1>
3624<title>Description</title>
3625<para>
3626   If there is no free memory -ENOMEM is returned, otherwise zero
3627   is returned and the old skb data released.
3628</para>
3629</refsect1>
3630</refentry>
3631
3632<refentry id="API-skb-postpull-rcsum">
3633<refentryinfo>
3634 <title>LINUX</title>
3635 <productname>Kernel Hackers Manual</productname>
3636 <date>July 2017</date>
3637</refentryinfo>
3638<refmeta>
3639 <refentrytitle><phrase>skb_postpull_rcsum</phrase></refentrytitle>
3640 <manvolnum>9</manvolnum>
3641 <refmiscinfo class="version">4.1.27</refmiscinfo>
3642</refmeta>
3643<refnamediv>
3644 <refname>skb_postpull_rcsum</refname>
3645 <refpurpose>
3646     update checksum for received skb after pull
3647 </refpurpose>
3648</refnamediv>
3649<refsynopsisdiv>
3650 <title>Synopsis</title>
3651  <funcsynopsis><funcprototype>
3652   <funcdef>void <function>skb_postpull_rcsum </function></funcdef>
3653   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3654   <paramdef>const void * <parameter>start</parameter></paramdef>
3655   <paramdef>unsigned int <parameter>len</parameter></paramdef>
3656  </funcprototype></funcsynopsis>
3657</refsynopsisdiv>
3658<refsect1>
3659 <title>Arguments</title>
3660 <variablelist>
3661  <varlistentry>
3662   <term><parameter>skb</parameter></term>
3663   <listitem>
3664    <para>
3665     buffer to update
3666    </para>
3667   </listitem>
3668  </varlistentry>
3669  <varlistentry>
3670   <term><parameter>start</parameter></term>
3671   <listitem>
3672    <para>
3673     start of data before pull
3674    </para>
3675   </listitem>
3676  </varlistentry>
3677  <varlistentry>
3678   <term><parameter>len</parameter></term>
3679   <listitem>
3680    <para>
3681     length of data pulled
3682    </para>
3683   </listitem>
3684  </varlistentry>
3685 </variablelist>
3686</refsect1>
3687<refsect1>
3688<title>Description</title>
3689<para>
3690   After doing a pull on a received packet, you need to call this to
3691   update the CHECKSUM_COMPLETE checksum, or set ip_summed to
3692   CHECKSUM_NONE so that it can be recomputed from scratch.
3693</para>
3694</refsect1>
3695</refentry>
3696
3697<refentry id="API-pskb-trim-rcsum">
3698<refentryinfo>
3699 <title>LINUX</title>
3700 <productname>Kernel Hackers Manual</productname>
3701 <date>July 2017</date>
3702</refentryinfo>
3703<refmeta>
3704 <refentrytitle><phrase>pskb_trim_rcsum</phrase></refentrytitle>
3705 <manvolnum>9</manvolnum>
3706 <refmiscinfo class="version">4.1.27</refmiscinfo>
3707</refmeta>
3708<refnamediv>
3709 <refname>pskb_trim_rcsum</refname>
3710 <refpurpose>
3711     trim received skb and update checksum
3712 </refpurpose>
3713</refnamediv>
3714<refsynopsisdiv>
3715 <title>Synopsis</title>
3716  <funcsynopsis><funcprototype>
3717   <funcdef>int <function>pskb_trim_rcsum </function></funcdef>
3718   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3719   <paramdef>unsigned int <parameter>len</parameter></paramdef>
3720  </funcprototype></funcsynopsis>
3721</refsynopsisdiv>
3722<refsect1>
3723 <title>Arguments</title>
3724 <variablelist>
3725  <varlistentry>
3726   <term><parameter>skb</parameter></term>
3727   <listitem>
3728    <para>
3729     buffer to trim
3730    </para>
3731   </listitem>
3732  </varlistentry>
3733  <varlistentry>
3734   <term><parameter>len</parameter></term>
3735   <listitem>
3736    <para>
3737     new length
3738    </para>
3739   </listitem>
3740  </varlistentry>
3741 </variablelist>
3742</refsect1>
3743<refsect1>
3744<title>Description</title>
3745<para>
3746   This is exactly the same as pskb_trim except that it ensures the
3747   checksum of received packets are still valid after the operation.
3748</para>
3749</refsect1>
3750</refentry>
3751
3752<refentry id="API-skb-needs-linearize">
3753<refentryinfo>
3754 <title>LINUX</title>
3755 <productname>Kernel Hackers Manual</productname>
3756 <date>July 2017</date>
3757</refentryinfo>
3758<refmeta>
3759 <refentrytitle><phrase>skb_needs_linearize</phrase></refentrytitle>
3760 <manvolnum>9</manvolnum>
3761 <refmiscinfo class="version">4.1.27</refmiscinfo>
3762</refmeta>
3763<refnamediv>
3764 <refname>skb_needs_linearize</refname>
3765 <refpurpose>
3766     check if we need to linearize a given skb depending on the given device features.
3767 </refpurpose>
3768</refnamediv>
3769<refsynopsisdiv>
3770 <title>Synopsis</title>
3771  <funcsynopsis><funcprototype>
3772   <funcdef>bool <function>skb_needs_linearize </function></funcdef>
3773   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3774   <paramdef>netdev_features_t <parameter>features</parameter></paramdef>
3775  </funcprototype></funcsynopsis>
3776</refsynopsisdiv>
3777<refsect1>
3778 <title>Arguments</title>
3779 <variablelist>
3780  <varlistentry>
3781   <term><parameter>skb</parameter></term>
3782   <listitem>
3783    <para>
3784     socket buffer to check
3785    </para>
3786   </listitem>
3787  </varlistentry>
3788  <varlistentry>
3789   <term><parameter>features</parameter></term>
3790   <listitem>
3791    <para>
3792     net device features
3793    </para>
3794   </listitem>
3795  </varlistentry>
3796 </variablelist>
3797</refsect1>
3798<refsect1>
3799<title>Returns true if either</title>
3800<para>
3801   1. skb has frag_list and the device doesn't support FRAGLIST, or
3802   2. skb is fragmented and the device does not support SG.
3803</para>
3804</refsect1>
3805</refentry>
3806
3807<refentry id="API-skb-get-timestamp">
3808<refentryinfo>
3809 <title>LINUX</title>
3810 <productname>Kernel Hackers Manual</productname>
3811 <date>July 2017</date>
3812</refentryinfo>
3813<refmeta>
3814 <refentrytitle><phrase>skb_get_timestamp</phrase></refentrytitle>
3815 <manvolnum>9</manvolnum>
3816 <refmiscinfo class="version">4.1.27</refmiscinfo>
3817</refmeta>
3818<refnamediv>
3819 <refname>skb_get_timestamp</refname>
3820 <refpurpose>
3821     get timestamp from a skb
3822 </refpurpose>
3823</refnamediv>
3824<refsynopsisdiv>
3825 <title>Synopsis</title>
3826  <funcsynopsis><funcprototype>
3827   <funcdef>void <function>skb_get_timestamp </function></funcdef>
3828   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
3829   <paramdef>struct timeval * <parameter>stamp</parameter></paramdef>
3830  </funcprototype></funcsynopsis>
3831</refsynopsisdiv>
3832<refsect1>
3833 <title>Arguments</title>
3834 <variablelist>
3835  <varlistentry>
3836   <term><parameter>skb</parameter></term>
3837   <listitem>
3838    <para>
3839     skb to get stamp from
3840    </para>
3841   </listitem>
3842  </varlistentry>
3843  <varlistentry>
3844   <term><parameter>stamp</parameter></term>
3845   <listitem>
3846    <para>
3847     pointer to struct timeval to store stamp in
3848    </para>
3849   </listitem>
3850  </varlistentry>
3851 </variablelist>
3852</refsect1>
3853<refsect1>
3854<title>Description</title>
3855<para>
3856   Timestamps are stored in the skb as offsets to a base timestamp.
3857   This function converts the offset back to a struct timeval and stores
3858   it in stamp.
3859</para>
3860</refsect1>
3861</refentry>
3862
3863<refentry id="API-skb-tx-timestamp">
3864<refentryinfo>
3865 <title>LINUX</title>
3866 <productname>Kernel Hackers Manual</productname>
3867 <date>July 2017</date>
3868</refentryinfo>
3869<refmeta>
3870 <refentrytitle><phrase>skb_tx_timestamp</phrase></refentrytitle>
3871 <manvolnum>9</manvolnum>
3872 <refmiscinfo class="version">4.1.27</refmiscinfo>
3873</refmeta>
3874<refnamediv>
3875 <refname>skb_tx_timestamp</refname>
3876 <refpurpose>
3877     Driver hook for transmit timestamping
3878 </refpurpose>
3879</refnamediv>
3880<refsynopsisdiv>
3881 <title>Synopsis</title>
3882  <funcsynopsis><funcprototype>
3883   <funcdef>void <function>skb_tx_timestamp </function></funcdef>
3884   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3885  </funcprototype></funcsynopsis>
3886</refsynopsisdiv>
3887<refsect1>
3888 <title>Arguments</title>
3889 <variablelist>
3890  <varlistentry>
3891   <term><parameter>skb</parameter></term>
3892   <listitem>
3893    <para>
3894     A socket buffer.
3895    </para>
3896   </listitem>
3897  </varlistentry>
3898 </variablelist>
3899</refsect1>
3900<refsect1>
3901<title>Description</title>
3902<para>
3903   </para><para>
3904
3905   Ethernet MAC Drivers should call this function in their <function>hard_xmit</function>
3906   function immediately before giving the sk_buff to the MAC hardware.
3907   </para><para>
3908
3909   Specifically, one should make absolutely sure that this function is
3910   called before TX completion of this packet can trigger.  Otherwise
3911   the packet could potentially already be freed.
3912</para>
3913</refsect1>
3914</refentry>
3915
3916<refentry id="API-skb-checksum-complete">
3917<refentryinfo>
3918 <title>LINUX</title>
3919 <productname>Kernel Hackers Manual</productname>
3920 <date>July 2017</date>
3921</refentryinfo>
3922<refmeta>
3923 <refentrytitle><phrase>skb_checksum_complete</phrase></refentrytitle>
3924 <manvolnum>9</manvolnum>
3925 <refmiscinfo class="version">4.1.27</refmiscinfo>
3926</refmeta>
3927<refnamediv>
3928 <refname>skb_checksum_complete</refname>
3929 <refpurpose>
3930     Calculate checksum of an entire packet
3931 </refpurpose>
3932</refnamediv>
3933<refsynopsisdiv>
3934 <title>Synopsis</title>
3935  <funcsynopsis><funcprototype>
3936   <funcdef>__sum16 <function>skb_checksum_complete </function></funcdef>
3937   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
3938  </funcprototype></funcsynopsis>
3939</refsynopsisdiv>
3940<refsect1>
3941 <title>Arguments</title>
3942 <variablelist>
3943  <varlistentry>
3944   <term><parameter>skb</parameter></term>
3945   <listitem>
3946    <para>
3947     packet to process
3948    </para>
3949   </listitem>
3950  </varlistentry>
3951 </variablelist>
3952</refsect1>
3953<refsect1>
3954<title>Description</title>
3955<para>
3956   This function calculates the checksum over the entire packet plus
3957   the value of skb-&gt;csum.  The latter can be used to supply the
3958   checksum of a pseudo header as used by TCP/UDP.  It returns the
3959   checksum.
3960   </para><para>
3961
3962   For protocols that contain complete checksums such as ICMP/TCP/UDP,
3963   this function can be used to verify that checksum on received
3964   packets.  In that case the function should return zero if the
3965   checksum is correct.  In particular, this function will return zero
3966   if skb-&gt;ip_summed is CHECKSUM_UNNECESSARY which indicates that the
3967   hardware has already verified the correctness of the checksum.
3968</para>
3969</refsect1>
3970</refentry>
3971
3972<refentry id="API-skb-checksum-none-assert">
3973<refentryinfo>
3974 <title>LINUX</title>
3975 <productname>Kernel Hackers Manual</productname>
3976 <date>July 2017</date>
3977</refentryinfo>
3978<refmeta>
3979 <refentrytitle><phrase>skb_checksum_none_assert</phrase></refentrytitle>
3980 <manvolnum>9</manvolnum>
3981 <refmiscinfo class="version">4.1.27</refmiscinfo>
3982</refmeta>
3983<refnamediv>
3984 <refname>skb_checksum_none_assert</refname>
3985 <refpurpose>
3986     make sure skb ip_summed is CHECKSUM_NONE
3987 </refpurpose>
3988</refnamediv>
3989<refsynopsisdiv>
3990 <title>Synopsis</title>
3991  <funcsynopsis><funcprototype>
3992   <funcdef>void <function>skb_checksum_none_assert </function></funcdef>
3993   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
3994  </funcprototype></funcsynopsis>
3995</refsynopsisdiv>
3996<refsect1>
3997 <title>Arguments</title>
3998 <variablelist>
3999  <varlistentry>
4000   <term><parameter>skb</parameter></term>
4001   <listitem>
4002    <para>
4003     skb to check
4004    </para>
4005   </listitem>
4006  </varlistentry>
4007 </variablelist>
4008</refsect1>
4009<refsect1>
4010<title>Description</title>
4011<para>
4012   fresh skbs have their ip_summed set to CHECKSUM_NONE.
4013   Instead of forcing ip_summed to CHECKSUM_NONE, we can
4014   use this helper, to document places where we make this assertion.
4015</para>
4016</refsect1>
4017</refentry>
4018
4019<refentry id="API-skb-head-is-locked">
4020<refentryinfo>
4021 <title>LINUX</title>
4022 <productname>Kernel Hackers Manual</productname>
4023 <date>July 2017</date>
4024</refentryinfo>
4025<refmeta>
4026 <refentrytitle><phrase>skb_head_is_locked</phrase></refentrytitle>
4027 <manvolnum>9</manvolnum>
4028 <refmiscinfo class="version">4.1.27</refmiscinfo>
4029</refmeta>
4030<refnamediv>
4031 <refname>skb_head_is_locked</refname>
4032 <refpurpose>
4033     Determine if the skb-&gt;head is locked down
4034 </refpurpose>
4035</refnamediv>
4036<refsynopsisdiv>
4037 <title>Synopsis</title>
4038  <funcsynopsis><funcprototype>
4039   <funcdef>bool <function>skb_head_is_locked </function></funcdef>
4040   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
4041  </funcprototype></funcsynopsis>
4042</refsynopsisdiv>
4043<refsect1>
4044 <title>Arguments</title>
4045 <variablelist>
4046  <varlistentry>
4047   <term><parameter>skb</parameter></term>
4048   <listitem>
4049    <para>
4050     skb to check
4051    </para>
4052   </listitem>
4053  </varlistentry>
4054 </variablelist>
4055</refsect1>
4056<refsect1>
4057<title>Description</title>
4058<para>
4059   The head on skbs build around a head frag can be removed if they are
4060   not cloned.  This function returns true if the skb head is locked down
4061   due to either being allocated via kmalloc, or by being a clone with
4062   multiple references to the head.
4063</para>
4064</refsect1>
4065</refentry>
4066
4067<refentry id="API-skb-gso-network-seglen">
4068<refentryinfo>
4069 <title>LINUX</title>
4070 <productname>Kernel Hackers Manual</productname>
4071 <date>July 2017</date>
4072</refentryinfo>
4073<refmeta>
4074 <refentrytitle><phrase>skb_gso_network_seglen</phrase></refentrytitle>
4075 <manvolnum>9</manvolnum>
4076 <refmiscinfo class="version">4.1.27</refmiscinfo>
4077</refmeta>
4078<refnamediv>
4079 <refname>skb_gso_network_seglen</refname>
4080 <refpurpose>
4081     Return length of individual segments of a gso packet
4082 </refpurpose>
4083</refnamediv>
4084<refsynopsisdiv>
4085 <title>Synopsis</title>
4086  <funcsynopsis><funcprototype>
4087   <funcdef>unsigned int <function>skb_gso_network_seglen </function></funcdef>
4088   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
4089  </funcprototype></funcsynopsis>
4090</refsynopsisdiv>
4091<refsect1>
4092 <title>Arguments</title>
4093 <variablelist>
4094  <varlistentry>
4095   <term><parameter>skb</parameter></term>
4096   <listitem>
4097    <para>
4098     GSO skb
4099    </para>
4100   </listitem>
4101  </varlistentry>
4102 </variablelist>
4103</refsect1>
4104<refsect1>
4105<title>Description</title>
4106<para>
4107   skb_gso_network_seglen is used to determine the real size of the
4108   individual segments, including Layer3 (IP, IPv6) and L4 headers (TCP/UDP).
4109   </para><para>
4110
4111   The MAC/L2 header is not accounted for.
4112</para>
4113</refsect1>
4114</refentry>
4115
4116<!-- include/net/sock.h -->
4117<refentry id="API-struct-sock-common">
4118<refentryinfo>
4119 <title>LINUX</title>
4120 <productname>Kernel Hackers Manual</productname>
4121 <date>July 2017</date>
4122</refentryinfo>
4123<refmeta>
4124 <refentrytitle><phrase>struct sock_common</phrase></refentrytitle>
4125 <manvolnum>9</manvolnum>
4126 <refmiscinfo class="version">4.1.27</refmiscinfo>
4127</refmeta>
4128<refnamediv>
4129 <refname>struct sock_common</refname>
4130 <refpurpose>
4131  minimal network layer representation of sockets
4132 </refpurpose>
4133</refnamediv>
4134<refsynopsisdiv>
4135 <title>Synopsis</title>
4136  <programlisting>
4137struct sock_common {
4138  union {unnamed_union};
4139  int skc_tx_queue_mapping;
4140  atomic_t skc_refcnt;
4141};  </programlisting>
4142</refsynopsisdiv>
4143 <refsect1>
4144  <title>Members</title>
4145  <variablelist>
4146    <varlistentry>      <term>{unnamed_union}</term>
4147      <listitem><para>
4148anonymous
4149      </para></listitem>
4150    </varlistentry>
4151    <varlistentry>      <term>skc_tx_queue_mapping</term>
4152      <listitem><para>
4153tx queue number for this connection
4154      </para></listitem>
4155    </varlistentry>
4156    <varlistentry>      <term>skc_refcnt</term>
4157      <listitem><para>
4158reference count
4159      </para></listitem>
4160    </varlistentry>
4161  </variablelist>
4162 </refsect1>
4163<refsect1>
4164<title>Description</title>
4165<para>
4166   This is the minimal network layer representation of sockets, the header
4167   for struct sock and struct inet_timewait_sock.
4168</para>
4169</refsect1>
4170</refentry>
4171
4172<refentry id="API-struct-sock">
4173<refentryinfo>
4174 <title>LINUX</title>
4175 <productname>Kernel Hackers Manual</productname>
4176 <date>July 2017</date>
4177</refentryinfo>
4178<refmeta>
4179 <refentrytitle><phrase>struct sock</phrase></refentrytitle>
4180 <manvolnum>9</manvolnum>
4181 <refmiscinfo class="version">4.1.27</refmiscinfo>
4182</refmeta>
4183<refnamediv>
4184 <refname>struct sock</refname>
4185 <refpurpose>
4186     network layer representation of sockets
4187 </refpurpose>
4188</refnamediv>
4189<refsynopsisdiv>
4190 <title>Synopsis</title>
4191  <programlisting>
4192struct sock {
4193  struct sock_common __sk_common;
4194#define sk_node			__sk_common.skc_node
4195#define sk_nulls_node		__sk_common.skc_nulls_node
4196#define sk_refcnt		__sk_common.skc_refcnt
4197#define sk_tx_queue_mapping	__sk_common.skc_tx_queue_mapping
4198#define sk_dontcopy_begin	__sk_common.skc_dontcopy_begin
4199#define sk_dontcopy_end		__sk_common.skc_dontcopy_end
4200#define sk_hash			__sk_common.skc_hash
4201#define sk_portpair		__sk_common.skc_portpair
4202#define sk_num			__sk_common.skc_num
4203#define sk_dport		__sk_common.skc_dport
4204#define sk_addrpair		__sk_common.skc_addrpair
4205#define sk_daddr		__sk_common.skc_daddr
4206#define sk_rcv_saddr		__sk_common.skc_rcv_saddr
4207#define sk_family		__sk_common.skc_family
4208#define sk_state		__sk_common.skc_state
4209#define sk_reuse		__sk_common.skc_reuse
4210#define sk_reuseport		__sk_common.skc_reuseport
4211#define sk_ipv6only		__sk_common.skc_ipv6only
4212#define sk_bound_dev_if		__sk_common.skc_bound_dev_if
4213#define sk_bind_node		__sk_common.skc_bind_node
4214#define sk_prot			__sk_common.skc_prot
4215#define sk_net			__sk_common.skc_net
4216#define sk_v6_daddr		__sk_common.skc_v6_daddr
4217#define sk_v6_rcv_saddr	__sk_common.skc_v6_rcv_saddr
4218#define sk_cookie		__sk_common.skc_cookie
4219  socket_lock_t sk_lock;
4220  struct sk_buff_head sk_receive_queue;
4221  struct sk_backlog;
4222#define sk_rmem_alloc sk_backlog.rmem_alloc
4223  int sk_forward_alloc;
4224#ifdef CONFIG_RPS
4225  __u32 sk_rxhash;
4226#endif
4227  u16 sk_incoming_cpu;
4228  __u32 sk_txhash;
4229#ifdef CONFIG_NET_RX_BUSY_POLL
4230  unsigned int sk_napi_id;
4231  unsigned int sk_ll_usec;
4232#endif
4233  atomic_t sk_drops;
4234  int sk_rcvbuf;
4235  struct sk_filter __rcu * sk_filter;
4236  struct socket_wq __rcu * sk_wq;
4237#ifdef CONFIG_XFRM
4238  struct xfrm_policy * sk_policy[2];
4239#endif
4240  unsigned long sk_flags;
4241  struct dst_entry * sk_rx_dst;
4242  struct dst_entry __rcu * sk_dst_cache;
4243  spinlock_t sk_dst_lock;
4244  atomic_t sk_wmem_alloc;
4245  atomic_t sk_omem_alloc;
4246  int sk_sndbuf;
4247  struct sk_buff_head sk_write_queue;
4248  unsigned int sk_shutdown:2;
4249  unsigned int sk_no_check_tx:1;
4250  unsigned int sk_no_check_rx:1;
4251  unsigned int sk_userlocks:4;
4252  unsigned int sk_protocol:8;
4253#define SK_PROTOCOL_MAX U8_MAX
4254  int sk_wmem_queued;
4255  gfp_t sk_allocation;
4256  u32 sk_pacing_rate;
4257  u32 sk_max_pacing_rate;
4258  netdev_features_t sk_route_caps;
4259  netdev_features_t sk_route_nocaps;
4260  int sk_gso_type;
4261  unsigned int sk_gso_max_size;
4262  u16 sk_gso_max_segs;
4263  int sk_rcvlowat;
4264  unsigned long sk_lingertime;
4265  struct sk_buff_head sk_error_queue;
4266  struct proto * sk_prot_creator;
4267  rwlock_t sk_callback_lock;
4268  int sk_err;
4269  int sk_err_soft;
4270  u32 sk_ack_backlog;
4271  u32 sk_max_ack_backlog;
4272  __u32 sk_priority;
4273#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
4274  __u32 sk_cgrp_prioidx;
4275#endif
4276  struct pid * sk_peer_pid;
4277  const struct cred * sk_peer_cred;
4278  long sk_rcvtimeo;
4279  long sk_sndtimeo;
4280  void * sk_protinfo;
4281  struct timer_list sk_timer;
4282  ktime_t sk_stamp;
4283  u16 sk_tsflags;
4284  u32 sk_tskey;
4285  struct socket * sk_socket;
4286  void * sk_user_data;
4287  struct page_frag sk_frag;
4288  struct sk_buff * sk_send_head;
4289  __s32 sk_peek_off;
4290  int sk_write_pending;
4291#ifdef CONFIG_SECURITY
4292  void * sk_security;
4293#endif
4294  __u32 sk_mark;
4295  u32 sk_classid;
4296  struct cg_proto * sk_cgrp;
4297  void (* sk_state_change) (struct sock *sk);
4298  void (* sk_data_ready) (struct sock *sk);
4299  void (* sk_write_space) (struct sock *sk);
4300  void (* sk_error_report) (struct sock *sk);
4301  int (* sk_backlog_rcv) (struct sock *sk,struct sk_buff *skb);
4302  void (* sk_destruct) (struct sock *sk);
4303};  </programlisting>
4304</refsynopsisdiv>
4305 <refsect1>
4306  <title>Members</title>
4307  <variablelist>
4308    <varlistentry>      <term>__sk_common</term>
4309      <listitem><para>
4310   shared layout with inet_timewait_sock
4311      </para></listitem>
4312    </varlistentry>
4313    <varlistentry>      <term>sk_lock</term>
4314      <listitem><para>
4315   synchronizer
4316      </para></listitem>
4317    </varlistentry>
4318    <varlistentry>      <term>sk_receive_queue</term>
4319      <listitem><para>
4320   incoming packets
4321      </para></listitem>
4322    </varlistentry>
4323    <varlistentry>      <term>sk_backlog</term>
4324      <listitem><para>
4325   always used with the per-socket spinlock held
4326      </para></listitem>
4327    </varlistentry>
4328    <varlistentry>      <term>sk_forward_alloc</term>
4329      <listitem><para>
4330   space allocated forward
4331      </para></listitem>
4332    </varlistentry>
4333    <varlistentry>      <term>sk_rxhash</term>
4334      <listitem><para>
4335   flow hash received from netif layer
4336      </para></listitem>
4337    </varlistentry>
4338    <varlistentry>      <term>sk_incoming_cpu</term>
4339      <listitem><para>
4340   record cpu processing incoming packets
4341      </para></listitem>
4342    </varlistentry>
4343    <varlistentry>      <term>sk_txhash</term>
4344      <listitem><para>
4345   computed flow hash for use on transmit
4346      </para></listitem>
4347    </varlistentry>
4348    <varlistentry>      <term>sk_napi_id</term>
4349      <listitem><para>
4350   id of the last napi context to receive data for sk
4351      </para></listitem>
4352    </varlistentry>
4353    <varlistentry>      <term>sk_ll_usec</term>
4354      <listitem><para>
4355   usecs to busypoll when there is no data
4356      </para></listitem>
4357    </varlistentry>
4358    <varlistentry>      <term>sk_drops</term>
4359      <listitem><para>
4360   raw/udp drops counter
4361      </para></listitem>
4362    </varlistentry>
4363    <varlistentry>      <term>sk_rcvbuf</term>
4364      <listitem><para>
4365   size of receive buffer in bytes
4366      </para></listitem>
4367    </varlistentry>
4368    <varlistentry>      <term>sk_filter</term>
4369      <listitem><para>
4370   socket filtering instructions
4371      </para></listitem>
4372    </varlistentry>
4373    <varlistentry>      <term>sk_wq</term>
4374      <listitem><para>
4375   sock wait queue and async head
4376      </para></listitem>
4377    </varlistentry>
4378    <varlistentry>      <term>sk_policy[2]</term>
4379      <listitem><para>
4380   flow policy
4381      </para></listitem>
4382    </varlistentry>
4383    <varlistentry>      <term>sk_flags</term>
4384      <listitem><para>
4385   <constant>SO_LINGER</constant> (l_onoff), <constant>SO_BROADCAST</constant>, <constant>SO_KEEPALIVE</constant>,
4386   <constant>SO_OOBINLINE</constant> settings, <constant>SO_TIMESTAMPING</constant> settings
4387      </para></listitem>
4388    </varlistentry>
4389    <varlistentry>      <term>sk_rx_dst</term>
4390      <listitem><para>
4391   receive input route used by early demux
4392      </para></listitem>
4393    </varlistentry>
4394    <varlistentry>      <term>sk_dst_cache</term>
4395      <listitem><para>
4396   destination cache
4397      </para></listitem>
4398    </varlistentry>
4399    <varlistentry>      <term>sk_dst_lock</term>
4400      <listitem><para>
4401   destination cache lock
4402      </para></listitem>
4403    </varlistentry>
4404    <varlistentry>      <term>sk_wmem_alloc</term>
4405      <listitem><para>
4406   transmit queue bytes committed
4407      </para></listitem>
4408    </varlistentry>
4409    <varlistentry>      <term>sk_omem_alloc</term>
4410      <listitem><para>
4411   "o<quote> is </quote>option<quote> or </quote>other"
4412      </para></listitem>
4413    </varlistentry>
4414    <varlistentry>      <term>sk_sndbuf</term>
4415      <listitem><para>
4416   size of send buffer in bytes
4417      </para></listitem>
4418    </varlistentry>
4419    <varlistentry>      <term>sk_write_queue</term>
4420      <listitem><para>
4421   Packet sending queue
4422      </para></listitem>
4423    </varlistentry>
4424    <varlistentry>      <term>sk_shutdown</term>
4425      <listitem><para>
4426   mask of <constant>SEND_SHUTDOWN</constant> and/or <constant>RCV_SHUTDOWN</constant>
4427      </para></listitem>
4428    </varlistentry>
4429    <varlistentry>      <term>sk_no_check_tx</term>
4430      <listitem><para>
4431   <constant>SO_NO_CHECK</constant> setting, set checksum in TX packets
4432      </para></listitem>
4433    </varlistentry>
4434    <varlistentry>      <term>sk_no_check_rx</term>
4435      <listitem><para>
4436   allow zero checksum in RX packets
4437      </para></listitem>
4438    </varlistentry>
4439    <varlistentry>      <term>sk_userlocks</term>
4440      <listitem><para>
4441   <constant>SO_SNDBUF</constant> and <constant>SO_RCVBUF</constant> settings
4442      </para></listitem>
4443    </varlistentry>
4444    <varlistentry>      <term>sk_protocol</term>
4445      <listitem><para>
4446   which protocol this socket belongs in this network family
4447      </para></listitem>
4448    </varlistentry>
4449    <varlistentry>      <term>sk_wmem_queued</term>
4450      <listitem><para>
4451   persistent queue size
4452      </para></listitem>
4453    </varlistentry>
4454    <varlistentry>      <term>sk_allocation</term>
4455      <listitem><para>
4456   allocation mode
4457      </para></listitem>
4458    </varlistentry>
4459    <varlistentry>      <term>sk_pacing_rate</term>
4460      <listitem><para>
4461   Pacing rate (if supported by transport/packet scheduler)
4462      </para></listitem>
4463    </varlistentry>
4464    <varlistentry>      <term>sk_max_pacing_rate</term>
4465      <listitem><para>
4466   Maximum pacing rate (<constant>SO_MAX_PACING_RATE</constant>)
4467      </para></listitem>
4468    </varlistentry>
4469    <varlistentry>      <term>sk_route_caps</term>
4470      <listitem><para>
4471   route capabilities (e.g. <constant>NETIF_F_TSO</constant>)
4472      </para></listitem>
4473    </varlistentry>
4474    <varlistentry>      <term>sk_route_nocaps</term>
4475      <listitem><para>
4476   forbidden route capabilities (e.g NETIF_F_GSO_MASK)
4477      </para></listitem>
4478    </varlistentry>
4479    <varlistentry>      <term>sk_gso_type</term>
4480      <listitem><para>
4481   GSO type (e.g. <constant>SKB_GSO_TCPV4</constant>)
4482      </para></listitem>
4483    </varlistentry>
4484    <varlistentry>      <term>sk_gso_max_size</term>
4485      <listitem><para>
4486   Maximum GSO segment size to build
4487      </para></listitem>
4488    </varlistentry>
4489    <varlistentry>      <term>sk_gso_max_segs</term>
4490      <listitem><para>
4491   Maximum number of GSO segments
4492      </para></listitem>
4493    </varlistentry>
4494    <varlistentry>      <term>sk_rcvlowat</term>
4495      <listitem><para>
4496   <constant>SO_RCVLOWAT</constant> setting
4497      </para></listitem>
4498    </varlistentry>
4499    <varlistentry>      <term>sk_lingertime</term>
4500      <listitem><para>
4501   <constant>SO_LINGER</constant> l_linger setting
4502      </para></listitem>
4503    </varlistentry>
4504    <varlistentry>      <term>sk_error_queue</term>
4505      <listitem><para>
4506   rarely used
4507      </para></listitem>
4508    </varlistentry>
4509    <varlistentry>      <term>sk_prot_creator</term>
4510      <listitem><para>
4511   sk_prot of original sock creator (see ipv6_setsockopt,
4512   IPV6_ADDRFORM for instance)
4513      </para></listitem>
4514    </varlistentry>
4515    <varlistentry>      <term>sk_callback_lock</term>
4516      <listitem><para>
4517   used with the callbacks in the end of this struct
4518      </para></listitem>
4519    </varlistentry>
4520    <varlistentry>      <term>sk_err</term>
4521      <listitem><para>
4522   last error
4523      </para></listitem>
4524    </varlistentry>
4525    <varlistentry>      <term>sk_err_soft</term>
4526      <listitem><para>
4527   errors that don't cause failure but are the cause of a
4528   persistent failure not just 'timed out'
4529      </para></listitem>
4530    </varlistentry>
4531    <varlistentry>      <term>sk_ack_backlog</term>
4532      <listitem><para>
4533   current listen backlog
4534      </para></listitem>
4535    </varlistentry>
4536    <varlistentry>      <term>sk_max_ack_backlog</term>
4537      <listitem><para>
4538   listen backlog set in <function>listen</function>
4539      </para></listitem>
4540    </varlistentry>
4541    <varlistentry>      <term>sk_priority</term>
4542      <listitem><para>
4543   <constant>SO_PRIORITY</constant> setting
4544      </para></listitem>
4545    </varlistentry>
4546    <varlistentry>      <term>sk_cgrp_prioidx</term>
4547      <listitem><para>
4548   socket group's priority map index
4549      </para></listitem>
4550    </varlistentry>
4551    <varlistentry>      <term>sk_peer_pid</term>
4552      <listitem><para>
4553   <structname>struct pid</structname> for this socket's peer
4554      </para></listitem>
4555    </varlistentry>
4556    <varlistentry>      <term>sk_peer_cred</term>
4557      <listitem><para>
4558   <constant>SO_PEERCRED</constant> setting
4559      </para></listitem>
4560    </varlistentry>
4561    <varlistentry>      <term>sk_rcvtimeo</term>
4562      <listitem><para>
4563   <constant>SO_RCVTIMEO</constant> setting
4564      </para></listitem>
4565    </varlistentry>
4566    <varlistentry>      <term>sk_sndtimeo</term>
4567      <listitem><para>
4568   <constant>SO_SNDTIMEO</constant> setting
4569      </para></listitem>
4570    </varlistentry>
4571    <varlistentry>      <term>sk_protinfo</term>
4572      <listitem><para>
4573   private area, net family specific, when not using slab
4574      </para></listitem>
4575    </varlistentry>
4576    <varlistentry>      <term>sk_timer</term>
4577      <listitem><para>
4578   sock cleanup timer
4579      </para></listitem>
4580    </varlistentry>
4581    <varlistentry>      <term>sk_stamp</term>
4582      <listitem><para>
4583   time stamp of last packet received
4584      </para></listitem>
4585    </varlistentry>
4586    <varlistentry>      <term>sk_tsflags</term>
4587      <listitem><para>
4588   SO_TIMESTAMPING socket options
4589      </para></listitem>
4590    </varlistentry>
4591    <varlistentry>      <term>sk_tskey</term>
4592      <listitem><para>
4593   counter to disambiguate concurrent tstamp requests
4594      </para></listitem>
4595    </varlistentry>
4596    <varlistentry>      <term>sk_socket</term>
4597      <listitem><para>
4598   Identd and reporting IO signals
4599      </para></listitem>
4600    </varlistentry>
4601    <varlistentry>      <term>sk_user_data</term>
4602      <listitem><para>
4603   RPC layer private data
4604      </para></listitem>
4605    </varlistentry>
4606    <varlistentry>      <term>sk_frag</term>
4607      <listitem><para>
4608   cached page frag
4609      </para></listitem>
4610    </varlistentry>
4611    <varlistentry>      <term>sk_send_head</term>
4612      <listitem><para>
4613   front of stuff to transmit
4614      </para></listitem>
4615    </varlistentry>
4616    <varlistentry>      <term>sk_peek_off</term>
4617      <listitem><para>
4618   current peek_offset value
4619      </para></listitem>
4620    </varlistentry>
4621    <varlistentry>      <term>sk_write_pending</term>
4622      <listitem><para>
4623   a write to stream socket waits to start
4624      </para></listitem>
4625    </varlistentry>
4626    <varlistentry>      <term>sk_security</term>
4627      <listitem><para>
4628   used by security modules
4629      </para></listitem>
4630    </varlistentry>
4631    <varlistentry>      <term>sk_mark</term>
4632      <listitem><para>
4633   generic packet mark
4634      </para></listitem>
4635    </varlistentry>
4636    <varlistentry>      <term>sk_classid</term>
4637      <listitem><para>
4638   this socket's cgroup classid
4639      </para></listitem>
4640    </varlistentry>
4641    <varlistentry>      <term>sk_cgrp</term>
4642      <listitem><para>
4643   this socket's cgroup-specific proto data
4644      </para></listitem>
4645    </varlistentry>
4646    <varlistentry>      <term>sk_state_change</term>
4647      <listitem><para>
4648   callback to indicate change in the state of the sock
4649      </para></listitem>
4650    </varlistentry>
4651    <varlistentry>      <term>sk_data_ready</term>
4652      <listitem><para>
4653   callback to indicate there is data to be processed
4654      </para></listitem>
4655    </varlistentry>
4656    <varlistentry>      <term>sk_write_space</term>
4657      <listitem><para>
4658   callback to indicate there is bf sending space available
4659      </para></listitem>
4660    </varlistentry>
4661    <varlistentry>      <term>sk_error_report</term>
4662      <listitem><para>
4663   callback to indicate errors (e.g. <constant>MSG_ERRQUEUE</constant>)
4664      </para></listitem>
4665    </varlistentry>
4666    <varlistentry>      <term>sk_backlog_rcv</term>
4667      <listitem><para>
4668   callback to process the backlog
4669      </para></listitem>
4670    </varlistentry>
4671    <varlistentry>      <term>sk_destruct</term>
4672      <listitem><para>
4673   called at sock freeing time, i.e. when all refcnt == 0
4674      </para></listitem>
4675    </varlistentry>
4676  </variablelist>
4677 </refsect1>
4678</refentry>
4679
4680<refentry id="API-sk-nulls-for-each-entry-offset">
4681<refentryinfo>
4682 <title>LINUX</title>
4683 <productname>Kernel Hackers Manual</productname>
4684 <date>July 2017</date>
4685</refentryinfo>
4686<refmeta>
4687 <refentrytitle><phrase>sk_nulls_for_each_entry_offset</phrase></refentrytitle>
4688 <manvolnum>9</manvolnum>
4689 <refmiscinfo class="version">4.1.27</refmiscinfo>
4690</refmeta>
4691<refnamediv>
4692 <refname>sk_nulls_for_each_entry_offset</refname>
4693 <refpurpose>
4694     iterate over a list at a given struct offset
4695 </refpurpose>
4696</refnamediv>
4697<refsynopsisdiv>
4698 <title>Synopsis</title>
4699  <funcsynopsis><funcprototype>
4700   <funcdef> <function>sk_nulls_for_each_entry_offset </function></funcdef>
4701   <paramdef> <parameter>tpos</parameter></paramdef>
4702   <paramdef> <parameter>pos</parameter></paramdef>
4703   <paramdef> <parameter>head</parameter></paramdef>
4704   <paramdef> <parameter>offset</parameter></paramdef>
4705  </funcprototype></funcsynopsis>
4706</refsynopsisdiv>
4707<refsect1>
4708 <title>Arguments</title>
4709 <variablelist>
4710  <varlistentry>
4711   <term><parameter>tpos</parameter></term>
4712   <listitem>
4713    <para>
4714     the type * to use as a loop cursor.
4715    </para>
4716   </listitem>
4717  </varlistentry>
4718  <varlistentry>
4719   <term><parameter>pos</parameter></term>
4720   <listitem>
4721    <para>
4722     the <structname>struct hlist_node</structname> to use as a loop cursor.
4723    </para>
4724   </listitem>
4725  </varlistentry>
4726  <varlistentry>
4727   <term><parameter>head</parameter></term>
4728   <listitem>
4729    <para>
4730     the head for your list.
4731    </para>
4732   </listitem>
4733  </varlistentry>
4734  <varlistentry>
4735   <term><parameter>offset</parameter></term>
4736   <listitem>
4737    <para>
4738     offset of hlist_node within the struct.
4739    </para>
4740   </listitem>
4741  </varlistentry>
4742 </variablelist>
4743</refsect1>
4744</refentry>
4745
4746<refentry id="API-unlock-sock-fast">
4747<refentryinfo>
4748 <title>LINUX</title>
4749 <productname>Kernel Hackers Manual</productname>
4750 <date>July 2017</date>
4751</refentryinfo>
4752<refmeta>
4753 <refentrytitle><phrase>unlock_sock_fast</phrase></refentrytitle>
4754 <manvolnum>9</manvolnum>
4755 <refmiscinfo class="version">4.1.27</refmiscinfo>
4756</refmeta>
4757<refnamediv>
4758 <refname>unlock_sock_fast</refname>
4759 <refpurpose>
4760     complement of lock_sock_fast
4761 </refpurpose>
4762</refnamediv>
4763<refsynopsisdiv>
4764 <title>Synopsis</title>
4765  <funcsynopsis><funcprototype>
4766   <funcdef>void <function>unlock_sock_fast </function></funcdef>
4767   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
4768   <paramdef>bool <parameter>slow</parameter></paramdef>
4769  </funcprototype></funcsynopsis>
4770</refsynopsisdiv>
4771<refsect1>
4772 <title>Arguments</title>
4773 <variablelist>
4774  <varlistentry>
4775   <term><parameter>sk</parameter></term>
4776   <listitem>
4777    <para>
4778     socket
4779    </para>
4780   </listitem>
4781  </varlistentry>
4782  <varlistentry>
4783   <term><parameter>slow</parameter></term>
4784   <listitem>
4785    <para>
4786     slow mode
4787    </para>
4788   </listitem>
4789  </varlistentry>
4790 </variablelist>
4791</refsect1>
4792<refsect1>
4793<title>Description</title>
4794<para>
4795   fast unlock socket for user context.
4796   If slow mode is on, we call regular <function>release_sock</function>
4797</para>
4798</refsect1>
4799</refentry>
4800
4801<refentry id="API-sk-wmem-alloc-get">
4802<refentryinfo>
4803 <title>LINUX</title>
4804 <productname>Kernel Hackers Manual</productname>
4805 <date>July 2017</date>
4806</refentryinfo>
4807<refmeta>
4808 <refentrytitle><phrase>sk_wmem_alloc_get</phrase></refentrytitle>
4809 <manvolnum>9</manvolnum>
4810 <refmiscinfo class="version">4.1.27</refmiscinfo>
4811</refmeta>
4812<refnamediv>
4813 <refname>sk_wmem_alloc_get</refname>
4814 <refpurpose>
4815     returns write allocations
4816 </refpurpose>
4817</refnamediv>
4818<refsynopsisdiv>
4819 <title>Synopsis</title>
4820  <funcsynopsis><funcprototype>
4821   <funcdef>int <function>sk_wmem_alloc_get </function></funcdef>
4822   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
4823  </funcprototype></funcsynopsis>
4824</refsynopsisdiv>
4825<refsect1>
4826 <title>Arguments</title>
4827 <variablelist>
4828  <varlistentry>
4829   <term><parameter>sk</parameter></term>
4830   <listitem>
4831    <para>
4832     socket
4833    </para>
4834   </listitem>
4835  </varlistentry>
4836 </variablelist>
4837</refsect1>
4838<refsect1>
4839<title>Description</title>
4840<para>
4841   Returns sk_wmem_alloc minus initial offset of one
4842</para>
4843</refsect1>
4844</refentry>
4845
4846<refentry id="API-sk-rmem-alloc-get">
4847<refentryinfo>
4848 <title>LINUX</title>
4849 <productname>Kernel Hackers Manual</productname>
4850 <date>July 2017</date>
4851</refentryinfo>
4852<refmeta>
4853 <refentrytitle><phrase>sk_rmem_alloc_get</phrase></refentrytitle>
4854 <manvolnum>9</manvolnum>
4855 <refmiscinfo class="version">4.1.27</refmiscinfo>
4856</refmeta>
4857<refnamediv>
4858 <refname>sk_rmem_alloc_get</refname>
4859 <refpurpose>
4860     returns read allocations
4861 </refpurpose>
4862</refnamediv>
4863<refsynopsisdiv>
4864 <title>Synopsis</title>
4865  <funcsynopsis><funcprototype>
4866   <funcdef>int <function>sk_rmem_alloc_get </function></funcdef>
4867   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
4868  </funcprototype></funcsynopsis>
4869</refsynopsisdiv>
4870<refsect1>
4871 <title>Arguments</title>
4872 <variablelist>
4873  <varlistentry>
4874   <term><parameter>sk</parameter></term>
4875   <listitem>
4876    <para>
4877     socket
4878    </para>
4879   </listitem>
4880  </varlistentry>
4881 </variablelist>
4882</refsect1>
4883<refsect1>
4884<title>Description</title>
4885<para>
4886   Returns sk_rmem_alloc
4887</para>
4888</refsect1>
4889</refentry>
4890
4891<refentry id="API-sk-has-allocations">
4892<refentryinfo>
4893 <title>LINUX</title>
4894 <productname>Kernel Hackers Manual</productname>
4895 <date>July 2017</date>
4896</refentryinfo>
4897<refmeta>
4898 <refentrytitle><phrase>sk_has_allocations</phrase></refentrytitle>
4899 <manvolnum>9</manvolnum>
4900 <refmiscinfo class="version">4.1.27</refmiscinfo>
4901</refmeta>
4902<refnamediv>
4903 <refname>sk_has_allocations</refname>
4904 <refpurpose>
4905     check if allocations are outstanding
4906 </refpurpose>
4907</refnamediv>
4908<refsynopsisdiv>
4909 <title>Synopsis</title>
4910  <funcsynopsis><funcprototype>
4911   <funcdef>bool <function>sk_has_allocations </function></funcdef>
4912   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
4913  </funcprototype></funcsynopsis>
4914</refsynopsisdiv>
4915<refsect1>
4916 <title>Arguments</title>
4917 <variablelist>
4918  <varlistentry>
4919   <term><parameter>sk</parameter></term>
4920   <listitem>
4921    <para>
4922     socket
4923    </para>
4924   </listitem>
4925  </varlistentry>
4926 </variablelist>
4927</refsect1>
4928<refsect1>
4929<title>Description</title>
4930<para>
4931   Returns true if socket has write or read allocations
4932</para>
4933</refsect1>
4934</refentry>
4935
4936<refentry id="API-wq-has-sleeper">
4937<refentryinfo>
4938 <title>LINUX</title>
4939 <productname>Kernel Hackers Manual</productname>
4940 <date>July 2017</date>
4941</refentryinfo>
4942<refmeta>
4943 <refentrytitle><phrase>wq_has_sleeper</phrase></refentrytitle>
4944 <manvolnum>9</manvolnum>
4945 <refmiscinfo class="version">4.1.27</refmiscinfo>
4946</refmeta>
4947<refnamediv>
4948 <refname>wq_has_sleeper</refname>
4949 <refpurpose>
4950     check if there are any waiting processes
4951 </refpurpose>
4952</refnamediv>
4953<refsynopsisdiv>
4954 <title>Synopsis</title>
4955  <funcsynopsis><funcprototype>
4956   <funcdef>bool <function>wq_has_sleeper </function></funcdef>
4957   <paramdef>struct socket_wq * <parameter>wq</parameter></paramdef>
4958  </funcprototype></funcsynopsis>
4959</refsynopsisdiv>
4960<refsect1>
4961 <title>Arguments</title>
4962 <variablelist>
4963  <varlistentry>
4964   <term><parameter>wq</parameter></term>
4965   <listitem>
4966    <para>
4967     struct socket_wq
4968    </para>
4969   </listitem>
4970  </varlistentry>
4971 </variablelist>
4972</refsect1>
4973<refsect1>
4974<title>Description</title>
4975<para>
4976   Returns true if socket_wq has waiting processes
4977   </para><para>
4978
4979   The purpose of the wq_has_sleeper and sock_poll_wait is to wrap the memory
4980   barrier call. They were added due to the race found within the tcp code.
4981</para>
4982</refsect1>
4983<refsect1>
4984<title>Consider following tcp code paths</title>
4985<para>
4986   </para><para>
4987
4988   CPU1                  CPU2
4989   </para><para>
4990
4991   sys_select            receive packet
4992   ...                 ...
4993   __add_wait_queue    update tp-&gt;rcv_nxt
4994   ...                 ...
4995   tp-&gt;rcv_nxt check   sock_def_readable
4996   ...                 {
4997   schedule               <function>rcu_read_lock</function>;
4998   wq = rcu_dereference(sk-&gt;sk_wq);
4999   if (wq &amp;&amp; waitqueue_active(<structname>wq</structname>-&gt;wait))
5000   wake_up_interruptible(<structname>wq</structname>-&gt;wait)
5001   ...
5002   }
5003   </para><para>
5004
5005   The race for tcp fires when the __add_wait_queue changes done by CPU1 stay
5006   in its cache, and so does the tp-&gt;rcv_nxt update on CPU2 side.  The CPU1
5007   could then endup calling schedule and sleep forever if there are no more
5008   data on the socket.
5009</para>
5010</refsect1>
5011</refentry>
5012
5013<refentry id="API-sock-poll-wait">
5014<refentryinfo>
5015 <title>LINUX</title>
5016 <productname>Kernel Hackers Manual</productname>
5017 <date>July 2017</date>
5018</refentryinfo>
5019<refmeta>
5020 <refentrytitle><phrase>sock_poll_wait</phrase></refentrytitle>
5021 <manvolnum>9</manvolnum>
5022 <refmiscinfo class="version">4.1.27</refmiscinfo>
5023</refmeta>
5024<refnamediv>
5025 <refname>sock_poll_wait</refname>
5026 <refpurpose>
5027     place memory barrier behind the poll_wait call.
5028 </refpurpose>
5029</refnamediv>
5030<refsynopsisdiv>
5031 <title>Synopsis</title>
5032  <funcsynopsis><funcprototype>
5033   <funcdef>void <function>sock_poll_wait </function></funcdef>
5034   <paramdef>struct file * <parameter>filp</parameter></paramdef>
5035   <paramdef>wait_queue_head_t * <parameter>wait_address</parameter></paramdef>
5036   <paramdef>poll_table * <parameter>p</parameter></paramdef>
5037  </funcprototype></funcsynopsis>
5038</refsynopsisdiv>
5039<refsect1>
5040 <title>Arguments</title>
5041 <variablelist>
5042  <varlistentry>
5043   <term><parameter>filp</parameter></term>
5044   <listitem>
5045    <para>
5046     file
5047    </para>
5048   </listitem>
5049  </varlistentry>
5050  <varlistentry>
5051   <term><parameter>wait_address</parameter></term>
5052   <listitem>
5053    <para>
5054     socket wait queue
5055    </para>
5056   </listitem>
5057  </varlistentry>
5058  <varlistentry>
5059   <term><parameter>p</parameter></term>
5060   <listitem>
5061    <para>
5062     poll_table
5063    </para>
5064   </listitem>
5065  </varlistentry>
5066 </variablelist>
5067</refsect1>
5068<refsect1>
5069<title>Description</title>
5070<para>
5071   See the comments in the wq_has_sleeper function.
5072</para>
5073</refsect1>
5074</refentry>
5075
5076<refentry id="API-sk-page-frag">
5077<refentryinfo>
5078 <title>LINUX</title>
5079 <productname>Kernel Hackers Manual</productname>
5080 <date>July 2017</date>
5081</refentryinfo>
5082<refmeta>
5083 <refentrytitle><phrase>sk_page_frag</phrase></refentrytitle>
5084 <manvolnum>9</manvolnum>
5085 <refmiscinfo class="version">4.1.27</refmiscinfo>
5086</refmeta>
5087<refnamediv>
5088 <refname>sk_page_frag</refname>
5089 <refpurpose>
5090     return an appropriate page_frag
5091 </refpurpose>
5092</refnamediv>
5093<refsynopsisdiv>
5094 <title>Synopsis</title>
5095  <funcsynopsis><funcprototype>
5096   <funcdef>struct page_frag * <function>sk_page_frag </function></funcdef>
5097   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
5098  </funcprototype></funcsynopsis>
5099</refsynopsisdiv>
5100<refsect1>
5101 <title>Arguments</title>
5102 <variablelist>
5103  <varlistentry>
5104   <term><parameter>sk</parameter></term>
5105   <listitem>
5106    <para>
5107     socket
5108    </para>
5109   </listitem>
5110  </varlistentry>
5111 </variablelist>
5112</refsect1>
5113<refsect1>
5114<title>Description</title>
5115<para>
5116   If socket allocation mode allows current thread to sleep, it means its
5117   safe to use the per task page_frag instead of the per socket one.
5118</para>
5119</refsect1>
5120</refentry>
5121
5122<refentry id="API-sock-tx-timestamp">
5123<refentryinfo>
5124 <title>LINUX</title>
5125 <productname>Kernel Hackers Manual</productname>
5126 <date>July 2017</date>
5127</refentryinfo>
5128<refmeta>
5129 <refentrytitle><phrase>sock_tx_timestamp</phrase></refentrytitle>
5130 <manvolnum>9</manvolnum>
5131 <refmiscinfo class="version">4.1.27</refmiscinfo>
5132</refmeta>
5133<refnamediv>
5134 <refname>sock_tx_timestamp</refname>
5135 <refpurpose>
5136     checks whether the outgoing packet is to be time stamped
5137 </refpurpose>
5138</refnamediv>
5139<refsynopsisdiv>
5140 <title>Synopsis</title>
5141  <funcsynopsis><funcprototype>
5142   <funcdef>void <function>sock_tx_timestamp </function></funcdef>
5143   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
5144   <paramdef>__u8 * <parameter>tx_flags</parameter></paramdef>
5145  </funcprototype></funcsynopsis>
5146</refsynopsisdiv>
5147<refsect1>
5148 <title>Arguments</title>
5149 <variablelist>
5150  <varlistentry>
5151   <term><parameter>sk</parameter></term>
5152   <listitem>
5153    <para>
5154     socket sending this packet
5155    </para>
5156   </listitem>
5157  </varlistentry>
5158  <varlistentry>
5159   <term><parameter>tx_flags</parameter></term>
5160   <listitem>
5161    <para>
5162     completed with instructions for time stamping
5163    </para>
5164   </listitem>
5165  </varlistentry>
5166 </variablelist>
5167</refsect1>
5168<refsect1>
5169<title>Note </title>
5170<para>
5171   callers should take care of initial *tx_flags value (usually 0)
5172</para>
5173</refsect1>
5174</refentry>
5175
5176<refentry id="API-sk-eat-skb">
5177<refentryinfo>
5178 <title>LINUX</title>
5179 <productname>Kernel Hackers Manual</productname>
5180 <date>July 2017</date>
5181</refentryinfo>
5182<refmeta>
5183 <refentrytitle><phrase>sk_eat_skb</phrase></refentrytitle>
5184 <manvolnum>9</manvolnum>
5185 <refmiscinfo class="version">4.1.27</refmiscinfo>
5186</refmeta>
5187<refnamediv>
5188 <refname>sk_eat_skb</refname>
5189 <refpurpose>
5190     Release a skb if it is no longer needed
5191 </refpurpose>
5192</refnamediv>
5193<refsynopsisdiv>
5194 <title>Synopsis</title>
5195  <funcsynopsis><funcprototype>
5196   <funcdef>void <function>sk_eat_skb </function></funcdef>
5197   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
5198   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
5199  </funcprototype></funcsynopsis>
5200</refsynopsisdiv>
5201<refsect1>
5202 <title>Arguments</title>
5203 <variablelist>
5204  <varlistentry>
5205   <term><parameter>sk</parameter></term>
5206   <listitem>
5207    <para>
5208     socket to eat this skb from
5209    </para>
5210   </listitem>
5211  </varlistentry>
5212  <varlistentry>
5213   <term><parameter>skb</parameter></term>
5214   <listitem>
5215    <para>
5216     socket buffer to eat
5217    </para>
5218   </listitem>
5219  </varlistentry>
5220 </variablelist>
5221</refsect1>
5222<refsect1>
5223<title>Description</title>
5224<para>
5225   This routine must be called with interrupts disabled or with the socket
5226   locked so that the sk_buff queue operation is ok.
5227</para>
5228</refsect1>
5229</refentry>
5230
5231<!-- net/socket.c -->
5232<refentry id="API-sockfd-lookup">
5233<refentryinfo>
5234 <title>LINUX</title>
5235 <productname>Kernel Hackers Manual</productname>
5236 <date>July 2017</date>
5237</refentryinfo>
5238<refmeta>
5239 <refentrytitle><phrase>sockfd_lookup</phrase></refentrytitle>
5240 <manvolnum>9</manvolnum>
5241 <refmiscinfo class="version">4.1.27</refmiscinfo>
5242</refmeta>
5243<refnamediv>
5244 <refname>sockfd_lookup</refname>
5245 <refpurpose>
5246  Go from a file number to its socket slot
5247 </refpurpose>
5248</refnamediv>
5249<refsynopsisdiv>
5250 <title>Synopsis</title>
5251  <funcsynopsis><funcprototype>
5252   <funcdef>struct socket * <function>sockfd_lookup </function></funcdef>
5253   <paramdef>int <parameter>fd</parameter></paramdef>
5254   <paramdef>int * <parameter>err</parameter></paramdef>
5255  </funcprototype></funcsynopsis>
5256</refsynopsisdiv>
5257<refsect1>
5258 <title>Arguments</title>
5259 <variablelist>
5260  <varlistentry>
5261   <term><parameter>fd</parameter></term>
5262   <listitem>
5263    <para>
5264     file handle
5265    </para>
5266   </listitem>
5267  </varlistentry>
5268  <varlistentry>
5269   <term><parameter>err</parameter></term>
5270   <listitem>
5271    <para>
5272     pointer to an error code return
5273    </para>
5274   </listitem>
5275  </varlistentry>
5276 </variablelist>
5277</refsect1>
5278<refsect1>
5279<title>Description</title>
5280<para>
5281   The file handle passed in is locked and the socket it is bound
5282   too is returned. If an error occurs the err pointer is overwritten
5283   with a negative errno code and NULL is returned. The function checks
5284   for both invalid handles and passing a handle which is not a socket.
5285   </para><para>
5286
5287   On a success the socket object pointer is returned.
5288</para>
5289</refsect1>
5290</refentry>
5291
5292<refentry id="API-sock-release">
5293<refentryinfo>
5294 <title>LINUX</title>
5295 <productname>Kernel Hackers Manual</productname>
5296 <date>July 2017</date>
5297</refentryinfo>
5298<refmeta>
5299 <refentrytitle><phrase>sock_release</phrase></refentrytitle>
5300 <manvolnum>9</manvolnum>
5301 <refmiscinfo class="version">4.1.27</refmiscinfo>
5302</refmeta>
5303<refnamediv>
5304 <refname>sock_release</refname>
5305 <refpurpose>
5306     close a socket
5307 </refpurpose>
5308</refnamediv>
5309<refsynopsisdiv>
5310 <title>Synopsis</title>
5311  <funcsynopsis><funcprototype>
5312   <funcdef>void <function>sock_release </function></funcdef>
5313   <paramdef>struct socket * <parameter>sock</parameter></paramdef>
5314  </funcprototype></funcsynopsis>
5315</refsynopsisdiv>
5316<refsect1>
5317 <title>Arguments</title>
5318 <variablelist>
5319  <varlistentry>
5320   <term><parameter>sock</parameter></term>
5321   <listitem>
5322    <para>
5323     socket to close
5324    </para>
5325   </listitem>
5326  </varlistentry>
5327 </variablelist>
5328</refsect1>
5329<refsect1>
5330<title>Description</title>
5331<para>
5332   The socket is released from the protocol stack if it has a release
5333   callback, and the inode is then released if the socket is bound to
5334   an inode not a file.
5335</para>
5336</refsect1>
5337</refentry>
5338
5339<refentry id="API-kernel-recvmsg">
5340<refentryinfo>
5341 <title>LINUX</title>
5342 <productname>Kernel Hackers Manual</productname>
5343 <date>July 2017</date>
5344</refentryinfo>
5345<refmeta>
5346 <refentrytitle><phrase>kernel_recvmsg</phrase></refentrytitle>
5347 <manvolnum>9</manvolnum>
5348 <refmiscinfo class="version">4.1.27</refmiscinfo>
5349</refmeta>
5350<refnamediv>
5351 <refname>kernel_recvmsg</refname>
5352 <refpurpose>
5353     Receive a message from a socket (kernel space)
5354 </refpurpose>
5355</refnamediv>
5356<refsynopsisdiv>
5357 <title>Synopsis</title>
5358  <funcsynopsis><funcprototype>
5359   <funcdef>int <function>kernel_recvmsg </function></funcdef>
5360   <paramdef>struct socket * <parameter>sock</parameter></paramdef>
5361   <paramdef>struct msghdr * <parameter>msg</parameter></paramdef>
5362   <paramdef>struct kvec * <parameter>vec</parameter></paramdef>
5363   <paramdef>size_t <parameter>num</parameter></paramdef>
5364   <paramdef>size_t <parameter>size</parameter></paramdef>
5365   <paramdef>int <parameter>flags</parameter></paramdef>
5366  </funcprototype></funcsynopsis>
5367</refsynopsisdiv>
5368<refsect1>
5369 <title>Arguments</title>
5370 <variablelist>
5371  <varlistentry>
5372   <term><parameter>sock</parameter></term>
5373   <listitem>
5374    <para>
5375     The socket to receive the message from
5376    </para>
5377   </listitem>
5378  </varlistentry>
5379  <varlistentry>
5380   <term><parameter>msg</parameter></term>
5381   <listitem>
5382    <para>
5383     Received message
5384    </para>
5385   </listitem>
5386  </varlistentry>
5387  <varlistentry>
5388   <term><parameter>vec</parameter></term>
5389   <listitem>
5390    <para>
5391     Input s/g array for message data
5392    </para>
5393   </listitem>
5394  </varlistentry>
5395  <varlistentry>
5396   <term><parameter>num</parameter></term>
5397   <listitem>
5398    <para>
5399     Size of input s/g array
5400    </para>
5401   </listitem>
5402  </varlistentry>
5403  <varlistentry>
5404   <term><parameter>size</parameter></term>
5405   <listitem>
5406    <para>
5407     Number of bytes to read
5408    </para>
5409   </listitem>
5410  </varlistentry>
5411  <varlistentry>
5412   <term><parameter>flags</parameter></term>
5413   <listitem>
5414    <para>
5415     Message flags (MSG_DONTWAIT, etc...)
5416    </para>
5417   </listitem>
5418  </varlistentry>
5419 </variablelist>
5420</refsect1>
5421<refsect1>
5422<title>Description</title>
5423<para>
5424   On return the msg structure contains the scatter/gather array passed in the
5425   vec argument. The array is modified so that it consists of the unfilled
5426   portion of the original array.
5427   </para><para>
5428
5429   The returned value is the total number of bytes received, or an error.
5430</para>
5431</refsect1>
5432</refentry>
5433
5434<refentry id="API-sock-register">
5435<refentryinfo>
5436 <title>LINUX</title>
5437 <productname>Kernel Hackers Manual</productname>
5438 <date>July 2017</date>
5439</refentryinfo>
5440<refmeta>
5441 <refentrytitle><phrase>sock_register</phrase></refentrytitle>
5442 <manvolnum>9</manvolnum>
5443 <refmiscinfo class="version">4.1.27</refmiscinfo>
5444</refmeta>
5445<refnamediv>
5446 <refname>sock_register</refname>
5447 <refpurpose>
5448     add a socket protocol handler
5449 </refpurpose>
5450</refnamediv>
5451<refsynopsisdiv>
5452 <title>Synopsis</title>
5453  <funcsynopsis><funcprototype>
5454   <funcdef>int <function>sock_register </function></funcdef>
5455   <paramdef>const struct net_proto_family * <parameter>ops</parameter></paramdef>
5456  </funcprototype></funcsynopsis>
5457</refsynopsisdiv>
5458<refsect1>
5459 <title>Arguments</title>
5460 <variablelist>
5461  <varlistentry>
5462   <term><parameter>ops</parameter></term>
5463   <listitem>
5464    <para>
5465     description of protocol
5466    </para>
5467   </listitem>
5468  </varlistentry>
5469 </variablelist>
5470</refsect1>
5471<refsect1>
5472<title>Description</title>
5473<para>
5474   This function is called by a protocol handler that wants to
5475   advertise its address family, and have it linked into the
5476   socket interface. The value ops-&gt;family corresponds to the
5477   socket system call protocol family.
5478</para>
5479</refsect1>
5480</refentry>
5481
5482<refentry id="API-sock-unregister">
5483<refentryinfo>
5484 <title>LINUX</title>
5485 <productname>Kernel Hackers Manual</productname>
5486 <date>July 2017</date>
5487</refentryinfo>
5488<refmeta>
5489 <refentrytitle><phrase>sock_unregister</phrase></refentrytitle>
5490 <manvolnum>9</manvolnum>
5491 <refmiscinfo class="version">4.1.27</refmiscinfo>
5492</refmeta>
5493<refnamediv>
5494 <refname>sock_unregister</refname>
5495 <refpurpose>
5496     remove a protocol handler
5497 </refpurpose>
5498</refnamediv>
5499<refsynopsisdiv>
5500 <title>Synopsis</title>
5501  <funcsynopsis><funcprototype>
5502   <funcdef>void <function>sock_unregister </function></funcdef>
5503   <paramdef>int <parameter>family</parameter></paramdef>
5504  </funcprototype></funcsynopsis>
5505</refsynopsisdiv>
5506<refsect1>
5507 <title>Arguments</title>
5508 <variablelist>
5509  <varlistentry>
5510   <term><parameter>family</parameter></term>
5511   <listitem>
5512    <para>
5513     protocol family to remove
5514    </para>
5515   </listitem>
5516  </varlistentry>
5517 </variablelist>
5518</refsect1>
5519<refsect1>
5520<title>Description</title>
5521<para>
5522   This function is called by a protocol handler that wants to
5523   remove its address family, and have it unlinked from the
5524   new socket creation.
5525   </para><para>
5526
5527   If protocol handler is a module, then it can use module reference
5528   counts to protect against new references. If protocol handler is not
5529   a module then it needs to provide its own protection in
5530   the ops-&gt;create routine.
5531</para>
5532</refsect1>
5533</refentry>
5534
5535<!-- net/core/skbuff.c -->
5536<refentry id="API---alloc-skb">
5537<refentryinfo>
5538 <title>LINUX</title>
5539 <productname>Kernel Hackers Manual</productname>
5540 <date>July 2017</date>
5541</refentryinfo>
5542<refmeta>
5543 <refentrytitle><phrase>__alloc_skb</phrase></refentrytitle>
5544 <manvolnum>9</manvolnum>
5545 <refmiscinfo class="version">4.1.27</refmiscinfo>
5546</refmeta>
5547<refnamediv>
5548 <refname>__alloc_skb</refname>
5549 <refpurpose>
5550  allocate a network buffer
5551 </refpurpose>
5552</refnamediv>
5553<refsynopsisdiv>
5554 <title>Synopsis</title>
5555  <funcsynopsis><funcprototype>
5556   <funcdef>struct sk_buff * <function>__alloc_skb </function></funcdef>
5557   <paramdef>unsigned int <parameter>size</parameter></paramdef>
5558   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
5559   <paramdef>int <parameter>flags</parameter></paramdef>
5560   <paramdef>int <parameter>node</parameter></paramdef>
5561  </funcprototype></funcsynopsis>
5562</refsynopsisdiv>
5563<refsect1>
5564 <title>Arguments</title>
5565 <variablelist>
5566  <varlistentry>
5567   <term><parameter>size</parameter></term>
5568   <listitem>
5569    <para>
5570     size to allocate
5571    </para>
5572   </listitem>
5573  </varlistentry>
5574  <varlistentry>
5575   <term><parameter>gfp_mask</parameter></term>
5576   <listitem>
5577    <para>
5578     allocation mask
5579    </para>
5580   </listitem>
5581  </varlistentry>
5582  <varlistentry>
5583   <term><parameter>flags</parameter></term>
5584   <listitem>
5585    <para>
5586     If SKB_ALLOC_FCLONE is set, allocate from fclone cache
5587     instead of head cache and allocate a cloned (child) skb.
5588     If SKB_ALLOC_RX is set, __GFP_MEMALLOC will be used for
5589     allocations in case the data is required for writeback
5590    </para>
5591   </listitem>
5592  </varlistentry>
5593  <varlistentry>
5594   <term><parameter>node</parameter></term>
5595   <listitem>
5596    <para>
5597     numa node to allocate memory on
5598    </para>
5599   </listitem>
5600  </varlistentry>
5601 </variablelist>
5602</refsect1>
5603<refsect1>
5604<title>Description</title>
5605<para>
5606   Allocate a new <structname>sk_buff</structname>. The returned buffer has no headroom and a
5607   tail room of at least size bytes. The object has a reference count
5608   of one. The return is the buffer. On a failure the return is <constant>NULL</constant>.
5609   </para><para>
5610
5611   Buffers may only be allocated from interrupts using a <parameter>gfp_mask</parameter> of
5612   <constant>GFP_ATOMIC</constant>.
5613</para>
5614</refsect1>
5615</refentry>
5616
5617<refentry id="API-netdev-alloc-frag">
5618<refentryinfo>
5619 <title>LINUX</title>
5620 <productname>Kernel Hackers Manual</productname>
5621 <date>July 2017</date>
5622</refentryinfo>
5623<refmeta>
5624 <refentrytitle><phrase>netdev_alloc_frag</phrase></refentrytitle>
5625 <manvolnum>9</manvolnum>
5626 <refmiscinfo class="version">4.1.27</refmiscinfo>
5627</refmeta>
5628<refnamediv>
5629 <refname>netdev_alloc_frag</refname>
5630 <refpurpose>
5631     allocate a page fragment
5632 </refpurpose>
5633</refnamediv>
5634<refsynopsisdiv>
5635 <title>Synopsis</title>
5636  <funcsynopsis><funcprototype>
5637   <funcdef>void * <function>netdev_alloc_frag </function></funcdef>
5638   <paramdef>unsigned int <parameter>fragsz</parameter></paramdef>
5639  </funcprototype></funcsynopsis>
5640</refsynopsisdiv>
5641<refsect1>
5642 <title>Arguments</title>
5643 <variablelist>
5644  <varlistentry>
5645   <term><parameter>fragsz</parameter></term>
5646   <listitem>
5647    <para>
5648     fragment size
5649    </para>
5650   </listitem>
5651  </varlistentry>
5652 </variablelist>
5653</refsect1>
5654<refsect1>
5655<title>Description</title>
5656<para>
5657   Allocates a frag from a page for receive buffer.
5658   Uses GFP_ATOMIC allocations.
5659</para>
5660</refsect1>
5661</refentry>
5662
5663<refentry id="API---netdev-alloc-skb">
5664<refentryinfo>
5665 <title>LINUX</title>
5666 <productname>Kernel Hackers Manual</productname>
5667 <date>July 2017</date>
5668</refentryinfo>
5669<refmeta>
5670 <refentrytitle><phrase>__netdev_alloc_skb</phrase></refentrytitle>
5671 <manvolnum>9</manvolnum>
5672 <refmiscinfo class="version">4.1.27</refmiscinfo>
5673</refmeta>
5674<refnamediv>
5675 <refname>__netdev_alloc_skb</refname>
5676 <refpurpose>
5677     allocate an skbuff for rx on a specific device
5678 </refpurpose>
5679</refnamediv>
5680<refsynopsisdiv>
5681 <title>Synopsis</title>
5682  <funcsynopsis><funcprototype>
5683   <funcdef>struct sk_buff * <function>__netdev_alloc_skb </function></funcdef>
5684   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
5685   <paramdef>unsigned int <parameter>length</parameter></paramdef>
5686   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
5687  </funcprototype></funcsynopsis>
5688</refsynopsisdiv>
5689<refsect1>
5690 <title>Arguments</title>
5691 <variablelist>
5692  <varlistentry>
5693   <term><parameter>dev</parameter></term>
5694   <listitem>
5695    <para>
5696     network device to receive on
5697    </para>
5698   </listitem>
5699  </varlistentry>
5700  <varlistentry>
5701   <term><parameter>length</parameter></term>
5702   <listitem>
5703    <para>
5704     length to allocate
5705    </para>
5706   </listitem>
5707  </varlistentry>
5708  <varlistentry>
5709   <term><parameter>gfp_mask</parameter></term>
5710   <listitem>
5711    <para>
5712     get_free_pages mask, passed to alloc_skb
5713    </para>
5714   </listitem>
5715  </varlistentry>
5716 </variablelist>
5717</refsect1>
5718<refsect1>
5719<title>Description</title>
5720<para>
5721   Allocate a new <structname>sk_buff</structname> and assign it a usage count of one. The
5722   buffer has NET_SKB_PAD headroom built in. Users should allocate
5723   the headroom they think they need without accounting for the
5724   built in space. The built in space is used for optimisations.
5725   </para><para>
5726
5727   <constant>NULL</constant> is returned if there is no free memory.
5728</para>
5729</refsect1>
5730</refentry>
5731
5732<refentry id="API---napi-alloc-skb">
5733<refentryinfo>
5734 <title>LINUX</title>
5735 <productname>Kernel Hackers Manual</productname>
5736 <date>July 2017</date>
5737</refentryinfo>
5738<refmeta>
5739 <refentrytitle><phrase>__napi_alloc_skb</phrase></refentrytitle>
5740 <manvolnum>9</manvolnum>
5741 <refmiscinfo class="version">4.1.27</refmiscinfo>
5742</refmeta>
5743<refnamediv>
5744 <refname>__napi_alloc_skb</refname>
5745 <refpurpose>
5746     allocate skbuff for rx in a specific NAPI instance
5747 </refpurpose>
5748</refnamediv>
5749<refsynopsisdiv>
5750 <title>Synopsis</title>
5751  <funcsynopsis><funcprototype>
5752   <funcdef>struct sk_buff * <function>__napi_alloc_skb </function></funcdef>
5753   <paramdef>struct napi_struct * <parameter>napi</parameter></paramdef>
5754   <paramdef>unsigned int <parameter>length</parameter></paramdef>
5755   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
5756  </funcprototype></funcsynopsis>
5757</refsynopsisdiv>
5758<refsect1>
5759 <title>Arguments</title>
5760 <variablelist>
5761  <varlistentry>
5762   <term><parameter>napi</parameter></term>
5763   <listitem>
5764    <para>
5765     napi instance this buffer was allocated for
5766    </para>
5767   </listitem>
5768  </varlistentry>
5769  <varlistentry>
5770   <term><parameter>length</parameter></term>
5771   <listitem>
5772    <para>
5773     length to allocate
5774    </para>
5775   </listitem>
5776  </varlistentry>
5777  <varlistentry>
5778   <term><parameter>gfp_mask</parameter></term>
5779   <listitem>
5780    <para>
5781     get_free_pages mask, passed to alloc_skb and alloc_pages
5782    </para>
5783   </listitem>
5784  </varlistentry>
5785 </variablelist>
5786</refsect1>
5787<refsect1>
5788<title>Description</title>
5789<para>
5790   Allocate a new sk_buff for use in NAPI receive.  This buffer will
5791   attempt to allocate the head from a special reserved region used
5792   only for NAPI Rx allocation.  By doing this we can save several
5793   CPU cycles by avoiding having to disable and re-enable IRQs.
5794   </para><para>
5795
5796   <constant>NULL</constant> is returned if there is no free memory.
5797</para>
5798</refsect1>
5799</refentry>
5800
5801<refentry id="API---kfree-skb">
5802<refentryinfo>
5803 <title>LINUX</title>
5804 <productname>Kernel Hackers Manual</productname>
5805 <date>July 2017</date>
5806</refentryinfo>
5807<refmeta>
5808 <refentrytitle><phrase>__kfree_skb</phrase></refentrytitle>
5809 <manvolnum>9</manvolnum>
5810 <refmiscinfo class="version">4.1.27</refmiscinfo>
5811</refmeta>
5812<refnamediv>
5813 <refname>__kfree_skb</refname>
5814 <refpurpose>
5815     private function
5816 </refpurpose>
5817</refnamediv>
5818<refsynopsisdiv>
5819 <title>Synopsis</title>
5820  <funcsynopsis><funcprototype>
5821   <funcdef>void <function>__kfree_skb </function></funcdef>
5822   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
5823  </funcprototype></funcsynopsis>
5824</refsynopsisdiv>
5825<refsect1>
5826 <title>Arguments</title>
5827 <variablelist>
5828  <varlistentry>
5829   <term><parameter>skb</parameter></term>
5830   <listitem>
5831    <para>
5832     buffer
5833    </para>
5834   </listitem>
5835  </varlistentry>
5836 </variablelist>
5837</refsect1>
5838<refsect1>
5839<title>Description</title>
5840<para>
5841   Free an sk_buff. Release anything attached to the buffer.
5842   Clean the state. This is an internal helper function. Users should
5843   always call kfree_skb
5844</para>
5845</refsect1>
5846</refentry>
5847
5848<refentry id="API-kfree-skb">
5849<refentryinfo>
5850 <title>LINUX</title>
5851 <productname>Kernel Hackers Manual</productname>
5852 <date>July 2017</date>
5853</refentryinfo>
5854<refmeta>
5855 <refentrytitle><phrase>kfree_skb</phrase></refentrytitle>
5856 <manvolnum>9</manvolnum>
5857 <refmiscinfo class="version">4.1.27</refmiscinfo>
5858</refmeta>
5859<refnamediv>
5860 <refname>kfree_skb</refname>
5861 <refpurpose>
5862     free an sk_buff
5863 </refpurpose>
5864</refnamediv>
5865<refsynopsisdiv>
5866 <title>Synopsis</title>
5867  <funcsynopsis><funcprototype>
5868   <funcdef>void <function>kfree_skb </function></funcdef>
5869   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
5870  </funcprototype></funcsynopsis>
5871</refsynopsisdiv>
5872<refsect1>
5873 <title>Arguments</title>
5874 <variablelist>
5875  <varlistentry>
5876   <term><parameter>skb</parameter></term>
5877   <listitem>
5878    <para>
5879     buffer to free
5880    </para>
5881   </listitem>
5882  </varlistentry>
5883 </variablelist>
5884</refsect1>
5885<refsect1>
5886<title>Description</title>
5887<para>
5888   Drop a reference to the buffer and free it if the usage count has
5889   hit zero.
5890</para>
5891</refsect1>
5892</refentry>
5893
5894<refentry id="API-skb-tx-error">
5895<refentryinfo>
5896 <title>LINUX</title>
5897 <productname>Kernel Hackers Manual</productname>
5898 <date>July 2017</date>
5899</refentryinfo>
5900<refmeta>
5901 <refentrytitle><phrase>skb_tx_error</phrase></refentrytitle>
5902 <manvolnum>9</manvolnum>
5903 <refmiscinfo class="version">4.1.27</refmiscinfo>
5904</refmeta>
5905<refnamediv>
5906 <refname>skb_tx_error</refname>
5907 <refpurpose>
5908     report an sk_buff xmit error
5909 </refpurpose>
5910</refnamediv>
5911<refsynopsisdiv>
5912 <title>Synopsis</title>
5913  <funcsynopsis><funcprototype>
5914   <funcdef>void <function>skb_tx_error </function></funcdef>
5915   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
5916  </funcprototype></funcsynopsis>
5917</refsynopsisdiv>
5918<refsect1>
5919 <title>Arguments</title>
5920 <variablelist>
5921  <varlistentry>
5922   <term><parameter>skb</parameter></term>
5923   <listitem>
5924    <para>
5925     buffer that triggered an error
5926    </para>
5927   </listitem>
5928  </varlistentry>
5929 </variablelist>
5930</refsect1>
5931<refsect1>
5932<title>Description</title>
5933<para>
5934   Report xmit error if a device callback is tracking this skb.
5935   skb must be freed afterwards.
5936</para>
5937</refsect1>
5938</refentry>
5939
5940<refentry id="API-consume-skb">
5941<refentryinfo>
5942 <title>LINUX</title>
5943 <productname>Kernel Hackers Manual</productname>
5944 <date>July 2017</date>
5945</refentryinfo>
5946<refmeta>
5947 <refentrytitle><phrase>consume_skb</phrase></refentrytitle>
5948 <manvolnum>9</manvolnum>
5949 <refmiscinfo class="version">4.1.27</refmiscinfo>
5950</refmeta>
5951<refnamediv>
5952 <refname>consume_skb</refname>
5953 <refpurpose>
5954     free an skbuff
5955 </refpurpose>
5956</refnamediv>
5957<refsynopsisdiv>
5958 <title>Synopsis</title>
5959  <funcsynopsis><funcprototype>
5960   <funcdef>void <function>consume_skb </function></funcdef>
5961   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
5962  </funcprototype></funcsynopsis>
5963</refsynopsisdiv>
5964<refsect1>
5965 <title>Arguments</title>
5966 <variablelist>
5967  <varlistentry>
5968   <term><parameter>skb</parameter></term>
5969   <listitem>
5970    <para>
5971     buffer to free
5972    </para>
5973   </listitem>
5974  </varlistentry>
5975 </variablelist>
5976</refsect1>
5977<refsect1>
5978<title>Description</title>
5979<para>
5980   Drop a ref to the buffer and free it if the usage count has hit zero
5981   Functions identically to kfree_skb, but kfree_skb assumes that the frame
5982   is being dropped after a failure and notes that
5983</para>
5984</refsect1>
5985</refentry>
5986
5987<refentry id="API-skb-morph">
5988<refentryinfo>
5989 <title>LINUX</title>
5990 <productname>Kernel Hackers Manual</productname>
5991 <date>July 2017</date>
5992</refentryinfo>
5993<refmeta>
5994 <refentrytitle><phrase>skb_morph</phrase></refentrytitle>
5995 <manvolnum>9</manvolnum>
5996 <refmiscinfo class="version">4.1.27</refmiscinfo>
5997</refmeta>
5998<refnamediv>
5999 <refname>skb_morph</refname>
6000 <refpurpose>
6001     morph one skb into another
6002 </refpurpose>
6003</refnamediv>
6004<refsynopsisdiv>
6005 <title>Synopsis</title>
6006  <funcsynopsis><funcprototype>
6007   <funcdef>struct sk_buff * <function>skb_morph </function></funcdef>
6008   <paramdef>struct sk_buff * <parameter>dst</parameter></paramdef>
6009   <paramdef>struct sk_buff * <parameter>src</parameter></paramdef>
6010  </funcprototype></funcsynopsis>
6011</refsynopsisdiv>
6012<refsect1>
6013 <title>Arguments</title>
6014 <variablelist>
6015  <varlistentry>
6016   <term><parameter>dst</parameter></term>
6017   <listitem>
6018    <para>
6019     the skb to receive the contents
6020    </para>
6021   </listitem>
6022  </varlistentry>
6023  <varlistentry>
6024   <term><parameter>src</parameter></term>
6025   <listitem>
6026    <para>
6027     the skb to supply the contents
6028    </para>
6029   </listitem>
6030  </varlistentry>
6031 </variablelist>
6032</refsect1>
6033<refsect1>
6034<title>Description</title>
6035<para>
6036   This is identical to skb_clone except that the target skb is
6037   supplied by the user.
6038   </para><para>
6039
6040   The target skb is returned upon exit.
6041</para>
6042</refsect1>
6043</refentry>
6044
6045<refentry id="API-skb-copy-ubufs">
6046<refentryinfo>
6047 <title>LINUX</title>
6048 <productname>Kernel Hackers Manual</productname>
6049 <date>July 2017</date>
6050</refentryinfo>
6051<refmeta>
6052 <refentrytitle><phrase>skb_copy_ubufs</phrase></refentrytitle>
6053 <manvolnum>9</manvolnum>
6054 <refmiscinfo class="version">4.1.27</refmiscinfo>
6055</refmeta>
6056<refnamediv>
6057 <refname>skb_copy_ubufs</refname>
6058 <refpurpose>
6059     copy userspace skb frags buffers to kernel
6060 </refpurpose>
6061</refnamediv>
6062<refsynopsisdiv>
6063 <title>Synopsis</title>
6064  <funcsynopsis><funcprototype>
6065   <funcdef>int <function>skb_copy_ubufs </function></funcdef>
6066   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6067   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
6068  </funcprototype></funcsynopsis>
6069</refsynopsisdiv>
6070<refsect1>
6071 <title>Arguments</title>
6072 <variablelist>
6073  <varlistentry>
6074   <term><parameter>skb</parameter></term>
6075   <listitem>
6076    <para>
6077     the skb to modify
6078    </para>
6079   </listitem>
6080  </varlistentry>
6081  <varlistentry>
6082   <term><parameter>gfp_mask</parameter></term>
6083   <listitem>
6084    <para>
6085     allocation priority
6086    </para>
6087   </listitem>
6088  </varlistentry>
6089 </variablelist>
6090</refsect1>
6091<refsect1>
6092<title>Description</title>
6093<para>
6094   This must be called on SKBTX_DEV_ZEROCOPY skb.
6095   It will copy all frags into kernel and drop the reference
6096   to userspace pages.
6097   </para><para>
6098
6099   If this function is called from an interrupt <function>gfp_mask</function> must be
6100   <constant>GFP_ATOMIC</constant>.
6101   </para><para>
6102
6103   Returns 0 on success or a negative error code on failure
6104   to allocate kernel memory to copy to.
6105</para>
6106</refsect1>
6107</refentry>
6108
6109<refentry id="API-skb-clone">
6110<refentryinfo>
6111 <title>LINUX</title>
6112 <productname>Kernel Hackers Manual</productname>
6113 <date>July 2017</date>
6114</refentryinfo>
6115<refmeta>
6116 <refentrytitle><phrase>skb_clone</phrase></refentrytitle>
6117 <manvolnum>9</manvolnum>
6118 <refmiscinfo class="version">4.1.27</refmiscinfo>
6119</refmeta>
6120<refnamediv>
6121 <refname>skb_clone</refname>
6122 <refpurpose>
6123     duplicate an sk_buff
6124 </refpurpose>
6125</refnamediv>
6126<refsynopsisdiv>
6127 <title>Synopsis</title>
6128  <funcsynopsis><funcprototype>
6129   <funcdef>struct sk_buff * <function>skb_clone </function></funcdef>
6130   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6131   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
6132  </funcprototype></funcsynopsis>
6133</refsynopsisdiv>
6134<refsect1>
6135 <title>Arguments</title>
6136 <variablelist>
6137  <varlistentry>
6138   <term><parameter>skb</parameter></term>
6139   <listitem>
6140    <para>
6141     buffer to clone
6142    </para>
6143   </listitem>
6144  </varlistentry>
6145  <varlistentry>
6146   <term><parameter>gfp_mask</parameter></term>
6147   <listitem>
6148    <para>
6149     allocation priority
6150    </para>
6151   </listitem>
6152  </varlistentry>
6153 </variablelist>
6154</refsect1>
6155<refsect1>
6156<title>Description</title>
6157<para>
6158   Duplicate an <structname>sk_buff</structname>. The new one is not owned by a socket. Both
6159   copies share the same packet data but not structure. The new
6160   buffer has a reference count of 1. If the allocation fails the
6161   function returns <constant>NULL</constant> otherwise the new buffer is returned.
6162   </para><para>
6163
6164   If this function is called from an interrupt <function>gfp_mask</function> must be
6165   <constant>GFP_ATOMIC</constant>.
6166</para>
6167</refsect1>
6168</refentry>
6169
6170<refentry id="API-skb-copy">
6171<refentryinfo>
6172 <title>LINUX</title>
6173 <productname>Kernel Hackers Manual</productname>
6174 <date>July 2017</date>
6175</refentryinfo>
6176<refmeta>
6177 <refentrytitle><phrase>skb_copy</phrase></refentrytitle>
6178 <manvolnum>9</manvolnum>
6179 <refmiscinfo class="version">4.1.27</refmiscinfo>
6180</refmeta>
6181<refnamediv>
6182 <refname>skb_copy</refname>
6183 <refpurpose>
6184     create private copy of an sk_buff
6185 </refpurpose>
6186</refnamediv>
6187<refsynopsisdiv>
6188 <title>Synopsis</title>
6189  <funcsynopsis><funcprototype>
6190   <funcdef>struct sk_buff * <function>skb_copy </function></funcdef>
6191   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
6192   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
6193  </funcprototype></funcsynopsis>
6194</refsynopsisdiv>
6195<refsect1>
6196 <title>Arguments</title>
6197 <variablelist>
6198  <varlistentry>
6199   <term><parameter>skb</parameter></term>
6200   <listitem>
6201    <para>
6202     buffer to copy
6203    </para>
6204   </listitem>
6205  </varlistentry>
6206  <varlistentry>
6207   <term><parameter>gfp_mask</parameter></term>
6208   <listitem>
6209    <para>
6210     allocation priority
6211    </para>
6212   </listitem>
6213  </varlistentry>
6214 </variablelist>
6215</refsect1>
6216<refsect1>
6217<title>Description</title>
6218<para>
6219   Make a copy of both an <structname>sk_buff</structname> and its data. This is used when the
6220   caller wishes to modify the data and needs a private copy of the
6221   data to alter. Returns <constant>NULL</constant> on failure or the pointer to the buffer
6222   on success. The returned buffer has a reference count of 1.
6223   </para><para>
6224
6225   As by-product this function converts non-linear <structname>sk_buff</structname> to linear
6226   one, so that <structname>sk_buff</structname> becomes completely private and caller is allowed
6227   to modify all the data of returned buffer. This means that this
6228   function is not recommended for use in circumstances when only
6229   header is going to be modified. Use <function>pskb_copy</function> instead.
6230</para>
6231</refsect1>
6232</refentry>
6233
6234<refentry id="API---pskb-copy-fclone">
6235<refentryinfo>
6236 <title>LINUX</title>
6237 <productname>Kernel Hackers Manual</productname>
6238 <date>July 2017</date>
6239</refentryinfo>
6240<refmeta>
6241 <refentrytitle><phrase>__pskb_copy_fclone</phrase></refentrytitle>
6242 <manvolnum>9</manvolnum>
6243 <refmiscinfo class="version">4.1.27</refmiscinfo>
6244</refmeta>
6245<refnamediv>
6246 <refname>__pskb_copy_fclone</refname>
6247 <refpurpose>
6248     create copy of an sk_buff with private head.
6249 </refpurpose>
6250</refnamediv>
6251<refsynopsisdiv>
6252 <title>Synopsis</title>
6253  <funcsynopsis><funcprototype>
6254   <funcdef>struct sk_buff * <function>__pskb_copy_fclone </function></funcdef>
6255   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6256   <paramdef>int <parameter>headroom</parameter></paramdef>
6257   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
6258   <paramdef>bool <parameter>fclone</parameter></paramdef>
6259  </funcprototype></funcsynopsis>
6260</refsynopsisdiv>
6261<refsect1>
6262 <title>Arguments</title>
6263 <variablelist>
6264  <varlistentry>
6265   <term><parameter>skb</parameter></term>
6266   <listitem>
6267    <para>
6268     buffer to copy
6269    </para>
6270   </listitem>
6271  </varlistentry>
6272  <varlistentry>
6273   <term><parameter>headroom</parameter></term>
6274   <listitem>
6275    <para>
6276     headroom of new skb
6277    </para>
6278   </listitem>
6279  </varlistentry>
6280  <varlistentry>
6281   <term><parameter>gfp_mask</parameter></term>
6282   <listitem>
6283    <para>
6284     allocation priority
6285    </para>
6286   </listitem>
6287  </varlistentry>
6288  <varlistentry>
6289   <term><parameter>fclone</parameter></term>
6290   <listitem>
6291    <para>
6292     if true allocate the copy of the skb from the fclone
6293     cache instead of the head cache; it is recommended to set this
6294     to true for the cases where the copy will likely be cloned
6295    </para>
6296   </listitem>
6297  </varlistentry>
6298 </variablelist>
6299</refsect1>
6300<refsect1>
6301<title>Description</title>
6302<para>
6303   Make a copy of both an <structname>sk_buff</structname> and part of its data, located
6304   in header. Fragmented data remain shared. This is used when
6305   the caller wishes to modify only header of <structname>sk_buff</structname> and needs
6306   private copy of the header to alter. Returns <constant>NULL</constant> on failure
6307   or the pointer to the buffer on success.
6308   The returned buffer has a reference count of 1.
6309</para>
6310</refsect1>
6311</refentry>
6312
6313<refentry id="API-pskb-expand-head">
6314<refentryinfo>
6315 <title>LINUX</title>
6316 <productname>Kernel Hackers Manual</productname>
6317 <date>July 2017</date>
6318</refentryinfo>
6319<refmeta>
6320 <refentrytitle><phrase>pskb_expand_head</phrase></refentrytitle>
6321 <manvolnum>9</manvolnum>
6322 <refmiscinfo class="version">4.1.27</refmiscinfo>
6323</refmeta>
6324<refnamediv>
6325 <refname>pskb_expand_head</refname>
6326 <refpurpose>
6327     reallocate header of <structname>sk_buff</structname>
6328 </refpurpose>
6329</refnamediv>
6330<refsynopsisdiv>
6331 <title>Synopsis</title>
6332  <funcsynopsis><funcprototype>
6333   <funcdef>int <function>pskb_expand_head </function></funcdef>
6334   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6335   <paramdef>int <parameter>nhead</parameter></paramdef>
6336   <paramdef>int <parameter>ntail</parameter></paramdef>
6337   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
6338  </funcprototype></funcsynopsis>
6339</refsynopsisdiv>
6340<refsect1>
6341 <title>Arguments</title>
6342 <variablelist>
6343  <varlistentry>
6344   <term><parameter>skb</parameter></term>
6345   <listitem>
6346    <para>
6347     buffer to reallocate
6348    </para>
6349   </listitem>
6350  </varlistentry>
6351  <varlistentry>
6352   <term><parameter>nhead</parameter></term>
6353   <listitem>
6354    <para>
6355     room to add at head
6356    </para>
6357   </listitem>
6358  </varlistentry>
6359  <varlistentry>
6360   <term><parameter>ntail</parameter></term>
6361   <listitem>
6362    <para>
6363     room to add at tail
6364    </para>
6365   </listitem>
6366  </varlistentry>
6367  <varlistentry>
6368   <term><parameter>gfp_mask</parameter></term>
6369   <listitem>
6370    <para>
6371     allocation priority
6372    </para>
6373   </listitem>
6374  </varlistentry>
6375 </variablelist>
6376</refsect1>
6377<refsect1>
6378<title>Description</title>
6379<para>
6380   Expands (or creates identical copy, if <parameter>nhead</parameter> and <parameter>ntail</parameter> are zero)
6381   header of <parameter>skb</parameter>. <structname>sk_buff</structname> itself is not changed. <structname>sk_buff</structname> MUST have
6382   reference count of 1. Returns zero in the case of success or error,
6383   if expansion failed. In the last case, <structname>sk_buff</structname> is not changed.
6384   </para><para>
6385
6386   All the pointers pointing into skb header may change and must be
6387   reloaded after call to this function.
6388</para>
6389</refsect1>
6390</refentry>
6391
6392<refentry id="API-skb-copy-expand">
6393<refentryinfo>
6394 <title>LINUX</title>
6395 <productname>Kernel Hackers Manual</productname>
6396 <date>July 2017</date>
6397</refentryinfo>
6398<refmeta>
6399 <refentrytitle><phrase>skb_copy_expand</phrase></refentrytitle>
6400 <manvolnum>9</manvolnum>
6401 <refmiscinfo class="version">4.1.27</refmiscinfo>
6402</refmeta>
6403<refnamediv>
6404 <refname>skb_copy_expand</refname>
6405 <refpurpose>
6406     copy and expand sk_buff
6407 </refpurpose>
6408</refnamediv>
6409<refsynopsisdiv>
6410 <title>Synopsis</title>
6411  <funcsynopsis><funcprototype>
6412   <funcdef>struct sk_buff * <function>skb_copy_expand </function></funcdef>
6413   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
6414   <paramdef>int <parameter>newheadroom</parameter></paramdef>
6415   <paramdef>int <parameter>newtailroom</parameter></paramdef>
6416   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
6417  </funcprototype></funcsynopsis>
6418</refsynopsisdiv>
6419<refsect1>
6420 <title>Arguments</title>
6421 <variablelist>
6422  <varlistentry>
6423   <term><parameter>skb</parameter></term>
6424   <listitem>
6425    <para>
6426     buffer to copy
6427    </para>
6428   </listitem>
6429  </varlistentry>
6430  <varlistentry>
6431   <term><parameter>newheadroom</parameter></term>
6432   <listitem>
6433    <para>
6434     new free bytes at head
6435    </para>
6436   </listitem>
6437  </varlistentry>
6438  <varlistentry>
6439   <term><parameter>newtailroom</parameter></term>
6440   <listitem>
6441    <para>
6442     new free bytes at tail
6443    </para>
6444   </listitem>
6445  </varlistentry>
6446  <varlistentry>
6447   <term><parameter>gfp_mask</parameter></term>
6448   <listitem>
6449    <para>
6450     allocation priority
6451    </para>
6452   </listitem>
6453  </varlistentry>
6454 </variablelist>
6455</refsect1>
6456<refsect1>
6457<title>Description</title>
6458<para>
6459   Make a copy of both an <structname>sk_buff</structname> and its data and while doing so
6460   allocate additional space.
6461   </para><para>
6462
6463   This is used when the caller wishes to modify the data and needs a
6464   private copy of the data to alter as well as more space for new fields.
6465   Returns <constant>NULL</constant> on failure or the pointer to the buffer
6466   on success. The returned buffer has a reference count of 1.
6467   </para><para>
6468
6469   You must pass <constant>GFP_ATOMIC</constant> as the allocation priority if this function
6470   is called from an interrupt.
6471</para>
6472</refsect1>
6473</refentry>
6474
6475<refentry id="API-skb-pad">
6476<refentryinfo>
6477 <title>LINUX</title>
6478 <productname>Kernel Hackers Manual</productname>
6479 <date>July 2017</date>
6480</refentryinfo>
6481<refmeta>
6482 <refentrytitle><phrase>skb_pad</phrase></refentrytitle>
6483 <manvolnum>9</manvolnum>
6484 <refmiscinfo class="version">4.1.27</refmiscinfo>
6485</refmeta>
6486<refnamediv>
6487 <refname>skb_pad</refname>
6488 <refpurpose>
6489     zero pad the tail of an skb
6490 </refpurpose>
6491</refnamediv>
6492<refsynopsisdiv>
6493 <title>Synopsis</title>
6494  <funcsynopsis><funcprototype>
6495   <funcdef>int <function>skb_pad </function></funcdef>
6496   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6497   <paramdef>int <parameter>pad</parameter></paramdef>
6498  </funcprototype></funcsynopsis>
6499</refsynopsisdiv>
6500<refsect1>
6501 <title>Arguments</title>
6502 <variablelist>
6503  <varlistentry>
6504   <term><parameter>skb</parameter></term>
6505   <listitem>
6506    <para>
6507     buffer to pad
6508    </para>
6509   </listitem>
6510  </varlistentry>
6511  <varlistentry>
6512   <term><parameter>pad</parameter></term>
6513   <listitem>
6514    <para>
6515     space to pad
6516    </para>
6517   </listitem>
6518  </varlistentry>
6519 </variablelist>
6520</refsect1>
6521<refsect1>
6522<title>Description</title>
6523<para>
6524   Ensure that a buffer is followed by a padding area that is zero
6525   filled. Used by network drivers which may DMA or transfer data
6526   beyond the buffer end onto the wire.
6527   </para><para>
6528
6529   May return error in out of memory cases. The skb is freed on error.
6530</para>
6531</refsect1>
6532</refentry>
6533
6534<refentry id="API-pskb-put">
6535<refentryinfo>
6536 <title>LINUX</title>
6537 <productname>Kernel Hackers Manual</productname>
6538 <date>July 2017</date>
6539</refentryinfo>
6540<refmeta>
6541 <refentrytitle><phrase>pskb_put</phrase></refentrytitle>
6542 <manvolnum>9</manvolnum>
6543 <refmiscinfo class="version">4.1.27</refmiscinfo>
6544</refmeta>
6545<refnamediv>
6546 <refname>pskb_put</refname>
6547 <refpurpose>
6548     add data to the tail of a potentially fragmented buffer
6549 </refpurpose>
6550</refnamediv>
6551<refsynopsisdiv>
6552 <title>Synopsis</title>
6553  <funcsynopsis><funcprototype>
6554   <funcdef>unsigned char * <function>pskb_put </function></funcdef>
6555   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6556   <paramdef>struct sk_buff * <parameter>tail</parameter></paramdef>
6557   <paramdef>int <parameter>len</parameter></paramdef>
6558  </funcprototype></funcsynopsis>
6559</refsynopsisdiv>
6560<refsect1>
6561 <title>Arguments</title>
6562 <variablelist>
6563  <varlistentry>
6564   <term><parameter>skb</parameter></term>
6565   <listitem>
6566    <para>
6567     start of the buffer to use
6568    </para>
6569   </listitem>
6570  </varlistentry>
6571  <varlistentry>
6572   <term><parameter>tail</parameter></term>
6573   <listitem>
6574    <para>
6575     tail fragment of the buffer to use
6576    </para>
6577   </listitem>
6578  </varlistentry>
6579  <varlistentry>
6580   <term><parameter>len</parameter></term>
6581   <listitem>
6582    <para>
6583     amount of data to add
6584    </para>
6585   </listitem>
6586  </varlistentry>
6587 </variablelist>
6588</refsect1>
6589<refsect1>
6590<title>Description</title>
6591<para>
6592   This function extends the used data area of the potentially
6593   fragmented buffer. <parameter>tail</parameter> must be the last fragment of <parameter>skb</parameter> -- or
6594   <parameter>skb</parameter> itself. If this would exceed the total buffer size the kernel
6595   will panic. A pointer to the first byte of the extra data is
6596   returned.
6597</para>
6598</refsect1>
6599</refentry>
6600
6601<refentry id="API-skb-put">
6602<refentryinfo>
6603 <title>LINUX</title>
6604 <productname>Kernel Hackers Manual</productname>
6605 <date>July 2017</date>
6606</refentryinfo>
6607<refmeta>
6608 <refentrytitle><phrase>skb_put</phrase></refentrytitle>
6609 <manvolnum>9</manvolnum>
6610 <refmiscinfo class="version">4.1.27</refmiscinfo>
6611</refmeta>
6612<refnamediv>
6613 <refname>skb_put</refname>
6614 <refpurpose>
6615     add data to a buffer
6616 </refpurpose>
6617</refnamediv>
6618<refsynopsisdiv>
6619 <title>Synopsis</title>
6620  <funcsynopsis><funcprototype>
6621   <funcdef>unsigned char * <function>skb_put </function></funcdef>
6622   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6623   <paramdef>unsigned int <parameter>len</parameter></paramdef>
6624  </funcprototype></funcsynopsis>
6625</refsynopsisdiv>
6626<refsect1>
6627 <title>Arguments</title>
6628 <variablelist>
6629  <varlistentry>
6630   <term><parameter>skb</parameter></term>
6631   <listitem>
6632    <para>
6633     buffer to use
6634    </para>
6635   </listitem>
6636  </varlistentry>
6637  <varlistentry>
6638   <term><parameter>len</parameter></term>
6639   <listitem>
6640    <para>
6641     amount of data to add
6642    </para>
6643   </listitem>
6644  </varlistentry>
6645 </variablelist>
6646</refsect1>
6647<refsect1>
6648<title>Description</title>
6649<para>
6650   This function extends the used data area of the buffer. If this would
6651   exceed the total buffer size the kernel will panic. A pointer to the
6652   first byte of the extra data is returned.
6653</para>
6654</refsect1>
6655</refentry>
6656
6657<refentry id="API-skb-push">
6658<refentryinfo>
6659 <title>LINUX</title>
6660 <productname>Kernel Hackers Manual</productname>
6661 <date>July 2017</date>
6662</refentryinfo>
6663<refmeta>
6664 <refentrytitle><phrase>skb_push</phrase></refentrytitle>
6665 <manvolnum>9</manvolnum>
6666 <refmiscinfo class="version">4.1.27</refmiscinfo>
6667</refmeta>
6668<refnamediv>
6669 <refname>skb_push</refname>
6670 <refpurpose>
6671     add data to the start of a buffer
6672 </refpurpose>
6673</refnamediv>
6674<refsynopsisdiv>
6675 <title>Synopsis</title>
6676  <funcsynopsis><funcprototype>
6677   <funcdef>unsigned char * <function>skb_push </function></funcdef>
6678   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6679   <paramdef>unsigned int <parameter>len</parameter></paramdef>
6680  </funcprototype></funcsynopsis>
6681</refsynopsisdiv>
6682<refsect1>
6683 <title>Arguments</title>
6684 <variablelist>
6685  <varlistentry>
6686   <term><parameter>skb</parameter></term>
6687   <listitem>
6688    <para>
6689     buffer to use
6690    </para>
6691   </listitem>
6692  </varlistentry>
6693  <varlistentry>
6694   <term><parameter>len</parameter></term>
6695   <listitem>
6696    <para>
6697     amount of data to add
6698    </para>
6699   </listitem>
6700  </varlistentry>
6701 </variablelist>
6702</refsect1>
6703<refsect1>
6704<title>Description</title>
6705<para>
6706   This function extends the used data area of the buffer at the buffer
6707   start. If this would exceed the total buffer headroom the kernel will
6708   panic. A pointer to the first byte of the extra data is returned.
6709</para>
6710</refsect1>
6711</refentry>
6712
6713<refentry id="API-skb-pull">
6714<refentryinfo>
6715 <title>LINUX</title>
6716 <productname>Kernel Hackers Manual</productname>
6717 <date>July 2017</date>
6718</refentryinfo>
6719<refmeta>
6720 <refentrytitle><phrase>skb_pull</phrase></refentrytitle>
6721 <manvolnum>9</manvolnum>
6722 <refmiscinfo class="version">4.1.27</refmiscinfo>
6723</refmeta>
6724<refnamediv>
6725 <refname>skb_pull</refname>
6726 <refpurpose>
6727     remove data from the start of a buffer
6728 </refpurpose>
6729</refnamediv>
6730<refsynopsisdiv>
6731 <title>Synopsis</title>
6732  <funcsynopsis><funcprototype>
6733   <funcdef>unsigned char * <function>skb_pull </function></funcdef>
6734   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6735   <paramdef>unsigned int <parameter>len</parameter></paramdef>
6736  </funcprototype></funcsynopsis>
6737</refsynopsisdiv>
6738<refsect1>
6739 <title>Arguments</title>
6740 <variablelist>
6741  <varlistentry>
6742   <term><parameter>skb</parameter></term>
6743   <listitem>
6744    <para>
6745     buffer to use
6746    </para>
6747   </listitem>
6748  </varlistentry>
6749  <varlistentry>
6750   <term><parameter>len</parameter></term>
6751   <listitem>
6752    <para>
6753     amount of data to remove
6754    </para>
6755   </listitem>
6756  </varlistentry>
6757 </variablelist>
6758</refsect1>
6759<refsect1>
6760<title>Description</title>
6761<para>
6762   This function removes data from the start of a buffer, returning
6763   the memory to the headroom. A pointer to the next data in the buffer
6764   is returned. Once the data has been pulled future pushes will overwrite
6765   the old data.
6766</para>
6767</refsect1>
6768</refentry>
6769
6770<refentry id="API-skb-trim">
6771<refentryinfo>
6772 <title>LINUX</title>
6773 <productname>Kernel Hackers Manual</productname>
6774 <date>July 2017</date>
6775</refentryinfo>
6776<refmeta>
6777 <refentrytitle><phrase>skb_trim</phrase></refentrytitle>
6778 <manvolnum>9</manvolnum>
6779 <refmiscinfo class="version">4.1.27</refmiscinfo>
6780</refmeta>
6781<refnamediv>
6782 <refname>skb_trim</refname>
6783 <refpurpose>
6784     remove end from a buffer
6785 </refpurpose>
6786</refnamediv>
6787<refsynopsisdiv>
6788 <title>Synopsis</title>
6789  <funcsynopsis><funcprototype>
6790   <funcdef>void <function>skb_trim </function></funcdef>
6791   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6792   <paramdef>unsigned int <parameter>len</parameter></paramdef>
6793  </funcprototype></funcsynopsis>
6794</refsynopsisdiv>
6795<refsect1>
6796 <title>Arguments</title>
6797 <variablelist>
6798  <varlistentry>
6799   <term><parameter>skb</parameter></term>
6800   <listitem>
6801    <para>
6802     buffer to alter
6803    </para>
6804   </listitem>
6805  </varlistentry>
6806  <varlistentry>
6807   <term><parameter>len</parameter></term>
6808   <listitem>
6809    <para>
6810     new length
6811    </para>
6812   </listitem>
6813  </varlistentry>
6814 </variablelist>
6815</refsect1>
6816<refsect1>
6817<title>Description</title>
6818<para>
6819   Cut the length of a buffer down by removing data from the tail. If
6820   the buffer is already under the length specified it is not modified.
6821   The skb must be linear.
6822</para>
6823</refsect1>
6824</refentry>
6825
6826<refentry id="API---pskb-pull-tail">
6827<refentryinfo>
6828 <title>LINUX</title>
6829 <productname>Kernel Hackers Manual</productname>
6830 <date>July 2017</date>
6831</refentryinfo>
6832<refmeta>
6833 <refentrytitle><phrase>__pskb_pull_tail</phrase></refentrytitle>
6834 <manvolnum>9</manvolnum>
6835 <refmiscinfo class="version">4.1.27</refmiscinfo>
6836</refmeta>
6837<refnamediv>
6838 <refname>__pskb_pull_tail</refname>
6839 <refpurpose>
6840     advance tail of skb header
6841 </refpurpose>
6842</refnamediv>
6843<refsynopsisdiv>
6844 <title>Synopsis</title>
6845  <funcsynopsis><funcprototype>
6846   <funcdef>unsigned char * <function>__pskb_pull_tail </function></funcdef>
6847   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6848   <paramdef>int <parameter>delta</parameter></paramdef>
6849  </funcprototype></funcsynopsis>
6850</refsynopsisdiv>
6851<refsect1>
6852 <title>Arguments</title>
6853 <variablelist>
6854  <varlistentry>
6855   <term><parameter>skb</parameter></term>
6856   <listitem>
6857    <para>
6858     buffer to reallocate
6859    </para>
6860   </listitem>
6861  </varlistentry>
6862  <varlistentry>
6863   <term><parameter>delta</parameter></term>
6864   <listitem>
6865    <para>
6866     number of bytes to advance tail
6867    </para>
6868   </listitem>
6869  </varlistentry>
6870 </variablelist>
6871</refsect1>
6872<refsect1>
6873<title>Description</title>
6874<para>
6875   The function makes a sense only on a fragmented <structname>sk_buff</structname>,
6876   it expands header moving its tail forward and copying necessary
6877   data from fragmented part.
6878   </para><para>
6879
6880   <structname>sk_buff</structname> MUST have reference count of 1.
6881   </para><para>
6882
6883   Returns <constant>NULL</constant> (and <structname>sk_buff</structname> does not change) if pull failed
6884   or value of new tail of skb in the case of success.
6885   </para><para>
6886
6887   All the pointers pointing into skb header may change and must be
6888   reloaded after call to this function.
6889</para>
6890</refsect1>
6891</refentry>
6892
6893<refentry id="API-skb-copy-bits">
6894<refentryinfo>
6895 <title>LINUX</title>
6896 <productname>Kernel Hackers Manual</productname>
6897 <date>July 2017</date>
6898</refentryinfo>
6899<refmeta>
6900 <refentrytitle><phrase>skb_copy_bits</phrase></refentrytitle>
6901 <manvolnum>9</manvolnum>
6902 <refmiscinfo class="version">4.1.27</refmiscinfo>
6903</refmeta>
6904<refnamediv>
6905 <refname>skb_copy_bits</refname>
6906 <refpurpose>
6907     copy bits from skb to kernel buffer
6908 </refpurpose>
6909</refnamediv>
6910<refsynopsisdiv>
6911 <title>Synopsis</title>
6912  <funcsynopsis><funcprototype>
6913   <funcdef>int <function>skb_copy_bits </function></funcdef>
6914   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
6915   <paramdef>int <parameter>offset</parameter></paramdef>
6916   <paramdef>void * <parameter>to</parameter></paramdef>
6917   <paramdef>int <parameter>len</parameter></paramdef>
6918  </funcprototype></funcsynopsis>
6919</refsynopsisdiv>
6920<refsect1>
6921 <title>Arguments</title>
6922 <variablelist>
6923  <varlistentry>
6924   <term><parameter>skb</parameter></term>
6925   <listitem>
6926    <para>
6927     source skb
6928    </para>
6929   </listitem>
6930  </varlistentry>
6931  <varlistentry>
6932   <term><parameter>offset</parameter></term>
6933   <listitem>
6934    <para>
6935     offset in source
6936    </para>
6937   </listitem>
6938  </varlistentry>
6939  <varlistentry>
6940   <term><parameter>to</parameter></term>
6941   <listitem>
6942    <para>
6943     destination buffer
6944    </para>
6945   </listitem>
6946  </varlistentry>
6947  <varlistentry>
6948   <term><parameter>len</parameter></term>
6949   <listitem>
6950    <para>
6951     number of bytes to copy
6952    </para>
6953   </listitem>
6954  </varlistentry>
6955 </variablelist>
6956</refsect1>
6957<refsect1>
6958<title>Description</title>
6959<para>
6960   Copy the specified number of bytes from the source skb to the
6961   destination buffer.
6962   </para><para>
6963
6964   CAUTION ! :
6965   If its prototype is ever changed,
6966   check arch/{*}/net/{*}.S files,
6967   since it is called from BPF assembly code.
6968</para>
6969</refsect1>
6970</refentry>
6971
6972<refentry id="API-skb-store-bits">
6973<refentryinfo>
6974 <title>LINUX</title>
6975 <productname>Kernel Hackers Manual</productname>
6976 <date>July 2017</date>
6977</refentryinfo>
6978<refmeta>
6979 <refentrytitle><phrase>skb_store_bits</phrase></refentrytitle>
6980 <manvolnum>9</manvolnum>
6981 <refmiscinfo class="version">4.1.27</refmiscinfo>
6982</refmeta>
6983<refnamediv>
6984 <refname>skb_store_bits</refname>
6985 <refpurpose>
6986     store bits from kernel buffer to skb
6987 </refpurpose>
6988</refnamediv>
6989<refsynopsisdiv>
6990 <title>Synopsis</title>
6991  <funcsynopsis><funcprototype>
6992   <funcdef>int <function>skb_store_bits </function></funcdef>
6993   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
6994   <paramdef>int <parameter>offset</parameter></paramdef>
6995   <paramdef>const void * <parameter>from</parameter></paramdef>
6996   <paramdef>int <parameter>len</parameter></paramdef>
6997  </funcprototype></funcsynopsis>
6998</refsynopsisdiv>
6999<refsect1>
7000 <title>Arguments</title>
7001 <variablelist>
7002  <varlistentry>
7003   <term><parameter>skb</parameter></term>
7004   <listitem>
7005    <para>
7006     destination buffer
7007    </para>
7008   </listitem>
7009  </varlistentry>
7010  <varlistentry>
7011   <term><parameter>offset</parameter></term>
7012   <listitem>
7013    <para>
7014     offset in destination
7015    </para>
7016   </listitem>
7017  </varlistentry>
7018  <varlistentry>
7019   <term><parameter>from</parameter></term>
7020   <listitem>
7021    <para>
7022     source buffer
7023    </para>
7024   </listitem>
7025  </varlistentry>
7026  <varlistentry>
7027   <term><parameter>len</parameter></term>
7028   <listitem>
7029    <para>
7030     number of bytes to copy
7031    </para>
7032   </listitem>
7033  </varlistentry>
7034 </variablelist>
7035</refsect1>
7036<refsect1>
7037<title>Description</title>
7038<para>
7039   Copy the specified number of bytes from the source buffer to the
7040   destination skb.  This function handles all the messy bits of
7041   traversing fragment lists and such.
7042</para>
7043</refsect1>
7044</refentry>
7045
7046<refentry id="API-skb-zerocopy">
7047<refentryinfo>
7048 <title>LINUX</title>
7049 <productname>Kernel Hackers Manual</productname>
7050 <date>July 2017</date>
7051</refentryinfo>
7052<refmeta>
7053 <refentrytitle><phrase>skb_zerocopy</phrase></refentrytitle>
7054 <manvolnum>9</manvolnum>
7055 <refmiscinfo class="version">4.1.27</refmiscinfo>
7056</refmeta>
7057<refnamediv>
7058 <refname>skb_zerocopy</refname>
7059 <refpurpose>
7060     Zero copy skb to skb
7061 </refpurpose>
7062</refnamediv>
7063<refsynopsisdiv>
7064 <title>Synopsis</title>
7065  <funcsynopsis><funcprototype>
7066   <funcdef>int <function>skb_zerocopy </function></funcdef>
7067   <paramdef>struct sk_buff * <parameter>to</parameter></paramdef>
7068   <paramdef>struct sk_buff * <parameter>from</parameter></paramdef>
7069   <paramdef>int <parameter>len</parameter></paramdef>
7070   <paramdef>int <parameter>hlen</parameter></paramdef>
7071  </funcprototype></funcsynopsis>
7072</refsynopsisdiv>
7073<refsect1>
7074 <title>Arguments</title>
7075 <variablelist>
7076  <varlistentry>
7077   <term><parameter>to</parameter></term>
7078   <listitem>
7079    <para>
7080     destination buffer
7081    </para>
7082   </listitem>
7083  </varlistentry>
7084  <varlistentry>
7085   <term><parameter>from</parameter></term>
7086   <listitem>
7087    <para>
7088     source buffer
7089    </para>
7090   </listitem>
7091  </varlistentry>
7092  <varlistentry>
7093   <term><parameter>len</parameter></term>
7094   <listitem>
7095    <para>
7096     number of bytes to copy from source buffer
7097    </para>
7098   </listitem>
7099  </varlistentry>
7100  <varlistentry>
7101   <term><parameter>hlen</parameter></term>
7102   <listitem>
7103    <para>
7104     size of linear headroom in destination buffer
7105    </para>
7106   </listitem>
7107  </varlistentry>
7108 </variablelist>
7109</refsect1>
7110<refsect1>
7111<title>Description</title>
7112<para>
7113   Copies up to `len` bytes from `from` to `to` by creating references
7114   to the frags in the source buffer.
7115   </para><para>
7116
7117   The `hlen` as calculated by <function>skb_zerocopy_headlen</function> specifies the
7118   headroom in the `to` buffer.
7119</para>
7120</refsect1>
7121<refsect1>
7122<title>0</title>
7123<para>
7124   everything is OK
7125   -ENOMEM: couldn't orphan frags of <parameter>from</parameter> due to lack of memory
7126   -EFAULT: <function>skb_copy_bits</function> found some problem with skb geometry
7127</para>
7128</refsect1>
7129</refentry>
7130
7131<refentry id="API-skb-dequeue">
7132<refentryinfo>
7133 <title>LINUX</title>
7134 <productname>Kernel Hackers Manual</productname>
7135 <date>July 2017</date>
7136</refentryinfo>
7137<refmeta>
7138 <refentrytitle><phrase>skb_dequeue</phrase></refentrytitle>
7139 <manvolnum>9</manvolnum>
7140 <refmiscinfo class="version">4.1.27</refmiscinfo>
7141</refmeta>
7142<refnamediv>
7143 <refname>skb_dequeue</refname>
7144 <refpurpose>
7145     remove from the head of the queue
7146 </refpurpose>
7147</refnamediv>
7148<refsynopsisdiv>
7149 <title>Synopsis</title>
7150  <funcsynopsis><funcprototype>
7151   <funcdef>struct sk_buff * <function>skb_dequeue </function></funcdef>
7152   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7153  </funcprototype></funcsynopsis>
7154</refsynopsisdiv>
7155<refsect1>
7156 <title>Arguments</title>
7157 <variablelist>
7158  <varlistentry>
7159   <term><parameter>list</parameter></term>
7160   <listitem>
7161    <para>
7162     list to dequeue from
7163    </para>
7164   </listitem>
7165  </varlistentry>
7166 </variablelist>
7167</refsect1>
7168<refsect1>
7169<title>Description</title>
7170<para>
7171   Remove the head of the list. The list lock is taken so the function
7172   may be used safely with other locking list functions. The head item is
7173   returned or <constant>NULL</constant> if the list is empty.
7174</para>
7175</refsect1>
7176</refentry>
7177
7178<refentry id="API-skb-dequeue-tail">
7179<refentryinfo>
7180 <title>LINUX</title>
7181 <productname>Kernel Hackers Manual</productname>
7182 <date>July 2017</date>
7183</refentryinfo>
7184<refmeta>
7185 <refentrytitle><phrase>skb_dequeue_tail</phrase></refentrytitle>
7186 <manvolnum>9</manvolnum>
7187 <refmiscinfo class="version">4.1.27</refmiscinfo>
7188</refmeta>
7189<refnamediv>
7190 <refname>skb_dequeue_tail</refname>
7191 <refpurpose>
7192     remove from the tail of the queue
7193 </refpurpose>
7194</refnamediv>
7195<refsynopsisdiv>
7196 <title>Synopsis</title>
7197  <funcsynopsis><funcprototype>
7198   <funcdef>struct sk_buff * <function>skb_dequeue_tail </function></funcdef>
7199   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7200  </funcprototype></funcsynopsis>
7201</refsynopsisdiv>
7202<refsect1>
7203 <title>Arguments</title>
7204 <variablelist>
7205  <varlistentry>
7206   <term><parameter>list</parameter></term>
7207   <listitem>
7208    <para>
7209     list to dequeue from
7210    </para>
7211   </listitem>
7212  </varlistentry>
7213 </variablelist>
7214</refsect1>
7215<refsect1>
7216<title>Description</title>
7217<para>
7218   Remove the tail of the list. The list lock is taken so the function
7219   may be used safely with other locking list functions. The tail item is
7220   returned or <constant>NULL</constant> if the list is empty.
7221</para>
7222</refsect1>
7223</refentry>
7224
7225<refentry id="API-skb-queue-purge">
7226<refentryinfo>
7227 <title>LINUX</title>
7228 <productname>Kernel Hackers Manual</productname>
7229 <date>July 2017</date>
7230</refentryinfo>
7231<refmeta>
7232 <refentrytitle><phrase>skb_queue_purge</phrase></refentrytitle>
7233 <manvolnum>9</manvolnum>
7234 <refmiscinfo class="version">4.1.27</refmiscinfo>
7235</refmeta>
7236<refnamediv>
7237 <refname>skb_queue_purge</refname>
7238 <refpurpose>
7239     empty a list
7240 </refpurpose>
7241</refnamediv>
7242<refsynopsisdiv>
7243 <title>Synopsis</title>
7244  <funcsynopsis><funcprototype>
7245   <funcdef>void <function>skb_queue_purge </function></funcdef>
7246   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7247  </funcprototype></funcsynopsis>
7248</refsynopsisdiv>
7249<refsect1>
7250 <title>Arguments</title>
7251 <variablelist>
7252  <varlistentry>
7253   <term><parameter>list</parameter></term>
7254   <listitem>
7255    <para>
7256     list to empty
7257    </para>
7258   </listitem>
7259  </varlistentry>
7260 </variablelist>
7261</refsect1>
7262<refsect1>
7263<title>Description</title>
7264<para>
7265   Delete all buffers on an <structname>sk_buff</structname> list. Each buffer is removed from
7266   the list and one reference dropped. This function takes the list
7267   lock and is atomic with respect to other list locking functions.
7268</para>
7269</refsect1>
7270</refentry>
7271
7272<refentry id="API-skb-queue-head">
7273<refentryinfo>
7274 <title>LINUX</title>
7275 <productname>Kernel Hackers Manual</productname>
7276 <date>July 2017</date>
7277</refentryinfo>
7278<refmeta>
7279 <refentrytitle><phrase>skb_queue_head</phrase></refentrytitle>
7280 <manvolnum>9</manvolnum>
7281 <refmiscinfo class="version">4.1.27</refmiscinfo>
7282</refmeta>
7283<refnamediv>
7284 <refname>skb_queue_head</refname>
7285 <refpurpose>
7286     queue a buffer at the list head
7287 </refpurpose>
7288</refnamediv>
7289<refsynopsisdiv>
7290 <title>Synopsis</title>
7291  <funcsynopsis><funcprototype>
7292   <funcdef>void <function>skb_queue_head </function></funcdef>
7293   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7294   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
7295  </funcprototype></funcsynopsis>
7296</refsynopsisdiv>
7297<refsect1>
7298 <title>Arguments</title>
7299 <variablelist>
7300  <varlistentry>
7301   <term><parameter>list</parameter></term>
7302   <listitem>
7303    <para>
7304     list to use
7305    </para>
7306   </listitem>
7307  </varlistentry>
7308  <varlistentry>
7309   <term><parameter>newsk</parameter></term>
7310   <listitem>
7311    <para>
7312     buffer to queue
7313    </para>
7314   </listitem>
7315  </varlistentry>
7316 </variablelist>
7317</refsect1>
7318<refsect1>
7319<title>Description</title>
7320<para>
7321   Queue a buffer at the start of the list. This function takes the
7322   list lock and can be used safely with other locking <structname>sk_buff</structname> functions
7323   safely.
7324   </para><para>
7325
7326   A buffer cannot be placed on two lists at the same time.
7327</para>
7328</refsect1>
7329</refentry>
7330
7331<refentry id="API-skb-queue-tail">
7332<refentryinfo>
7333 <title>LINUX</title>
7334 <productname>Kernel Hackers Manual</productname>
7335 <date>July 2017</date>
7336</refentryinfo>
7337<refmeta>
7338 <refentrytitle><phrase>skb_queue_tail</phrase></refentrytitle>
7339 <manvolnum>9</manvolnum>
7340 <refmiscinfo class="version">4.1.27</refmiscinfo>
7341</refmeta>
7342<refnamediv>
7343 <refname>skb_queue_tail</refname>
7344 <refpurpose>
7345     queue a buffer at the list tail
7346 </refpurpose>
7347</refnamediv>
7348<refsynopsisdiv>
7349 <title>Synopsis</title>
7350  <funcsynopsis><funcprototype>
7351   <funcdef>void <function>skb_queue_tail </function></funcdef>
7352   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7353   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
7354  </funcprototype></funcsynopsis>
7355</refsynopsisdiv>
7356<refsect1>
7357 <title>Arguments</title>
7358 <variablelist>
7359  <varlistentry>
7360   <term><parameter>list</parameter></term>
7361   <listitem>
7362    <para>
7363     list to use
7364    </para>
7365   </listitem>
7366  </varlistentry>
7367  <varlistentry>
7368   <term><parameter>newsk</parameter></term>
7369   <listitem>
7370    <para>
7371     buffer to queue
7372    </para>
7373   </listitem>
7374  </varlistentry>
7375 </variablelist>
7376</refsect1>
7377<refsect1>
7378<title>Description</title>
7379<para>
7380   Queue a buffer at the tail of the list. This function takes the
7381   list lock and can be used safely with other locking <structname>sk_buff</structname> functions
7382   safely.
7383   </para><para>
7384
7385   A buffer cannot be placed on two lists at the same time.
7386</para>
7387</refsect1>
7388</refentry>
7389
7390<refentry id="API-skb-unlink">
7391<refentryinfo>
7392 <title>LINUX</title>
7393 <productname>Kernel Hackers Manual</productname>
7394 <date>July 2017</date>
7395</refentryinfo>
7396<refmeta>
7397 <refentrytitle><phrase>skb_unlink</phrase></refentrytitle>
7398 <manvolnum>9</manvolnum>
7399 <refmiscinfo class="version">4.1.27</refmiscinfo>
7400</refmeta>
7401<refnamediv>
7402 <refname>skb_unlink</refname>
7403 <refpurpose>
7404     remove a buffer from a list
7405 </refpurpose>
7406</refnamediv>
7407<refsynopsisdiv>
7408 <title>Synopsis</title>
7409  <funcsynopsis><funcprototype>
7410   <funcdef>void <function>skb_unlink </function></funcdef>
7411   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
7412   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7413  </funcprototype></funcsynopsis>
7414</refsynopsisdiv>
7415<refsect1>
7416 <title>Arguments</title>
7417 <variablelist>
7418  <varlistentry>
7419   <term><parameter>skb</parameter></term>
7420   <listitem>
7421    <para>
7422     buffer to remove
7423    </para>
7424   </listitem>
7425  </varlistentry>
7426  <varlistentry>
7427   <term><parameter>list</parameter></term>
7428   <listitem>
7429    <para>
7430     list to use
7431    </para>
7432   </listitem>
7433  </varlistentry>
7434 </variablelist>
7435</refsect1>
7436<refsect1>
7437<title>Description</title>
7438<para>
7439   Remove a packet from a list. The list locks are taken and this
7440   function is atomic with respect to other list locked calls
7441   </para><para>
7442
7443   You must know what list the SKB is on.
7444</para>
7445</refsect1>
7446</refentry>
7447
7448<refentry id="API-skb-append">
7449<refentryinfo>
7450 <title>LINUX</title>
7451 <productname>Kernel Hackers Manual</productname>
7452 <date>July 2017</date>
7453</refentryinfo>
7454<refmeta>
7455 <refentrytitle><phrase>skb_append</phrase></refentrytitle>
7456 <manvolnum>9</manvolnum>
7457 <refmiscinfo class="version">4.1.27</refmiscinfo>
7458</refmeta>
7459<refnamediv>
7460 <refname>skb_append</refname>
7461 <refpurpose>
7462     append a buffer
7463 </refpurpose>
7464</refnamediv>
7465<refsynopsisdiv>
7466 <title>Synopsis</title>
7467  <funcsynopsis><funcprototype>
7468   <funcdef>void <function>skb_append </function></funcdef>
7469   <paramdef>struct sk_buff * <parameter>old</parameter></paramdef>
7470   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
7471   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7472  </funcprototype></funcsynopsis>
7473</refsynopsisdiv>
7474<refsect1>
7475 <title>Arguments</title>
7476 <variablelist>
7477  <varlistentry>
7478   <term><parameter>old</parameter></term>
7479   <listitem>
7480    <para>
7481     buffer to insert after
7482    </para>
7483   </listitem>
7484  </varlistentry>
7485  <varlistentry>
7486   <term><parameter>newsk</parameter></term>
7487   <listitem>
7488    <para>
7489     buffer to insert
7490    </para>
7491   </listitem>
7492  </varlistentry>
7493  <varlistentry>
7494   <term><parameter>list</parameter></term>
7495   <listitem>
7496    <para>
7497     list to use
7498    </para>
7499   </listitem>
7500  </varlistentry>
7501 </variablelist>
7502</refsect1>
7503<refsect1>
7504<title>Description</title>
7505<para>
7506   Place a packet after a given packet in a list. The list locks are taken
7507   and this function is atomic with respect to other list locked calls.
7508   A buffer cannot be placed on two lists at the same time.
7509</para>
7510</refsect1>
7511</refentry>
7512
7513<refentry id="API-skb-insert">
7514<refentryinfo>
7515 <title>LINUX</title>
7516 <productname>Kernel Hackers Manual</productname>
7517 <date>July 2017</date>
7518</refentryinfo>
7519<refmeta>
7520 <refentrytitle><phrase>skb_insert</phrase></refentrytitle>
7521 <manvolnum>9</manvolnum>
7522 <refmiscinfo class="version">4.1.27</refmiscinfo>
7523</refmeta>
7524<refnamediv>
7525 <refname>skb_insert</refname>
7526 <refpurpose>
7527     insert a buffer
7528 </refpurpose>
7529</refnamediv>
7530<refsynopsisdiv>
7531 <title>Synopsis</title>
7532  <funcsynopsis><funcprototype>
7533   <funcdef>void <function>skb_insert </function></funcdef>
7534   <paramdef>struct sk_buff * <parameter>old</parameter></paramdef>
7535   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
7536   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
7537  </funcprototype></funcsynopsis>
7538</refsynopsisdiv>
7539<refsect1>
7540 <title>Arguments</title>
7541 <variablelist>
7542  <varlistentry>
7543   <term><parameter>old</parameter></term>
7544   <listitem>
7545    <para>
7546     buffer to insert before
7547    </para>
7548   </listitem>
7549  </varlistentry>
7550  <varlistentry>
7551   <term><parameter>newsk</parameter></term>
7552   <listitem>
7553    <para>
7554     buffer to insert
7555    </para>
7556   </listitem>
7557  </varlistentry>
7558  <varlistentry>
7559   <term><parameter>list</parameter></term>
7560   <listitem>
7561    <para>
7562     list to use
7563    </para>
7564   </listitem>
7565  </varlistentry>
7566 </variablelist>
7567</refsect1>
7568<refsect1>
7569<title>Description</title>
7570<para>
7571   Place a packet before a given packet in a list. The list locks are
7572   taken and this function is atomic with respect to other list locked
7573   calls.
7574   </para><para>
7575
7576   A buffer cannot be placed on two lists at the same time.
7577</para>
7578</refsect1>
7579</refentry>
7580
7581<refentry id="API-skb-split">
7582<refentryinfo>
7583 <title>LINUX</title>
7584 <productname>Kernel Hackers Manual</productname>
7585 <date>July 2017</date>
7586</refentryinfo>
7587<refmeta>
7588 <refentrytitle><phrase>skb_split</phrase></refentrytitle>
7589 <manvolnum>9</manvolnum>
7590 <refmiscinfo class="version">4.1.27</refmiscinfo>
7591</refmeta>
7592<refnamediv>
7593 <refname>skb_split</refname>
7594 <refpurpose>
7595     Split fragmented skb to two parts at length len.
7596 </refpurpose>
7597</refnamediv>
7598<refsynopsisdiv>
7599 <title>Synopsis</title>
7600  <funcsynopsis><funcprototype>
7601   <funcdef>void <function>skb_split </function></funcdef>
7602   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
7603   <paramdef>struct sk_buff * <parameter>skb1</parameter></paramdef>
7604   <paramdef>const u32 <parameter>len</parameter></paramdef>
7605  </funcprototype></funcsynopsis>
7606</refsynopsisdiv>
7607<refsect1>
7608 <title>Arguments</title>
7609 <variablelist>
7610  <varlistentry>
7611   <term><parameter>skb</parameter></term>
7612   <listitem>
7613    <para>
7614     the buffer to split
7615    </para>
7616   </listitem>
7617  </varlistentry>
7618  <varlistentry>
7619   <term><parameter>skb1</parameter></term>
7620   <listitem>
7621    <para>
7622     the buffer to receive the second part
7623    </para>
7624   </listitem>
7625  </varlistentry>
7626  <varlistentry>
7627   <term><parameter>len</parameter></term>
7628   <listitem>
7629    <para>
7630     new length for skb
7631    </para>
7632   </listitem>
7633  </varlistentry>
7634 </variablelist>
7635</refsect1>
7636</refentry>
7637
7638<refentry id="API-skb-prepare-seq-read">
7639<refentryinfo>
7640 <title>LINUX</title>
7641 <productname>Kernel Hackers Manual</productname>
7642 <date>July 2017</date>
7643</refentryinfo>
7644<refmeta>
7645 <refentrytitle><phrase>skb_prepare_seq_read</phrase></refentrytitle>
7646 <manvolnum>9</manvolnum>
7647 <refmiscinfo class="version">4.1.27</refmiscinfo>
7648</refmeta>
7649<refnamediv>
7650 <refname>skb_prepare_seq_read</refname>
7651 <refpurpose>
7652     Prepare a sequential read of skb data
7653 </refpurpose>
7654</refnamediv>
7655<refsynopsisdiv>
7656 <title>Synopsis</title>
7657  <funcsynopsis><funcprototype>
7658   <funcdef>void <function>skb_prepare_seq_read </function></funcdef>
7659   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
7660   <paramdef>unsigned int <parameter>from</parameter></paramdef>
7661   <paramdef>unsigned int <parameter>to</parameter></paramdef>
7662   <paramdef>struct skb_seq_state * <parameter>st</parameter></paramdef>
7663  </funcprototype></funcsynopsis>
7664</refsynopsisdiv>
7665<refsect1>
7666 <title>Arguments</title>
7667 <variablelist>
7668  <varlistentry>
7669   <term><parameter>skb</parameter></term>
7670   <listitem>
7671    <para>
7672     the buffer to read
7673    </para>
7674   </listitem>
7675  </varlistentry>
7676  <varlistentry>
7677   <term><parameter>from</parameter></term>
7678   <listitem>
7679    <para>
7680     lower offset of data to be read
7681    </para>
7682   </listitem>
7683  </varlistentry>
7684  <varlistentry>
7685   <term><parameter>to</parameter></term>
7686   <listitem>
7687    <para>
7688     upper offset of data to be read
7689    </para>
7690   </listitem>
7691  </varlistentry>
7692  <varlistentry>
7693   <term><parameter>st</parameter></term>
7694   <listitem>
7695    <para>
7696     state variable
7697    </para>
7698   </listitem>
7699  </varlistentry>
7700 </variablelist>
7701</refsect1>
7702<refsect1>
7703<title>Description</title>
7704<para>
7705   Initializes the specified state variable. Must be called before
7706   invoking <function>skb_seq_read</function> for the first time.
7707</para>
7708</refsect1>
7709</refentry>
7710
7711<refentry id="API-skb-seq-read">
7712<refentryinfo>
7713 <title>LINUX</title>
7714 <productname>Kernel Hackers Manual</productname>
7715 <date>July 2017</date>
7716</refentryinfo>
7717<refmeta>
7718 <refentrytitle><phrase>skb_seq_read</phrase></refentrytitle>
7719 <manvolnum>9</manvolnum>
7720 <refmiscinfo class="version">4.1.27</refmiscinfo>
7721</refmeta>
7722<refnamediv>
7723 <refname>skb_seq_read</refname>
7724 <refpurpose>
7725     Sequentially read skb data
7726 </refpurpose>
7727</refnamediv>
7728<refsynopsisdiv>
7729 <title>Synopsis</title>
7730  <funcsynopsis><funcprototype>
7731   <funcdef>unsigned int <function>skb_seq_read </function></funcdef>
7732   <paramdef>unsigned int <parameter>consumed</parameter></paramdef>
7733   <paramdef>const u8 ** <parameter>data</parameter></paramdef>
7734   <paramdef>struct skb_seq_state * <parameter>st</parameter></paramdef>
7735  </funcprototype></funcsynopsis>
7736</refsynopsisdiv>
7737<refsect1>
7738 <title>Arguments</title>
7739 <variablelist>
7740  <varlistentry>
7741   <term><parameter>consumed</parameter></term>
7742   <listitem>
7743    <para>
7744     number of bytes consumed by the caller so far
7745    </para>
7746   </listitem>
7747  </varlistentry>
7748  <varlistentry>
7749   <term><parameter>data</parameter></term>
7750   <listitem>
7751    <para>
7752     destination pointer for data to be returned
7753    </para>
7754   </listitem>
7755  </varlistentry>
7756  <varlistentry>
7757   <term><parameter>st</parameter></term>
7758   <listitem>
7759    <para>
7760     state variable
7761    </para>
7762   </listitem>
7763  </varlistentry>
7764 </variablelist>
7765</refsect1>
7766<refsect1>
7767<title>Description</title>
7768<para>
7769   Reads a block of skb data at <parameter>consumed</parameter> relative to the
7770   lower offset specified to <function>skb_prepare_seq_read</function>. Assigns
7771   the head of the data block to <parameter>data</parameter> and returns the length
7772   of the block or 0 if the end of the skb data or the upper
7773   offset has been reached.
7774   </para><para>
7775
7776   The caller is not required to consume all of the data
7777   returned, i.e. <parameter>consumed</parameter> is typically set to the number
7778   of bytes already consumed and the next call to
7779   <function>skb_seq_read</function> will return the remaining part of the block.
7780</para>
7781</refsect1>
7782<refsect1>
7783<title>Note 1</title>
7784<para>
7785   The size of each block of data returned can be arbitrary,
7786   this limitation is the cost for zerocopy sequential
7787   reads of potentially non linear data.
7788</para>
7789</refsect1>
7790<refsect1>
7791<title>Note 2</title>
7792<para>
7793   Fragment lists within fragments are not implemented
7794   at the moment, state-&gt;root_skb could be replaced with
7795   a stack for this purpose.
7796</para>
7797</refsect1>
7798</refentry>
7799
7800<refentry id="API-skb-abort-seq-read">
7801<refentryinfo>
7802 <title>LINUX</title>
7803 <productname>Kernel Hackers Manual</productname>
7804 <date>July 2017</date>
7805</refentryinfo>
7806<refmeta>
7807 <refentrytitle><phrase>skb_abort_seq_read</phrase></refentrytitle>
7808 <manvolnum>9</manvolnum>
7809 <refmiscinfo class="version">4.1.27</refmiscinfo>
7810</refmeta>
7811<refnamediv>
7812 <refname>skb_abort_seq_read</refname>
7813 <refpurpose>
7814     Abort a sequential read of skb data
7815 </refpurpose>
7816</refnamediv>
7817<refsynopsisdiv>
7818 <title>Synopsis</title>
7819  <funcsynopsis><funcprototype>
7820   <funcdef>void <function>skb_abort_seq_read </function></funcdef>
7821   <paramdef>struct skb_seq_state * <parameter>st</parameter></paramdef>
7822  </funcprototype></funcsynopsis>
7823</refsynopsisdiv>
7824<refsect1>
7825 <title>Arguments</title>
7826 <variablelist>
7827  <varlistentry>
7828   <term><parameter>st</parameter></term>
7829   <listitem>
7830    <para>
7831     state variable
7832    </para>
7833   </listitem>
7834  </varlistentry>
7835 </variablelist>
7836</refsect1>
7837<refsect1>
7838<title>Description</title>
7839<para>
7840   Must be called if <function>skb_seq_read</function> was not called until it
7841   returned 0.
7842</para>
7843</refsect1>
7844</refentry>
7845
7846<refentry id="API-skb-find-text">
7847<refentryinfo>
7848 <title>LINUX</title>
7849 <productname>Kernel Hackers Manual</productname>
7850 <date>July 2017</date>
7851</refentryinfo>
7852<refmeta>
7853 <refentrytitle><phrase>skb_find_text</phrase></refentrytitle>
7854 <manvolnum>9</manvolnum>
7855 <refmiscinfo class="version">4.1.27</refmiscinfo>
7856</refmeta>
7857<refnamediv>
7858 <refname>skb_find_text</refname>
7859 <refpurpose>
7860     Find a text pattern in skb data
7861 </refpurpose>
7862</refnamediv>
7863<refsynopsisdiv>
7864 <title>Synopsis</title>
7865  <funcsynopsis><funcprototype>
7866   <funcdef>unsigned int <function>skb_find_text </function></funcdef>
7867   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
7868   <paramdef>unsigned int <parameter>from</parameter></paramdef>
7869   <paramdef>unsigned int <parameter>to</parameter></paramdef>
7870   <paramdef>struct ts_config * <parameter>config</parameter></paramdef>
7871  </funcprototype></funcsynopsis>
7872</refsynopsisdiv>
7873<refsect1>
7874 <title>Arguments</title>
7875 <variablelist>
7876  <varlistentry>
7877   <term><parameter>skb</parameter></term>
7878   <listitem>
7879    <para>
7880     the buffer to look in
7881    </para>
7882   </listitem>
7883  </varlistentry>
7884  <varlistentry>
7885   <term><parameter>from</parameter></term>
7886   <listitem>
7887    <para>
7888     search offset
7889    </para>
7890   </listitem>
7891  </varlistentry>
7892  <varlistentry>
7893   <term><parameter>to</parameter></term>
7894   <listitem>
7895    <para>
7896     search limit
7897    </para>
7898   </listitem>
7899  </varlistentry>
7900  <varlistentry>
7901   <term><parameter>config</parameter></term>
7902   <listitem>
7903    <para>
7904     textsearch configuration
7905    </para>
7906   </listitem>
7907  </varlistentry>
7908 </variablelist>
7909</refsect1>
7910<refsect1>
7911<title>Description</title>
7912<para>
7913   Finds a pattern in the skb data according to the specified
7914   textsearch configuration. Use <function>textsearch_next</function> to retrieve
7915   subsequent occurrences of the pattern. Returns the offset
7916   to the first occurrence or UINT_MAX if no match was found.
7917</para>
7918</refsect1>
7919</refentry>
7920
7921<refentry id="API-skb-append-datato-frags">
7922<refentryinfo>
7923 <title>LINUX</title>
7924 <productname>Kernel Hackers Manual</productname>
7925 <date>July 2017</date>
7926</refentryinfo>
7927<refmeta>
7928 <refentrytitle><phrase>skb_append_datato_frags</phrase></refentrytitle>
7929 <manvolnum>9</manvolnum>
7930 <refmiscinfo class="version">4.1.27</refmiscinfo>
7931</refmeta>
7932<refnamediv>
7933 <refname>skb_append_datato_frags</refname>
7934 <refpurpose>
7935     append the user data to a skb
7936 </refpurpose>
7937</refnamediv>
7938<refsynopsisdiv>
7939 <title>Synopsis</title>
7940  <funcsynopsis><funcprototype>
7941   <funcdef>int <function>skb_append_datato_frags </function></funcdef>
7942   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
7943   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
7944   <paramdef>int (*<parameter>getfrag</parameter>)
7945     <funcparams>void *from, char *to, int offset, 					int len, int odd, struct sk_buff *skb</funcparams></paramdef>
7946   <paramdef>void * <parameter>from</parameter></paramdef>
7947   <paramdef>int <parameter>length</parameter></paramdef>
7948  </funcprototype></funcsynopsis>
7949</refsynopsisdiv>
7950<refsect1>
7951 <title>Arguments</title>
7952 <variablelist>
7953  <varlistentry>
7954   <term><parameter>sk</parameter></term>
7955   <listitem>
7956    <para>
7957     sock  structure
7958    </para>
7959   </listitem>
7960  </varlistentry>
7961  <varlistentry>
7962   <term><parameter>skb</parameter></term>
7963   <listitem>
7964    <para>
7965     skb structure to be appended with user data.
7966    </para>
7967   </listitem>
7968  </varlistentry>
7969  <varlistentry>
7970   <term><parameter>getfrag</parameter></term>
7971   <listitem>
7972    <para>
7973     call back function to be used for getting the user data
7974    </para>
7975   </listitem>
7976  </varlistentry>
7977  <varlistentry>
7978   <term><parameter>from</parameter></term>
7979   <listitem>
7980    <para>
7981     pointer to user message iov
7982    </para>
7983   </listitem>
7984  </varlistentry>
7985  <varlistentry>
7986   <term><parameter>length</parameter></term>
7987   <listitem>
7988    <para>
7989     length of the iov message
7990    </para>
7991   </listitem>
7992  </varlistentry>
7993 </variablelist>
7994</refsect1>
7995<refsect1>
7996<title>Description</title>
7997<para>
7998   This procedure append the user data in the fragment part
7999   of the skb if any page alloc fails user this procedure returns  -ENOMEM
8000</para>
8001</refsect1>
8002</refentry>
8003
8004<refentry id="API-skb-pull-rcsum">
8005<refentryinfo>
8006 <title>LINUX</title>
8007 <productname>Kernel Hackers Manual</productname>
8008 <date>July 2017</date>
8009</refentryinfo>
8010<refmeta>
8011 <refentrytitle><phrase>skb_pull_rcsum</phrase></refentrytitle>
8012 <manvolnum>9</manvolnum>
8013 <refmiscinfo class="version">4.1.27</refmiscinfo>
8014</refmeta>
8015<refnamediv>
8016 <refname>skb_pull_rcsum</refname>
8017 <refpurpose>
8018     pull skb and update receive checksum
8019 </refpurpose>
8020</refnamediv>
8021<refsynopsisdiv>
8022 <title>Synopsis</title>
8023  <funcsynopsis><funcprototype>
8024   <funcdef>unsigned char * <function>skb_pull_rcsum </function></funcdef>
8025   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
8026   <paramdef>unsigned int <parameter>len</parameter></paramdef>
8027  </funcprototype></funcsynopsis>
8028</refsynopsisdiv>
8029<refsect1>
8030 <title>Arguments</title>
8031 <variablelist>
8032  <varlistentry>
8033   <term><parameter>skb</parameter></term>
8034   <listitem>
8035    <para>
8036     buffer to update
8037    </para>
8038   </listitem>
8039  </varlistentry>
8040  <varlistentry>
8041   <term><parameter>len</parameter></term>
8042   <listitem>
8043    <para>
8044     length of data pulled
8045    </para>
8046   </listitem>
8047  </varlistentry>
8048 </variablelist>
8049</refsect1>
8050<refsect1>
8051<title>Description</title>
8052<para>
8053   This function performs an skb_pull on the packet and updates
8054   the CHECKSUM_COMPLETE checksum.  It should be used on
8055   receive path processing instead of skb_pull unless you know
8056   that the checksum difference is zero (e.g., a valid IP header)
8057   or you are setting ip_summed to CHECKSUM_NONE.
8058</para>
8059</refsect1>
8060</refentry>
8061
8062<refentry id="API-skb-segment">
8063<refentryinfo>
8064 <title>LINUX</title>
8065 <productname>Kernel Hackers Manual</productname>
8066 <date>July 2017</date>
8067</refentryinfo>
8068<refmeta>
8069 <refentrytitle><phrase>skb_segment</phrase></refentrytitle>
8070 <manvolnum>9</manvolnum>
8071 <refmiscinfo class="version">4.1.27</refmiscinfo>
8072</refmeta>
8073<refnamediv>
8074 <refname>skb_segment</refname>
8075 <refpurpose>
8076     Perform protocol segmentation on skb.
8077 </refpurpose>
8078</refnamediv>
8079<refsynopsisdiv>
8080 <title>Synopsis</title>
8081  <funcsynopsis><funcprototype>
8082   <funcdef>struct sk_buff * <function>skb_segment </function></funcdef>
8083   <paramdef>struct sk_buff * <parameter>head_skb</parameter></paramdef>
8084   <paramdef>netdev_features_t <parameter>features</parameter></paramdef>
8085  </funcprototype></funcsynopsis>
8086</refsynopsisdiv>
8087<refsect1>
8088 <title>Arguments</title>
8089 <variablelist>
8090  <varlistentry>
8091   <term><parameter>head_skb</parameter></term>
8092   <listitem>
8093    <para>
8094     buffer to segment
8095    </para>
8096   </listitem>
8097  </varlistentry>
8098  <varlistentry>
8099   <term><parameter>features</parameter></term>
8100   <listitem>
8101    <para>
8102     features for the output path (see dev-&gt;features)
8103    </para>
8104   </listitem>
8105  </varlistentry>
8106 </variablelist>
8107</refsect1>
8108<refsect1>
8109<title>Description</title>
8110<para>
8111   This function performs segmentation on the given skb.  It returns
8112   a pointer to the first in a list of new skbs for the segments.
8113   In case of error it returns ERR_PTR(err).
8114</para>
8115</refsect1>
8116</refentry>
8117
8118<refentry id="API-skb-cow-data">
8119<refentryinfo>
8120 <title>LINUX</title>
8121 <productname>Kernel Hackers Manual</productname>
8122 <date>July 2017</date>
8123</refentryinfo>
8124<refmeta>
8125 <refentrytitle><phrase>skb_cow_data</phrase></refentrytitle>
8126 <manvolnum>9</manvolnum>
8127 <refmiscinfo class="version">4.1.27</refmiscinfo>
8128</refmeta>
8129<refnamediv>
8130 <refname>skb_cow_data</refname>
8131 <refpurpose>
8132     Check that a socket buffer's data buffers are writable
8133 </refpurpose>
8134</refnamediv>
8135<refsynopsisdiv>
8136 <title>Synopsis</title>
8137  <funcsynopsis><funcprototype>
8138   <funcdef>int <function>skb_cow_data </function></funcdef>
8139   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
8140   <paramdef>int <parameter>tailbits</parameter></paramdef>
8141   <paramdef>struct sk_buff ** <parameter>trailer</parameter></paramdef>
8142  </funcprototype></funcsynopsis>
8143</refsynopsisdiv>
8144<refsect1>
8145 <title>Arguments</title>
8146 <variablelist>
8147  <varlistentry>
8148   <term><parameter>skb</parameter></term>
8149   <listitem>
8150    <para>
8151     The socket buffer to check.
8152    </para>
8153   </listitem>
8154  </varlistentry>
8155  <varlistentry>
8156   <term><parameter>tailbits</parameter></term>
8157   <listitem>
8158    <para>
8159     Amount of trailing space to be added
8160    </para>
8161   </listitem>
8162  </varlistentry>
8163  <varlistentry>
8164   <term><parameter>trailer</parameter></term>
8165   <listitem>
8166    <para>
8167     Returned pointer to the skb where the <parameter>tailbits</parameter> space begins
8168    </para>
8169   </listitem>
8170  </varlistentry>
8171 </variablelist>
8172</refsect1>
8173<refsect1>
8174<title>Description</title>
8175<para>
8176   Make sure that the data buffers attached to a socket buffer are
8177   writable. If they are not, private copies are made of the data buffers
8178   and the socket buffer is set to use these instead.
8179   </para><para>
8180
8181   If <parameter>tailbits</parameter> is given, make sure that there is space to write <parameter>tailbits</parameter>
8182   bytes of data beyond current end of socket buffer.  <parameter>trailer</parameter> will be
8183   set to point to the skb in which this space begins.
8184   </para><para>
8185
8186   The number of scatterlist elements required to completely map the
8187   COW'd and extended socket buffer will be returned.
8188</para>
8189</refsect1>
8190</refentry>
8191
8192<refentry id="API-skb-clone-sk">
8193<refentryinfo>
8194 <title>LINUX</title>
8195 <productname>Kernel Hackers Manual</productname>
8196 <date>July 2017</date>
8197</refentryinfo>
8198<refmeta>
8199 <refentrytitle><phrase>skb_clone_sk</phrase></refentrytitle>
8200 <manvolnum>9</manvolnum>
8201 <refmiscinfo class="version">4.1.27</refmiscinfo>
8202</refmeta>
8203<refnamediv>
8204 <refname>skb_clone_sk</refname>
8205 <refpurpose>
8206     create clone of skb, and take reference to socket
8207 </refpurpose>
8208</refnamediv>
8209<refsynopsisdiv>
8210 <title>Synopsis</title>
8211  <funcsynopsis><funcprototype>
8212   <funcdef>struct sk_buff * <function>skb_clone_sk </function></funcdef>
8213   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
8214  </funcprototype></funcsynopsis>
8215</refsynopsisdiv>
8216<refsect1>
8217 <title>Arguments</title>
8218 <variablelist>
8219  <varlistentry>
8220   <term><parameter>skb</parameter></term>
8221   <listitem>
8222    <para>
8223     the skb to clone
8224    </para>
8225   </listitem>
8226  </varlistentry>
8227 </variablelist>
8228</refsect1>
8229<refsect1>
8230<title>Description</title>
8231<para>
8232   This function creates a clone of a buffer that holds a reference on
8233   sk_refcnt.  Buffers created via this function are meant to be
8234   returned using sock_queue_err_skb, or free via kfree_skb.
8235   </para><para>
8236
8237   When passing buffers allocated with this function to sock_queue_err_skb
8238   it is necessary to wrap the call with sock_hold/sock_put in order to
8239   prevent the socket from being released prior to being enqueued on
8240   the sk_error_queue.
8241</para>
8242</refsect1>
8243</refentry>
8244
8245<refentry id="API-skb-partial-csum-set">
8246<refentryinfo>
8247 <title>LINUX</title>
8248 <productname>Kernel Hackers Manual</productname>
8249 <date>July 2017</date>
8250</refentryinfo>
8251<refmeta>
8252 <refentrytitle><phrase>skb_partial_csum_set</phrase></refentrytitle>
8253 <manvolnum>9</manvolnum>
8254 <refmiscinfo class="version">4.1.27</refmiscinfo>
8255</refmeta>
8256<refnamediv>
8257 <refname>skb_partial_csum_set</refname>
8258 <refpurpose>
8259     set up and verify partial csum values for packet
8260 </refpurpose>
8261</refnamediv>
8262<refsynopsisdiv>
8263 <title>Synopsis</title>
8264  <funcsynopsis><funcprototype>
8265   <funcdef>bool <function>skb_partial_csum_set </function></funcdef>
8266   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
8267   <paramdef>u16 <parameter>start</parameter></paramdef>
8268   <paramdef>u16 <parameter>off</parameter></paramdef>
8269  </funcprototype></funcsynopsis>
8270</refsynopsisdiv>
8271<refsect1>
8272 <title>Arguments</title>
8273 <variablelist>
8274  <varlistentry>
8275   <term><parameter>skb</parameter></term>
8276   <listitem>
8277    <para>
8278     the skb to set
8279    </para>
8280   </listitem>
8281  </varlistentry>
8282  <varlistentry>
8283   <term><parameter>start</parameter></term>
8284   <listitem>
8285    <para>
8286     the number of bytes after skb-&gt;data to start checksumming.
8287    </para>
8288   </listitem>
8289  </varlistentry>
8290  <varlistentry>
8291   <term><parameter>off</parameter></term>
8292   <listitem>
8293    <para>
8294     the offset from start to place the checksum.
8295    </para>
8296   </listitem>
8297  </varlistentry>
8298 </variablelist>
8299</refsect1>
8300<refsect1>
8301<title>Description</title>
8302<para>
8303   For untrusted partially-checksummed packets, we need to make sure the values
8304   for skb-&gt;csum_start and skb-&gt;csum_offset are valid so we don't oops.
8305   </para><para>
8306
8307   This function checks and sets those values and skb-&gt;ip_summed: if this
8308   returns false you should drop the packet.
8309</para>
8310</refsect1>
8311</refentry>
8312
8313<refentry id="API-skb-checksum-setup">
8314<refentryinfo>
8315 <title>LINUX</title>
8316 <productname>Kernel Hackers Manual</productname>
8317 <date>July 2017</date>
8318</refentryinfo>
8319<refmeta>
8320 <refentrytitle><phrase>skb_checksum_setup</phrase></refentrytitle>
8321 <manvolnum>9</manvolnum>
8322 <refmiscinfo class="version">4.1.27</refmiscinfo>
8323</refmeta>
8324<refnamediv>
8325 <refname>skb_checksum_setup</refname>
8326 <refpurpose>
8327     set up partial checksum offset
8328 </refpurpose>
8329</refnamediv>
8330<refsynopsisdiv>
8331 <title>Synopsis</title>
8332  <funcsynopsis><funcprototype>
8333   <funcdef>int <function>skb_checksum_setup </function></funcdef>
8334   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
8335   <paramdef>bool <parameter>recalculate</parameter></paramdef>
8336  </funcprototype></funcsynopsis>
8337</refsynopsisdiv>
8338<refsect1>
8339 <title>Arguments</title>
8340 <variablelist>
8341  <varlistentry>
8342   <term><parameter>skb</parameter></term>
8343   <listitem>
8344    <para>
8345     the skb to set up
8346    </para>
8347   </listitem>
8348  </varlistentry>
8349  <varlistentry>
8350   <term><parameter>recalculate</parameter></term>
8351   <listitem>
8352    <para>
8353     if true the pseudo-header checksum will be recalculated
8354    </para>
8355   </listitem>
8356  </varlistentry>
8357 </variablelist>
8358</refsect1>
8359</refentry>
8360
8361<refentry id="API-skb-try-coalesce">
8362<refentryinfo>
8363 <title>LINUX</title>
8364 <productname>Kernel Hackers Manual</productname>
8365 <date>July 2017</date>
8366</refentryinfo>
8367<refmeta>
8368 <refentrytitle><phrase>skb_try_coalesce</phrase></refentrytitle>
8369 <manvolnum>9</manvolnum>
8370 <refmiscinfo class="version">4.1.27</refmiscinfo>
8371</refmeta>
8372<refnamediv>
8373 <refname>skb_try_coalesce</refname>
8374 <refpurpose>
8375     try to merge skb to prior one
8376 </refpurpose>
8377</refnamediv>
8378<refsynopsisdiv>
8379 <title>Synopsis</title>
8380  <funcsynopsis><funcprototype>
8381   <funcdef>bool <function>skb_try_coalesce </function></funcdef>
8382   <paramdef>struct sk_buff * <parameter>to</parameter></paramdef>
8383   <paramdef>struct sk_buff * <parameter>from</parameter></paramdef>
8384   <paramdef>bool * <parameter>fragstolen</parameter></paramdef>
8385   <paramdef>int * <parameter>delta_truesize</parameter></paramdef>
8386  </funcprototype></funcsynopsis>
8387</refsynopsisdiv>
8388<refsect1>
8389 <title>Arguments</title>
8390 <variablelist>
8391  <varlistentry>
8392   <term><parameter>to</parameter></term>
8393   <listitem>
8394    <para>
8395     prior buffer
8396    </para>
8397   </listitem>
8398  </varlistentry>
8399  <varlistentry>
8400   <term><parameter>from</parameter></term>
8401   <listitem>
8402    <para>
8403     buffer to add
8404    </para>
8405   </listitem>
8406  </varlistentry>
8407  <varlistentry>
8408   <term><parameter>fragstolen</parameter></term>
8409   <listitem>
8410    <para>
8411     pointer to boolean
8412    </para>
8413   </listitem>
8414  </varlistentry>
8415  <varlistentry>
8416   <term><parameter>delta_truesize</parameter></term>
8417   <listitem>
8418    <para>
8419     how much more was allocated than was requested
8420    </para>
8421   </listitem>
8422  </varlistentry>
8423 </variablelist>
8424</refsect1>
8425</refentry>
8426
8427<refentry id="API-skb-scrub-packet">
8428<refentryinfo>
8429 <title>LINUX</title>
8430 <productname>Kernel Hackers Manual</productname>
8431 <date>July 2017</date>
8432</refentryinfo>
8433<refmeta>
8434 <refentrytitle><phrase>skb_scrub_packet</phrase></refentrytitle>
8435 <manvolnum>9</manvolnum>
8436 <refmiscinfo class="version">4.1.27</refmiscinfo>
8437</refmeta>
8438<refnamediv>
8439 <refname>skb_scrub_packet</refname>
8440 <refpurpose>
8441     scrub an skb
8442 </refpurpose>
8443</refnamediv>
8444<refsynopsisdiv>
8445 <title>Synopsis</title>
8446  <funcsynopsis><funcprototype>
8447   <funcdef>void <function>skb_scrub_packet </function></funcdef>
8448   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
8449   <paramdef>bool <parameter>xnet</parameter></paramdef>
8450  </funcprototype></funcsynopsis>
8451</refsynopsisdiv>
8452<refsect1>
8453 <title>Arguments</title>
8454 <variablelist>
8455  <varlistentry>
8456   <term><parameter>skb</parameter></term>
8457   <listitem>
8458    <para>
8459     buffer to clean
8460    </para>
8461   </listitem>
8462  </varlistentry>
8463  <varlistentry>
8464   <term><parameter>xnet</parameter></term>
8465   <listitem>
8466    <para>
8467     packet is crossing netns
8468    </para>
8469   </listitem>
8470  </varlistentry>
8471 </variablelist>
8472</refsect1>
8473<refsect1>
8474<title>Description</title>
8475<para>
8476   skb_scrub_packet can be used after encapsulating or decapsulting a packet
8477   into/from a tunnel. Some information have to be cleared during these
8478   operations.
8479   skb_scrub_packet can also be used to clean a skb before injecting it in
8480   another namespace (<parameter>xnet</parameter> == true). We have to clear all information in the
8481   skb that could impact namespace isolation.
8482</para>
8483</refsect1>
8484</refentry>
8485
8486<refentry id="API-skb-gso-transport-seglen">
8487<refentryinfo>
8488 <title>LINUX</title>
8489 <productname>Kernel Hackers Manual</productname>
8490 <date>July 2017</date>
8491</refentryinfo>
8492<refmeta>
8493 <refentrytitle><phrase>skb_gso_transport_seglen</phrase></refentrytitle>
8494 <manvolnum>9</manvolnum>
8495 <refmiscinfo class="version">4.1.27</refmiscinfo>
8496</refmeta>
8497<refnamediv>
8498 <refname>skb_gso_transport_seglen</refname>
8499 <refpurpose>
8500     Return length of individual segments of a gso packet
8501 </refpurpose>
8502</refnamediv>
8503<refsynopsisdiv>
8504 <title>Synopsis</title>
8505  <funcsynopsis><funcprototype>
8506   <funcdef>unsigned int <function>skb_gso_transport_seglen </function></funcdef>
8507   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
8508  </funcprototype></funcsynopsis>
8509</refsynopsisdiv>
8510<refsect1>
8511 <title>Arguments</title>
8512 <variablelist>
8513  <varlistentry>
8514   <term><parameter>skb</parameter></term>
8515   <listitem>
8516    <para>
8517     GSO skb
8518    </para>
8519   </listitem>
8520  </varlistentry>
8521 </variablelist>
8522</refsect1>
8523<refsect1>
8524<title>Description</title>
8525<para>
8526   skb_gso_transport_seglen is used to determine the real size of the
8527   individual segments, including Layer4 headers (TCP/UDP).
8528   </para><para>
8529
8530   The MAC/L2 or network (IP, IPv6) headers are not accounted for.
8531</para>
8532</refsect1>
8533</refentry>
8534
8535<refentry id="API-alloc-skb-with-frags">
8536<refentryinfo>
8537 <title>LINUX</title>
8538 <productname>Kernel Hackers Manual</productname>
8539 <date>July 2017</date>
8540</refentryinfo>
8541<refmeta>
8542 <refentrytitle><phrase>alloc_skb_with_frags</phrase></refentrytitle>
8543 <manvolnum>9</manvolnum>
8544 <refmiscinfo class="version">4.1.27</refmiscinfo>
8545</refmeta>
8546<refnamediv>
8547 <refname>alloc_skb_with_frags</refname>
8548 <refpurpose>
8549     allocate skb with page frags
8550 </refpurpose>
8551</refnamediv>
8552<refsynopsisdiv>
8553 <title>Synopsis</title>
8554  <funcsynopsis><funcprototype>
8555   <funcdef>struct sk_buff * <function>alloc_skb_with_frags </function></funcdef>
8556   <paramdef>unsigned long <parameter>header_len</parameter></paramdef>
8557   <paramdef>unsigned long <parameter>data_len</parameter></paramdef>
8558   <paramdef>int <parameter>max_page_order</parameter></paramdef>
8559   <paramdef>int * <parameter>errcode</parameter></paramdef>
8560   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
8561  </funcprototype></funcsynopsis>
8562</refsynopsisdiv>
8563<refsect1>
8564 <title>Arguments</title>
8565 <variablelist>
8566  <varlistentry>
8567   <term><parameter>header_len</parameter></term>
8568   <listitem>
8569    <para>
8570     size of linear part
8571    </para>
8572   </listitem>
8573  </varlistentry>
8574  <varlistentry>
8575   <term><parameter>data_len</parameter></term>
8576   <listitem>
8577    <para>
8578     needed length in frags
8579    </para>
8580   </listitem>
8581  </varlistentry>
8582  <varlistentry>
8583   <term><parameter>max_page_order</parameter></term>
8584   <listitem>
8585    <para>
8586     max page order desired.
8587    </para>
8588   </listitem>
8589  </varlistentry>
8590  <varlistentry>
8591   <term><parameter>errcode</parameter></term>
8592   <listitem>
8593    <para>
8594     pointer to error code if any
8595    </para>
8596   </listitem>
8597  </varlistentry>
8598  <varlistentry>
8599   <term><parameter>gfp_mask</parameter></term>
8600   <listitem>
8601    <para>
8602     allocation mask
8603    </para>
8604   </listitem>
8605  </varlistentry>
8606 </variablelist>
8607</refsect1>
8608<refsect1>
8609<title>Description</title>
8610<para>
8611   This can be used to allocate a paged skb, given a maximal order for frags.
8612</para>
8613</refsect1>
8614</refentry>
8615
8616<!-- net/core/sock.c -->
8617<refentry id="API-sk-ns-capable">
8618<refentryinfo>
8619 <title>LINUX</title>
8620 <productname>Kernel Hackers Manual</productname>
8621 <date>July 2017</date>
8622</refentryinfo>
8623<refmeta>
8624 <refentrytitle><phrase>sk_ns_capable</phrase></refentrytitle>
8625 <manvolnum>9</manvolnum>
8626 <refmiscinfo class="version">4.1.27</refmiscinfo>
8627</refmeta>
8628<refnamediv>
8629 <refname>sk_ns_capable</refname>
8630 <refpurpose>
8631  General socket capability test
8632 </refpurpose>
8633</refnamediv>
8634<refsynopsisdiv>
8635 <title>Synopsis</title>
8636  <funcsynopsis><funcprototype>
8637   <funcdef>bool <function>sk_ns_capable </function></funcdef>
8638   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
8639   <paramdef>struct user_namespace * <parameter>user_ns</parameter></paramdef>
8640   <paramdef>int <parameter>cap</parameter></paramdef>
8641  </funcprototype></funcsynopsis>
8642</refsynopsisdiv>
8643<refsect1>
8644 <title>Arguments</title>
8645 <variablelist>
8646  <varlistentry>
8647   <term><parameter>sk</parameter></term>
8648   <listitem>
8649    <para>
8650     Socket to use a capability on or through
8651    </para>
8652   </listitem>
8653  </varlistentry>
8654  <varlistentry>
8655   <term><parameter>user_ns</parameter></term>
8656   <listitem>
8657    <para>
8658     The user namespace of the capability to use
8659    </para>
8660   </listitem>
8661  </varlistentry>
8662  <varlistentry>
8663   <term><parameter>cap</parameter></term>
8664   <listitem>
8665    <para>
8666     The capability to use
8667    </para>
8668   </listitem>
8669  </varlistentry>
8670 </variablelist>
8671</refsect1>
8672<refsect1>
8673<title>Description</title>
8674<para>
8675   Test to see if the opener of the socket had when the socket was
8676   created and the current process has the capability <parameter>cap</parameter> in the user
8677   namespace <parameter>user_ns</parameter>.
8678</para>
8679</refsect1>
8680</refentry>
8681
8682<refentry id="API-sk-capable">
8683<refentryinfo>
8684 <title>LINUX</title>
8685 <productname>Kernel Hackers Manual</productname>
8686 <date>July 2017</date>
8687</refentryinfo>
8688<refmeta>
8689 <refentrytitle><phrase>sk_capable</phrase></refentrytitle>
8690 <manvolnum>9</manvolnum>
8691 <refmiscinfo class="version">4.1.27</refmiscinfo>
8692</refmeta>
8693<refnamediv>
8694 <refname>sk_capable</refname>
8695 <refpurpose>
8696     Socket global capability test
8697 </refpurpose>
8698</refnamediv>
8699<refsynopsisdiv>
8700 <title>Synopsis</title>
8701  <funcsynopsis><funcprototype>
8702   <funcdef>bool <function>sk_capable </function></funcdef>
8703   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
8704   <paramdef>int <parameter>cap</parameter></paramdef>
8705  </funcprototype></funcsynopsis>
8706</refsynopsisdiv>
8707<refsect1>
8708 <title>Arguments</title>
8709 <variablelist>
8710  <varlistentry>
8711   <term><parameter>sk</parameter></term>
8712   <listitem>
8713    <para>
8714     Socket to use a capability on or through
8715    </para>
8716   </listitem>
8717  </varlistentry>
8718  <varlistentry>
8719   <term><parameter>cap</parameter></term>
8720   <listitem>
8721    <para>
8722     The global capability to use
8723    </para>
8724   </listitem>
8725  </varlistentry>
8726 </variablelist>
8727</refsect1>
8728<refsect1>
8729<title>Description</title>
8730<para>
8731   Test to see if the opener of the socket had when the socket was
8732   created and the current process has the capability <parameter>cap</parameter> in all user
8733   namespaces.
8734</para>
8735</refsect1>
8736</refentry>
8737
8738<refentry id="API-sk-net-capable">
8739<refentryinfo>
8740 <title>LINUX</title>
8741 <productname>Kernel Hackers Manual</productname>
8742 <date>July 2017</date>
8743</refentryinfo>
8744<refmeta>
8745 <refentrytitle><phrase>sk_net_capable</phrase></refentrytitle>
8746 <manvolnum>9</manvolnum>
8747 <refmiscinfo class="version">4.1.27</refmiscinfo>
8748</refmeta>
8749<refnamediv>
8750 <refname>sk_net_capable</refname>
8751 <refpurpose>
8752     Network namespace socket capability test
8753 </refpurpose>
8754</refnamediv>
8755<refsynopsisdiv>
8756 <title>Synopsis</title>
8757  <funcsynopsis><funcprototype>
8758   <funcdef>bool <function>sk_net_capable </function></funcdef>
8759   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
8760   <paramdef>int <parameter>cap</parameter></paramdef>
8761  </funcprototype></funcsynopsis>
8762</refsynopsisdiv>
8763<refsect1>
8764 <title>Arguments</title>
8765 <variablelist>
8766  <varlistentry>
8767   <term><parameter>sk</parameter></term>
8768   <listitem>
8769    <para>
8770     Socket to use a capability on or through
8771    </para>
8772   </listitem>
8773  </varlistentry>
8774  <varlistentry>
8775   <term><parameter>cap</parameter></term>
8776   <listitem>
8777    <para>
8778     The capability to use
8779    </para>
8780   </listitem>
8781  </varlistentry>
8782 </variablelist>
8783</refsect1>
8784<refsect1>
8785<title>Description</title>
8786<para>
8787   Test to see if the opener of the socket had when the socket was created
8788   and the current process has the capability <parameter>cap</parameter> over the network namespace
8789   the socket is a member of.
8790</para>
8791</refsect1>
8792</refentry>
8793
8794<refentry id="API-sk-set-memalloc">
8795<refentryinfo>
8796 <title>LINUX</title>
8797 <productname>Kernel Hackers Manual</productname>
8798 <date>July 2017</date>
8799</refentryinfo>
8800<refmeta>
8801 <refentrytitle><phrase>sk_set_memalloc</phrase></refentrytitle>
8802 <manvolnum>9</manvolnum>
8803 <refmiscinfo class="version">4.1.27</refmiscinfo>
8804</refmeta>
8805<refnamediv>
8806 <refname>sk_set_memalloc</refname>
8807 <refpurpose>
8808     sets <constant>SOCK_MEMALLOC</constant>
8809 </refpurpose>
8810</refnamediv>
8811<refsynopsisdiv>
8812 <title>Synopsis</title>
8813  <funcsynopsis><funcprototype>
8814   <funcdef>void <function>sk_set_memalloc </function></funcdef>
8815   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
8816  </funcprototype></funcsynopsis>
8817</refsynopsisdiv>
8818<refsect1>
8819 <title>Arguments</title>
8820 <variablelist>
8821  <varlistentry>
8822   <term><parameter>sk</parameter></term>
8823   <listitem>
8824    <para>
8825     socket to set it on
8826    </para>
8827   </listitem>
8828  </varlistentry>
8829 </variablelist>
8830</refsect1>
8831<refsect1>
8832<title>Description</title>
8833<para>
8834   Set <constant>SOCK_MEMALLOC</constant> on a socket for access to emergency reserves.
8835   It's the responsibility of the admin to adjust min_free_kbytes
8836   to meet the requirements
8837</para>
8838</refsect1>
8839</refentry>
8840
8841<refentry id="API-sk-alloc">
8842<refentryinfo>
8843 <title>LINUX</title>
8844 <productname>Kernel Hackers Manual</productname>
8845 <date>July 2017</date>
8846</refentryinfo>
8847<refmeta>
8848 <refentrytitle><phrase>sk_alloc</phrase></refentrytitle>
8849 <manvolnum>9</manvolnum>
8850 <refmiscinfo class="version">4.1.27</refmiscinfo>
8851</refmeta>
8852<refnamediv>
8853 <refname>sk_alloc</refname>
8854 <refpurpose>
8855     All socket objects are allocated here
8856 </refpurpose>
8857</refnamediv>
8858<refsynopsisdiv>
8859 <title>Synopsis</title>
8860  <funcsynopsis><funcprototype>
8861   <funcdef>struct sock * <function>sk_alloc </function></funcdef>
8862   <paramdef>struct net * <parameter>net</parameter></paramdef>
8863   <paramdef>int <parameter>family</parameter></paramdef>
8864   <paramdef>gfp_t <parameter>priority</parameter></paramdef>
8865   <paramdef>struct proto * <parameter>prot</parameter></paramdef>
8866  </funcprototype></funcsynopsis>
8867</refsynopsisdiv>
8868<refsect1>
8869 <title>Arguments</title>
8870 <variablelist>
8871  <varlistentry>
8872   <term><parameter>net</parameter></term>
8873   <listitem>
8874    <para>
8875     the applicable net namespace
8876    </para>
8877   </listitem>
8878  </varlistentry>
8879  <varlistentry>
8880   <term><parameter>family</parameter></term>
8881   <listitem>
8882    <para>
8883     protocol family
8884    </para>
8885   </listitem>
8886  </varlistentry>
8887  <varlistentry>
8888   <term><parameter>priority</parameter></term>
8889   <listitem>
8890    <para>
8891     for allocation (<constant>GFP_KERNEL</constant>, <constant>GFP_ATOMIC</constant>, etc)
8892    </para>
8893   </listitem>
8894  </varlistentry>
8895  <varlistentry>
8896   <term><parameter>prot</parameter></term>
8897   <listitem>
8898    <para>
8899     struct proto associated with this new sock instance
8900    </para>
8901   </listitem>
8902  </varlistentry>
8903 </variablelist>
8904</refsect1>
8905</refentry>
8906
8907<refentry id="API-sk-clone-lock">
8908<refentryinfo>
8909 <title>LINUX</title>
8910 <productname>Kernel Hackers Manual</productname>
8911 <date>July 2017</date>
8912</refentryinfo>
8913<refmeta>
8914 <refentrytitle><phrase>sk_clone_lock</phrase></refentrytitle>
8915 <manvolnum>9</manvolnum>
8916 <refmiscinfo class="version">4.1.27</refmiscinfo>
8917</refmeta>
8918<refnamediv>
8919 <refname>sk_clone_lock</refname>
8920 <refpurpose>
8921     clone a socket, and lock its clone
8922 </refpurpose>
8923</refnamediv>
8924<refsynopsisdiv>
8925 <title>Synopsis</title>
8926  <funcsynopsis><funcprototype>
8927   <funcdef>struct sock * <function>sk_clone_lock </function></funcdef>
8928   <paramdef>const struct sock * <parameter>sk</parameter></paramdef>
8929   <paramdef>const gfp_t <parameter>priority</parameter></paramdef>
8930  </funcprototype></funcsynopsis>
8931</refsynopsisdiv>
8932<refsect1>
8933 <title>Arguments</title>
8934 <variablelist>
8935  <varlistentry>
8936   <term><parameter>sk</parameter></term>
8937   <listitem>
8938    <para>
8939     the socket to clone
8940    </para>
8941   </listitem>
8942  </varlistentry>
8943  <varlistentry>
8944   <term><parameter>priority</parameter></term>
8945   <listitem>
8946    <para>
8947     for allocation (<constant>GFP_KERNEL</constant>, <constant>GFP_ATOMIC</constant>, etc)
8948    </para>
8949   </listitem>
8950  </varlistentry>
8951 </variablelist>
8952</refsect1>
8953<refsect1>
8954<title>Description</title>
8955<para>
8956   Caller must unlock socket even in error path (bh_unlock_sock(newsk))
8957</para>
8958</refsect1>
8959</refentry>
8960
8961<refentry id="API-skb-page-frag-refill">
8962<refentryinfo>
8963 <title>LINUX</title>
8964 <productname>Kernel Hackers Manual</productname>
8965 <date>July 2017</date>
8966</refentryinfo>
8967<refmeta>
8968 <refentrytitle><phrase>skb_page_frag_refill</phrase></refentrytitle>
8969 <manvolnum>9</manvolnum>
8970 <refmiscinfo class="version">4.1.27</refmiscinfo>
8971</refmeta>
8972<refnamediv>
8973 <refname>skb_page_frag_refill</refname>
8974 <refpurpose>
8975     check that a page_frag contains enough room
8976 </refpurpose>
8977</refnamediv>
8978<refsynopsisdiv>
8979 <title>Synopsis</title>
8980  <funcsynopsis><funcprototype>
8981   <funcdef>bool <function>skb_page_frag_refill </function></funcdef>
8982   <paramdef>unsigned int <parameter>sz</parameter></paramdef>
8983   <paramdef>struct page_frag * <parameter>pfrag</parameter></paramdef>
8984   <paramdef>gfp_t <parameter>gfp</parameter></paramdef>
8985  </funcprototype></funcsynopsis>
8986</refsynopsisdiv>
8987<refsect1>
8988 <title>Arguments</title>
8989 <variablelist>
8990  <varlistentry>
8991   <term><parameter>sz</parameter></term>
8992   <listitem>
8993    <para>
8994     minimum size of the fragment we want to get
8995    </para>
8996   </listitem>
8997  </varlistentry>
8998  <varlistentry>
8999   <term><parameter>pfrag</parameter></term>
9000   <listitem>
9001    <para>
9002     pointer to page_frag
9003    </para>
9004   </listitem>
9005  </varlistentry>
9006  <varlistentry>
9007   <term><parameter>gfp</parameter></term>
9008   <listitem>
9009    <para>
9010     priority for memory allocation
9011    </para>
9012   </listitem>
9013  </varlistentry>
9014 </variablelist>
9015</refsect1>
9016<refsect1>
9017<title>Note</title>
9018<para>
9019   While this allocator tries to use high order pages, there is
9020   no guarantee that allocations succeed. Therefore, <parameter>sz</parameter> MUST be
9021   less or equal than PAGE_SIZE.
9022</para>
9023</refsect1>
9024</refentry>
9025
9026<refentry id="API-sk-wait-data">
9027<refentryinfo>
9028 <title>LINUX</title>
9029 <productname>Kernel Hackers Manual</productname>
9030 <date>July 2017</date>
9031</refentryinfo>
9032<refmeta>
9033 <refentrytitle><phrase>sk_wait_data</phrase></refentrytitle>
9034 <manvolnum>9</manvolnum>
9035 <refmiscinfo class="version">4.1.27</refmiscinfo>
9036</refmeta>
9037<refnamediv>
9038 <refname>sk_wait_data</refname>
9039 <refpurpose>
9040     wait for data to arrive at sk_receive_queue
9041 </refpurpose>
9042</refnamediv>
9043<refsynopsisdiv>
9044 <title>Synopsis</title>
9045  <funcsynopsis><funcprototype>
9046   <funcdef>int <function>sk_wait_data </function></funcdef>
9047   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9048   <paramdef>long * <parameter>timeo</parameter></paramdef>
9049  </funcprototype></funcsynopsis>
9050</refsynopsisdiv>
9051<refsect1>
9052 <title>Arguments</title>
9053 <variablelist>
9054  <varlistentry>
9055   <term><parameter>sk</parameter></term>
9056   <listitem>
9057    <para>
9058     sock to wait on
9059    </para>
9060   </listitem>
9061  </varlistentry>
9062  <varlistentry>
9063   <term><parameter>timeo</parameter></term>
9064   <listitem>
9065    <para>
9066     for how long
9067    </para>
9068   </listitem>
9069  </varlistentry>
9070 </variablelist>
9071</refsect1>
9072<refsect1>
9073<title>Description</title>
9074<para>
9075   Now socket state including sk-&gt;sk_err is changed only under lock,
9076   hence we may omit checks after joining wait queue.
9077   We check receive queue before <function>schedule</function> only as optimization;
9078   it is very likely that <function>release_sock</function> added new data.
9079</para>
9080</refsect1>
9081</refentry>
9082
9083<refentry id="API---sk-mem-schedule">
9084<refentryinfo>
9085 <title>LINUX</title>
9086 <productname>Kernel Hackers Manual</productname>
9087 <date>July 2017</date>
9088</refentryinfo>
9089<refmeta>
9090 <refentrytitle><phrase>__sk_mem_schedule</phrase></refentrytitle>
9091 <manvolnum>9</manvolnum>
9092 <refmiscinfo class="version">4.1.27</refmiscinfo>
9093</refmeta>
9094<refnamediv>
9095 <refname>__sk_mem_schedule</refname>
9096 <refpurpose>
9097     increase sk_forward_alloc and memory_allocated
9098 </refpurpose>
9099</refnamediv>
9100<refsynopsisdiv>
9101 <title>Synopsis</title>
9102  <funcsynopsis><funcprototype>
9103   <funcdef>int <function>__sk_mem_schedule </function></funcdef>
9104   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9105   <paramdef>int <parameter>size</parameter></paramdef>
9106   <paramdef>int <parameter>kind</parameter></paramdef>
9107  </funcprototype></funcsynopsis>
9108</refsynopsisdiv>
9109<refsect1>
9110 <title>Arguments</title>
9111 <variablelist>
9112  <varlistentry>
9113   <term><parameter>sk</parameter></term>
9114   <listitem>
9115    <para>
9116     socket
9117    </para>
9118   </listitem>
9119  </varlistentry>
9120  <varlistentry>
9121   <term><parameter>size</parameter></term>
9122   <listitem>
9123    <para>
9124     memory size to allocate
9125    </para>
9126   </listitem>
9127  </varlistentry>
9128  <varlistentry>
9129   <term><parameter>kind</parameter></term>
9130   <listitem>
9131    <para>
9132     allocation type
9133    </para>
9134   </listitem>
9135  </varlistentry>
9136 </variablelist>
9137</refsect1>
9138<refsect1>
9139<title>Description</title>
9140<para>
9141   If kind is SK_MEM_SEND, it means wmem allocation. Otherwise it means
9142   rmem allocation. This function assumes that protocols which have
9143   memory_pressure use sk_wmem_queued as write buffer accounting.
9144</para>
9145</refsect1>
9146</refentry>
9147
9148<refentry id="API---sk-mem-reclaim">
9149<refentryinfo>
9150 <title>LINUX</title>
9151 <productname>Kernel Hackers Manual</productname>
9152 <date>July 2017</date>
9153</refentryinfo>
9154<refmeta>
9155 <refentrytitle><phrase>__sk_mem_reclaim</phrase></refentrytitle>
9156 <manvolnum>9</manvolnum>
9157 <refmiscinfo class="version">4.1.27</refmiscinfo>
9158</refmeta>
9159<refnamediv>
9160 <refname>__sk_mem_reclaim</refname>
9161 <refpurpose>
9162     reclaim memory_allocated
9163 </refpurpose>
9164</refnamediv>
9165<refsynopsisdiv>
9166 <title>Synopsis</title>
9167  <funcsynopsis><funcprototype>
9168   <funcdef>void <function>__sk_mem_reclaim </function></funcdef>
9169   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9170  </funcprototype></funcsynopsis>
9171</refsynopsisdiv>
9172<refsect1>
9173 <title>Arguments</title>
9174 <variablelist>
9175  <varlistentry>
9176   <term><parameter>sk</parameter></term>
9177   <listitem>
9178    <para>
9179     socket
9180    </para>
9181   </listitem>
9182  </varlistentry>
9183 </variablelist>
9184</refsect1>
9185</refentry>
9186
9187<refentry id="API-lock-sock-fast">
9188<refentryinfo>
9189 <title>LINUX</title>
9190 <productname>Kernel Hackers Manual</productname>
9191 <date>July 2017</date>
9192</refentryinfo>
9193<refmeta>
9194 <refentrytitle><phrase>lock_sock_fast</phrase></refentrytitle>
9195 <manvolnum>9</manvolnum>
9196 <refmiscinfo class="version">4.1.27</refmiscinfo>
9197</refmeta>
9198<refnamediv>
9199 <refname>lock_sock_fast</refname>
9200 <refpurpose>
9201     fast version of lock_sock
9202 </refpurpose>
9203</refnamediv>
9204<refsynopsisdiv>
9205 <title>Synopsis</title>
9206  <funcsynopsis><funcprototype>
9207   <funcdef>bool <function>lock_sock_fast </function></funcdef>
9208   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9209  </funcprototype></funcsynopsis>
9210</refsynopsisdiv>
9211<refsect1>
9212 <title>Arguments</title>
9213 <variablelist>
9214  <varlistentry>
9215   <term><parameter>sk</parameter></term>
9216   <listitem>
9217    <para>
9218     socket
9219    </para>
9220   </listitem>
9221  </varlistentry>
9222 </variablelist>
9223</refsect1>
9224<refsect1>
9225<title>Description</title>
9226<para>
9227   This version should be used for very small section, where process wont block
9228   return false if fast path is taken
9229   sk_lock.slock locked, owned = 0, BH disabled
9230   return true if slow path is taken
9231   sk_lock.slock unlocked, owned = 1, BH enabled
9232</para>
9233</refsect1>
9234</refentry>
9235
9236<!-- net/core/datagram.c -->
9237<refentry id="API---skb-recv-datagram">
9238<refentryinfo>
9239 <title>LINUX</title>
9240 <productname>Kernel Hackers Manual</productname>
9241 <date>July 2017</date>
9242</refentryinfo>
9243<refmeta>
9244 <refentrytitle><phrase>__skb_recv_datagram</phrase></refentrytitle>
9245 <manvolnum>9</manvolnum>
9246 <refmiscinfo class="version">4.1.27</refmiscinfo>
9247</refmeta>
9248<refnamediv>
9249 <refname>__skb_recv_datagram</refname>
9250 <refpurpose>
9251  Receive a datagram skbuff
9252 </refpurpose>
9253</refnamediv>
9254<refsynopsisdiv>
9255 <title>Synopsis</title>
9256  <funcsynopsis><funcprototype>
9257   <funcdef>struct sk_buff * <function>__skb_recv_datagram </function></funcdef>
9258   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9259   <paramdef>unsigned int <parameter>flags</parameter></paramdef>
9260   <paramdef>int * <parameter>peeked</parameter></paramdef>
9261   <paramdef>int * <parameter>off</parameter></paramdef>
9262   <paramdef>int * <parameter>err</parameter></paramdef>
9263  </funcprototype></funcsynopsis>
9264</refsynopsisdiv>
9265<refsect1>
9266 <title>Arguments</title>
9267 <variablelist>
9268  <varlistentry>
9269   <term><parameter>sk</parameter></term>
9270   <listitem>
9271    <para>
9272     socket
9273    </para>
9274   </listitem>
9275  </varlistentry>
9276  <varlistentry>
9277   <term><parameter>flags</parameter></term>
9278   <listitem>
9279    <para>
9280     MSG_ flags
9281    </para>
9282   </listitem>
9283  </varlistentry>
9284  <varlistentry>
9285   <term><parameter>peeked</parameter></term>
9286   <listitem>
9287    <para>
9288     returns non-zero if this packet has been seen before
9289    </para>
9290   </listitem>
9291  </varlistentry>
9292  <varlistentry>
9293   <term><parameter>off</parameter></term>
9294   <listitem>
9295    <para>
9296     an offset in bytes to peek skb from. Returns an offset
9297     within an skb where data actually starts
9298    </para>
9299   </listitem>
9300  </varlistentry>
9301  <varlistentry>
9302   <term><parameter>err</parameter></term>
9303   <listitem>
9304    <para>
9305     error code returned
9306    </para>
9307   </listitem>
9308  </varlistentry>
9309 </variablelist>
9310</refsect1>
9311<refsect1>
9312<title>Description</title>
9313<para>
9314   Get a datagram skbuff, understands the peeking, nonblocking wakeups
9315   and possible races. This replaces identical code in packet, raw and
9316   udp, as well as the IPX AX.25 and Appletalk. It also finally fixes
9317   the long standing peek and read race for datagram sockets. If you
9318   alter this routine remember it must be re-entrant.
9319   </para><para>
9320
9321   This function will lock the socket if a skb is returned, so the caller
9322   needs to unlock the socket in that case (usually by calling
9323   skb_free_datagram)
9324   </para><para>
9325
9326   * It does not lock socket since today. This function is
9327   * free of race conditions. This measure should/can improve
9328   * significantly datagram socket latencies at high loads,
9329   * when data copying to user space takes lots of time.
9330   * (BTW I've just killed the last <function>cli</function> in IP/IPv6/core/netlink/packet
9331   *  8) Great win.)
9332   *			                    --ANK (980729)
9333   </para><para>
9334
9335   The order of the tests when we find no data waiting are specified
9336   quite explicitly by POSIX 1003.1g, don't change them without having
9337   the standard around please.
9338</para>
9339</refsect1>
9340</refentry>
9341
9342<refentry id="API-skb-kill-datagram">
9343<refentryinfo>
9344 <title>LINUX</title>
9345 <productname>Kernel Hackers Manual</productname>
9346 <date>July 2017</date>
9347</refentryinfo>
9348<refmeta>
9349 <refentrytitle><phrase>skb_kill_datagram</phrase></refentrytitle>
9350 <manvolnum>9</manvolnum>
9351 <refmiscinfo class="version">4.1.27</refmiscinfo>
9352</refmeta>
9353<refnamediv>
9354 <refname>skb_kill_datagram</refname>
9355 <refpurpose>
9356     Free a datagram skbuff forcibly
9357 </refpurpose>
9358</refnamediv>
9359<refsynopsisdiv>
9360 <title>Synopsis</title>
9361  <funcsynopsis><funcprototype>
9362   <funcdef>int <function>skb_kill_datagram </function></funcdef>
9363   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9364   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
9365   <paramdef>unsigned int <parameter>flags</parameter></paramdef>
9366  </funcprototype></funcsynopsis>
9367</refsynopsisdiv>
9368<refsect1>
9369 <title>Arguments</title>
9370 <variablelist>
9371  <varlistentry>
9372   <term><parameter>sk</parameter></term>
9373   <listitem>
9374    <para>
9375     socket
9376    </para>
9377   </listitem>
9378  </varlistentry>
9379  <varlistentry>
9380   <term><parameter>skb</parameter></term>
9381   <listitem>
9382    <para>
9383     datagram skbuff
9384    </para>
9385   </listitem>
9386  </varlistentry>
9387  <varlistentry>
9388   <term><parameter>flags</parameter></term>
9389   <listitem>
9390    <para>
9391     MSG_ flags
9392    </para>
9393   </listitem>
9394  </varlistentry>
9395 </variablelist>
9396</refsect1>
9397<refsect1>
9398<title>Description</title>
9399<para>
9400   This function frees a datagram skbuff that was received by
9401   skb_recv_datagram.  The flags argument must match the one
9402   used for skb_recv_datagram.
9403   </para><para>
9404
9405   If the MSG_PEEK flag is set, and the packet is still on the
9406   receive queue of the socket, it will be taken off the queue
9407   before it is freed.
9408   </para><para>
9409
9410   This function currently only disables BH when acquiring the
9411   sk_receive_queue lock.  Therefore it must not be used in a
9412   context where that lock is acquired in an IRQ context.
9413   </para><para>
9414
9415   It returns 0 if the packet was removed by us.
9416</para>
9417</refsect1>
9418</refentry>
9419
9420<refentry id="API-skb-copy-datagram-iter">
9421<refentryinfo>
9422 <title>LINUX</title>
9423 <productname>Kernel Hackers Manual</productname>
9424 <date>July 2017</date>
9425</refentryinfo>
9426<refmeta>
9427 <refentrytitle><phrase>skb_copy_datagram_iter</phrase></refentrytitle>
9428 <manvolnum>9</manvolnum>
9429 <refmiscinfo class="version">4.1.27</refmiscinfo>
9430</refmeta>
9431<refnamediv>
9432 <refname>skb_copy_datagram_iter</refname>
9433 <refpurpose>
9434     Copy a datagram to an iovec iterator.
9435 </refpurpose>
9436</refnamediv>
9437<refsynopsisdiv>
9438 <title>Synopsis</title>
9439  <funcsynopsis><funcprototype>
9440   <funcdef>int <function>skb_copy_datagram_iter </function></funcdef>
9441   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
9442   <paramdef>int <parameter>offset</parameter></paramdef>
9443   <paramdef>struct iov_iter * <parameter>to</parameter></paramdef>
9444   <paramdef>int <parameter>len</parameter></paramdef>
9445  </funcprototype></funcsynopsis>
9446</refsynopsisdiv>
9447<refsect1>
9448 <title>Arguments</title>
9449 <variablelist>
9450  <varlistentry>
9451   <term><parameter>skb</parameter></term>
9452   <listitem>
9453    <para>
9454     buffer to copy
9455    </para>
9456   </listitem>
9457  </varlistentry>
9458  <varlistentry>
9459   <term><parameter>offset</parameter></term>
9460   <listitem>
9461    <para>
9462     offset in the buffer to start copying from
9463    </para>
9464   </listitem>
9465  </varlistentry>
9466  <varlistentry>
9467   <term><parameter>to</parameter></term>
9468   <listitem>
9469    <para>
9470     iovec iterator to copy to
9471    </para>
9472   </listitem>
9473  </varlistentry>
9474  <varlistentry>
9475   <term><parameter>len</parameter></term>
9476   <listitem>
9477    <para>
9478     amount of data to copy from buffer to iovec
9479    </para>
9480   </listitem>
9481  </varlistentry>
9482 </variablelist>
9483</refsect1>
9484</refentry>
9485
9486<refentry id="API-skb-copy-datagram-from-iter">
9487<refentryinfo>
9488 <title>LINUX</title>
9489 <productname>Kernel Hackers Manual</productname>
9490 <date>July 2017</date>
9491</refentryinfo>
9492<refmeta>
9493 <refentrytitle><phrase>skb_copy_datagram_from_iter</phrase></refentrytitle>
9494 <manvolnum>9</manvolnum>
9495 <refmiscinfo class="version">4.1.27</refmiscinfo>
9496</refmeta>
9497<refnamediv>
9498 <refname>skb_copy_datagram_from_iter</refname>
9499 <refpurpose>
9500     Copy a datagram from an iov_iter.
9501 </refpurpose>
9502</refnamediv>
9503<refsynopsisdiv>
9504 <title>Synopsis</title>
9505  <funcsynopsis><funcprototype>
9506   <funcdef>int <function>skb_copy_datagram_from_iter </function></funcdef>
9507   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
9508   <paramdef>int <parameter>offset</parameter></paramdef>
9509   <paramdef>struct iov_iter * <parameter>from</parameter></paramdef>
9510   <paramdef>int <parameter>len</parameter></paramdef>
9511  </funcprototype></funcsynopsis>
9512</refsynopsisdiv>
9513<refsect1>
9514 <title>Arguments</title>
9515 <variablelist>
9516  <varlistentry>
9517   <term><parameter>skb</parameter></term>
9518   <listitem>
9519    <para>
9520     buffer to copy
9521    </para>
9522   </listitem>
9523  </varlistentry>
9524  <varlistentry>
9525   <term><parameter>offset</parameter></term>
9526   <listitem>
9527    <para>
9528     offset in the buffer to start copying to
9529    </para>
9530   </listitem>
9531  </varlistentry>
9532  <varlistentry>
9533   <term><parameter>from</parameter></term>
9534   <listitem>
9535    <para>
9536     the copy source
9537    </para>
9538   </listitem>
9539  </varlistentry>
9540  <varlistentry>
9541   <term><parameter>len</parameter></term>
9542   <listitem>
9543    <para>
9544     amount of data to copy to buffer from iovec
9545    </para>
9546   </listitem>
9547  </varlistentry>
9548 </variablelist>
9549</refsect1>
9550<refsect1>
9551<title>Description</title>
9552<para>
9553   Returns 0 or -EFAULT.
9554</para>
9555</refsect1>
9556</refentry>
9557
9558<refentry id="API-zerocopy-sg-from-iter">
9559<refentryinfo>
9560 <title>LINUX</title>
9561 <productname>Kernel Hackers Manual</productname>
9562 <date>July 2017</date>
9563</refentryinfo>
9564<refmeta>
9565 <refentrytitle><phrase>zerocopy_sg_from_iter</phrase></refentrytitle>
9566 <manvolnum>9</manvolnum>
9567 <refmiscinfo class="version">4.1.27</refmiscinfo>
9568</refmeta>
9569<refnamediv>
9570 <refname>zerocopy_sg_from_iter</refname>
9571 <refpurpose>
9572     Build a zerocopy datagram from an iov_iter
9573 </refpurpose>
9574</refnamediv>
9575<refsynopsisdiv>
9576 <title>Synopsis</title>
9577  <funcsynopsis><funcprototype>
9578   <funcdef>int <function>zerocopy_sg_from_iter </function></funcdef>
9579   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
9580   <paramdef>struct iov_iter * <parameter>from</parameter></paramdef>
9581  </funcprototype></funcsynopsis>
9582</refsynopsisdiv>
9583<refsect1>
9584 <title>Arguments</title>
9585 <variablelist>
9586  <varlistentry>
9587   <term><parameter>skb</parameter></term>
9588   <listitem>
9589    <para>
9590     buffer to copy
9591    </para>
9592   </listitem>
9593  </varlistentry>
9594  <varlistentry>
9595   <term><parameter>from</parameter></term>
9596   <listitem>
9597    <para>
9598     the source to copy from
9599    </para>
9600   </listitem>
9601  </varlistentry>
9602 </variablelist>
9603</refsect1>
9604<refsect1>
9605<title>Description</title>
9606<para>
9607   The function will first copy up to headlen, and then pin the userspace
9608   pages and build frags through them.
9609   </para><para>
9610
9611   Returns 0, -EFAULT or -EMSGSIZE.
9612</para>
9613</refsect1>
9614</refentry>
9615
9616<refentry id="API-skb-copy-and-csum-datagram-msg">
9617<refentryinfo>
9618 <title>LINUX</title>
9619 <productname>Kernel Hackers Manual</productname>
9620 <date>July 2017</date>
9621</refentryinfo>
9622<refmeta>
9623 <refentrytitle><phrase>skb_copy_and_csum_datagram_msg</phrase></refentrytitle>
9624 <manvolnum>9</manvolnum>
9625 <refmiscinfo class="version">4.1.27</refmiscinfo>
9626</refmeta>
9627<refnamediv>
9628 <refname>skb_copy_and_csum_datagram_msg</refname>
9629 <refpurpose>
9630     Copy and checksum skb to user iovec.
9631 </refpurpose>
9632</refnamediv>
9633<refsynopsisdiv>
9634 <title>Synopsis</title>
9635  <funcsynopsis><funcprototype>
9636   <funcdef>int <function>skb_copy_and_csum_datagram_msg </function></funcdef>
9637   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
9638   <paramdef>int <parameter>hlen</parameter></paramdef>
9639   <paramdef>struct msghdr * <parameter>msg</parameter></paramdef>
9640  </funcprototype></funcsynopsis>
9641</refsynopsisdiv>
9642<refsect1>
9643 <title>Arguments</title>
9644 <variablelist>
9645  <varlistentry>
9646   <term><parameter>skb</parameter></term>
9647   <listitem>
9648    <para>
9649     skbuff
9650    </para>
9651   </listitem>
9652  </varlistentry>
9653  <varlistentry>
9654   <term><parameter>hlen</parameter></term>
9655   <listitem>
9656    <para>
9657     hardware length
9658    </para>
9659   </listitem>
9660  </varlistentry>
9661  <varlistentry>
9662   <term><parameter>msg</parameter></term>
9663   <listitem>
9664    <para>
9665     destination
9666    </para>
9667   </listitem>
9668  </varlistentry>
9669 </variablelist>
9670</refsect1>
9671<refsect1>
9672<title>Description</title>
9673<para>
9674   Caller _must_ check that skb will fit to this iovec.
9675</para>
9676</refsect1>
9677<refsect1>
9678<title>Returns</title>
9679<para>
9680   0       - success.
9681   -EINVAL - checksum failure.
9682   -EFAULT - fault during copy.
9683</para>
9684</refsect1>
9685</refentry>
9686
9687<refentry id="API-datagram-poll">
9688<refentryinfo>
9689 <title>LINUX</title>
9690 <productname>Kernel Hackers Manual</productname>
9691 <date>July 2017</date>
9692</refentryinfo>
9693<refmeta>
9694 <refentrytitle><phrase>datagram_poll</phrase></refentrytitle>
9695 <manvolnum>9</manvolnum>
9696 <refmiscinfo class="version">4.1.27</refmiscinfo>
9697</refmeta>
9698<refnamediv>
9699 <refname>datagram_poll</refname>
9700 <refpurpose>
9701     generic datagram poll
9702 </refpurpose>
9703</refnamediv>
9704<refsynopsisdiv>
9705 <title>Synopsis</title>
9706  <funcsynopsis><funcprototype>
9707   <funcdef>unsigned int <function>datagram_poll </function></funcdef>
9708   <paramdef>struct file * <parameter>file</parameter></paramdef>
9709   <paramdef>struct socket * <parameter>sock</parameter></paramdef>
9710   <paramdef>poll_table * <parameter>wait</parameter></paramdef>
9711  </funcprototype></funcsynopsis>
9712</refsynopsisdiv>
9713<refsect1>
9714 <title>Arguments</title>
9715 <variablelist>
9716  <varlistentry>
9717   <term><parameter>file</parameter></term>
9718   <listitem>
9719    <para>
9720     file struct
9721    </para>
9722   </listitem>
9723  </varlistentry>
9724  <varlistentry>
9725   <term><parameter>sock</parameter></term>
9726   <listitem>
9727    <para>
9728     socket
9729    </para>
9730   </listitem>
9731  </varlistentry>
9732  <varlistentry>
9733   <term><parameter>wait</parameter></term>
9734   <listitem>
9735    <para>
9736     poll table
9737    </para>
9738   </listitem>
9739  </varlistentry>
9740 </variablelist>
9741</refsect1>
9742<refsect1>
9743<title>Datagram poll</title>
9744<para>
9745   Again totally generic. This also handles
9746   sequenced packet sockets providing the socket receive queue
9747   is only ever holding data ready to receive.
9748</para>
9749</refsect1>
9750<refsect1>
9751<title>Note</title>
9752<para>
9753   when you _don't_ use this routine for this protocol,
9754   and you use a different write policy from <function>sock_writeable</function>
9755   then please supply your own write_space callback.
9756</para>
9757</refsect1>
9758</refentry>
9759
9760<!-- net/core/stream.c -->
9761<refentry id="API-sk-stream-write-space">
9762<refentryinfo>
9763 <title>LINUX</title>
9764 <productname>Kernel Hackers Manual</productname>
9765 <date>July 2017</date>
9766</refentryinfo>
9767<refmeta>
9768 <refentrytitle><phrase>sk_stream_write_space</phrase></refentrytitle>
9769 <manvolnum>9</manvolnum>
9770 <refmiscinfo class="version">4.1.27</refmiscinfo>
9771</refmeta>
9772<refnamediv>
9773 <refname>sk_stream_write_space</refname>
9774 <refpurpose>
9775  stream socket write_space callback.
9776 </refpurpose>
9777</refnamediv>
9778<refsynopsisdiv>
9779 <title>Synopsis</title>
9780  <funcsynopsis><funcprototype>
9781   <funcdef>void <function>sk_stream_write_space </function></funcdef>
9782   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9783  </funcprototype></funcsynopsis>
9784</refsynopsisdiv>
9785<refsect1>
9786 <title>Arguments</title>
9787 <variablelist>
9788  <varlistentry>
9789   <term><parameter>sk</parameter></term>
9790   <listitem>
9791    <para>
9792     socket
9793    </para>
9794   </listitem>
9795  </varlistentry>
9796 </variablelist>
9797</refsect1>
9798<refsect1>
9799<title>FIXME</title>
9800<para>
9801   write proper description
9802</para>
9803</refsect1>
9804</refentry>
9805
9806<refentry id="API-sk-stream-wait-connect">
9807<refentryinfo>
9808 <title>LINUX</title>
9809 <productname>Kernel Hackers Manual</productname>
9810 <date>July 2017</date>
9811</refentryinfo>
9812<refmeta>
9813 <refentrytitle><phrase>sk_stream_wait_connect</phrase></refentrytitle>
9814 <manvolnum>9</manvolnum>
9815 <refmiscinfo class="version">4.1.27</refmiscinfo>
9816</refmeta>
9817<refnamediv>
9818 <refname>sk_stream_wait_connect</refname>
9819 <refpurpose>
9820     Wait for a socket to get into the connected state
9821 </refpurpose>
9822</refnamediv>
9823<refsynopsisdiv>
9824 <title>Synopsis</title>
9825  <funcsynopsis><funcprototype>
9826   <funcdef>int <function>sk_stream_wait_connect </function></funcdef>
9827   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9828   <paramdef>long * <parameter>timeo_p</parameter></paramdef>
9829  </funcprototype></funcsynopsis>
9830</refsynopsisdiv>
9831<refsect1>
9832 <title>Arguments</title>
9833 <variablelist>
9834  <varlistentry>
9835   <term><parameter>sk</parameter></term>
9836   <listitem>
9837    <para>
9838     sock to wait on
9839    </para>
9840   </listitem>
9841  </varlistentry>
9842  <varlistentry>
9843   <term><parameter>timeo_p</parameter></term>
9844   <listitem>
9845    <para>
9846     for how long to wait
9847    </para>
9848   </listitem>
9849  </varlistentry>
9850 </variablelist>
9851</refsect1>
9852<refsect1>
9853<title>Description</title>
9854<para>
9855   Must be called with the socket locked.
9856</para>
9857</refsect1>
9858</refentry>
9859
9860<refentry id="API-sk-stream-wait-memory">
9861<refentryinfo>
9862 <title>LINUX</title>
9863 <productname>Kernel Hackers Manual</productname>
9864 <date>July 2017</date>
9865</refentryinfo>
9866<refmeta>
9867 <refentrytitle><phrase>sk_stream_wait_memory</phrase></refentrytitle>
9868 <manvolnum>9</manvolnum>
9869 <refmiscinfo class="version">4.1.27</refmiscinfo>
9870</refmeta>
9871<refnamediv>
9872 <refname>sk_stream_wait_memory</refname>
9873 <refpurpose>
9874     Wait for more memory for a socket
9875 </refpurpose>
9876</refnamediv>
9877<refsynopsisdiv>
9878 <title>Synopsis</title>
9879  <funcsynopsis><funcprototype>
9880   <funcdef>int <function>sk_stream_wait_memory </function></funcdef>
9881   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9882   <paramdef>long * <parameter>timeo_p</parameter></paramdef>
9883  </funcprototype></funcsynopsis>
9884</refsynopsisdiv>
9885<refsect1>
9886 <title>Arguments</title>
9887 <variablelist>
9888  <varlistentry>
9889   <term><parameter>sk</parameter></term>
9890   <listitem>
9891    <para>
9892     socket to wait for memory
9893    </para>
9894   </listitem>
9895  </varlistentry>
9896  <varlistentry>
9897   <term><parameter>timeo_p</parameter></term>
9898   <listitem>
9899    <para>
9900     for how long
9901    </para>
9902   </listitem>
9903  </varlistentry>
9904 </variablelist>
9905</refsect1>
9906</refentry>
9907
9908     </sect1>
9909     <sect1><title>Socket Filter</title>
9910<!-- net/core/filter.c -->
9911<refentry id="API-sk-filter">
9912<refentryinfo>
9913 <title>LINUX</title>
9914 <productname>Kernel Hackers Manual</productname>
9915 <date>July 2017</date>
9916</refentryinfo>
9917<refmeta>
9918 <refentrytitle><phrase>sk_filter</phrase></refentrytitle>
9919 <manvolnum>9</manvolnum>
9920 <refmiscinfo class="version">4.1.27</refmiscinfo>
9921</refmeta>
9922<refnamediv>
9923 <refname>sk_filter</refname>
9924 <refpurpose>
9925  run a packet through a socket filter
9926 </refpurpose>
9927</refnamediv>
9928<refsynopsisdiv>
9929 <title>Synopsis</title>
9930  <funcsynopsis><funcprototype>
9931   <funcdef>int <function>sk_filter </function></funcdef>
9932   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
9933   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
9934  </funcprototype></funcsynopsis>
9935</refsynopsisdiv>
9936<refsect1>
9937 <title>Arguments</title>
9938 <variablelist>
9939  <varlistentry>
9940   <term><parameter>sk</parameter></term>
9941   <listitem>
9942    <para>
9943     sock associated with <structname>sk_buff</structname>
9944    </para>
9945   </listitem>
9946  </varlistentry>
9947  <varlistentry>
9948   <term><parameter>skb</parameter></term>
9949   <listitem>
9950    <para>
9951     buffer to filter
9952    </para>
9953   </listitem>
9954  </varlistentry>
9955 </variablelist>
9956</refsect1>
9957<refsect1>
9958<title>Description</title>
9959<para>
9960   Run the filter code and then cut skb-&gt;data to correct size returned by
9961   SK_RUN_FILTER. If pkt_len is 0 we toss packet. If skb-&gt;len is smaller
9962   than pkt_len we keep whole skb-&gt;data. This is the socket level
9963   wrapper to SK_RUN_FILTER. It returns 0 if the packet should
9964   be accepted or -EPERM if the packet should be tossed.
9965</para>
9966</refsect1>
9967</refentry>
9968
9969<refentry id="API-bpf-check-classic">
9970<refentryinfo>
9971 <title>LINUX</title>
9972 <productname>Kernel Hackers Manual</productname>
9973 <date>July 2017</date>
9974</refentryinfo>
9975<refmeta>
9976 <refentrytitle><phrase>bpf_check_classic</phrase></refentrytitle>
9977 <manvolnum>9</manvolnum>
9978 <refmiscinfo class="version">4.1.27</refmiscinfo>
9979</refmeta>
9980<refnamediv>
9981 <refname>bpf_check_classic</refname>
9982 <refpurpose>
9983     verify socket filter code
9984 </refpurpose>
9985</refnamediv>
9986<refsynopsisdiv>
9987 <title>Synopsis</title>
9988  <funcsynopsis><funcprototype>
9989   <funcdef>int <function>bpf_check_classic </function></funcdef>
9990   <paramdef>const struct sock_filter * <parameter>filter</parameter></paramdef>
9991   <paramdef>unsigned int <parameter>flen</parameter></paramdef>
9992  </funcprototype></funcsynopsis>
9993</refsynopsisdiv>
9994<refsect1>
9995 <title>Arguments</title>
9996 <variablelist>
9997  <varlistentry>
9998   <term><parameter>filter</parameter></term>
9999   <listitem>
10000    <para>
10001     filter to verify
10002    </para>
10003   </listitem>
10004  </varlistentry>
10005  <varlistentry>
10006   <term><parameter>flen</parameter></term>
10007   <listitem>
10008    <para>
10009     length of filter
10010    </para>
10011   </listitem>
10012  </varlistentry>
10013 </variablelist>
10014</refsect1>
10015<refsect1>
10016<title>Description</title>
10017<para>
10018   Check the user's filter code. If we let some ugly
10019   filter code slip through kaboom! The filter must contain
10020   no references or jumps that are out of range, no illegal
10021   instructions, and must end with a RET instruction.
10022   </para><para>
10023
10024   All jumps are forward as they are not signed.
10025   </para><para>
10026
10027   Returns 0 if the rule set is legal or -EINVAL if not.
10028</para>
10029</refsect1>
10030</refentry>
10031
10032<refentry id="API-bpf-prog-create">
10033<refentryinfo>
10034 <title>LINUX</title>
10035 <productname>Kernel Hackers Manual</productname>
10036 <date>July 2017</date>
10037</refentryinfo>
10038<refmeta>
10039 <refentrytitle><phrase>bpf_prog_create</phrase></refentrytitle>
10040 <manvolnum>9</manvolnum>
10041 <refmiscinfo class="version">4.1.27</refmiscinfo>
10042</refmeta>
10043<refnamediv>
10044 <refname>bpf_prog_create</refname>
10045 <refpurpose>
10046     create an unattached filter
10047 </refpurpose>
10048</refnamediv>
10049<refsynopsisdiv>
10050 <title>Synopsis</title>
10051  <funcsynopsis><funcprototype>
10052   <funcdef>int <function>bpf_prog_create </function></funcdef>
10053   <paramdef>struct bpf_prog ** <parameter>pfp</parameter></paramdef>
10054   <paramdef>struct sock_fprog_kern * <parameter>fprog</parameter></paramdef>
10055  </funcprototype></funcsynopsis>
10056</refsynopsisdiv>
10057<refsect1>
10058 <title>Arguments</title>
10059 <variablelist>
10060  <varlistentry>
10061   <term><parameter>pfp</parameter></term>
10062   <listitem>
10063    <para>
10064     the unattached filter that is created
10065    </para>
10066   </listitem>
10067  </varlistentry>
10068  <varlistentry>
10069   <term><parameter>fprog</parameter></term>
10070   <listitem>
10071    <para>
10072     the filter program
10073    </para>
10074   </listitem>
10075  </varlistentry>
10076 </variablelist>
10077</refsect1>
10078<refsect1>
10079<title>Description</title>
10080<para>
10081   Create a filter independent of any socket. We first run some
10082   sanity checks on it to make sure it does not explode on us later.
10083   If an error occurs or there is insufficient memory for the filter
10084   a negative errno code is returned. On success the return is zero.
10085</para>
10086</refsect1>
10087</refentry>
10088
10089<refentry id="API-sk-attach-filter">
10090<refentryinfo>
10091 <title>LINUX</title>
10092 <productname>Kernel Hackers Manual</productname>
10093 <date>July 2017</date>
10094</refentryinfo>
10095<refmeta>
10096 <refentrytitle><phrase>sk_attach_filter</phrase></refentrytitle>
10097 <manvolnum>9</manvolnum>
10098 <refmiscinfo class="version">4.1.27</refmiscinfo>
10099</refmeta>
10100<refnamediv>
10101 <refname>sk_attach_filter</refname>
10102 <refpurpose>
10103     attach a socket filter
10104 </refpurpose>
10105</refnamediv>
10106<refsynopsisdiv>
10107 <title>Synopsis</title>
10108  <funcsynopsis><funcprototype>
10109   <funcdef>int <function>sk_attach_filter </function></funcdef>
10110   <paramdef>struct sock_fprog * <parameter>fprog</parameter></paramdef>
10111   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
10112  </funcprototype></funcsynopsis>
10113</refsynopsisdiv>
10114<refsect1>
10115 <title>Arguments</title>
10116 <variablelist>
10117  <varlistentry>
10118   <term><parameter>fprog</parameter></term>
10119   <listitem>
10120    <para>
10121     the filter program
10122    </para>
10123   </listitem>
10124  </varlistentry>
10125  <varlistentry>
10126   <term><parameter>sk</parameter></term>
10127   <listitem>
10128    <para>
10129     the socket to use
10130    </para>
10131   </listitem>
10132  </varlistentry>
10133 </variablelist>
10134</refsect1>
10135<refsect1>
10136<title>Description</title>
10137<para>
10138   Attach the user's filter code. We first run some sanity checks on
10139   it to make sure it does not explode on us later. If an error
10140   occurs or there is insufficient memory for the filter a negative
10141   errno code is returned. On success the return is zero.
10142</para>
10143</refsect1>
10144</refentry>
10145
10146     </sect1>
10147     <sect1><title>Generic Network Statistics</title>
10148<!-- include/uapi/linux/gen_stats.h -->
10149<refentry id="API-struct-gnet-stats-basic">
10150<refentryinfo>
10151 <title>LINUX</title>
10152 <productname>Kernel Hackers Manual</productname>
10153 <date>July 2017</date>
10154</refentryinfo>
10155<refmeta>
10156 <refentrytitle><phrase>struct gnet_stats_basic</phrase></refentrytitle>
10157 <manvolnum>9</manvolnum>
10158 <refmiscinfo class="version">4.1.27</refmiscinfo>
10159</refmeta>
10160<refnamediv>
10161 <refname>struct gnet_stats_basic</refname>
10162 <refpurpose>
10163  byte/packet throughput statistics
10164 </refpurpose>
10165</refnamediv>
10166<refsynopsisdiv>
10167 <title>Synopsis</title>
10168  <programlisting>
10169struct gnet_stats_basic {
10170  __u64 bytes;
10171  __u32 packets;
10172};  </programlisting>
10173</refsynopsisdiv>
10174 <refsect1>
10175  <title>Members</title>
10176  <variablelist>
10177    <varlistentry>      <term>bytes</term>
10178      <listitem><para>
10179number of seen bytes
10180      </para></listitem>
10181    </varlistentry>
10182    <varlistentry>      <term>packets</term>
10183      <listitem><para>
10184number of seen packets
10185      </para></listitem>
10186    </varlistentry>
10187  </variablelist>
10188 </refsect1>
10189</refentry>
10190
10191<refentry id="API-struct-gnet-stats-rate-est">
10192<refentryinfo>
10193 <title>LINUX</title>
10194 <productname>Kernel Hackers Manual</productname>
10195 <date>July 2017</date>
10196</refentryinfo>
10197<refmeta>
10198 <refentrytitle><phrase>struct gnet_stats_rate_est</phrase></refentrytitle>
10199 <manvolnum>9</manvolnum>
10200 <refmiscinfo class="version">4.1.27</refmiscinfo>
10201</refmeta>
10202<refnamediv>
10203 <refname>struct gnet_stats_rate_est</refname>
10204 <refpurpose>
10205     rate estimator
10206 </refpurpose>
10207</refnamediv>
10208<refsynopsisdiv>
10209 <title>Synopsis</title>
10210  <programlisting>
10211struct gnet_stats_rate_est {
10212  __u32 bps;
10213  __u32 pps;
10214};  </programlisting>
10215</refsynopsisdiv>
10216 <refsect1>
10217  <title>Members</title>
10218  <variablelist>
10219    <varlistentry>      <term>bps</term>
10220      <listitem><para>
10221   current byte rate
10222      </para></listitem>
10223    </varlistentry>
10224    <varlistentry>      <term>pps</term>
10225      <listitem><para>
10226   current packet rate
10227      </para></listitem>
10228    </varlistentry>
10229  </variablelist>
10230 </refsect1>
10231</refentry>
10232
10233<refentry id="API-struct-gnet-stats-rate-est64">
10234<refentryinfo>
10235 <title>LINUX</title>
10236 <productname>Kernel Hackers Manual</productname>
10237 <date>July 2017</date>
10238</refentryinfo>
10239<refmeta>
10240 <refentrytitle><phrase>struct gnet_stats_rate_est64</phrase></refentrytitle>
10241 <manvolnum>9</manvolnum>
10242 <refmiscinfo class="version">4.1.27</refmiscinfo>
10243</refmeta>
10244<refnamediv>
10245 <refname>struct gnet_stats_rate_est64</refname>
10246 <refpurpose>
10247     rate estimator
10248 </refpurpose>
10249</refnamediv>
10250<refsynopsisdiv>
10251 <title>Synopsis</title>
10252  <programlisting>
10253struct gnet_stats_rate_est64 {
10254  __u64 bps;
10255  __u64 pps;
10256};  </programlisting>
10257</refsynopsisdiv>
10258 <refsect1>
10259  <title>Members</title>
10260  <variablelist>
10261    <varlistentry>      <term>bps</term>
10262      <listitem><para>
10263   current byte rate
10264      </para></listitem>
10265    </varlistentry>
10266    <varlistentry>      <term>pps</term>
10267      <listitem><para>
10268   current packet rate
10269      </para></listitem>
10270    </varlistentry>
10271  </variablelist>
10272 </refsect1>
10273</refentry>
10274
10275<refentry id="API-struct-gnet-stats-queue">
10276<refentryinfo>
10277 <title>LINUX</title>
10278 <productname>Kernel Hackers Manual</productname>
10279 <date>July 2017</date>
10280</refentryinfo>
10281<refmeta>
10282 <refentrytitle><phrase>struct gnet_stats_queue</phrase></refentrytitle>
10283 <manvolnum>9</manvolnum>
10284 <refmiscinfo class="version">4.1.27</refmiscinfo>
10285</refmeta>
10286<refnamediv>
10287 <refname>struct gnet_stats_queue</refname>
10288 <refpurpose>
10289     queuing statistics
10290 </refpurpose>
10291</refnamediv>
10292<refsynopsisdiv>
10293 <title>Synopsis</title>
10294  <programlisting>
10295struct gnet_stats_queue {
10296  __u32 qlen;
10297  __u32 backlog;
10298  __u32 drops;
10299  __u32 requeues;
10300  __u32 overlimits;
10301};  </programlisting>
10302</refsynopsisdiv>
10303 <refsect1>
10304  <title>Members</title>
10305  <variablelist>
10306    <varlistentry>      <term>qlen</term>
10307      <listitem><para>
10308   queue length
10309      </para></listitem>
10310    </varlistentry>
10311    <varlistentry>      <term>backlog</term>
10312      <listitem><para>
10313   backlog size of queue
10314      </para></listitem>
10315    </varlistentry>
10316    <varlistentry>      <term>drops</term>
10317      <listitem><para>
10318   number of dropped packets
10319      </para></listitem>
10320    </varlistentry>
10321    <varlistentry>      <term>requeues</term>
10322      <listitem><para>
10323   number of requeues
10324      </para></listitem>
10325    </varlistentry>
10326    <varlistentry>      <term>overlimits</term>
10327      <listitem><para>
10328   number of enqueues over the limit
10329      </para></listitem>
10330    </varlistentry>
10331  </variablelist>
10332 </refsect1>
10333</refentry>
10334
10335<refentry id="API-struct-gnet-estimator">
10336<refentryinfo>
10337 <title>LINUX</title>
10338 <productname>Kernel Hackers Manual</productname>
10339 <date>July 2017</date>
10340</refentryinfo>
10341<refmeta>
10342 <refentrytitle><phrase>struct gnet_estimator</phrase></refentrytitle>
10343 <manvolnum>9</manvolnum>
10344 <refmiscinfo class="version">4.1.27</refmiscinfo>
10345</refmeta>
10346<refnamediv>
10347 <refname>struct gnet_estimator</refname>
10348 <refpurpose>
10349     rate estimator configuration
10350 </refpurpose>
10351</refnamediv>
10352<refsynopsisdiv>
10353 <title>Synopsis</title>
10354  <programlisting>
10355struct gnet_estimator {
10356  signed char interval;
10357  unsigned char ewma_log;
10358};  </programlisting>
10359</refsynopsisdiv>
10360 <refsect1>
10361  <title>Members</title>
10362  <variablelist>
10363    <varlistentry>      <term>interval</term>
10364      <listitem><para>
10365   sampling period
10366      </para></listitem>
10367    </varlistentry>
10368    <varlistentry>      <term>ewma_log</term>
10369      <listitem><para>
10370   the log of measurement window weight
10371      </para></listitem>
10372    </varlistentry>
10373  </variablelist>
10374 </refsect1>
10375</refentry>
10376
10377<!-- net/core/gen_stats.c -->
10378<refentry id="API-gnet-stats-start-copy-compat">
10379<refentryinfo>
10380 <title>LINUX</title>
10381 <productname>Kernel Hackers Manual</productname>
10382 <date>July 2017</date>
10383</refentryinfo>
10384<refmeta>
10385 <refentrytitle><phrase>gnet_stats_start_copy_compat</phrase></refentrytitle>
10386 <manvolnum>9</manvolnum>
10387 <refmiscinfo class="version">4.1.27</refmiscinfo>
10388</refmeta>
10389<refnamediv>
10390 <refname>gnet_stats_start_copy_compat</refname>
10391 <refpurpose>
10392  start dumping procedure in compatibility mode
10393 </refpurpose>
10394</refnamediv>
10395<refsynopsisdiv>
10396 <title>Synopsis</title>
10397  <funcsynopsis><funcprototype>
10398   <funcdef>int <function>gnet_stats_start_copy_compat </function></funcdef>
10399   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
10400   <paramdef>int <parameter>type</parameter></paramdef>
10401   <paramdef>int <parameter>tc_stats_type</parameter></paramdef>
10402   <paramdef>int <parameter>xstats_type</parameter></paramdef>
10403   <paramdef>spinlock_t * <parameter>lock</parameter></paramdef>
10404   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
10405  </funcprototype></funcsynopsis>
10406</refsynopsisdiv>
10407<refsect1>
10408 <title>Arguments</title>
10409 <variablelist>
10410  <varlistentry>
10411   <term><parameter>skb</parameter></term>
10412   <listitem>
10413    <para>
10414     socket buffer to put statistics TLVs into
10415    </para>
10416   </listitem>
10417  </varlistentry>
10418  <varlistentry>
10419   <term><parameter>type</parameter></term>
10420   <listitem>
10421    <para>
10422     TLV type for top level statistic TLV
10423    </para>
10424   </listitem>
10425  </varlistentry>
10426  <varlistentry>
10427   <term><parameter>tc_stats_type</parameter></term>
10428   <listitem>
10429    <para>
10430     TLV type for backward compatibility struct tc_stats TLV
10431    </para>
10432   </listitem>
10433  </varlistentry>
10434  <varlistentry>
10435   <term><parameter>xstats_type</parameter></term>
10436   <listitem>
10437    <para>
10438     TLV type for backward compatibility xstats TLV
10439    </para>
10440   </listitem>
10441  </varlistentry>
10442  <varlistentry>
10443   <term><parameter>lock</parameter></term>
10444   <listitem>
10445    <para>
10446     statistics lock
10447    </para>
10448   </listitem>
10449  </varlistentry>
10450  <varlistentry>
10451   <term><parameter>d</parameter></term>
10452   <listitem>
10453    <para>
10454     dumping handle
10455    </para>
10456   </listitem>
10457  </varlistentry>
10458 </variablelist>
10459</refsect1>
10460<refsect1>
10461<title>Description</title>
10462<para>
10463   Initializes the dumping handle, grabs the statistic lock and appends
10464   an empty TLV header to the socket buffer for use a container for all
10465   other statistic TLVS.
10466   </para><para>
10467
10468   The dumping handle is marked to be in backward compatibility mode telling
10469   all <function>gnet_stats_copy_XXX</function> functions to fill a local copy of struct tc_stats.
10470   </para><para>
10471
10472   Returns 0 on success or -1 if the room in the socket buffer was not sufficient.
10473</para>
10474</refsect1>
10475</refentry>
10476
10477<refentry id="API-gnet-stats-start-copy">
10478<refentryinfo>
10479 <title>LINUX</title>
10480 <productname>Kernel Hackers Manual</productname>
10481 <date>July 2017</date>
10482</refentryinfo>
10483<refmeta>
10484 <refentrytitle><phrase>gnet_stats_start_copy</phrase></refentrytitle>
10485 <manvolnum>9</manvolnum>
10486 <refmiscinfo class="version">4.1.27</refmiscinfo>
10487</refmeta>
10488<refnamediv>
10489 <refname>gnet_stats_start_copy</refname>
10490 <refpurpose>
10491     start dumping procedure in compatibility mode
10492 </refpurpose>
10493</refnamediv>
10494<refsynopsisdiv>
10495 <title>Synopsis</title>
10496  <funcsynopsis><funcprototype>
10497   <funcdef>int <function>gnet_stats_start_copy </function></funcdef>
10498   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
10499   <paramdef>int <parameter>type</parameter></paramdef>
10500   <paramdef>spinlock_t * <parameter>lock</parameter></paramdef>
10501   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
10502  </funcprototype></funcsynopsis>
10503</refsynopsisdiv>
10504<refsect1>
10505 <title>Arguments</title>
10506 <variablelist>
10507  <varlistentry>
10508   <term><parameter>skb</parameter></term>
10509   <listitem>
10510    <para>
10511     socket buffer to put statistics TLVs into
10512    </para>
10513   </listitem>
10514  </varlistentry>
10515  <varlistentry>
10516   <term><parameter>type</parameter></term>
10517   <listitem>
10518    <para>
10519     TLV type for top level statistic TLV
10520    </para>
10521   </listitem>
10522  </varlistentry>
10523  <varlistentry>
10524   <term><parameter>lock</parameter></term>
10525   <listitem>
10526    <para>
10527     statistics lock
10528    </para>
10529   </listitem>
10530  </varlistentry>
10531  <varlistentry>
10532   <term><parameter>d</parameter></term>
10533   <listitem>
10534    <para>
10535     dumping handle
10536    </para>
10537   </listitem>
10538  </varlistentry>
10539 </variablelist>
10540</refsect1>
10541<refsect1>
10542<title>Description</title>
10543<para>
10544   Initializes the dumping handle, grabs the statistic lock and appends
10545   an empty TLV header to the socket buffer for use a container for all
10546   other statistic TLVS.
10547   </para><para>
10548
10549   Returns 0 on success or -1 if the room in the socket buffer was not sufficient.
10550</para>
10551</refsect1>
10552</refentry>
10553
10554<refentry id="API-gnet-stats-copy-basic">
10555<refentryinfo>
10556 <title>LINUX</title>
10557 <productname>Kernel Hackers Manual</productname>
10558 <date>July 2017</date>
10559</refentryinfo>
10560<refmeta>
10561 <refentrytitle><phrase>gnet_stats_copy_basic</phrase></refentrytitle>
10562 <manvolnum>9</manvolnum>
10563 <refmiscinfo class="version">4.1.27</refmiscinfo>
10564</refmeta>
10565<refnamediv>
10566 <refname>gnet_stats_copy_basic</refname>
10567 <refpurpose>
10568     copy basic statistics into statistic TLV
10569 </refpurpose>
10570</refnamediv>
10571<refsynopsisdiv>
10572 <title>Synopsis</title>
10573  <funcsynopsis><funcprototype>
10574   <funcdef>int <function>gnet_stats_copy_basic </function></funcdef>
10575   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
10576   <paramdef>struct gnet_stats_basic_cpu __percpu * <parameter>cpu</parameter></paramdef>
10577   <paramdef>struct gnet_stats_basic_packed * <parameter>b</parameter></paramdef>
10578  </funcprototype></funcsynopsis>
10579</refsynopsisdiv>
10580<refsect1>
10581 <title>Arguments</title>
10582 <variablelist>
10583  <varlistentry>
10584   <term><parameter>d</parameter></term>
10585   <listitem>
10586    <para>
10587     dumping handle
10588    </para>
10589   </listitem>
10590  </varlistentry>
10591  <varlistentry>
10592   <term><parameter>cpu</parameter></term>
10593   <listitem>
10594    <para>
10595     -- undescribed --
10596    </para>
10597   </listitem>
10598  </varlistentry>
10599  <varlistentry>
10600   <term><parameter>b</parameter></term>
10601   <listitem>
10602    <para>
10603     basic statistics
10604    </para>
10605   </listitem>
10606  </varlistentry>
10607 </variablelist>
10608</refsect1>
10609<refsect1>
10610<title>Description</title>
10611<para>
10612   Appends the basic statistics to the top level TLV created by
10613   <function>gnet_stats_start_copy</function>.
10614   </para><para>
10615
10616   Returns 0 on success or -1 with the statistic lock released
10617   if the room in the socket buffer was not sufficient.
10618</para>
10619</refsect1>
10620</refentry>
10621
10622<refentry id="API-gnet-stats-copy-rate-est">
10623<refentryinfo>
10624 <title>LINUX</title>
10625 <productname>Kernel Hackers Manual</productname>
10626 <date>July 2017</date>
10627</refentryinfo>
10628<refmeta>
10629 <refentrytitle><phrase>gnet_stats_copy_rate_est</phrase></refentrytitle>
10630 <manvolnum>9</manvolnum>
10631 <refmiscinfo class="version">4.1.27</refmiscinfo>
10632</refmeta>
10633<refnamediv>
10634 <refname>gnet_stats_copy_rate_est</refname>
10635 <refpurpose>
10636     copy rate estimator statistics into statistics TLV
10637 </refpurpose>
10638</refnamediv>
10639<refsynopsisdiv>
10640 <title>Synopsis</title>
10641  <funcsynopsis><funcprototype>
10642   <funcdef>int <function>gnet_stats_copy_rate_est </function></funcdef>
10643   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
10644   <paramdef>const struct gnet_stats_basic_packed * <parameter>b</parameter></paramdef>
10645   <paramdef>struct gnet_stats_rate_est64 * <parameter>r</parameter></paramdef>
10646  </funcprototype></funcsynopsis>
10647</refsynopsisdiv>
10648<refsect1>
10649 <title>Arguments</title>
10650 <variablelist>
10651  <varlistentry>
10652   <term><parameter>d</parameter></term>
10653   <listitem>
10654    <para>
10655     dumping handle
10656    </para>
10657   </listitem>
10658  </varlistentry>
10659  <varlistentry>
10660   <term><parameter>b</parameter></term>
10661   <listitem>
10662    <para>
10663     basic statistics
10664    </para>
10665   </listitem>
10666  </varlistentry>
10667  <varlistentry>
10668   <term><parameter>r</parameter></term>
10669   <listitem>
10670    <para>
10671     rate estimator statistics
10672    </para>
10673   </listitem>
10674  </varlistentry>
10675 </variablelist>
10676</refsect1>
10677<refsect1>
10678<title>Description</title>
10679<para>
10680   Appends the rate estimator statistics to the top level TLV created by
10681   <function>gnet_stats_start_copy</function>.
10682   </para><para>
10683
10684   Returns 0 on success or -1 with the statistic lock released
10685   if the room in the socket buffer was not sufficient.
10686</para>
10687</refsect1>
10688</refentry>
10689
10690<refentry id="API-gnet-stats-copy-queue">
10691<refentryinfo>
10692 <title>LINUX</title>
10693 <productname>Kernel Hackers Manual</productname>
10694 <date>July 2017</date>
10695</refentryinfo>
10696<refmeta>
10697 <refentrytitle><phrase>gnet_stats_copy_queue</phrase></refentrytitle>
10698 <manvolnum>9</manvolnum>
10699 <refmiscinfo class="version">4.1.27</refmiscinfo>
10700</refmeta>
10701<refnamediv>
10702 <refname>gnet_stats_copy_queue</refname>
10703 <refpurpose>
10704     copy queue statistics into statistics TLV
10705 </refpurpose>
10706</refnamediv>
10707<refsynopsisdiv>
10708 <title>Synopsis</title>
10709  <funcsynopsis><funcprototype>
10710   <funcdef>int <function>gnet_stats_copy_queue </function></funcdef>
10711   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
10712   <paramdef>struct gnet_stats_queue __percpu * <parameter>cpu_q</parameter></paramdef>
10713   <paramdef>struct gnet_stats_queue * <parameter>q</parameter></paramdef>
10714   <paramdef>__u32 <parameter>qlen</parameter></paramdef>
10715  </funcprototype></funcsynopsis>
10716</refsynopsisdiv>
10717<refsect1>
10718 <title>Arguments</title>
10719 <variablelist>
10720  <varlistentry>
10721   <term><parameter>d</parameter></term>
10722   <listitem>
10723    <para>
10724     dumping handle
10725    </para>
10726   </listitem>
10727  </varlistentry>
10728  <varlistentry>
10729   <term><parameter>cpu_q</parameter></term>
10730   <listitem>
10731    <para>
10732     per cpu queue statistics
10733    </para>
10734   </listitem>
10735  </varlistentry>
10736  <varlistentry>
10737   <term><parameter>q</parameter></term>
10738   <listitem>
10739    <para>
10740     queue statistics
10741    </para>
10742   </listitem>
10743  </varlistentry>
10744  <varlistentry>
10745   <term><parameter>qlen</parameter></term>
10746   <listitem>
10747    <para>
10748     queue length statistics
10749    </para>
10750   </listitem>
10751  </varlistentry>
10752 </variablelist>
10753</refsect1>
10754<refsect1>
10755<title>Description</title>
10756<para>
10757   Appends the queue statistics to the top level TLV created by
10758   <function>gnet_stats_start_copy</function>. Using per cpu queue statistics if
10759   they are available.
10760   </para><para>
10761
10762   Returns 0 on success or -1 with the statistic lock released
10763   if the room in the socket buffer was not sufficient.
10764</para>
10765</refsect1>
10766</refentry>
10767
10768<refentry id="API-gnet-stats-copy-app">
10769<refentryinfo>
10770 <title>LINUX</title>
10771 <productname>Kernel Hackers Manual</productname>
10772 <date>July 2017</date>
10773</refentryinfo>
10774<refmeta>
10775 <refentrytitle><phrase>gnet_stats_copy_app</phrase></refentrytitle>
10776 <manvolnum>9</manvolnum>
10777 <refmiscinfo class="version">4.1.27</refmiscinfo>
10778</refmeta>
10779<refnamediv>
10780 <refname>gnet_stats_copy_app</refname>
10781 <refpurpose>
10782     copy application specific statistics into statistics TLV
10783 </refpurpose>
10784</refnamediv>
10785<refsynopsisdiv>
10786 <title>Synopsis</title>
10787  <funcsynopsis><funcprototype>
10788   <funcdef>int <function>gnet_stats_copy_app </function></funcdef>
10789   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
10790   <paramdef>void * <parameter>st</parameter></paramdef>
10791   <paramdef>int <parameter>len</parameter></paramdef>
10792  </funcprototype></funcsynopsis>
10793</refsynopsisdiv>
10794<refsect1>
10795 <title>Arguments</title>
10796 <variablelist>
10797  <varlistentry>
10798   <term><parameter>d</parameter></term>
10799   <listitem>
10800    <para>
10801     dumping handle
10802    </para>
10803   </listitem>
10804  </varlistentry>
10805  <varlistentry>
10806   <term><parameter>st</parameter></term>
10807   <listitem>
10808    <para>
10809     application specific statistics data
10810    </para>
10811   </listitem>
10812  </varlistentry>
10813  <varlistentry>
10814   <term><parameter>len</parameter></term>
10815   <listitem>
10816    <para>
10817     length of data
10818    </para>
10819   </listitem>
10820  </varlistentry>
10821 </variablelist>
10822</refsect1>
10823<refsect1>
10824<title>Description</title>
10825<para>
10826   Appends the application specific statistics to the top level TLV created by
10827   <function>gnet_stats_start_copy</function> and remembers the data for XSTATS if the dumping
10828   handle is in backward compatibility mode.
10829   </para><para>
10830
10831   Returns 0 on success or -1 with the statistic lock released
10832   if the room in the socket buffer was not sufficient.
10833</para>
10834</refsect1>
10835</refentry>
10836
10837<refentry id="API-gnet-stats-finish-copy">
10838<refentryinfo>
10839 <title>LINUX</title>
10840 <productname>Kernel Hackers Manual</productname>
10841 <date>July 2017</date>
10842</refentryinfo>
10843<refmeta>
10844 <refentrytitle><phrase>gnet_stats_finish_copy</phrase></refentrytitle>
10845 <manvolnum>9</manvolnum>
10846 <refmiscinfo class="version">4.1.27</refmiscinfo>
10847</refmeta>
10848<refnamediv>
10849 <refname>gnet_stats_finish_copy</refname>
10850 <refpurpose>
10851     finish dumping procedure
10852 </refpurpose>
10853</refnamediv>
10854<refsynopsisdiv>
10855 <title>Synopsis</title>
10856  <funcsynopsis><funcprototype>
10857   <funcdef>int <function>gnet_stats_finish_copy </function></funcdef>
10858   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
10859  </funcprototype></funcsynopsis>
10860</refsynopsisdiv>
10861<refsect1>
10862 <title>Arguments</title>
10863 <variablelist>
10864  <varlistentry>
10865   <term><parameter>d</parameter></term>
10866   <listitem>
10867    <para>
10868     dumping handle
10869    </para>
10870   </listitem>
10871  </varlistentry>
10872 </variablelist>
10873</refsect1>
10874<refsect1>
10875<title>Description</title>
10876<para>
10877   Corrects the length of the top level TLV to include all TLVs added
10878   by <function>gnet_stats_copy_XXX</function> calls. Adds the backward compatibility TLVs
10879   if <function>gnet_stats_start_copy_compat</function> was used and releases the statistics
10880   lock.
10881   </para><para>
10882
10883   Returns 0 on success or -1 with the statistic lock released
10884   if the room in the socket buffer was not sufficient.
10885</para>
10886</refsect1>
10887</refentry>
10888
10889<!-- net/core/gen_estimator.c -->
10890<refentry id="API-gen-new-estimator">
10891<refentryinfo>
10892 <title>LINUX</title>
10893 <productname>Kernel Hackers Manual</productname>
10894 <date>July 2017</date>
10895</refentryinfo>
10896<refmeta>
10897 <refentrytitle><phrase>gen_new_estimator</phrase></refentrytitle>
10898 <manvolnum>9</manvolnum>
10899 <refmiscinfo class="version">4.1.27</refmiscinfo>
10900</refmeta>
10901<refnamediv>
10902 <refname>gen_new_estimator</refname>
10903 <refpurpose>
10904  create a new rate estimator
10905 </refpurpose>
10906</refnamediv>
10907<refsynopsisdiv>
10908 <title>Synopsis</title>
10909  <funcsynopsis><funcprototype>
10910   <funcdef>int <function>gen_new_estimator </function></funcdef>
10911   <paramdef>struct gnet_stats_basic_packed * <parameter>bstats</parameter></paramdef>
10912   <paramdef>struct gnet_stats_basic_cpu __percpu * <parameter>cpu_bstats</parameter></paramdef>
10913   <paramdef>struct gnet_stats_rate_est64 * <parameter>rate_est</parameter></paramdef>
10914   <paramdef>spinlock_t * <parameter>stats_lock</parameter></paramdef>
10915   <paramdef>struct nlattr * <parameter>opt</parameter></paramdef>
10916  </funcprototype></funcsynopsis>
10917</refsynopsisdiv>
10918<refsect1>
10919 <title>Arguments</title>
10920 <variablelist>
10921  <varlistentry>
10922   <term><parameter>bstats</parameter></term>
10923   <listitem>
10924    <para>
10925     basic statistics
10926    </para>
10927   </listitem>
10928  </varlistentry>
10929  <varlistentry>
10930   <term><parameter>cpu_bstats</parameter></term>
10931   <listitem>
10932    <para>
10933     -- undescribed --
10934    </para>
10935   </listitem>
10936  </varlistentry>
10937  <varlistentry>
10938   <term><parameter>rate_est</parameter></term>
10939   <listitem>
10940    <para>
10941     rate estimator statistics
10942    </para>
10943   </listitem>
10944  </varlistentry>
10945  <varlistentry>
10946   <term><parameter>stats_lock</parameter></term>
10947   <listitem>
10948    <para>
10949     statistics lock
10950    </para>
10951   </listitem>
10952  </varlistentry>
10953  <varlistentry>
10954   <term><parameter>opt</parameter></term>
10955   <listitem>
10956    <para>
10957     rate estimator configuration TLV
10958    </para>
10959   </listitem>
10960  </varlistentry>
10961 </variablelist>
10962</refsect1>
10963<refsect1>
10964<title>Description</title>
10965<para>
10966   Creates a new rate estimator with <structname>bstats</structname> as source and <structname>rate_est</structname>
10967   as destination. A new timer with the interval specified in the
10968   configuration TLV is created. Upon each interval, the latest statistics
10969   will be read from <structname>bstats</structname> and the estimated rate will be stored in
10970   <structname>rate_est</structname> with the statistics lock grabbed during this period.
10971   </para><para>
10972
10973   Returns 0 on success or a negative error code.
10974</para>
10975</refsect1>
10976</refentry>
10977
10978<refentry id="API-gen-kill-estimator">
10979<refentryinfo>
10980 <title>LINUX</title>
10981 <productname>Kernel Hackers Manual</productname>
10982 <date>July 2017</date>
10983</refentryinfo>
10984<refmeta>
10985 <refentrytitle><phrase>gen_kill_estimator</phrase></refentrytitle>
10986 <manvolnum>9</manvolnum>
10987 <refmiscinfo class="version">4.1.27</refmiscinfo>
10988</refmeta>
10989<refnamediv>
10990 <refname>gen_kill_estimator</refname>
10991 <refpurpose>
10992     remove a rate estimator
10993 </refpurpose>
10994</refnamediv>
10995<refsynopsisdiv>
10996 <title>Synopsis</title>
10997  <funcsynopsis><funcprototype>
10998   <funcdef>void <function>gen_kill_estimator </function></funcdef>
10999   <paramdef>struct gnet_stats_basic_packed * <parameter>bstats</parameter></paramdef>
11000   <paramdef>struct gnet_stats_rate_est64 * <parameter>rate_est</parameter></paramdef>
11001  </funcprototype></funcsynopsis>
11002</refsynopsisdiv>
11003<refsect1>
11004 <title>Arguments</title>
11005 <variablelist>
11006  <varlistentry>
11007   <term><parameter>bstats</parameter></term>
11008   <listitem>
11009    <para>
11010     basic statistics
11011    </para>
11012   </listitem>
11013  </varlistentry>
11014  <varlistentry>
11015   <term><parameter>rate_est</parameter></term>
11016   <listitem>
11017    <para>
11018     rate estimator statistics
11019    </para>
11020   </listitem>
11021  </varlistentry>
11022 </variablelist>
11023</refsect1>
11024<refsect1>
11025<title>Description</title>
11026<para>
11027   Removes the rate estimator specified by <structname>bstats</structname> and <structname>rate_est</structname>.
11028</para>
11029</refsect1>
11030<refsect1>
11031<title>Note </title>
11032<para>
11033   Caller should respect an RCU grace period before freeing stats_lock
11034</para>
11035</refsect1>
11036</refentry>
11037
11038<refentry id="API-gen-replace-estimator">
11039<refentryinfo>
11040 <title>LINUX</title>
11041 <productname>Kernel Hackers Manual</productname>
11042 <date>July 2017</date>
11043</refentryinfo>
11044<refmeta>
11045 <refentrytitle><phrase>gen_replace_estimator</phrase></refentrytitle>
11046 <manvolnum>9</manvolnum>
11047 <refmiscinfo class="version">4.1.27</refmiscinfo>
11048</refmeta>
11049<refnamediv>
11050 <refname>gen_replace_estimator</refname>
11051 <refpurpose>
11052     replace rate estimator configuration
11053 </refpurpose>
11054</refnamediv>
11055<refsynopsisdiv>
11056 <title>Synopsis</title>
11057  <funcsynopsis><funcprototype>
11058   <funcdef>int <function>gen_replace_estimator </function></funcdef>
11059   <paramdef>struct gnet_stats_basic_packed * <parameter>bstats</parameter></paramdef>
11060   <paramdef>struct gnet_stats_basic_cpu __percpu * <parameter>cpu_bstats</parameter></paramdef>
11061   <paramdef>struct gnet_stats_rate_est64 * <parameter>rate_est</parameter></paramdef>
11062   <paramdef>spinlock_t * <parameter>stats_lock</parameter></paramdef>
11063   <paramdef>struct nlattr * <parameter>opt</parameter></paramdef>
11064  </funcprototype></funcsynopsis>
11065</refsynopsisdiv>
11066<refsect1>
11067 <title>Arguments</title>
11068 <variablelist>
11069  <varlistentry>
11070   <term><parameter>bstats</parameter></term>
11071   <listitem>
11072    <para>
11073     basic statistics
11074    </para>
11075   </listitem>
11076  </varlistentry>
11077  <varlistentry>
11078   <term><parameter>cpu_bstats</parameter></term>
11079   <listitem>
11080    <para>
11081     -- undescribed --
11082    </para>
11083   </listitem>
11084  </varlistentry>
11085  <varlistentry>
11086   <term><parameter>rate_est</parameter></term>
11087   <listitem>
11088    <para>
11089     rate estimator statistics
11090    </para>
11091   </listitem>
11092  </varlistentry>
11093  <varlistentry>
11094   <term><parameter>stats_lock</parameter></term>
11095   <listitem>
11096    <para>
11097     statistics lock
11098    </para>
11099   </listitem>
11100  </varlistentry>
11101  <varlistentry>
11102   <term><parameter>opt</parameter></term>
11103   <listitem>
11104    <para>
11105     rate estimator configuration TLV
11106    </para>
11107   </listitem>
11108  </varlistentry>
11109 </variablelist>
11110</refsect1>
11111<refsect1>
11112<title>Description</title>
11113<para>
11114   Replaces the configuration of a rate estimator by calling
11115   <function>gen_kill_estimator</function> and <function>gen_new_estimator</function>.
11116   </para><para>
11117
11118   Returns 0 on success or a negative error code.
11119</para>
11120</refsect1>
11121</refentry>
11122
11123<refentry id="API-gen-estimator-active">
11124<refentryinfo>
11125 <title>LINUX</title>
11126 <productname>Kernel Hackers Manual</productname>
11127 <date>July 2017</date>
11128</refentryinfo>
11129<refmeta>
11130 <refentrytitle><phrase>gen_estimator_active</phrase></refentrytitle>
11131 <manvolnum>9</manvolnum>
11132 <refmiscinfo class="version">4.1.27</refmiscinfo>
11133</refmeta>
11134<refnamediv>
11135 <refname>gen_estimator_active</refname>
11136 <refpurpose>
11137     test if estimator is currently in use
11138 </refpurpose>
11139</refnamediv>
11140<refsynopsisdiv>
11141 <title>Synopsis</title>
11142  <funcsynopsis><funcprototype>
11143   <funcdef>bool <function>gen_estimator_active </function></funcdef>
11144   <paramdef>const struct gnet_stats_basic_packed * <parameter>bstats</parameter></paramdef>
11145   <paramdef>const struct gnet_stats_rate_est64 * <parameter>rate_est</parameter></paramdef>
11146  </funcprototype></funcsynopsis>
11147</refsynopsisdiv>
11148<refsect1>
11149 <title>Arguments</title>
11150 <variablelist>
11151  <varlistentry>
11152   <term><parameter>bstats</parameter></term>
11153   <listitem>
11154    <para>
11155     basic statistics
11156    </para>
11157   </listitem>
11158  </varlistentry>
11159  <varlistentry>
11160   <term><parameter>rate_est</parameter></term>
11161   <listitem>
11162    <para>
11163     rate estimator statistics
11164    </para>
11165   </listitem>
11166  </varlistentry>
11167 </variablelist>
11168</refsect1>
11169<refsect1>
11170<title>Description</title>
11171<para>
11172   Returns true if estimator is active, and false if not.
11173</para>
11174</refsect1>
11175</refentry>
11176
11177     </sect1>
11178     <sect1><title>SUN RPC subsystem</title>
11179<!-- The !D functionality is not perfect, garbage has to be protected by comments
11180net/sunrpc/sunrpc_syms.c-->
11181<!-- net/sunrpc/xdr.c -->
11182<refentry id="API-xdr-encode-opaque-fixed">
11183<refentryinfo>
11184 <title>LINUX</title>
11185 <productname>Kernel Hackers Manual</productname>
11186 <date>July 2017</date>
11187</refentryinfo>
11188<refmeta>
11189 <refentrytitle><phrase>xdr_encode_opaque_fixed</phrase></refentrytitle>
11190 <manvolnum>9</manvolnum>
11191 <refmiscinfo class="version">4.1.27</refmiscinfo>
11192</refmeta>
11193<refnamediv>
11194 <refname>xdr_encode_opaque_fixed</refname>
11195 <refpurpose>
11196  Encode fixed length opaque data
11197 </refpurpose>
11198</refnamediv>
11199<refsynopsisdiv>
11200 <title>Synopsis</title>
11201  <funcsynopsis><funcprototype>
11202   <funcdef>__be32 * <function>xdr_encode_opaque_fixed </function></funcdef>
11203   <paramdef>__be32 * <parameter>p</parameter></paramdef>
11204   <paramdef>const void * <parameter>ptr</parameter></paramdef>
11205   <paramdef>unsigned int <parameter>nbytes</parameter></paramdef>
11206  </funcprototype></funcsynopsis>
11207</refsynopsisdiv>
11208<refsect1>
11209 <title>Arguments</title>
11210 <variablelist>
11211  <varlistentry>
11212   <term><parameter>p</parameter></term>
11213   <listitem>
11214    <para>
11215     pointer to current position in XDR buffer.
11216    </para>
11217   </listitem>
11218  </varlistentry>
11219  <varlistentry>
11220   <term><parameter>ptr</parameter></term>
11221   <listitem>
11222    <para>
11223     pointer to data to encode (or NULL)
11224    </para>
11225   </listitem>
11226  </varlistentry>
11227  <varlistentry>
11228   <term><parameter>nbytes</parameter></term>
11229   <listitem>
11230    <para>
11231     size of data.
11232    </para>
11233   </listitem>
11234  </varlistentry>
11235 </variablelist>
11236</refsect1>
11237<refsect1>
11238<title>Description</title>
11239<para>
11240   Copy the array of data of length nbytes at ptr to the XDR buffer
11241   at position p, then align to the next 32-bit boundary by padding
11242   with zero bytes (see RFC1832).
11243</para>
11244</refsect1>
11245<refsect1>
11246<title>Note</title>
11247<para>
11248   if ptr is NULL, only the padding is performed.
11249   </para><para>
11250
11251   Returns the updated current XDR buffer position
11252</para>
11253</refsect1>
11254</refentry>
11255
11256<refentry id="API-xdr-encode-opaque">
11257<refentryinfo>
11258 <title>LINUX</title>
11259 <productname>Kernel Hackers Manual</productname>
11260 <date>July 2017</date>
11261</refentryinfo>
11262<refmeta>
11263 <refentrytitle><phrase>xdr_encode_opaque</phrase></refentrytitle>
11264 <manvolnum>9</manvolnum>
11265 <refmiscinfo class="version">4.1.27</refmiscinfo>
11266</refmeta>
11267<refnamediv>
11268 <refname>xdr_encode_opaque</refname>
11269 <refpurpose>
11270     Encode variable length opaque data
11271 </refpurpose>
11272</refnamediv>
11273<refsynopsisdiv>
11274 <title>Synopsis</title>
11275  <funcsynopsis><funcprototype>
11276   <funcdef>__be32 * <function>xdr_encode_opaque </function></funcdef>
11277   <paramdef>__be32 * <parameter>p</parameter></paramdef>
11278   <paramdef>const void * <parameter>ptr</parameter></paramdef>
11279   <paramdef>unsigned int <parameter>nbytes</parameter></paramdef>
11280  </funcprototype></funcsynopsis>
11281</refsynopsisdiv>
11282<refsect1>
11283 <title>Arguments</title>
11284 <variablelist>
11285  <varlistentry>
11286   <term><parameter>p</parameter></term>
11287   <listitem>
11288    <para>
11289     pointer to current position in XDR buffer.
11290    </para>
11291   </listitem>
11292  </varlistentry>
11293  <varlistentry>
11294   <term><parameter>ptr</parameter></term>
11295   <listitem>
11296    <para>
11297     pointer to data to encode (or NULL)
11298    </para>
11299   </listitem>
11300  </varlistentry>
11301  <varlistentry>
11302   <term><parameter>nbytes</parameter></term>
11303   <listitem>
11304    <para>
11305     size of data.
11306    </para>
11307   </listitem>
11308  </varlistentry>
11309 </variablelist>
11310</refsect1>
11311<refsect1>
11312<title>Description</title>
11313<para>
11314   Returns the updated current XDR buffer position
11315</para>
11316</refsect1>
11317</refentry>
11318
11319<refentry id="API-xdr-terminate-string">
11320<refentryinfo>
11321 <title>LINUX</title>
11322 <productname>Kernel Hackers Manual</productname>
11323 <date>July 2017</date>
11324</refentryinfo>
11325<refmeta>
11326 <refentrytitle><phrase>xdr_terminate_string</phrase></refentrytitle>
11327 <manvolnum>9</manvolnum>
11328 <refmiscinfo class="version">4.1.27</refmiscinfo>
11329</refmeta>
11330<refnamediv>
11331 <refname>xdr_terminate_string</refname>
11332 <refpurpose>
11333     '\0'-terminate a string residing in an xdr_buf
11334 </refpurpose>
11335</refnamediv>
11336<refsynopsisdiv>
11337 <title>Synopsis</title>
11338  <funcsynopsis><funcprototype>
11339   <funcdef>void <function>xdr_terminate_string </function></funcdef>
11340   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
11341   <paramdef>const u32 <parameter>len</parameter></paramdef>
11342  </funcprototype></funcsynopsis>
11343</refsynopsisdiv>
11344<refsect1>
11345 <title>Arguments</title>
11346 <variablelist>
11347  <varlistentry>
11348   <term><parameter>buf</parameter></term>
11349   <listitem>
11350    <para>
11351     XDR buffer where string resides
11352    </para>
11353   </listitem>
11354  </varlistentry>
11355  <varlistentry>
11356   <term><parameter>len</parameter></term>
11357   <listitem>
11358    <para>
11359     length of string, in bytes
11360    </para>
11361   </listitem>
11362  </varlistentry>
11363 </variablelist>
11364</refsect1>
11365</refentry>
11366
11367<refentry id="API--copy-from-pages">
11368<refentryinfo>
11369 <title>LINUX</title>
11370 <productname>Kernel Hackers Manual</productname>
11371 <date>July 2017</date>
11372</refentryinfo>
11373<refmeta>
11374 <refentrytitle><phrase>_copy_from_pages</phrase></refentrytitle>
11375 <manvolnum>9</manvolnum>
11376 <refmiscinfo class="version">4.1.27</refmiscinfo>
11377</refmeta>
11378<refnamediv>
11379 <refname>_copy_from_pages</refname>
11380 <refpurpose>
11381   </refpurpose>
11382</refnamediv>
11383<refsynopsisdiv>
11384 <title>Synopsis</title>
11385  <funcsynopsis><funcprototype>
11386   <funcdef>void <function>_copy_from_pages </function></funcdef>
11387   <paramdef>char * <parameter>p</parameter></paramdef>
11388   <paramdef>struct page ** <parameter>pages</parameter></paramdef>
11389   <paramdef>size_t <parameter>pgbase</parameter></paramdef>
11390   <paramdef>size_t <parameter>len</parameter></paramdef>
11391  </funcprototype></funcsynopsis>
11392</refsynopsisdiv>
11393<refsect1>
11394 <title>Arguments</title>
11395 <variablelist>
11396  <varlistentry>
11397   <term><parameter>p</parameter></term>
11398   <listitem>
11399    <para>
11400     pointer to destination
11401    </para>
11402   </listitem>
11403  </varlistentry>
11404  <varlistentry>
11405   <term><parameter>pages</parameter></term>
11406   <listitem>
11407    <para>
11408     array of pages
11409    </para>
11410   </listitem>
11411  </varlistentry>
11412  <varlistentry>
11413   <term><parameter>pgbase</parameter></term>
11414   <listitem>
11415    <para>
11416     offset of source data
11417    </para>
11418   </listitem>
11419  </varlistentry>
11420  <varlistentry>
11421   <term><parameter>len</parameter></term>
11422   <listitem>
11423    <para>
11424     length
11425    </para>
11426   </listitem>
11427  </varlistentry>
11428 </variablelist>
11429</refsect1>
11430<refsect1>
11431<title>Description</title>
11432<para>
11433   Copies data into an arbitrary memory location from an array of pages
11434   The copy is assumed to be non-overlapping.
11435</para>
11436</refsect1>
11437</refentry>
11438
11439<refentry id="API-xdr-stream-pos">
11440<refentryinfo>
11441 <title>LINUX</title>
11442 <productname>Kernel Hackers Manual</productname>
11443 <date>July 2017</date>
11444</refentryinfo>
11445<refmeta>
11446 <refentrytitle><phrase>xdr_stream_pos</phrase></refentrytitle>
11447 <manvolnum>9</manvolnum>
11448 <refmiscinfo class="version">4.1.27</refmiscinfo>
11449</refmeta>
11450<refnamediv>
11451 <refname>xdr_stream_pos</refname>
11452 <refpurpose>
11453     Return the current offset from the start of the xdr_stream
11454 </refpurpose>
11455</refnamediv>
11456<refsynopsisdiv>
11457 <title>Synopsis</title>
11458  <funcsynopsis><funcprototype>
11459   <funcdef>unsigned int <function>xdr_stream_pos </function></funcdef>
11460   <paramdef>const struct xdr_stream * <parameter>xdr</parameter></paramdef>
11461  </funcprototype></funcsynopsis>
11462</refsynopsisdiv>
11463<refsect1>
11464 <title>Arguments</title>
11465 <variablelist>
11466  <varlistentry>
11467   <term><parameter>xdr</parameter></term>
11468   <listitem>
11469    <para>
11470     pointer to struct xdr_stream
11471    </para>
11472   </listitem>
11473  </varlistentry>
11474 </variablelist>
11475</refsect1>
11476</refentry>
11477
11478<refentry id="API-xdr-init-encode">
11479<refentryinfo>
11480 <title>LINUX</title>
11481 <productname>Kernel Hackers Manual</productname>
11482 <date>July 2017</date>
11483</refentryinfo>
11484<refmeta>
11485 <refentrytitle><phrase>xdr_init_encode</phrase></refentrytitle>
11486 <manvolnum>9</manvolnum>
11487 <refmiscinfo class="version">4.1.27</refmiscinfo>
11488</refmeta>
11489<refnamediv>
11490 <refname>xdr_init_encode</refname>
11491 <refpurpose>
11492     Initialize a struct xdr_stream for sending data.
11493 </refpurpose>
11494</refnamediv>
11495<refsynopsisdiv>
11496 <title>Synopsis</title>
11497  <funcsynopsis><funcprototype>
11498   <funcdef>void <function>xdr_init_encode </function></funcdef>
11499   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11500   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
11501   <paramdef>__be32 * <parameter>p</parameter></paramdef>
11502  </funcprototype></funcsynopsis>
11503</refsynopsisdiv>
11504<refsect1>
11505 <title>Arguments</title>
11506 <variablelist>
11507  <varlistentry>
11508   <term><parameter>xdr</parameter></term>
11509   <listitem>
11510    <para>
11511     pointer to xdr_stream struct
11512    </para>
11513   </listitem>
11514  </varlistentry>
11515  <varlistentry>
11516   <term><parameter>buf</parameter></term>
11517   <listitem>
11518    <para>
11519     pointer to XDR buffer in which to encode data
11520    </para>
11521   </listitem>
11522  </varlistentry>
11523  <varlistentry>
11524   <term><parameter>p</parameter></term>
11525   <listitem>
11526    <para>
11527     current pointer inside XDR buffer
11528    </para>
11529   </listitem>
11530  </varlistentry>
11531 </variablelist>
11532</refsect1>
11533<refsect1>
11534<title>Note</title>
11535<para>
11536   at the moment the RPC client only passes the length of our
11537   scratch buffer in the xdr_buf's header kvec. Previously this
11538   meant we needed to call <function>xdr_adjust_iovec</function> after encoding the
11539   data. With the new scheme, the xdr_stream manages the details
11540   of the buffer length, and takes care of adjusting the kvec
11541   length for us.
11542</para>
11543</refsect1>
11544</refentry>
11545
11546<refentry id="API-xdr-commit-encode">
11547<refentryinfo>
11548 <title>LINUX</title>
11549 <productname>Kernel Hackers Manual</productname>
11550 <date>July 2017</date>
11551</refentryinfo>
11552<refmeta>
11553 <refentrytitle><phrase>xdr_commit_encode</phrase></refentrytitle>
11554 <manvolnum>9</manvolnum>
11555 <refmiscinfo class="version">4.1.27</refmiscinfo>
11556</refmeta>
11557<refnamediv>
11558 <refname>xdr_commit_encode</refname>
11559 <refpurpose>
11560     Ensure all data is written to buffer
11561 </refpurpose>
11562</refnamediv>
11563<refsynopsisdiv>
11564 <title>Synopsis</title>
11565  <funcsynopsis><funcprototype>
11566   <funcdef>void <function>xdr_commit_encode </function></funcdef>
11567   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11568  </funcprototype></funcsynopsis>
11569</refsynopsisdiv>
11570<refsect1>
11571 <title>Arguments</title>
11572 <variablelist>
11573  <varlistentry>
11574   <term><parameter>xdr</parameter></term>
11575   <listitem>
11576    <para>
11577     pointer to xdr_stream
11578    </para>
11579   </listitem>
11580  </varlistentry>
11581 </variablelist>
11582</refsect1>
11583<refsect1>
11584<title>Description</title>
11585<para>
11586   We handle encoding across page boundaries by giving the caller a
11587   temporary location to write to, then later copying the data into
11588   place; xdr_commit_encode does that copying.
11589   </para><para>
11590
11591   Normally the caller doesn't need to call this directly, as the
11592   following xdr_reserve_space will do it.  But an explicit call may be
11593   required at the end of encoding, or any other time when the xdr_buf
11594   data might be read.
11595</para>
11596</refsect1>
11597</refentry>
11598
11599<refentry id="API-xdr-reserve-space">
11600<refentryinfo>
11601 <title>LINUX</title>
11602 <productname>Kernel Hackers Manual</productname>
11603 <date>July 2017</date>
11604</refentryinfo>
11605<refmeta>
11606 <refentrytitle><phrase>xdr_reserve_space</phrase></refentrytitle>
11607 <manvolnum>9</manvolnum>
11608 <refmiscinfo class="version">4.1.27</refmiscinfo>
11609</refmeta>
11610<refnamediv>
11611 <refname>xdr_reserve_space</refname>
11612 <refpurpose>
11613     Reserve buffer space for sending
11614 </refpurpose>
11615</refnamediv>
11616<refsynopsisdiv>
11617 <title>Synopsis</title>
11618  <funcsynopsis><funcprototype>
11619   <funcdef>__be32 * <function>xdr_reserve_space </function></funcdef>
11620   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11621   <paramdef>size_t <parameter>nbytes</parameter></paramdef>
11622  </funcprototype></funcsynopsis>
11623</refsynopsisdiv>
11624<refsect1>
11625 <title>Arguments</title>
11626 <variablelist>
11627  <varlistentry>
11628   <term><parameter>xdr</parameter></term>
11629   <listitem>
11630    <para>
11631     pointer to xdr_stream
11632    </para>
11633   </listitem>
11634  </varlistentry>
11635  <varlistentry>
11636   <term><parameter>nbytes</parameter></term>
11637   <listitem>
11638    <para>
11639     number of bytes to reserve
11640    </para>
11641   </listitem>
11642  </varlistentry>
11643 </variablelist>
11644</refsect1>
11645<refsect1>
11646<title>Description</title>
11647<para>
11648   Checks that we have enough buffer space to encode 'nbytes' more
11649   bytes of data. If so, update the total xdr_buf length, and
11650   adjust the length of the current kvec.
11651</para>
11652</refsect1>
11653</refentry>
11654
11655<refentry id="API-xdr-truncate-encode">
11656<refentryinfo>
11657 <title>LINUX</title>
11658 <productname>Kernel Hackers Manual</productname>
11659 <date>July 2017</date>
11660</refentryinfo>
11661<refmeta>
11662 <refentrytitle><phrase>xdr_truncate_encode</phrase></refentrytitle>
11663 <manvolnum>9</manvolnum>
11664 <refmiscinfo class="version">4.1.27</refmiscinfo>
11665</refmeta>
11666<refnamediv>
11667 <refname>xdr_truncate_encode</refname>
11668 <refpurpose>
11669     truncate an encode buffer
11670 </refpurpose>
11671</refnamediv>
11672<refsynopsisdiv>
11673 <title>Synopsis</title>
11674  <funcsynopsis><funcprototype>
11675   <funcdef>void <function>xdr_truncate_encode </function></funcdef>
11676   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11677   <paramdef>size_t <parameter>len</parameter></paramdef>
11678  </funcprototype></funcsynopsis>
11679</refsynopsisdiv>
11680<refsect1>
11681 <title>Arguments</title>
11682 <variablelist>
11683  <varlistentry>
11684   <term><parameter>xdr</parameter></term>
11685   <listitem>
11686    <para>
11687     pointer to xdr_stream
11688    </para>
11689   </listitem>
11690  </varlistentry>
11691  <varlistentry>
11692   <term><parameter>len</parameter></term>
11693   <listitem>
11694    <para>
11695     new length of buffer
11696    </para>
11697   </listitem>
11698  </varlistentry>
11699 </variablelist>
11700</refsect1>
11701<refsect1>
11702<title>Description</title>
11703<para>
11704   Truncates the xdr stream, so that xdr-&gt;buf-&gt;len == len,
11705   and xdr-&gt;p points at offset len from the start of the buffer, and
11706   head, tail, and page lengths are adjusted to correspond.
11707   </para><para>
11708
11709   If this means moving xdr-&gt;p to a different buffer, we assume that
11710   that the end pointer should be set to the end of the current page,
11711   except in the case of the head buffer when we assume the head
11712   buffer's current length represents the end of the available buffer.
11713   </para><para>
11714
11715   This is *not* safe to use on a buffer that already has inlined page
11716   cache pages (as in a zero-copy server read reply), except for the
11717   simple case of truncating from one position in the tail to another.
11718</para>
11719</refsect1>
11720</refentry>
11721
11722<refentry id="API-xdr-restrict-buflen">
11723<refentryinfo>
11724 <title>LINUX</title>
11725 <productname>Kernel Hackers Manual</productname>
11726 <date>July 2017</date>
11727</refentryinfo>
11728<refmeta>
11729 <refentrytitle><phrase>xdr_restrict_buflen</phrase></refentrytitle>
11730 <manvolnum>9</manvolnum>
11731 <refmiscinfo class="version">4.1.27</refmiscinfo>
11732</refmeta>
11733<refnamediv>
11734 <refname>xdr_restrict_buflen</refname>
11735 <refpurpose>
11736     decrease available buffer space
11737 </refpurpose>
11738</refnamediv>
11739<refsynopsisdiv>
11740 <title>Synopsis</title>
11741  <funcsynopsis><funcprototype>
11742   <funcdef>int <function>xdr_restrict_buflen </function></funcdef>
11743   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11744   <paramdef>int <parameter>newbuflen</parameter></paramdef>
11745  </funcprototype></funcsynopsis>
11746</refsynopsisdiv>
11747<refsect1>
11748 <title>Arguments</title>
11749 <variablelist>
11750  <varlistentry>
11751   <term><parameter>xdr</parameter></term>
11752   <listitem>
11753    <para>
11754     pointer to xdr_stream
11755    </para>
11756   </listitem>
11757  </varlistentry>
11758  <varlistentry>
11759   <term><parameter>newbuflen</parameter></term>
11760   <listitem>
11761    <para>
11762     new maximum number of bytes available
11763    </para>
11764   </listitem>
11765  </varlistentry>
11766 </variablelist>
11767</refsect1>
11768<refsect1>
11769<title>Description</title>
11770<para>
11771   Adjust our idea of how much space is available in the buffer.
11772   If we've already used too much space in the buffer, returns -1.
11773   If the available space is already smaller than newbuflen, returns 0
11774   and does nothing.  Otherwise, adjusts xdr-&gt;buf-&gt;buflen to newbuflen
11775   and ensures xdr-&gt;end is set at most offset newbuflen from the start
11776   of the buffer.
11777</para>
11778</refsect1>
11779</refentry>
11780
11781<refentry id="API-xdr-write-pages">
11782<refentryinfo>
11783 <title>LINUX</title>
11784 <productname>Kernel Hackers Manual</productname>
11785 <date>July 2017</date>
11786</refentryinfo>
11787<refmeta>
11788 <refentrytitle><phrase>xdr_write_pages</phrase></refentrytitle>
11789 <manvolnum>9</manvolnum>
11790 <refmiscinfo class="version">4.1.27</refmiscinfo>
11791</refmeta>
11792<refnamediv>
11793 <refname>xdr_write_pages</refname>
11794 <refpurpose>
11795     Insert a list of pages into an XDR buffer for sending
11796 </refpurpose>
11797</refnamediv>
11798<refsynopsisdiv>
11799 <title>Synopsis</title>
11800  <funcsynopsis><funcprototype>
11801   <funcdef>void <function>xdr_write_pages </function></funcdef>
11802   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11803   <paramdef>struct page ** <parameter>pages</parameter></paramdef>
11804   <paramdef>unsigned int <parameter>base</parameter></paramdef>
11805   <paramdef>unsigned int <parameter>len</parameter></paramdef>
11806  </funcprototype></funcsynopsis>
11807</refsynopsisdiv>
11808<refsect1>
11809 <title>Arguments</title>
11810 <variablelist>
11811  <varlistentry>
11812   <term><parameter>xdr</parameter></term>
11813   <listitem>
11814    <para>
11815     pointer to xdr_stream
11816    </para>
11817   </listitem>
11818  </varlistentry>
11819  <varlistentry>
11820   <term><parameter>pages</parameter></term>
11821   <listitem>
11822    <para>
11823     list of pages
11824    </para>
11825   </listitem>
11826  </varlistentry>
11827  <varlistentry>
11828   <term><parameter>base</parameter></term>
11829   <listitem>
11830    <para>
11831     offset of first byte
11832    </para>
11833   </listitem>
11834  </varlistentry>
11835  <varlistentry>
11836   <term><parameter>len</parameter></term>
11837   <listitem>
11838    <para>
11839     length of data in bytes
11840    </para>
11841   </listitem>
11842  </varlistentry>
11843 </variablelist>
11844</refsect1>
11845</refentry>
11846
11847<refentry id="API-xdr-init-decode">
11848<refentryinfo>
11849 <title>LINUX</title>
11850 <productname>Kernel Hackers Manual</productname>
11851 <date>July 2017</date>
11852</refentryinfo>
11853<refmeta>
11854 <refentrytitle><phrase>xdr_init_decode</phrase></refentrytitle>
11855 <manvolnum>9</manvolnum>
11856 <refmiscinfo class="version">4.1.27</refmiscinfo>
11857</refmeta>
11858<refnamediv>
11859 <refname>xdr_init_decode</refname>
11860 <refpurpose>
11861     Initialize an xdr_stream for decoding data.
11862 </refpurpose>
11863</refnamediv>
11864<refsynopsisdiv>
11865 <title>Synopsis</title>
11866  <funcsynopsis><funcprototype>
11867   <funcdef>void <function>xdr_init_decode </function></funcdef>
11868   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11869   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
11870   <paramdef>__be32 * <parameter>p</parameter></paramdef>
11871  </funcprototype></funcsynopsis>
11872</refsynopsisdiv>
11873<refsect1>
11874 <title>Arguments</title>
11875 <variablelist>
11876  <varlistentry>
11877   <term><parameter>xdr</parameter></term>
11878   <listitem>
11879    <para>
11880     pointer to xdr_stream struct
11881    </para>
11882   </listitem>
11883  </varlistentry>
11884  <varlistentry>
11885   <term><parameter>buf</parameter></term>
11886   <listitem>
11887    <para>
11888     pointer to XDR buffer from which to decode data
11889    </para>
11890   </listitem>
11891  </varlistentry>
11892  <varlistentry>
11893   <term><parameter>p</parameter></term>
11894   <listitem>
11895    <para>
11896     current pointer inside XDR buffer
11897    </para>
11898   </listitem>
11899  </varlistentry>
11900 </variablelist>
11901</refsect1>
11902</refentry>
11903
11904<refentry id="API-xdr-init-decode-pages">
11905<refentryinfo>
11906 <title>LINUX</title>
11907 <productname>Kernel Hackers Manual</productname>
11908 <date>July 2017</date>
11909</refentryinfo>
11910<refmeta>
11911 <refentrytitle><phrase>xdr_init_decode_pages</phrase></refentrytitle>
11912 <manvolnum>9</manvolnum>
11913 <refmiscinfo class="version">4.1.27</refmiscinfo>
11914</refmeta>
11915<refnamediv>
11916 <refname>xdr_init_decode_pages</refname>
11917 <refpurpose>
11918     Initialize an xdr_stream for decoding data.
11919 </refpurpose>
11920</refnamediv>
11921<refsynopsisdiv>
11922 <title>Synopsis</title>
11923  <funcsynopsis><funcprototype>
11924   <funcdef>void <function>xdr_init_decode_pages </function></funcdef>
11925   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11926   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
11927   <paramdef>struct page ** <parameter>pages</parameter></paramdef>
11928   <paramdef>unsigned int <parameter>len</parameter></paramdef>
11929  </funcprototype></funcsynopsis>
11930</refsynopsisdiv>
11931<refsect1>
11932 <title>Arguments</title>
11933 <variablelist>
11934  <varlistentry>
11935   <term><parameter>xdr</parameter></term>
11936   <listitem>
11937    <para>
11938     pointer to xdr_stream struct
11939    </para>
11940   </listitem>
11941  </varlistentry>
11942  <varlistentry>
11943   <term><parameter>buf</parameter></term>
11944   <listitem>
11945    <para>
11946     pointer to XDR buffer from which to decode data
11947    </para>
11948   </listitem>
11949  </varlistentry>
11950  <varlistentry>
11951   <term><parameter>pages</parameter></term>
11952   <listitem>
11953    <para>
11954     list of pages to decode into
11955    </para>
11956   </listitem>
11957  </varlistentry>
11958  <varlistentry>
11959   <term><parameter>len</parameter></term>
11960   <listitem>
11961    <para>
11962     length in bytes of buffer in pages
11963    </para>
11964   </listitem>
11965  </varlistentry>
11966 </variablelist>
11967</refsect1>
11968</refentry>
11969
11970<refentry id="API-xdr-set-scratch-buffer">
11971<refentryinfo>
11972 <title>LINUX</title>
11973 <productname>Kernel Hackers Manual</productname>
11974 <date>July 2017</date>
11975</refentryinfo>
11976<refmeta>
11977 <refentrytitle><phrase>xdr_set_scratch_buffer</phrase></refentrytitle>
11978 <manvolnum>9</manvolnum>
11979 <refmiscinfo class="version">4.1.27</refmiscinfo>
11980</refmeta>
11981<refnamediv>
11982 <refname>xdr_set_scratch_buffer</refname>
11983 <refpurpose>
11984     Attach a scratch buffer for decoding data.
11985 </refpurpose>
11986</refnamediv>
11987<refsynopsisdiv>
11988 <title>Synopsis</title>
11989  <funcsynopsis><funcprototype>
11990   <funcdef>void <function>xdr_set_scratch_buffer </function></funcdef>
11991   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
11992   <paramdef>void * <parameter>buf</parameter></paramdef>
11993   <paramdef>size_t <parameter>buflen</parameter></paramdef>
11994  </funcprototype></funcsynopsis>
11995</refsynopsisdiv>
11996<refsect1>
11997 <title>Arguments</title>
11998 <variablelist>
11999  <varlistentry>
12000   <term><parameter>xdr</parameter></term>
12001   <listitem>
12002    <para>
12003     pointer to xdr_stream struct
12004    </para>
12005   </listitem>
12006  </varlistentry>
12007  <varlistentry>
12008   <term><parameter>buf</parameter></term>
12009   <listitem>
12010    <para>
12011     pointer to an empty buffer
12012    </para>
12013   </listitem>
12014  </varlistentry>
12015  <varlistentry>
12016   <term><parameter>buflen</parameter></term>
12017   <listitem>
12018    <para>
12019     size of 'buf'
12020    </para>
12021   </listitem>
12022  </varlistentry>
12023 </variablelist>
12024</refsect1>
12025<refsect1>
12026<title>Description</title>
12027<para>
12028   The scratch buffer is used when decoding from an array of pages.
12029   If an <function>xdr_inline_decode</function> call spans across page boundaries, then
12030   we copy the data into the scratch buffer in order to allow linear
12031   access.
12032</para>
12033</refsect1>
12034</refentry>
12035
12036<refentry id="API-xdr-inline-decode">
12037<refentryinfo>
12038 <title>LINUX</title>
12039 <productname>Kernel Hackers Manual</productname>
12040 <date>July 2017</date>
12041</refentryinfo>
12042<refmeta>
12043 <refentrytitle><phrase>xdr_inline_decode</phrase></refentrytitle>
12044 <manvolnum>9</manvolnum>
12045 <refmiscinfo class="version">4.1.27</refmiscinfo>
12046</refmeta>
12047<refnamediv>
12048 <refname>xdr_inline_decode</refname>
12049 <refpurpose>
12050     Retrieve XDR data to decode
12051 </refpurpose>
12052</refnamediv>
12053<refsynopsisdiv>
12054 <title>Synopsis</title>
12055  <funcsynopsis><funcprototype>
12056   <funcdef>__be32 * <function>xdr_inline_decode </function></funcdef>
12057   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
12058   <paramdef>size_t <parameter>nbytes</parameter></paramdef>
12059  </funcprototype></funcsynopsis>
12060</refsynopsisdiv>
12061<refsect1>
12062 <title>Arguments</title>
12063 <variablelist>
12064  <varlistentry>
12065   <term><parameter>xdr</parameter></term>
12066   <listitem>
12067    <para>
12068     pointer to xdr_stream struct
12069    </para>
12070   </listitem>
12071  </varlistentry>
12072  <varlistentry>
12073   <term><parameter>nbytes</parameter></term>
12074   <listitem>
12075    <para>
12076     number of bytes of data to decode
12077    </para>
12078   </listitem>
12079  </varlistentry>
12080 </variablelist>
12081</refsect1>
12082<refsect1>
12083<title>Description</title>
12084<para>
12085   Check if the input buffer is long enough to enable us to decode
12086   'nbytes' more bytes of data starting at the current position.
12087   If so return the current pointer, then update the current
12088   pointer position.
12089</para>
12090</refsect1>
12091</refentry>
12092
12093<refentry id="API-xdr-read-pages">
12094<refentryinfo>
12095 <title>LINUX</title>
12096 <productname>Kernel Hackers Manual</productname>
12097 <date>July 2017</date>
12098</refentryinfo>
12099<refmeta>
12100 <refentrytitle><phrase>xdr_read_pages</phrase></refentrytitle>
12101 <manvolnum>9</manvolnum>
12102 <refmiscinfo class="version">4.1.27</refmiscinfo>
12103</refmeta>
12104<refnamediv>
12105 <refname>xdr_read_pages</refname>
12106 <refpurpose>
12107     Ensure page-based XDR data to decode is aligned at current pointer position
12108 </refpurpose>
12109</refnamediv>
12110<refsynopsisdiv>
12111 <title>Synopsis</title>
12112  <funcsynopsis><funcprototype>
12113   <funcdef>unsigned int <function>xdr_read_pages </function></funcdef>
12114   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
12115   <paramdef>unsigned int <parameter>len</parameter></paramdef>
12116  </funcprototype></funcsynopsis>
12117</refsynopsisdiv>
12118<refsect1>
12119 <title>Arguments</title>
12120 <variablelist>
12121  <varlistentry>
12122   <term><parameter>xdr</parameter></term>
12123   <listitem>
12124    <para>
12125     pointer to xdr_stream struct
12126    </para>
12127   </listitem>
12128  </varlistentry>
12129  <varlistentry>
12130   <term><parameter>len</parameter></term>
12131   <listitem>
12132    <para>
12133     number of bytes of page data
12134    </para>
12135   </listitem>
12136  </varlistentry>
12137 </variablelist>
12138</refsect1>
12139<refsect1>
12140<title>Description</title>
12141<para>
12142   Moves data beyond the current pointer position from the XDR head[] buffer
12143   into the page list. Any data that lies beyond current position + <quote>len</quote>
12144   bytes is moved into the XDR tail[].
12145   </para><para>
12146
12147   Returns the number of XDR encoded bytes now contained in the pages
12148</para>
12149</refsect1>
12150</refentry>
12151
12152<refentry id="API-xdr-enter-page">
12153<refentryinfo>
12154 <title>LINUX</title>
12155 <productname>Kernel Hackers Manual</productname>
12156 <date>July 2017</date>
12157</refentryinfo>
12158<refmeta>
12159 <refentrytitle><phrase>xdr_enter_page</phrase></refentrytitle>
12160 <manvolnum>9</manvolnum>
12161 <refmiscinfo class="version">4.1.27</refmiscinfo>
12162</refmeta>
12163<refnamediv>
12164 <refname>xdr_enter_page</refname>
12165 <refpurpose>
12166     decode data from the XDR page
12167 </refpurpose>
12168</refnamediv>
12169<refsynopsisdiv>
12170 <title>Synopsis</title>
12171  <funcsynopsis><funcprototype>
12172   <funcdef>void <function>xdr_enter_page </function></funcdef>
12173   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
12174   <paramdef>unsigned int <parameter>len</parameter></paramdef>
12175  </funcprototype></funcsynopsis>
12176</refsynopsisdiv>
12177<refsect1>
12178 <title>Arguments</title>
12179 <variablelist>
12180  <varlistentry>
12181   <term><parameter>xdr</parameter></term>
12182   <listitem>
12183    <para>
12184     pointer to xdr_stream struct
12185    </para>
12186   </listitem>
12187  </varlistentry>
12188  <varlistentry>
12189   <term><parameter>len</parameter></term>
12190   <listitem>
12191    <para>
12192     number of bytes of page data
12193    </para>
12194   </listitem>
12195  </varlistentry>
12196 </variablelist>
12197</refsect1>
12198<refsect1>
12199<title>Description</title>
12200<para>
12201   Moves data beyond the current pointer position from the XDR head[] buffer
12202   into the page list. Any data that lies beyond current position + <quote>len</quote>
12203   bytes is moved into the XDR tail[]. The current pointer is then
12204   repositioned at the beginning of the first XDR page.
12205</para>
12206</refsect1>
12207</refentry>
12208
12209<refentry id="API-xdr-buf-subsegment">
12210<refentryinfo>
12211 <title>LINUX</title>
12212 <productname>Kernel Hackers Manual</productname>
12213 <date>July 2017</date>
12214</refentryinfo>
12215<refmeta>
12216 <refentrytitle><phrase>xdr_buf_subsegment</phrase></refentrytitle>
12217 <manvolnum>9</manvolnum>
12218 <refmiscinfo class="version">4.1.27</refmiscinfo>
12219</refmeta>
12220<refnamediv>
12221 <refname>xdr_buf_subsegment</refname>
12222 <refpurpose>
12223     set subbuf to a portion of buf
12224 </refpurpose>
12225</refnamediv>
12226<refsynopsisdiv>
12227 <title>Synopsis</title>
12228  <funcsynopsis><funcprototype>
12229   <funcdef>int <function>xdr_buf_subsegment </function></funcdef>
12230   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
12231   <paramdef>struct xdr_buf * <parameter>subbuf</parameter></paramdef>
12232   <paramdef>unsigned int <parameter>base</parameter></paramdef>
12233   <paramdef>unsigned int <parameter>len</parameter></paramdef>
12234  </funcprototype></funcsynopsis>
12235</refsynopsisdiv>
12236<refsect1>
12237 <title>Arguments</title>
12238 <variablelist>
12239  <varlistentry>
12240   <term><parameter>buf</parameter></term>
12241   <listitem>
12242    <para>
12243     an xdr buffer
12244    </para>
12245   </listitem>
12246  </varlistentry>
12247  <varlistentry>
12248   <term><parameter>subbuf</parameter></term>
12249   <listitem>
12250    <para>
12251     the result buffer
12252    </para>
12253   </listitem>
12254  </varlistentry>
12255  <varlistentry>
12256   <term><parameter>base</parameter></term>
12257   <listitem>
12258    <para>
12259     beginning of range in bytes
12260    </para>
12261   </listitem>
12262  </varlistentry>
12263  <varlistentry>
12264   <term><parameter>len</parameter></term>
12265   <listitem>
12266    <para>
12267     length of range in bytes
12268    </para>
12269   </listitem>
12270  </varlistentry>
12271 </variablelist>
12272</refsect1>
12273<refsect1>
12274<title>Description</title>
12275<para>
12276   sets <parameter>subbuf</parameter> to an xdr buffer representing the portion of <parameter>buf</parameter> of
12277   length <parameter>len</parameter> starting at offset <parameter>base</parameter>.
12278   </para><para>
12279
12280   <parameter>buf</parameter> and <parameter>subbuf</parameter> may be pointers to the same struct xdr_buf.
12281   </para><para>
12282
12283   Returns -1 if base of length are out of bounds.
12284</para>
12285</refsect1>
12286</refentry>
12287
12288<refentry id="API-xdr-buf-trim">
12289<refentryinfo>
12290 <title>LINUX</title>
12291 <productname>Kernel Hackers Manual</productname>
12292 <date>July 2017</date>
12293</refentryinfo>
12294<refmeta>
12295 <refentrytitle><phrase>xdr_buf_trim</phrase></refentrytitle>
12296 <manvolnum>9</manvolnum>
12297 <refmiscinfo class="version">4.1.27</refmiscinfo>
12298</refmeta>
12299<refnamediv>
12300 <refname>xdr_buf_trim</refname>
12301 <refpurpose>
12302     lop at most <quote>len</quote> bytes off the end of <quote>buf</quote>
12303 </refpurpose>
12304</refnamediv>
12305<refsynopsisdiv>
12306 <title>Synopsis</title>
12307  <funcsynopsis><funcprototype>
12308   <funcdef>void <function>xdr_buf_trim </function></funcdef>
12309   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
12310   <paramdef>unsigned int <parameter>len</parameter></paramdef>
12311  </funcprototype></funcsynopsis>
12312</refsynopsisdiv>
12313<refsect1>
12314 <title>Arguments</title>
12315 <variablelist>
12316  <varlistentry>
12317   <term><parameter>buf</parameter></term>
12318   <listitem>
12319    <para>
12320     buf to be trimmed
12321    </para>
12322   </listitem>
12323  </varlistentry>
12324  <varlistentry>
12325   <term><parameter>len</parameter></term>
12326   <listitem>
12327    <para>
12328     number of bytes to reduce <quote>buf</quote> by
12329    </para>
12330   </listitem>
12331  </varlistentry>
12332 </variablelist>
12333</refsect1>
12334<refsect1>
12335<title>Description</title>
12336<para>
12337   Trim an xdr_buf by the given number of bytes by fixing up the lengths. Note
12338   that it's possible that we'll trim less than that amount if the xdr_buf is
12339   too small, or if (for instance) it's all in the head and the parser has
12340   already read too far into it.
12341</para>
12342</refsect1>
12343</refentry>
12344
12345<!-- net/sunrpc/svc_xprt.c -->
12346<refentry id="API-svc-print-addr">
12347<refentryinfo>
12348 <title>LINUX</title>
12349 <productname>Kernel Hackers Manual</productname>
12350 <date>July 2017</date>
12351</refentryinfo>
12352<refmeta>
12353 <refentrytitle><phrase>svc_print_addr</phrase></refentrytitle>
12354 <manvolnum>9</manvolnum>
12355 <refmiscinfo class="version">4.1.27</refmiscinfo>
12356</refmeta>
12357<refnamediv>
12358 <refname>svc_print_addr</refname>
12359 <refpurpose>
12360  Format rq_addr field for printing
12361 </refpurpose>
12362</refnamediv>
12363<refsynopsisdiv>
12364 <title>Synopsis</title>
12365  <funcsynopsis><funcprototype>
12366   <funcdef>char * <function>svc_print_addr </function></funcdef>
12367   <paramdef>struct svc_rqst * <parameter>rqstp</parameter></paramdef>
12368   <paramdef>char * <parameter>buf</parameter></paramdef>
12369   <paramdef>size_t <parameter>len</parameter></paramdef>
12370  </funcprototype></funcsynopsis>
12371</refsynopsisdiv>
12372<refsect1>
12373 <title>Arguments</title>
12374 <variablelist>
12375  <varlistentry>
12376   <term><parameter>rqstp</parameter></term>
12377   <listitem>
12378    <para>
12379     svc_rqst struct containing address to print
12380    </para>
12381   </listitem>
12382  </varlistentry>
12383  <varlistentry>
12384   <term><parameter>buf</parameter></term>
12385   <listitem>
12386    <para>
12387     target buffer for formatted address
12388    </para>
12389   </listitem>
12390  </varlistentry>
12391  <varlistentry>
12392   <term><parameter>len</parameter></term>
12393   <listitem>
12394    <para>
12395     length of target buffer
12396    </para>
12397   </listitem>
12398  </varlistentry>
12399 </variablelist>
12400</refsect1>
12401</refentry>
12402
12403<refentry id="API-svc-reserve">
12404<refentryinfo>
12405 <title>LINUX</title>
12406 <productname>Kernel Hackers Manual</productname>
12407 <date>July 2017</date>
12408</refentryinfo>
12409<refmeta>
12410 <refentrytitle><phrase>svc_reserve</phrase></refentrytitle>
12411 <manvolnum>9</manvolnum>
12412 <refmiscinfo class="version">4.1.27</refmiscinfo>
12413</refmeta>
12414<refnamediv>
12415 <refname>svc_reserve</refname>
12416 <refpurpose>
12417     change the space reserved for the reply to a request.
12418 </refpurpose>
12419</refnamediv>
12420<refsynopsisdiv>
12421 <title>Synopsis</title>
12422  <funcsynopsis><funcprototype>
12423   <funcdef>void <function>svc_reserve </function></funcdef>
12424   <paramdef>struct svc_rqst * <parameter>rqstp</parameter></paramdef>
12425   <paramdef>int <parameter>space</parameter></paramdef>
12426  </funcprototype></funcsynopsis>
12427</refsynopsisdiv>
12428<refsect1>
12429 <title>Arguments</title>
12430 <variablelist>
12431  <varlistentry>
12432   <term><parameter>rqstp</parameter></term>
12433   <listitem>
12434    <para>
12435     The request in question
12436    </para>
12437   </listitem>
12438  </varlistentry>
12439  <varlistentry>
12440   <term><parameter>space</parameter></term>
12441   <listitem>
12442    <para>
12443     new max space to reserve
12444    </para>
12445   </listitem>
12446  </varlistentry>
12447 </variablelist>
12448</refsect1>
12449<refsect1>
12450<title>Description</title>
12451<para>
12452   Each request reserves some space on the output queue of the transport
12453   to make sure the reply fits.  This function reduces that reserved
12454   space to be the amount of space used already, plus <parameter>space</parameter>.
12455</para>
12456</refsect1>
12457</refentry>
12458
12459<refentry id="API-svc-find-xprt">
12460<refentryinfo>
12461 <title>LINUX</title>
12462 <productname>Kernel Hackers Manual</productname>
12463 <date>July 2017</date>
12464</refentryinfo>
12465<refmeta>
12466 <refentrytitle><phrase>svc_find_xprt</phrase></refentrytitle>
12467 <manvolnum>9</manvolnum>
12468 <refmiscinfo class="version">4.1.27</refmiscinfo>
12469</refmeta>
12470<refnamediv>
12471 <refname>svc_find_xprt</refname>
12472 <refpurpose>
12473     find an RPC transport instance
12474 </refpurpose>
12475</refnamediv>
12476<refsynopsisdiv>
12477 <title>Synopsis</title>
12478  <funcsynopsis><funcprototype>
12479   <funcdef>struct svc_xprt * <function>svc_find_xprt </function></funcdef>
12480   <paramdef>struct svc_serv * <parameter>serv</parameter></paramdef>
12481   <paramdef>const char * <parameter>xcl_name</parameter></paramdef>
12482   <paramdef>struct net * <parameter>net</parameter></paramdef>
12483   <paramdef>const sa_family_t <parameter>af</parameter></paramdef>
12484   <paramdef>const unsigned short <parameter>port</parameter></paramdef>
12485  </funcprototype></funcsynopsis>
12486</refsynopsisdiv>
12487<refsect1>
12488 <title>Arguments</title>
12489 <variablelist>
12490  <varlistentry>
12491   <term><parameter>serv</parameter></term>
12492   <listitem>
12493    <para>
12494     pointer to svc_serv to search
12495    </para>
12496   </listitem>
12497  </varlistentry>
12498  <varlistentry>
12499   <term><parameter>xcl_name</parameter></term>
12500   <listitem>
12501    <para>
12502     C string containing transport's class name
12503    </para>
12504   </listitem>
12505  </varlistentry>
12506  <varlistentry>
12507   <term><parameter>net</parameter></term>
12508   <listitem>
12509    <para>
12510     owner net pointer
12511    </para>
12512   </listitem>
12513  </varlistentry>
12514  <varlistentry>
12515   <term><parameter>af</parameter></term>
12516   <listitem>
12517    <para>
12518     Address family of transport's local address
12519    </para>
12520   </listitem>
12521  </varlistentry>
12522  <varlistentry>
12523   <term><parameter>port</parameter></term>
12524   <listitem>
12525    <para>
12526     transport's IP port number
12527    </para>
12528   </listitem>
12529  </varlistentry>
12530 </variablelist>
12531</refsect1>
12532<refsect1>
12533<title>Description</title>
12534<para>
12535   Return the transport instance pointer for the endpoint accepting
12536   connections/peer traffic from the specified transport class,
12537   address family and port.
12538   </para><para>
12539
12540   Specifying 0 for the address family or port is effectively a
12541   wild-card, and will result in matching the first transport in the
12542   service's list that has a matching class name.
12543</para>
12544</refsect1>
12545</refentry>
12546
12547<refentry id="API-svc-xprt-names">
12548<refentryinfo>
12549 <title>LINUX</title>
12550 <productname>Kernel Hackers Manual</productname>
12551 <date>July 2017</date>
12552</refentryinfo>
12553<refmeta>
12554 <refentrytitle><phrase>svc_xprt_names</phrase></refentrytitle>
12555 <manvolnum>9</manvolnum>
12556 <refmiscinfo class="version">4.1.27</refmiscinfo>
12557</refmeta>
12558<refnamediv>
12559 <refname>svc_xprt_names</refname>
12560 <refpurpose>
12561     format a buffer with a list of transport names
12562 </refpurpose>
12563</refnamediv>
12564<refsynopsisdiv>
12565 <title>Synopsis</title>
12566  <funcsynopsis><funcprototype>
12567   <funcdef>int <function>svc_xprt_names </function></funcdef>
12568   <paramdef>struct svc_serv * <parameter>serv</parameter></paramdef>
12569   <paramdef>char * <parameter>buf</parameter></paramdef>
12570   <paramdef>const int <parameter>buflen</parameter></paramdef>
12571  </funcprototype></funcsynopsis>
12572</refsynopsisdiv>
12573<refsect1>
12574 <title>Arguments</title>
12575 <variablelist>
12576  <varlistentry>
12577   <term><parameter>serv</parameter></term>
12578   <listitem>
12579    <para>
12580     pointer to an RPC service
12581    </para>
12582   </listitem>
12583  </varlistentry>
12584  <varlistentry>
12585   <term><parameter>buf</parameter></term>
12586   <listitem>
12587    <para>
12588     pointer to a buffer to be filled in
12589    </para>
12590   </listitem>
12591  </varlistentry>
12592  <varlistentry>
12593   <term><parameter>buflen</parameter></term>
12594   <listitem>
12595    <para>
12596     length of buffer to be filled in
12597    </para>
12598   </listitem>
12599  </varlistentry>
12600 </variablelist>
12601</refsect1>
12602<refsect1>
12603<title>Description</title>
12604<para>
12605   Fills in <parameter>buf</parameter> with a string containing a list of transport names,
12606   each name terminated with '\n'.
12607   </para><para>
12608
12609   Returns positive length of the filled-in string on success; otherwise
12610   a negative errno value is returned if an error occurs.
12611</para>
12612</refsect1>
12613</refentry>
12614
12615<!-- net/sunrpc/xprt.c -->
12616<refentry id="API-xprt-register-transport">
12617<refentryinfo>
12618 <title>LINUX</title>
12619 <productname>Kernel Hackers Manual</productname>
12620 <date>July 2017</date>
12621</refentryinfo>
12622<refmeta>
12623 <refentrytitle><phrase>xprt_register_transport</phrase></refentrytitle>
12624 <manvolnum>9</manvolnum>
12625 <refmiscinfo class="version">4.1.27</refmiscinfo>
12626</refmeta>
12627<refnamediv>
12628 <refname>xprt_register_transport</refname>
12629 <refpurpose>
12630  register a transport implementation
12631 </refpurpose>
12632</refnamediv>
12633<refsynopsisdiv>
12634 <title>Synopsis</title>
12635  <funcsynopsis><funcprototype>
12636   <funcdef>int <function>xprt_register_transport </function></funcdef>
12637   <paramdef>struct xprt_class * <parameter>transport</parameter></paramdef>
12638  </funcprototype></funcsynopsis>
12639</refsynopsisdiv>
12640<refsect1>
12641 <title>Arguments</title>
12642 <variablelist>
12643  <varlistentry>
12644   <term><parameter>transport</parameter></term>
12645   <listitem>
12646    <para>
12647     transport to register
12648    </para>
12649   </listitem>
12650  </varlistentry>
12651 </variablelist>
12652</refsect1>
12653<refsect1>
12654<title>Description</title>
12655<para>
12656   If a transport implementation is loaded as a kernel module, it can
12657   call this interface to make itself known to the RPC client.
12658</para>
12659</refsect1>
12660<refsect1>
12661<title>0</title>
12662<para>
12663   transport successfully registered
12664   -EEXIST:	transport already registered
12665   -EINVAL:	transport module being unloaded
12666</para>
12667</refsect1>
12668</refentry>
12669
12670<refentry id="API-xprt-unregister-transport">
12671<refentryinfo>
12672 <title>LINUX</title>
12673 <productname>Kernel Hackers Manual</productname>
12674 <date>July 2017</date>
12675</refentryinfo>
12676<refmeta>
12677 <refentrytitle><phrase>xprt_unregister_transport</phrase></refentrytitle>
12678 <manvolnum>9</manvolnum>
12679 <refmiscinfo class="version">4.1.27</refmiscinfo>
12680</refmeta>
12681<refnamediv>
12682 <refname>xprt_unregister_transport</refname>
12683 <refpurpose>
12684     unregister a transport implementation
12685 </refpurpose>
12686</refnamediv>
12687<refsynopsisdiv>
12688 <title>Synopsis</title>
12689  <funcsynopsis><funcprototype>
12690   <funcdef>int <function>xprt_unregister_transport </function></funcdef>
12691   <paramdef>struct xprt_class * <parameter>transport</parameter></paramdef>
12692  </funcprototype></funcsynopsis>
12693</refsynopsisdiv>
12694<refsect1>
12695 <title>Arguments</title>
12696 <variablelist>
12697  <varlistentry>
12698   <term><parameter>transport</parameter></term>
12699   <listitem>
12700    <para>
12701     transport to unregister
12702    </para>
12703   </listitem>
12704  </varlistentry>
12705 </variablelist>
12706</refsect1>
12707<refsect1>
12708<title>0</title>
12709<para>
12710   transport successfully unregistered
12711   -ENOENT:	transport never registered
12712</para>
12713</refsect1>
12714</refentry>
12715
12716<refentry id="API-xprt-load-transport">
12717<refentryinfo>
12718 <title>LINUX</title>
12719 <productname>Kernel Hackers Manual</productname>
12720 <date>July 2017</date>
12721</refentryinfo>
12722<refmeta>
12723 <refentrytitle><phrase>xprt_load_transport</phrase></refentrytitle>
12724 <manvolnum>9</manvolnum>
12725 <refmiscinfo class="version">4.1.27</refmiscinfo>
12726</refmeta>
12727<refnamediv>
12728 <refname>xprt_load_transport</refname>
12729 <refpurpose>
12730     load a transport implementation
12731 </refpurpose>
12732</refnamediv>
12733<refsynopsisdiv>
12734 <title>Synopsis</title>
12735  <funcsynopsis><funcprototype>
12736   <funcdef>int <function>xprt_load_transport </function></funcdef>
12737   <paramdef>const char * <parameter>transport_name</parameter></paramdef>
12738  </funcprototype></funcsynopsis>
12739</refsynopsisdiv>
12740<refsect1>
12741 <title>Arguments</title>
12742 <variablelist>
12743  <varlistentry>
12744   <term><parameter>transport_name</parameter></term>
12745   <listitem>
12746    <para>
12747     transport to load
12748    </para>
12749   </listitem>
12750  </varlistentry>
12751 </variablelist>
12752</refsect1>
12753<refsect1>
12754<title>0</title>
12755<para>
12756   transport successfully loaded
12757   -ENOENT:	transport module not available
12758</para>
12759</refsect1>
12760</refentry>
12761
12762<refentry id="API-xprt-reserve-xprt">
12763<refentryinfo>
12764 <title>LINUX</title>
12765 <productname>Kernel Hackers Manual</productname>
12766 <date>July 2017</date>
12767</refentryinfo>
12768<refmeta>
12769 <refentrytitle><phrase>xprt_reserve_xprt</phrase></refentrytitle>
12770 <manvolnum>9</manvolnum>
12771 <refmiscinfo class="version">4.1.27</refmiscinfo>
12772</refmeta>
12773<refnamediv>
12774 <refname>xprt_reserve_xprt</refname>
12775 <refpurpose>
12776     serialize write access to transports
12777 </refpurpose>
12778</refnamediv>
12779<refsynopsisdiv>
12780 <title>Synopsis</title>
12781  <funcsynopsis><funcprototype>
12782   <funcdef>int <function>xprt_reserve_xprt </function></funcdef>
12783   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
12784   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
12785  </funcprototype></funcsynopsis>
12786</refsynopsisdiv>
12787<refsect1>
12788 <title>Arguments</title>
12789 <variablelist>
12790  <varlistentry>
12791   <term><parameter>xprt</parameter></term>
12792   <listitem>
12793    <para>
12794     pointer to the target transport
12795    </para>
12796   </listitem>
12797  </varlistentry>
12798  <varlistentry>
12799   <term><parameter>task</parameter></term>
12800   <listitem>
12801    <para>
12802     task that is requesting access to the transport
12803    </para>
12804   </listitem>
12805  </varlistentry>
12806 </variablelist>
12807</refsect1>
12808<refsect1>
12809<title>Description</title>
12810<para>
12811   This prevents mixing the payload of separate requests, and prevents
12812   transport connects from colliding with writes.  No congestion control
12813   is provided.
12814</para>
12815</refsect1>
12816</refentry>
12817
12818<refentry id="API-xprt-release-xprt">
12819<refentryinfo>
12820 <title>LINUX</title>
12821 <productname>Kernel Hackers Manual</productname>
12822 <date>July 2017</date>
12823</refentryinfo>
12824<refmeta>
12825 <refentrytitle><phrase>xprt_release_xprt</phrase></refentrytitle>
12826 <manvolnum>9</manvolnum>
12827 <refmiscinfo class="version">4.1.27</refmiscinfo>
12828</refmeta>
12829<refnamediv>
12830 <refname>xprt_release_xprt</refname>
12831 <refpurpose>
12832     allow other requests to use a transport
12833 </refpurpose>
12834</refnamediv>
12835<refsynopsisdiv>
12836 <title>Synopsis</title>
12837  <funcsynopsis><funcprototype>
12838   <funcdef>void <function>xprt_release_xprt </function></funcdef>
12839   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
12840   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
12841  </funcprototype></funcsynopsis>
12842</refsynopsisdiv>
12843<refsect1>
12844 <title>Arguments</title>
12845 <variablelist>
12846  <varlistentry>
12847   <term><parameter>xprt</parameter></term>
12848   <listitem>
12849    <para>
12850     transport with other tasks potentially waiting
12851    </para>
12852   </listitem>
12853  </varlistentry>
12854  <varlistentry>
12855   <term><parameter>task</parameter></term>
12856   <listitem>
12857    <para>
12858     task that is releasing access to the transport
12859    </para>
12860   </listitem>
12861  </varlistentry>
12862 </variablelist>
12863</refsect1>
12864<refsect1>
12865<title>Description</title>
12866<para>
12867   Note that <quote>task</quote> can be NULL.  No congestion control is provided.
12868</para>
12869</refsect1>
12870</refentry>
12871
12872<refentry id="API-xprt-release-xprt-cong">
12873<refentryinfo>
12874 <title>LINUX</title>
12875 <productname>Kernel Hackers Manual</productname>
12876 <date>July 2017</date>
12877</refentryinfo>
12878<refmeta>
12879 <refentrytitle><phrase>xprt_release_xprt_cong</phrase></refentrytitle>
12880 <manvolnum>9</manvolnum>
12881 <refmiscinfo class="version">4.1.27</refmiscinfo>
12882</refmeta>
12883<refnamediv>
12884 <refname>xprt_release_xprt_cong</refname>
12885 <refpurpose>
12886     allow other requests to use a transport
12887 </refpurpose>
12888</refnamediv>
12889<refsynopsisdiv>
12890 <title>Synopsis</title>
12891  <funcsynopsis><funcprototype>
12892   <funcdef>void <function>xprt_release_xprt_cong </function></funcdef>
12893   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
12894   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
12895  </funcprototype></funcsynopsis>
12896</refsynopsisdiv>
12897<refsect1>
12898 <title>Arguments</title>
12899 <variablelist>
12900  <varlistentry>
12901   <term><parameter>xprt</parameter></term>
12902   <listitem>
12903    <para>
12904     transport with other tasks potentially waiting
12905    </para>
12906   </listitem>
12907  </varlistentry>
12908  <varlistentry>
12909   <term><parameter>task</parameter></term>
12910   <listitem>
12911    <para>
12912     task that is releasing access to the transport
12913    </para>
12914   </listitem>
12915  </varlistentry>
12916 </variablelist>
12917</refsect1>
12918<refsect1>
12919<title>Description</title>
12920<para>
12921   Note that <quote>task</quote> can be NULL.  Another task is awoken to use the
12922   transport if the transport's congestion window allows it.
12923</para>
12924</refsect1>
12925</refentry>
12926
12927<refentry id="API-xprt-release-rqst-cong">
12928<refentryinfo>
12929 <title>LINUX</title>
12930 <productname>Kernel Hackers Manual</productname>
12931 <date>July 2017</date>
12932</refentryinfo>
12933<refmeta>
12934 <refentrytitle><phrase>xprt_release_rqst_cong</phrase></refentrytitle>
12935 <manvolnum>9</manvolnum>
12936 <refmiscinfo class="version">4.1.27</refmiscinfo>
12937</refmeta>
12938<refnamediv>
12939 <refname>xprt_release_rqst_cong</refname>
12940 <refpurpose>
12941     housekeeping when request is complete
12942 </refpurpose>
12943</refnamediv>
12944<refsynopsisdiv>
12945 <title>Synopsis</title>
12946  <funcsynopsis><funcprototype>
12947   <funcdef>void <function>xprt_release_rqst_cong </function></funcdef>
12948   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
12949  </funcprototype></funcsynopsis>
12950</refsynopsisdiv>
12951<refsect1>
12952 <title>Arguments</title>
12953 <variablelist>
12954  <varlistentry>
12955   <term><parameter>task</parameter></term>
12956   <listitem>
12957    <para>
12958     RPC request that recently completed
12959    </para>
12960   </listitem>
12961  </varlistentry>
12962 </variablelist>
12963</refsect1>
12964<refsect1>
12965<title>Description</title>
12966<para>
12967   Useful for transports that require congestion control.
12968</para>
12969</refsect1>
12970</refentry>
12971
12972<refentry id="API-xprt-adjust-cwnd">
12973<refentryinfo>
12974 <title>LINUX</title>
12975 <productname>Kernel Hackers Manual</productname>
12976 <date>July 2017</date>
12977</refentryinfo>
12978<refmeta>
12979 <refentrytitle><phrase>xprt_adjust_cwnd</phrase></refentrytitle>
12980 <manvolnum>9</manvolnum>
12981 <refmiscinfo class="version">4.1.27</refmiscinfo>
12982</refmeta>
12983<refnamediv>
12984 <refname>xprt_adjust_cwnd</refname>
12985 <refpurpose>
12986     adjust transport congestion window
12987 </refpurpose>
12988</refnamediv>
12989<refsynopsisdiv>
12990 <title>Synopsis</title>
12991  <funcsynopsis><funcprototype>
12992   <funcdef>void <function>xprt_adjust_cwnd </function></funcdef>
12993   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
12994   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
12995   <paramdef>int <parameter>result</parameter></paramdef>
12996  </funcprototype></funcsynopsis>
12997</refsynopsisdiv>
12998<refsect1>
12999 <title>Arguments</title>
13000 <variablelist>
13001  <varlistentry>
13002   <term><parameter>xprt</parameter></term>
13003   <listitem>
13004    <para>
13005     pointer to xprt
13006    </para>
13007   </listitem>
13008  </varlistentry>
13009  <varlistentry>
13010   <term><parameter>task</parameter></term>
13011   <listitem>
13012    <para>
13013     recently completed RPC request used to adjust window
13014    </para>
13015   </listitem>
13016  </varlistentry>
13017  <varlistentry>
13018   <term><parameter>result</parameter></term>
13019   <listitem>
13020    <para>
13021     result code of completed RPC request
13022    </para>
13023   </listitem>
13024  </varlistentry>
13025 </variablelist>
13026</refsect1>
13027<refsect1>
13028<title>Description</title>
13029<para>
13030   The transport code maintains an estimate on the maximum number of out-
13031   standing RPC requests, using a smoothed version of the congestion
13032   avoidance implemented in 44BSD. This is basically the Van Jacobson
13033</para>
13034</refsect1>
13035<refsect1>
13036<title>congestion algorithm</title>
13037<para>
13038   If a retransmit occurs, the congestion window is
13039   halved; otherwise, it is incremented by 1/cwnd when
13040   </para><para>
13041
13042   -	a reply is received and
13043   -	a full number of requests are outstanding and
13044   -	the congestion window hasn't been updated recently.
13045</para>
13046</refsect1>
13047</refentry>
13048
13049<refentry id="API-xprt-wake-pending-tasks">
13050<refentryinfo>
13051 <title>LINUX</title>
13052 <productname>Kernel Hackers Manual</productname>
13053 <date>July 2017</date>
13054</refentryinfo>
13055<refmeta>
13056 <refentrytitle><phrase>xprt_wake_pending_tasks</phrase></refentrytitle>
13057 <manvolnum>9</manvolnum>
13058 <refmiscinfo class="version">4.1.27</refmiscinfo>
13059</refmeta>
13060<refnamediv>
13061 <refname>xprt_wake_pending_tasks</refname>
13062 <refpurpose>
13063     wake all tasks on a transport's pending queue
13064 </refpurpose>
13065</refnamediv>
13066<refsynopsisdiv>
13067 <title>Synopsis</title>
13068  <funcsynopsis><funcprototype>
13069   <funcdef>void <function>xprt_wake_pending_tasks </function></funcdef>
13070   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
13071   <paramdef>int <parameter>status</parameter></paramdef>
13072  </funcprototype></funcsynopsis>
13073</refsynopsisdiv>
13074<refsect1>
13075 <title>Arguments</title>
13076 <variablelist>
13077  <varlistentry>
13078   <term><parameter>xprt</parameter></term>
13079   <listitem>
13080    <para>
13081     transport with waiting tasks
13082    </para>
13083   </listitem>
13084  </varlistentry>
13085  <varlistentry>
13086   <term><parameter>status</parameter></term>
13087   <listitem>
13088    <para>
13089     result code to plant in each task before waking it
13090    </para>
13091   </listitem>
13092  </varlistentry>
13093 </variablelist>
13094</refsect1>
13095</refentry>
13096
13097<refentry id="API-xprt-wait-for-buffer-space">
13098<refentryinfo>
13099 <title>LINUX</title>
13100 <productname>Kernel Hackers Manual</productname>
13101 <date>July 2017</date>
13102</refentryinfo>
13103<refmeta>
13104 <refentrytitle><phrase>xprt_wait_for_buffer_space</phrase></refentrytitle>
13105 <manvolnum>9</manvolnum>
13106 <refmiscinfo class="version">4.1.27</refmiscinfo>
13107</refmeta>
13108<refnamediv>
13109 <refname>xprt_wait_for_buffer_space</refname>
13110 <refpurpose>
13111     wait for transport output buffer to clear
13112 </refpurpose>
13113</refnamediv>
13114<refsynopsisdiv>
13115 <title>Synopsis</title>
13116  <funcsynopsis><funcprototype>
13117   <funcdef>void <function>xprt_wait_for_buffer_space </function></funcdef>
13118   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
13119   <paramdef>rpc_action <parameter>action</parameter></paramdef>
13120  </funcprototype></funcsynopsis>
13121</refsynopsisdiv>
13122<refsect1>
13123 <title>Arguments</title>
13124 <variablelist>
13125  <varlistentry>
13126   <term><parameter>task</parameter></term>
13127   <listitem>
13128    <para>
13129     task to be put to sleep
13130    </para>
13131   </listitem>
13132  </varlistentry>
13133  <varlistentry>
13134   <term><parameter>action</parameter></term>
13135   <listitem>
13136    <para>
13137     function pointer to be executed after wait
13138    </para>
13139   </listitem>
13140  </varlistentry>
13141 </variablelist>
13142</refsect1>
13143<refsect1>
13144<title>Description</title>
13145<para>
13146   Note that we only set the timer for the case of <function>RPC_IS_SOFT</function>, since
13147   we don't in general want to force a socket disconnection due to
13148   an incomplete RPC call transmission.
13149</para>
13150</refsect1>
13151</refentry>
13152
13153<refentry id="API-xprt-write-space">
13154<refentryinfo>
13155 <title>LINUX</title>
13156 <productname>Kernel Hackers Manual</productname>
13157 <date>July 2017</date>
13158</refentryinfo>
13159<refmeta>
13160 <refentrytitle><phrase>xprt_write_space</phrase></refentrytitle>
13161 <manvolnum>9</manvolnum>
13162 <refmiscinfo class="version">4.1.27</refmiscinfo>
13163</refmeta>
13164<refnamediv>
13165 <refname>xprt_write_space</refname>
13166 <refpurpose>
13167     wake the task waiting for transport output buffer space
13168 </refpurpose>
13169</refnamediv>
13170<refsynopsisdiv>
13171 <title>Synopsis</title>
13172  <funcsynopsis><funcprototype>
13173   <funcdef>void <function>xprt_write_space </function></funcdef>
13174   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
13175  </funcprototype></funcsynopsis>
13176</refsynopsisdiv>
13177<refsect1>
13178 <title>Arguments</title>
13179 <variablelist>
13180  <varlistentry>
13181   <term><parameter>xprt</parameter></term>
13182   <listitem>
13183    <para>
13184     transport with waiting tasks
13185    </para>
13186   </listitem>
13187  </varlistentry>
13188 </variablelist>
13189</refsect1>
13190<refsect1>
13191<title>Description</title>
13192<para>
13193   Can be called in a soft IRQ context, so xprt_write_space never sleeps.
13194</para>
13195</refsect1>
13196</refentry>
13197
13198<refentry id="API-xprt-set-retrans-timeout-def">
13199<refentryinfo>
13200 <title>LINUX</title>
13201 <productname>Kernel Hackers Manual</productname>
13202 <date>July 2017</date>
13203</refentryinfo>
13204<refmeta>
13205 <refentrytitle><phrase>xprt_set_retrans_timeout_def</phrase></refentrytitle>
13206 <manvolnum>9</manvolnum>
13207 <refmiscinfo class="version">4.1.27</refmiscinfo>
13208</refmeta>
13209<refnamediv>
13210 <refname>xprt_set_retrans_timeout_def</refname>
13211 <refpurpose>
13212     set a request's retransmit timeout
13213 </refpurpose>
13214</refnamediv>
13215<refsynopsisdiv>
13216 <title>Synopsis</title>
13217  <funcsynopsis><funcprototype>
13218   <funcdef>void <function>xprt_set_retrans_timeout_def </function></funcdef>
13219   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
13220  </funcprototype></funcsynopsis>
13221</refsynopsisdiv>
13222<refsect1>
13223 <title>Arguments</title>
13224 <variablelist>
13225  <varlistentry>
13226   <term><parameter>task</parameter></term>
13227   <listitem>
13228    <para>
13229     task whose timeout is to be set
13230    </para>
13231   </listitem>
13232  </varlistentry>
13233 </variablelist>
13234</refsect1>
13235<refsect1>
13236<title>Description</title>
13237<para>
13238   Set a request's retransmit timeout based on the transport's
13239   default timeout parameters.  Used by transports that don't adjust
13240   the retransmit timeout based on round-trip time estimation.
13241</para>
13242</refsect1>
13243</refentry>
13244
13245<refentry id="API-xprt-set-retrans-timeout-rtt">
13246<refentryinfo>
13247 <title>LINUX</title>
13248 <productname>Kernel Hackers Manual</productname>
13249 <date>July 2017</date>
13250</refentryinfo>
13251<refmeta>
13252 <refentrytitle><phrase>xprt_set_retrans_timeout_rtt</phrase></refentrytitle>
13253 <manvolnum>9</manvolnum>
13254 <refmiscinfo class="version">4.1.27</refmiscinfo>
13255</refmeta>
13256<refnamediv>
13257 <refname>xprt_set_retrans_timeout_rtt</refname>
13258 <refpurpose>
13259     set a request's retransmit timeout
13260 </refpurpose>
13261</refnamediv>
13262<refsynopsisdiv>
13263 <title>Synopsis</title>
13264  <funcsynopsis><funcprototype>
13265   <funcdef>void <function>xprt_set_retrans_timeout_rtt </function></funcdef>
13266   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
13267  </funcprototype></funcsynopsis>
13268</refsynopsisdiv>
13269<refsect1>
13270 <title>Arguments</title>
13271 <variablelist>
13272  <varlistentry>
13273   <term><parameter>task</parameter></term>
13274   <listitem>
13275    <para>
13276     task whose timeout is to be set
13277    </para>
13278   </listitem>
13279  </varlistentry>
13280 </variablelist>
13281</refsect1>
13282<refsect1>
13283<title>Description</title>
13284<para>
13285   Set a request's retransmit timeout using the RTT estimator.
13286</para>
13287</refsect1>
13288</refentry>
13289
13290<refentry id="API-xprt-disconnect-done">
13291<refentryinfo>
13292 <title>LINUX</title>
13293 <productname>Kernel Hackers Manual</productname>
13294 <date>July 2017</date>
13295</refentryinfo>
13296<refmeta>
13297 <refentrytitle><phrase>xprt_disconnect_done</phrase></refentrytitle>
13298 <manvolnum>9</manvolnum>
13299 <refmiscinfo class="version">4.1.27</refmiscinfo>
13300</refmeta>
13301<refnamediv>
13302 <refname>xprt_disconnect_done</refname>
13303 <refpurpose>
13304     mark a transport as disconnected
13305 </refpurpose>
13306</refnamediv>
13307<refsynopsisdiv>
13308 <title>Synopsis</title>
13309  <funcsynopsis><funcprototype>
13310   <funcdef>void <function>xprt_disconnect_done </function></funcdef>
13311   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
13312  </funcprototype></funcsynopsis>
13313</refsynopsisdiv>
13314<refsect1>
13315 <title>Arguments</title>
13316 <variablelist>
13317  <varlistentry>
13318   <term><parameter>xprt</parameter></term>
13319   <listitem>
13320    <para>
13321     transport to flag for disconnect
13322    </para>
13323   </listitem>
13324  </varlistentry>
13325 </variablelist>
13326</refsect1>
13327</refentry>
13328
13329<refentry id="API-xprt-lookup-rqst">
13330<refentryinfo>
13331 <title>LINUX</title>
13332 <productname>Kernel Hackers Manual</productname>
13333 <date>July 2017</date>
13334</refentryinfo>
13335<refmeta>
13336 <refentrytitle><phrase>xprt_lookup_rqst</phrase></refentrytitle>
13337 <manvolnum>9</manvolnum>
13338 <refmiscinfo class="version">4.1.27</refmiscinfo>
13339</refmeta>
13340<refnamediv>
13341 <refname>xprt_lookup_rqst</refname>
13342 <refpurpose>
13343     find an RPC request corresponding to an XID
13344 </refpurpose>
13345</refnamediv>
13346<refsynopsisdiv>
13347 <title>Synopsis</title>
13348  <funcsynopsis><funcprototype>
13349   <funcdef>struct rpc_rqst * <function>xprt_lookup_rqst </function></funcdef>
13350   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
13351   <paramdef>__be32 <parameter>xid</parameter></paramdef>
13352  </funcprototype></funcsynopsis>
13353</refsynopsisdiv>
13354<refsect1>
13355 <title>Arguments</title>
13356 <variablelist>
13357  <varlistentry>
13358   <term><parameter>xprt</parameter></term>
13359   <listitem>
13360    <para>
13361     transport on which the original request was transmitted
13362    </para>
13363   </listitem>
13364  </varlistentry>
13365  <varlistentry>
13366   <term><parameter>xid</parameter></term>
13367   <listitem>
13368    <para>
13369     RPC XID of incoming reply
13370    </para>
13371   </listitem>
13372  </varlistentry>
13373 </variablelist>
13374</refsect1>
13375</refentry>
13376
13377<refentry id="API-xprt-complete-rqst">
13378<refentryinfo>
13379 <title>LINUX</title>
13380 <productname>Kernel Hackers Manual</productname>
13381 <date>July 2017</date>
13382</refentryinfo>
13383<refmeta>
13384 <refentrytitle><phrase>xprt_complete_rqst</phrase></refentrytitle>
13385 <manvolnum>9</manvolnum>
13386 <refmiscinfo class="version">4.1.27</refmiscinfo>
13387</refmeta>
13388<refnamediv>
13389 <refname>xprt_complete_rqst</refname>
13390 <refpurpose>
13391     called when reply processing is complete
13392 </refpurpose>
13393</refnamediv>
13394<refsynopsisdiv>
13395 <title>Synopsis</title>
13396  <funcsynopsis><funcprototype>
13397   <funcdef>void <function>xprt_complete_rqst </function></funcdef>
13398   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
13399   <paramdef>int <parameter>copied</parameter></paramdef>
13400  </funcprototype></funcsynopsis>
13401</refsynopsisdiv>
13402<refsect1>
13403 <title>Arguments</title>
13404 <variablelist>
13405  <varlistentry>
13406   <term><parameter>task</parameter></term>
13407   <listitem>
13408    <para>
13409     RPC request that recently completed
13410    </para>
13411   </listitem>
13412  </varlistentry>
13413  <varlistentry>
13414   <term><parameter>copied</parameter></term>
13415   <listitem>
13416    <para>
13417     actual number of bytes received from the transport
13418    </para>
13419   </listitem>
13420  </varlistentry>
13421 </variablelist>
13422</refsect1>
13423<refsect1>
13424<title>Description</title>
13425<para>
13426   Caller holds transport lock.
13427</para>
13428</refsect1>
13429</refentry>
13430
13431<!-- net/sunrpc/sched.c -->
13432<refentry id="API-rpc-wake-up">
13433<refentryinfo>
13434 <title>LINUX</title>
13435 <productname>Kernel Hackers Manual</productname>
13436 <date>July 2017</date>
13437</refentryinfo>
13438<refmeta>
13439 <refentrytitle><phrase>rpc_wake_up</phrase></refentrytitle>
13440 <manvolnum>9</manvolnum>
13441 <refmiscinfo class="version">4.1.27</refmiscinfo>
13442</refmeta>
13443<refnamediv>
13444 <refname>rpc_wake_up</refname>
13445 <refpurpose>
13446  wake up all rpc_tasks
13447 </refpurpose>
13448</refnamediv>
13449<refsynopsisdiv>
13450 <title>Synopsis</title>
13451  <funcsynopsis><funcprototype>
13452   <funcdef>void <function>rpc_wake_up </function></funcdef>
13453   <paramdef>struct rpc_wait_queue * <parameter>queue</parameter></paramdef>
13454  </funcprototype></funcsynopsis>
13455</refsynopsisdiv>
13456<refsect1>
13457 <title>Arguments</title>
13458 <variablelist>
13459  <varlistentry>
13460   <term><parameter>queue</parameter></term>
13461   <listitem>
13462    <para>
13463     rpc_wait_queue on which the tasks are sleeping
13464    </para>
13465   </listitem>
13466  </varlistentry>
13467 </variablelist>
13468</refsect1>
13469<refsect1>
13470<title>Description</title>
13471<para>
13472   Grabs queue-&gt;lock
13473</para>
13474</refsect1>
13475</refentry>
13476
13477<refentry id="API-rpc-wake-up-status">
13478<refentryinfo>
13479 <title>LINUX</title>
13480 <productname>Kernel Hackers Manual</productname>
13481 <date>July 2017</date>
13482</refentryinfo>
13483<refmeta>
13484 <refentrytitle><phrase>rpc_wake_up_status</phrase></refentrytitle>
13485 <manvolnum>9</manvolnum>
13486 <refmiscinfo class="version">4.1.27</refmiscinfo>
13487</refmeta>
13488<refnamediv>
13489 <refname>rpc_wake_up_status</refname>
13490 <refpurpose>
13491     wake up all rpc_tasks and set their status value.
13492 </refpurpose>
13493</refnamediv>
13494<refsynopsisdiv>
13495 <title>Synopsis</title>
13496  <funcsynopsis><funcprototype>
13497   <funcdef>void <function>rpc_wake_up_status </function></funcdef>
13498   <paramdef>struct rpc_wait_queue * <parameter>queue</parameter></paramdef>
13499   <paramdef>int <parameter>status</parameter></paramdef>
13500  </funcprototype></funcsynopsis>
13501</refsynopsisdiv>
13502<refsect1>
13503 <title>Arguments</title>
13504 <variablelist>
13505  <varlistentry>
13506   <term><parameter>queue</parameter></term>
13507   <listitem>
13508    <para>
13509     rpc_wait_queue on which the tasks are sleeping
13510    </para>
13511   </listitem>
13512  </varlistentry>
13513  <varlistentry>
13514   <term><parameter>status</parameter></term>
13515   <listitem>
13516    <para>
13517     status value to set
13518    </para>
13519   </listitem>
13520  </varlistentry>
13521 </variablelist>
13522</refsect1>
13523<refsect1>
13524<title>Description</title>
13525<para>
13526   Grabs queue-&gt;lock
13527</para>
13528</refsect1>
13529</refentry>
13530
13531<refentry id="API-rpc-malloc">
13532<refentryinfo>
13533 <title>LINUX</title>
13534 <productname>Kernel Hackers Manual</productname>
13535 <date>July 2017</date>
13536</refentryinfo>
13537<refmeta>
13538 <refentrytitle><phrase>rpc_malloc</phrase></refentrytitle>
13539 <manvolnum>9</manvolnum>
13540 <refmiscinfo class="version">4.1.27</refmiscinfo>
13541</refmeta>
13542<refnamediv>
13543 <refname>rpc_malloc</refname>
13544 <refpurpose>
13545     allocate an RPC buffer
13546 </refpurpose>
13547</refnamediv>
13548<refsynopsisdiv>
13549 <title>Synopsis</title>
13550  <funcsynopsis><funcprototype>
13551   <funcdef>void * <function>rpc_malloc </function></funcdef>
13552   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
13553   <paramdef>size_t <parameter>size</parameter></paramdef>
13554  </funcprototype></funcsynopsis>
13555</refsynopsisdiv>
13556<refsect1>
13557 <title>Arguments</title>
13558 <variablelist>
13559  <varlistentry>
13560   <term><parameter>task</parameter></term>
13561   <listitem>
13562    <para>
13563     RPC task that will use this buffer
13564    </para>
13565   </listitem>
13566  </varlistentry>
13567  <varlistentry>
13568   <term><parameter>size</parameter></term>
13569   <listitem>
13570    <para>
13571     requested byte size
13572    </para>
13573   </listitem>
13574  </varlistentry>
13575 </variablelist>
13576</refsect1>
13577<refsect1>
13578<title>Description</title>
13579<para>
13580   To prevent rpciod from hanging, this allocator never sleeps,
13581   returning NULL and suppressing warning if the request cannot be serviced
13582   immediately.
13583   The caller can arrange to sleep in a way that is safe for rpciod.
13584   </para><para>
13585
13586   Most requests are 'small' (under 2KiB) and can be serviced from a
13587   mempool, ensuring that NFS reads and writes can always proceed,
13588   and that there is good locality of reference for these buffers.
13589   </para><para>
13590
13591   In order to avoid memory starvation triggering more writebacks of
13592   NFS requests, we avoid using GFP_KERNEL.
13593</para>
13594</refsect1>
13595</refentry>
13596
13597<refentry id="API-rpc-free">
13598<refentryinfo>
13599 <title>LINUX</title>
13600 <productname>Kernel Hackers Manual</productname>
13601 <date>July 2017</date>
13602</refentryinfo>
13603<refmeta>
13604 <refentrytitle><phrase>rpc_free</phrase></refentrytitle>
13605 <manvolnum>9</manvolnum>
13606 <refmiscinfo class="version">4.1.27</refmiscinfo>
13607</refmeta>
13608<refnamediv>
13609 <refname>rpc_free</refname>
13610 <refpurpose>
13611     free buffer allocated via rpc_malloc
13612 </refpurpose>
13613</refnamediv>
13614<refsynopsisdiv>
13615 <title>Synopsis</title>
13616  <funcsynopsis><funcprototype>
13617   <funcdef>void <function>rpc_free </function></funcdef>
13618   <paramdef>void * <parameter>buffer</parameter></paramdef>
13619  </funcprototype></funcsynopsis>
13620</refsynopsisdiv>
13621<refsect1>
13622 <title>Arguments</title>
13623 <variablelist>
13624  <varlistentry>
13625   <term><parameter>buffer</parameter></term>
13626   <listitem>
13627    <para>
13628     buffer to free
13629    </para>
13630   </listitem>
13631  </varlistentry>
13632 </variablelist>
13633</refsect1>
13634</refentry>
13635
13636<!-- net/sunrpc/socklib.c -->
13637<refentry id="API-xdr-skb-read-bits">
13638<refentryinfo>
13639 <title>LINUX</title>
13640 <productname>Kernel Hackers Manual</productname>
13641 <date>July 2017</date>
13642</refentryinfo>
13643<refmeta>
13644 <refentrytitle><phrase>xdr_skb_read_bits</phrase></refentrytitle>
13645 <manvolnum>9</manvolnum>
13646 <refmiscinfo class="version">4.1.27</refmiscinfo>
13647</refmeta>
13648<refnamediv>
13649 <refname>xdr_skb_read_bits</refname>
13650 <refpurpose>
13651  copy some data bits from skb to internal buffer
13652 </refpurpose>
13653</refnamediv>
13654<refsynopsisdiv>
13655 <title>Synopsis</title>
13656  <funcsynopsis><funcprototype>
13657   <funcdef>size_t <function>xdr_skb_read_bits </function></funcdef>
13658   <paramdef>struct xdr_skb_reader * <parameter>desc</parameter></paramdef>
13659   <paramdef>void * <parameter>to</parameter></paramdef>
13660   <paramdef>size_t <parameter>len</parameter></paramdef>
13661  </funcprototype></funcsynopsis>
13662</refsynopsisdiv>
13663<refsect1>
13664 <title>Arguments</title>
13665 <variablelist>
13666  <varlistentry>
13667   <term><parameter>desc</parameter></term>
13668   <listitem>
13669    <para>
13670     sk_buff copy helper
13671    </para>
13672   </listitem>
13673  </varlistentry>
13674  <varlistentry>
13675   <term><parameter>to</parameter></term>
13676   <listitem>
13677    <para>
13678     copy destination
13679    </para>
13680   </listitem>
13681  </varlistentry>
13682  <varlistentry>
13683   <term><parameter>len</parameter></term>
13684   <listitem>
13685    <para>
13686     number of bytes to copy
13687    </para>
13688   </listitem>
13689  </varlistentry>
13690 </variablelist>
13691</refsect1>
13692<refsect1>
13693<title>Description</title>
13694<para>
13695   Possibly called several times to iterate over an sk_buff and copy
13696   data out of it.
13697</para>
13698</refsect1>
13699</refentry>
13700
13701<refentry id="API-xdr-partial-copy-from-skb">
13702<refentryinfo>
13703 <title>LINUX</title>
13704 <productname>Kernel Hackers Manual</productname>
13705 <date>July 2017</date>
13706</refentryinfo>
13707<refmeta>
13708 <refentrytitle><phrase>xdr_partial_copy_from_skb</phrase></refentrytitle>
13709 <manvolnum>9</manvolnum>
13710 <refmiscinfo class="version">4.1.27</refmiscinfo>
13711</refmeta>
13712<refnamediv>
13713 <refname>xdr_partial_copy_from_skb</refname>
13714 <refpurpose>
13715     copy data out of an skb
13716 </refpurpose>
13717</refnamediv>
13718<refsynopsisdiv>
13719 <title>Synopsis</title>
13720  <funcsynopsis><funcprototype>
13721   <funcdef>ssize_t <function>xdr_partial_copy_from_skb </function></funcdef>
13722   <paramdef>struct xdr_buf * <parameter>xdr</parameter></paramdef>
13723   <paramdef>unsigned int <parameter>base</parameter></paramdef>
13724   <paramdef>struct xdr_skb_reader * <parameter>desc</parameter></paramdef>
13725   <paramdef>xdr_skb_read_actor <parameter>copy_actor</parameter></paramdef>
13726  </funcprototype></funcsynopsis>
13727</refsynopsisdiv>
13728<refsect1>
13729 <title>Arguments</title>
13730 <variablelist>
13731  <varlistentry>
13732   <term><parameter>xdr</parameter></term>
13733   <listitem>
13734    <para>
13735     target XDR buffer
13736    </para>
13737   </listitem>
13738  </varlistentry>
13739  <varlistentry>
13740   <term><parameter>base</parameter></term>
13741   <listitem>
13742    <para>
13743     starting offset
13744    </para>
13745   </listitem>
13746  </varlistentry>
13747  <varlistentry>
13748   <term><parameter>desc</parameter></term>
13749   <listitem>
13750    <para>
13751     sk_buff copy helper
13752    </para>
13753   </listitem>
13754  </varlistentry>
13755  <varlistentry>
13756   <term><parameter>copy_actor</parameter></term>
13757   <listitem>
13758    <para>
13759     virtual method for copying data
13760    </para>
13761   </listitem>
13762  </varlistentry>
13763 </variablelist>
13764</refsect1>
13765</refentry>
13766
13767<refentry id="API-csum-partial-copy-to-xdr">
13768<refentryinfo>
13769 <title>LINUX</title>
13770 <productname>Kernel Hackers Manual</productname>
13771 <date>July 2017</date>
13772</refentryinfo>
13773<refmeta>
13774 <refentrytitle><phrase>csum_partial_copy_to_xdr</phrase></refentrytitle>
13775 <manvolnum>9</manvolnum>
13776 <refmiscinfo class="version">4.1.27</refmiscinfo>
13777</refmeta>
13778<refnamediv>
13779 <refname>csum_partial_copy_to_xdr</refname>
13780 <refpurpose>
13781     checksum and copy data
13782 </refpurpose>
13783</refnamediv>
13784<refsynopsisdiv>
13785 <title>Synopsis</title>
13786  <funcsynopsis><funcprototype>
13787   <funcdef>int <function>csum_partial_copy_to_xdr </function></funcdef>
13788   <paramdef>struct xdr_buf * <parameter>xdr</parameter></paramdef>
13789   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
13790  </funcprototype></funcsynopsis>
13791</refsynopsisdiv>
13792<refsect1>
13793 <title>Arguments</title>
13794 <variablelist>
13795  <varlistentry>
13796   <term><parameter>xdr</parameter></term>
13797   <listitem>
13798    <para>
13799     target XDR buffer
13800    </para>
13801   </listitem>
13802  </varlistentry>
13803  <varlistentry>
13804   <term><parameter>skb</parameter></term>
13805   <listitem>
13806    <para>
13807     source skb
13808    </para>
13809   </listitem>
13810  </varlistentry>
13811 </variablelist>
13812</refsect1>
13813<refsect1>
13814<title>Description</title>
13815<para>
13816   We have set things up such that we perform the checksum of the UDP
13817   packet in parallel with the copies into the RPC client iovec.  -DaveM
13818</para>
13819</refsect1>
13820</refentry>
13821
13822<!-- net/sunrpc/stats.c -->
13823<refentry id="API-rpc-alloc-iostats">
13824<refentryinfo>
13825 <title>LINUX</title>
13826 <productname>Kernel Hackers Manual</productname>
13827 <date>July 2017</date>
13828</refentryinfo>
13829<refmeta>
13830 <refentrytitle><phrase>rpc_alloc_iostats</phrase></refentrytitle>
13831 <manvolnum>9</manvolnum>
13832 <refmiscinfo class="version">4.1.27</refmiscinfo>
13833</refmeta>
13834<refnamediv>
13835 <refname>rpc_alloc_iostats</refname>
13836 <refpurpose>
13837  allocate an rpc_iostats structure
13838 </refpurpose>
13839</refnamediv>
13840<refsynopsisdiv>
13841 <title>Synopsis</title>
13842  <funcsynopsis><funcprototype>
13843   <funcdef>struct rpc_iostats * <function>rpc_alloc_iostats </function></funcdef>
13844   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
13845  </funcprototype></funcsynopsis>
13846</refsynopsisdiv>
13847<refsect1>
13848 <title>Arguments</title>
13849 <variablelist>
13850  <varlistentry>
13851   <term><parameter>clnt</parameter></term>
13852   <listitem>
13853    <para>
13854     RPC program, version, and xprt
13855    </para>
13856   </listitem>
13857  </varlistentry>
13858 </variablelist>
13859</refsect1>
13860</refentry>
13861
13862<refentry id="API-rpc-free-iostats">
13863<refentryinfo>
13864 <title>LINUX</title>
13865 <productname>Kernel Hackers Manual</productname>
13866 <date>July 2017</date>
13867</refentryinfo>
13868<refmeta>
13869 <refentrytitle><phrase>rpc_free_iostats</phrase></refentrytitle>
13870 <manvolnum>9</manvolnum>
13871 <refmiscinfo class="version">4.1.27</refmiscinfo>
13872</refmeta>
13873<refnamediv>
13874 <refname>rpc_free_iostats</refname>
13875 <refpurpose>
13876     release an rpc_iostats structure
13877 </refpurpose>
13878</refnamediv>
13879<refsynopsisdiv>
13880 <title>Synopsis</title>
13881  <funcsynopsis><funcprototype>
13882   <funcdef>void <function>rpc_free_iostats </function></funcdef>
13883   <paramdef>struct rpc_iostats * <parameter>stats</parameter></paramdef>
13884  </funcprototype></funcsynopsis>
13885</refsynopsisdiv>
13886<refsect1>
13887 <title>Arguments</title>
13888 <variablelist>
13889  <varlistentry>
13890   <term><parameter>stats</parameter></term>
13891   <listitem>
13892    <para>
13893     doomed rpc_iostats structure
13894    </para>
13895   </listitem>
13896  </varlistentry>
13897 </variablelist>
13898</refsect1>
13899</refentry>
13900
13901<refentry id="API-rpc-count-iostats-metrics">
13902<refentryinfo>
13903 <title>LINUX</title>
13904 <productname>Kernel Hackers Manual</productname>
13905 <date>July 2017</date>
13906</refentryinfo>
13907<refmeta>
13908 <refentrytitle><phrase>rpc_count_iostats_metrics</phrase></refentrytitle>
13909 <manvolnum>9</manvolnum>
13910 <refmiscinfo class="version">4.1.27</refmiscinfo>
13911</refmeta>
13912<refnamediv>
13913 <refname>rpc_count_iostats_metrics</refname>
13914 <refpurpose>
13915     tally up per-task stats
13916 </refpurpose>
13917</refnamediv>
13918<refsynopsisdiv>
13919 <title>Synopsis</title>
13920  <funcsynopsis><funcprototype>
13921   <funcdef>void <function>rpc_count_iostats_metrics </function></funcdef>
13922   <paramdef>const struct rpc_task * <parameter>task</parameter></paramdef>
13923   <paramdef>struct rpc_iostats * <parameter>op_metrics</parameter></paramdef>
13924  </funcprototype></funcsynopsis>
13925</refsynopsisdiv>
13926<refsect1>
13927 <title>Arguments</title>
13928 <variablelist>
13929  <varlistentry>
13930   <term><parameter>task</parameter></term>
13931   <listitem>
13932    <para>
13933     completed rpc_task
13934    </para>
13935   </listitem>
13936  </varlistentry>
13937  <varlistentry>
13938   <term><parameter>op_metrics</parameter></term>
13939   <listitem>
13940    <para>
13941     stat structure for OP that will accumulate stats from <parameter>task</parameter>
13942    </para>
13943   </listitem>
13944  </varlistentry>
13945 </variablelist>
13946</refsect1>
13947</refentry>
13948
13949<refentry id="API-rpc-count-iostats">
13950<refentryinfo>
13951 <title>LINUX</title>
13952 <productname>Kernel Hackers Manual</productname>
13953 <date>July 2017</date>
13954</refentryinfo>
13955<refmeta>
13956 <refentrytitle><phrase>rpc_count_iostats</phrase></refentrytitle>
13957 <manvolnum>9</manvolnum>
13958 <refmiscinfo class="version">4.1.27</refmiscinfo>
13959</refmeta>
13960<refnamediv>
13961 <refname>rpc_count_iostats</refname>
13962 <refpurpose>
13963     tally up per-task stats
13964 </refpurpose>
13965</refnamediv>
13966<refsynopsisdiv>
13967 <title>Synopsis</title>
13968  <funcsynopsis><funcprototype>
13969   <funcdef>void <function>rpc_count_iostats </function></funcdef>
13970   <paramdef>const struct rpc_task * <parameter>task</parameter></paramdef>
13971   <paramdef>struct rpc_iostats * <parameter>stats</parameter></paramdef>
13972  </funcprototype></funcsynopsis>
13973</refsynopsisdiv>
13974<refsect1>
13975 <title>Arguments</title>
13976 <variablelist>
13977  <varlistentry>
13978   <term><parameter>task</parameter></term>
13979   <listitem>
13980    <para>
13981     completed rpc_task
13982    </para>
13983   </listitem>
13984  </varlistentry>
13985  <varlistentry>
13986   <term><parameter>stats</parameter></term>
13987   <listitem>
13988    <para>
13989     array of stat structures
13990    </para>
13991   </listitem>
13992  </varlistentry>
13993 </variablelist>
13994</refsect1>
13995<refsect1>
13996<title>Description</title>
13997<para>
13998   Uses the statidx from <parameter>task</parameter>
13999</para>
14000</refsect1>
14001</refentry>
14002
14003<!-- net/sunrpc/rpc_pipe.c -->
14004<refentry id="API-rpc-queue-upcall">
14005<refentryinfo>
14006 <title>LINUX</title>
14007 <productname>Kernel Hackers Manual</productname>
14008 <date>July 2017</date>
14009</refentryinfo>
14010<refmeta>
14011 <refentrytitle><phrase>rpc_queue_upcall</phrase></refentrytitle>
14012 <manvolnum>9</manvolnum>
14013 <refmiscinfo class="version">4.1.27</refmiscinfo>
14014</refmeta>
14015<refnamediv>
14016 <refname>rpc_queue_upcall</refname>
14017 <refpurpose>
14018  queue an upcall message to userspace
14019 </refpurpose>
14020</refnamediv>
14021<refsynopsisdiv>
14022 <title>Synopsis</title>
14023  <funcsynopsis><funcprototype>
14024   <funcdef>int <function>rpc_queue_upcall </function></funcdef>
14025   <paramdef>struct rpc_pipe * <parameter>pipe</parameter></paramdef>
14026   <paramdef>struct rpc_pipe_msg * <parameter>msg</parameter></paramdef>
14027  </funcprototype></funcsynopsis>
14028</refsynopsisdiv>
14029<refsect1>
14030 <title>Arguments</title>
14031 <variablelist>
14032  <varlistentry>
14033   <term><parameter>pipe</parameter></term>
14034   <listitem>
14035    <para>
14036     upcall pipe on which to queue given message
14037    </para>
14038   </listitem>
14039  </varlistentry>
14040  <varlistentry>
14041   <term><parameter>msg</parameter></term>
14042   <listitem>
14043    <para>
14044     message to queue
14045    </para>
14046   </listitem>
14047  </varlistentry>
14048 </variablelist>
14049</refsect1>
14050<refsect1>
14051<title>Description</title>
14052<para>
14053   Call with an <parameter>inode</parameter> created by <function>rpc_mkpipe</function> to queue an upcall.
14054   A userspace process may then later read the upcall by performing a
14055   read on an open file for this inode.  It is up to the caller to
14056   initialize the fields of <parameter>msg</parameter> (other than <parameter>msg</parameter>-&gt;list) appropriately.
14057</para>
14058</refsect1>
14059</refentry>
14060
14061<refentry id="API-rpc-mkpipe-dentry">
14062<refentryinfo>
14063 <title>LINUX</title>
14064 <productname>Kernel Hackers Manual</productname>
14065 <date>July 2017</date>
14066</refentryinfo>
14067<refmeta>
14068 <refentrytitle><phrase>rpc_mkpipe_dentry</phrase></refentrytitle>
14069 <manvolnum>9</manvolnum>
14070 <refmiscinfo class="version">4.1.27</refmiscinfo>
14071</refmeta>
14072<refnamediv>
14073 <refname>rpc_mkpipe_dentry</refname>
14074 <refpurpose>
14075     make an rpc_pipefs file for kernel&lt;-&gt;userspace communication
14076 </refpurpose>
14077</refnamediv>
14078<refsynopsisdiv>
14079 <title>Synopsis</title>
14080  <funcsynopsis><funcprototype>
14081   <funcdef>struct dentry * <function>rpc_mkpipe_dentry </function></funcdef>
14082   <paramdef>struct dentry * <parameter>parent</parameter></paramdef>
14083   <paramdef>const char * <parameter>name</parameter></paramdef>
14084   <paramdef>void * <parameter>private</parameter></paramdef>
14085   <paramdef>struct rpc_pipe * <parameter>pipe</parameter></paramdef>
14086  </funcprototype></funcsynopsis>
14087</refsynopsisdiv>
14088<refsect1>
14089 <title>Arguments</title>
14090 <variablelist>
14091  <varlistentry>
14092   <term><parameter>parent</parameter></term>
14093   <listitem>
14094    <para>
14095     dentry of directory to create new <quote>pipe</quote> in
14096    </para>
14097   </listitem>
14098  </varlistentry>
14099  <varlistentry>
14100   <term><parameter>name</parameter></term>
14101   <listitem>
14102    <para>
14103     name of pipe
14104    </para>
14105   </listitem>
14106  </varlistentry>
14107  <varlistentry>
14108   <term><parameter>private</parameter></term>
14109   <listitem>
14110    <para>
14111     private data to associate with the pipe, for the caller's use
14112    </para>
14113   </listitem>
14114  </varlistentry>
14115  <varlistentry>
14116   <term><parameter>pipe</parameter></term>
14117   <listitem>
14118    <para>
14119     <structname>rpc_pipe</structname> containing input parameters
14120    </para>
14121   </listitem>
14122  </varlistentry>
14123 </variablelist>
14124</refsect1>
14125<refsect1>
14126<title>Description</title>
14127<para>
14128   Data is made available for userspace to read by calls to
14129   <function>rpc_queue_upcall</function>.  The actual reads will result in calls to
14130   <parameter>ops</parameter>-&gt;upcall, which will be called with the file pointer,
14131   message, and userspace buffer to copy to.
14132   </para><para>
14133
14134   Writes can come at any time, and do not necessarily have to be
14135   responses to upcalls.  They will result in calls to <parameter>msg</parameter>-&gt;downcall.
14136   </para><para>
14137
14138   The <parameter>private</parameter> argument passed here will be available to all these methods
14139   from the file pointer, via RPC_I(file_inode(file))-&gt;private.
14140</para>
14141</refsect1>
14142</refentry>
14143
14144<refentry id="API-rpc-unlink">
14145<refentryinfo>
14146 <title>LINUX</title>
14147 <productname>Kernel Hackers Manual</productname>
14148 <date>July 2017</date>
14149</refentryinfo>
14150<refmeta>
14151 <refentrytitle><phrase>rpc_unlink</phrase></refentrytitle>
14152 <manvolnum>9</manvolnum>
14153 <refmiscinfo class="version">4.1.27</refmiscinfo>
14154</refmeta>
14155<refnamediv>
14156 <refname>rpc_unlink</refname>
14157 <refpurpose>
14158     remove a pipe
14159 </refpurpose>
14160</refnamediv>
14161<refsynopsisdiv>
14162 <title>Synopsis</title>
14163  <funcsynopsis><funcprototype>
14164   <funcdef>int <function>rpc_unlink </function></funcdef>
14165   <paramdef>struct dentry * <parameter>dentry</parameter></paramdef>
14166  </funcprototype></funcsynopsis>
14167</refsynopsisdiv>
14168<refsect1>
14169 <title>Arguments</title>
14170 <variablelist>
14171  <varlistentry>
14172   <term><parameter>dentry</parameter></term>
14173   <listitem>
14174    <para>
14175     dentry for the pipe, as returned from rpc_mkpipe
14176    </para>
14177   </listitem>
14178  </varlistentry>
14179 </variablelist>
14180</refsect1>
14181<refsect1>
14182<title>Description</title>
14183<para>
14184   After this call, lookups will no longer find the pipe, and any
14185   attempts to read or write using preexisting opens of the pipe will
14186   return -EPIPE.
14187</para>
14188</refsect1>
14189</refentry>
14190
14191<refentry id="API-rpc-init-pipe-dir-head">
14192<refentryinfo>
14193 <title>LINUX</title>
14194 <productname>Kernel Hackers Manual</productname>
14195 <date>July 2017</date>
14196</refentryinfo>
14197<refmeta>
14198 <refentrytitle><phrase>rpc_init_pipe_dir_head</phrase></refentrytitle>
14199 <manvolnum>9</manvolnum>
14200 <refmiscinfo class="version">4.1.27</refmiscinfo>
14201</refmeta>
14202<refnamediv>
14203 <refname>rpc_init_pipe_dir_head</refname>
14204 <refpurpose>
14205     initialise a struct rpc_pipe_dir_head
14206 </refpurpose>
14207</refnamediv>
14208<refsynopsisdiv>
14209 <title>Synopsis</title>
14210  <funcsynopsis><funcprototype>
14211   <funcdef>void <function>rpc_init_pipe_dir_head </function></funcdef>
14212   <paramdef>struct rpc_pipe_dir_head * <parameter>pdh</parameter></paramdef>
14213  </funcprototype></funcsynopsis>
14214</refsynopsisdiv>
14215<refsect1>
14216 <title>Arguments</title>
14217 <variablelist>
14218  <varlistentry>
14219   <term><parameter>pdh</parameter></term>
14220   <listitem>
14221    <para>
14222     pointer to struct rpc_pipe_dir_head
14223    </para>
14224   </listitem>
14225  </varlistentry>
14226 </variablelist>
14227</refsect1>
14228</refentry>
14229
14230<refentry id="API-rpc-init-pipe-dir-object">
14231<refentryinfo>
14232 <title>LINUX</title>
14233 <productname>Kernel Hackers Manual</productname>
14234 <date>July 2017</date>
14235</refentryinfo>
14236<refmeta>
14237 <refentrytitle><phrase>rpc_init_pipe_dir_object</phrase></refentrytitle>
14238 <manvolnum>9</manvolnum>
14239 <refmiscinfo class="version">4.1.27</refmiscinfo>
14240</refmeta>
14241<refnamediv>
14242 <refname>rpc_init_pipe_dir_object</refname>
14243 <refpurpose>
14244     initialise a struct rpc_pipe_dir_object
14245 </refpurpose>
14246</refnamediv>
14247<refsynopsisdiv>
14248 <title>Synopsis</title>
14249  <funcsynopsis><funcprototype>
14250   <funcdef>void <function>rpc_init_pipe_dir_object </function></funcdef>
14251   <paramdef>struct rpc_pipe_dir_object * <parameter>pdo</parameter></paramdef>
14252   <paramdef>const struct rpc_pipe_dir_object_ops * <parameter>pdo_ops</parameter></paramdef>
14253   <paramdef>void * <parameter>pdo_data</parameter></paramdef>
14254  </funcprototype></funcsynopsis>
14255</refsynopsisdiv>
14256<refsect1>
14257 <title>Arguments</title>
14258 <variablelist>
14259  <varlistentry>
14260   <term><parameter>pdo</parameter></term>
14261   <listitem>
14262    <para>
14263     pointer to struct rpc_pipe_dir_object
14264    </para>
14265   </listitem>
14266  </varlistentry>
14267  <varlistentry>
14268   <term><parameter>pdo_ops</parameter></term>
14269   <listitem>
14270    <para>
14271     pointer to const struct rpc_pipe_dir_object_ops
14272    </para>
14273   </listitem>
14274  </varlistentry>
14275  <varlistentry>
14276   <term><parameter>pdo_data</parameter></term>
14277   <listitem>
14278    <para>
14279     pointer to caller-defined data
14280    </para>
14281   </listitem>
14282  </varlistentry>
14283 </variablelist>
14284</refsect1>
14285</refentry>
14286
14287<refentry id="API-rpc-add-pipe-dir-object">
14288<refentryinfo>
14289 <title>LINUX</title>
14290 <productname>Kernel Hackers Manual</productname>
14291 <date>July 2017</date>
14292</refentryinfo>
14293<refmeta>
14294 <refentrytitle><phrase>rpc_add_pipe_dir_object</phrase></refentrytitle>
14295 <manvolnum>9</manvolnum>
14296 <refmiscinfo class="version">4.1.27</refmiscinfo>
14297</refmeta>
14298<refnamediv>
14299 <refname>rpc_add_pipe_dir_object</refname>
14300 <refpurpose>
14301     associate a rpc_pipe_dir_object to a directory
14302 </refpurpose>
14303</refnamediv>
14304<refsynopsisdiv>
14305 <title>Synopsis</title>
14306  <funcsynopsis><funcprototype>
14307   <funcdef>int <function>rpc_add_pipe_dir_object </function></funcdef>
14308   <paramdef>struct net * <parameter>net</parameter></paramdef>
14309   <paramdef>struct rpc_pipe_dir_head * <parameter>pdh</parameter></paramdef>
14310   <paramdef>struct rpc_pipe_dir_object * <parameter>pdo</parameter></paramdef>
14311  </funcprototype></funcsynopsis>
14312</refsynopsisdiv>
14313<refsect1>
14314 <title>Arguments</title>
14315 <variablelist>
14316  <varlistentry>
14317   <term><parameter>net</parameter></term>
14318   <listitem>
14319    <para>
14320     pointer to struct net
14321    </para>
14322   </listitem>
14323  </varlistentry>
14324  <varlistentry>
14325   <term><parameter>pdh</parameter></term>
14326   <listitem>
14327    <para>
14328     pointer to struct rpc_pipe_dir_head
14329    </para>
14330   </listitem>
14331  </varlistentry>
14332  <varlistentry>
14333   <term><parameter>pdo</parameter></term>
14334   <listitem>
14335    <para>
14336     pointer to struct rpc_pipe_dir_object
14337    </para>
14338   </listitem>
14339  </varlistentry>
14340 </variablelist>
14341</refsect1>
14342</refentry>
14343
14344<refentry id="API-rpc-remove-pipe-dir-object">
14345<refentryinfo>
14346 <title>LINUX</title>
14347 <productname>Kernel Hackers Manual</productname>
14348 <date>July 2017</date>
14349</refentryinfo>
14350<refmeta>
14351 <refentrytitle><phrase>rpc_remove_pipe_dir_object</phrase></refentrytitle>
14352 <manvolnum>9</manvolnum>
14353 <refmiscinfo class="version">4.1.27</refmiscinfo>
14354</refmeta>
14355<refnamediv>
14356 <refname>rpc_remove_pipe_dir_object</refname>
14357 <refpurpose>
14358     remove a rpc_pipe_dir_object from a directory
14359 </refpurpose>
14360</refnamediv>
14361<refsynopsisdiv>
14362 <title>Synopsis</title>
14363  <funcsynopsis><funcprototype>
14364   <funcdef>void <function>rpc_remove_pipe_dir_object </function></funcdef>
14365   <paramdef>struct net * <parameter>net</parameter></paramdef>
14366   <paramdef>struct rpc_pipe_dir_head * <parameter>pdh</parameter></paramdef>
14367   <paramdef>struct rpc_pipe_dir_object * <parameter>pdo</parameter></paramdef>
14368  </funcprototype></funcsynopsis>
14369</refsynopsisdiv>
14370<refsect1>
14371 <title>Arguments</title>
14372 <variablelist>
14373  <varlistentry>
14374   <term><parameter>net</parameter></term>
14375   <listitem>
14376    <para>
14377     pointer to struct net
14378    </para>
14379   </listitem>
14380  </varlistentry>
14381  <varlistentry>
14382   <term><parameter>pdh</parameter></term>
14383   <listitem>
14384    <para>
14385     pointer to struct rpc_pipe_dir_head
14386    </para>
14387   </listitem>
14388  </varlistentry>
14389  <varlistentry>
14390   <term><parameter>pdo</parameter></term>
14391   <listitem>
14392    <para>
14393     pointer to struct rpc_pipe_dir_object
14394    </para>
14395   </listitem>
14396  </varlistentry>
14397 </variablelist>
14398</refsect1>
14399</refentry>
14400
14401<refentry id="API-rpc-find-or-alloc-pipe-dir-object">
14402<refentryinfo>
14403 <title>LINUX</title>
14404 <productname>Kernel Hackers Manual</productname>
14405 <date>July 2017</date>
14406</refentryinfo>
14407<refmeta>
14408 <refentrytitle><phrase>rpc_find_or_alloc_pipe_dir_object</phrase></refentrytitle>
14409 <manvolnum>9</manvolnum>
14410 <refmiscinfo class="version">4.1.27</refmiscinfo>
14411</refmeta>
14412<refnamediv>
14413 <refname>rpc_find_or_alloc_pipe_dir_object</refname>
14414 <refpurpose>
14415   </refpurpose>
14416</refnamediv>
14417<refsynopsisdiv>
14418 <title>Synopsis</title>
14419  <funcsynopsis><funcprototype>
14420   <funcdef>struct rpc_pipe_dir_object * <function>rpc_find_or_alloc_pipe_dir_object </function></funcdef>
14421   <paramdef>struct net * <parameter>net</parameter></paramdef>
14422   <paramdef>struct rpc_pipe_dir_head * <parameter>pdh</parameter></paramdef>
14423   <paramdef>int (*<parameter>match</parameter>)
14424     <funcparams>struct rpc_pipe_dir_object *, void *</funcparams></paramdef>
14425   <paramdef>struct rpc_pipe_dir_object *(*<parameter>alloc</parameter>)
14426     <funcparams>void *</funcparams></paramdef>
14427   <paramdef>void * <parameter>data</parameter></paramdef>
14428  </funcprototype></funcsynopsis>
14429</refsynopsisdiv>
14430<refsect1>
14431 <title>Arguments</title>
14432 <variablelist>
14433  <varlistentry>
14434   <term><parameter>net</parameter></term>
14435   <listitem>
14436    <para>
14437     pointer to struct net
14438    </para>
14439   </listitem>
14440  </varlistentry>
14441  <varlistentry>
14442   <term><parameter>pdh</parameter></term>
14443   <listitem>
14444    <para>
14445     pointer to struct rpc_pipe_dir_head
14446    </para>
14447   </listitem>
14448  </varlistentry>
14449  <varlistentry>
14450   <term><parameter>match</parameter></term>
14451   <listitem>
14452    <para>
14453     match struct rpc_pipe_dir_object to data
14454    </para>
14455   </listitem>
14456  </varlistentry>
14457  <varlistentry>
14458   <term><parameter>alloc</parameter></term>
14459   <listitem>
14460    <para>
14461     allocate a new struct rpc_pipe_dir_object
14462    </para>
14463   </listitem>
14464  </varlistentry>
14465  <varlistentry>
14466   <term><parameter>data</parameter></term>
14467   <listitem>
14468    <para>
14469     user defined data for <function>match</function> and <function>alloc</function>
14470    </para>
14471   </listitem>
14472  </varlistentry>
14473 </variablelist>
14474</refsect1>
14475</refentry>
14476
14477<!-- net/sunrpc/rpcb_clnt.c -->
14478<refentry id="API-rpcb-getport-async">
14479<refentryinfo>
14480 <title>LINUX</title>
14481 <productname>Kernel Hackers Manual</productname>
14482 <date>July 2017</date>
14483</refentryinfo>
14484<refmeta>
14485 <refentrytitle><phrase>rpcb_getport_async</phrase></refentrytitle>
14486 <manvolnum>9</manvolnum>
14487 <refmiscinfo class="version">4.1.27</refmiscinfo>
14488</refmeta>
14489<refnamediv>
14490 <refname>rpcb_getport_async</refname>
14491 <refpurpose>
14492  obtain the port for a given RPC service on a given host
14493 </refpurpose>
14494</refnamediv>
14495<refsynopsisdiv>
14496 <title>Synopsis</title>
14497  <funcsynopsis><funcprototype>
14498   <funcdef>void <function>rpcb_getport_async </function></funcdef>
14499   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
14500  </funcprototype></funcsynopsis>
14501</refsynopsisdiv>
14502<refsect1>
14503 <title>Arguments</title>
14504 <variablelist>
14505  <varlistentry>
14506   <term><parameter>task</parameter></term>
14507   <listitem>
14508    <para>
14509     task that is waiting for portmapper request
14510    </para>
14511   </listitem>
14512  </varlistentry>
14513 </variablelist>
14514</refsect1>
14515<refsect1>
14516<title>Description</title>
14517<para>
14518   This one can be called for an ongoing RPC request, and can be used in
14519   an async (rpciod) context.
14520</para>
14521</refsect1>
14522</refentry>
14523
14524<!-- net/sunrpc/clnt.c -->
14525<refentry id="API-rpc-create">
14526<refentryinfo>
14527 <title>LINUX</title>
14528 <productname>Kernel Hackers Manual</productname>
14529 <date>July 2017</date>
14530</refentryinfo>
14531<refmeta>
14532 <refentrytitle><phrase>rpc_create</phrase></refentrytitle>
14533 <manvolnum>9</manvolnum>
14534 <refmiscinfo class="version">4.1.27</refmiscinfo>
14535</refmeta>
14536<refnamediv>
14537 <refname>rpc_create</refname>
14538 <refpurpose>
14539  create an RPC client and transport with one call
14540 </refpurpose>
14541</refnamediv>
14542<refsynopsisdiv>
14543 <title>Synopsis</title>
14544  <funcsynopsis><funcprototype>
14545   <funcdef>struct rpc_clnt * <function>rpc_create </function></funcdef>
14546   <paramdef>struct rpc_create_args * <parameter>args</parameter></paramdef>
14547  </funcprototype></funcsynopsis>
14548</refsynopsisdiv>
14549<refsect1>
14550 <title>Arguments</title>
14551 <variablelist>
14552  <varlistentry>
14553   <term><parameter>args</parameter></term>
14554   <listitem>
14555    <para>
14556     rpc_clnt create argument structure
14557    </para>
14558   </listitem>
14559  </varlistentry>
14560 </variablelist>
14561</refsect1>
14562<refsect1>
14563<title>Description</title>
14564<para>
14565   Creates and initializes an RPC transport and an RPC client.
14566   </para><para>
14567
14568   It can ping the server in order to determine if it is up, and to see if
14569   it supports this program and version.  RPC_CLNT_CREATE_NOPING disables
14570   this behavior so asynchronous tasks can also use rpc_create.
14571</para>
14572</refsect1>
14573</refentry>
14574
14575<refentry id="API-rpc-clone-client">
14576<refentryinfo>
14577 <title>LINUX</title>
14578 <productname>Kernel Hackers Manual</productname>
14579 <date>July 2017</date>
14580</refentryinfo>
14581<refmeta>
14582 <refentrytitle><phrase>rpc_clone_client</phrase></refentrytitle>
14583 <manvolnum>9</manvolnum>
14584 <refmiscinfo class="version">4.1.27</refmiscinfo>
14585</refmeta>
14586<refnamediv>
14587 <refname>rpc_clone_client</refname>
14588 <refpurpose>
14589     Clone an RPC client structure
14590 </refpurpose>
14591</refnamediv>
14592<refsynopsisdiv>
14593 <title>Synopsis</title>
14594  <funcsynopsis><funcprototype>
14595   <funcdef>struct rpc_clnt * <function>rpc_clone_client </function></funcdef>
14596   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
14597  </funcprototype></funcsynopsis>
14598</refsynopsisdiv>
14599<refsect1>
14600 <title>Arguments</title>
14601 <variablelist>
14602  <varlistentry>
14603   <term><parameter>clnt</parameter></term>
14604   <listitem>
14605    <para>
14606     RPC client whose parameters are copied
14607    </para>
14608   </listitem>
14609  </varlistentry>
14610 </variablelist>
14611</refsect1>
14612<refsect1>
14613<title>Description</title>
14614<para>
14615   Returns a fresh RPC client or an ERR_PTR.
14616</para>
14617</refsect1>
14618</refentry>
14619
14620<refentry id="API-rpc-clone-client-set-auth">
14621<refentryinfo>
14622 <title>LINUX</title>
14623 <productname>Kernel Hackers Manual</productname>
14624 <date>July 2017</date>
14625</refentryinfo>
14626<refmeta>
14627 <refentrytitle><phrase>rpc_clone_client_set_auth</phrase></refentrytitle>
14628 <manvolnum>9</manvolnum>
14629 <refmiscinfo class="version">4.1.27</refmiscinfo>
14630</refmeta>
14631<refnamediv>
14632 <refname>rpc_clone_client_set_auth</refname>
14633 <refpurpose>
14634     Clone an RPC client structure and set its auth
14635 </refpurpose>
14636</refnamediv>
14637<refsynopsisdiv>
14638 <title>Synopsis</title>
14639  <funcsynopsis><funcprototype>
14640   <funcdef>struct rpc_clnt * <function>rpc_clone_client_set_auth </function></funcdef>
14641   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
14642   <paramdef>rpc_authflavor_t <parameter>flavor</parameter></paramdef>
14643  </funcprototype></funcsynopsis>
14644</refsynopsisdiv>
14645<refsect1>
14646 <title>Arguments</title>
14647 <variablelist>
14648  <varlistentry>
14649   <term><parameter>clnt</parameter></term>
14650   <listitem>
14651    <para>
14652     RPC client whose parameters are copied
14653    </para>
14654   </listitem>
14655  </varlistentry>
14656  <varlistentry>
14657   <term><parameter>flavor</parameter></term>
14658   <listitem>
14659    <para>
14660     security flavor for new client
14661    </para>
14662   </listitem>
14663  </varlistentry>
14664 </variablelist>
14665</refsect1>
14666<refsect1>
14667<title>Description</title>
14668<para>
14669   Returns a fresh RPC client or an ERR_PTR.
14670</para>
14671</refsect1>
14672</refentry>
14673
14674<refentry id="API-rpc-switch-client-transport">
14675<refentryinfo>
14676 <title>LINUX</title>
14677 <productname>Kernel Hackers Manual</productname>
14678 <date>July 2017</date>
14679</refentryinfo>
14680<refmeta>
14681 <refentrytitle><phrase>rpc_switch_client_transport</phrase></refentrytitle>
14682 <manvolnum>9</manvolnum>
14683 <refmiscinfo class="version">4.1.27</refmiscinfo>
14684</refmeta>
14685<refnamediv>
14686 <refname>rpc_switch_client_transport</refname>
14687 <refpurpose>
14688   </refpurpose>
14689</refnamediv>
14690<refsynopsisdiv>
14691 <title>Synopsis</title>
14692  <funcsynopsis><funcprototype>
14693   <funcdef>int <function>rpc_switch_client_transport </function></funcdef>
14694   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
14695   <paramdef>struct xprt_create * <parameter>args</parameter></paramdef>
14696   <paramdef>const struct rpc_timeout * <parameter>timeout</parameter></paramdef>
14697  </funcprototype></funcsynopsis>
14698</refsynopsisdiv>
14699<refsect1>
14700 <title>Arguments</title>
14701 <variablelist>
14702  <varlistentry>
14703   <term><parameter>clnt</parameter></term>
14704   <listitem>
14705    <para>
14706     pointer to a struct rpc_clnt
14707    </para>
14708   </listitem>
14709  </varlistentry>
14710  <varlistentry>
14711   <term><parameter>args</parameter></term>
14712   <listitem>
14713    <para>
14714     pointer to the new transport arguments
14715    </para>
14716   </listitem>
14717  </varlistentry>
14718  <varlistentry>
14719   <term><parameter>timeout</parameter></term>
14720   <listitem>
14721    <para>
14722     pointer to the new timeout parameters
14723    </para>
14724   </listitem>
14725  </varlistentry>
14726 </variablelist>
14727</refsect1>
14728<refsect1>
14729<title>Description</title>
14730<para>
14731   This function allows the caller to switch the RPC transport for the
14732   rpc_clnt structure 'clnt' to allow it to connect to a mirrored NFS
14733   server, for instance.  It assumes that the caller has ensured that
14734   there are no active RPC tasks by using some form of locking.
14735   </para><para>
14736
14737   Returns zero if <quote>clnt</quote> is now using the new xprt.  Otherwise a
14738   negative errno is returned, and <quote>clnt</quote> continues to use the old
14739   xprt.
14740</para>
14741</refsect1>
14742</refentry>
14743
14744<refentry id="API-rpc-bind-new-program">
14745<refentryinfo>
14746 <title>LINUX</title>
14747 <productname>Kernel Hackers Manual</productname>
14748 <date>July 2017</date>
14749</refentryinfo>
14750<refmeta>
14751 <refentrytitle><phrase>rpc_bind_new_program</phrase></refentrytitle>
14752 <manvolnum>9</manvolnum>
14753 <refmiscinfo class="version">4.1.27</refmiscinfo>
14754</refmeta>
14755<refnamediv>
14756 <refname>rpc_bind_new_program</refname>
14757 <refpurpose>
14758     bind a new RPC program to an existing client
14759 </refpurpose>
14760</refnamediv>
14761<refsynopsisdiv>
14762 <title>Synopsis</title>
14763  <funcsynopsis><funcprototype>
14764   <funcdef>struct rpc_clnt * <function>rpc_bind_new_program </function></funcdef>
14765   <paramdef>struct rpc_clnt * <parameter>old</parameter></paramdef>
14766   <paramdef>const struct rpc_program * <parameter>program</parameter></paramdef>
14767   <paramdef>u32 <parameter>vers</parameter></paramdef>
14768  </funcprototype></funcsynopsis>
14769</refsynopsisdiv>
14770<refsect1>
14771 <title>Arguments</title>
14772 <variablelist>
14773  <varlistentry>
14774   <term><parameter>old</parameter></term>
14775   <listitem>
14776    <para>
14777     old rpc_client
14778    </para>
14779   </listitem>
14780  </varlistentry>
14781  <varlistentry>
14782   <term><parameter>program</parameter></term>
14783   <listitem>
14784    <para>
14785     rpc program to set
14786    </para>
14787   </listitem>
14788  </varlistentry>
14789  <varlistentry>
14790   <term><parameter>vers</parameter></term>
14791   <listitem>
14792    <para>
14793     rpc program version
14794    </para>
14795   </listitem>
14796  </varlistentry>
14797 </variablelist>
14798</refsect1>
14799<refsect1>
14800<title>Description</title>
14801<para>
14802   Clones the rpc client and sets up a new RPC program. This is mainly
14803   of use for enabling different RPC programs to share the same transport.
14804   The Sun NFSv2/v3 ACL protocol can do this.
14805</para>
14806</refsect1>
14807</refentry>
14808
14809<refentry id="API-rpc-run-task">
14810<refentryinfo>
14811 <title>LINUX</title>
14812 <productname>Kernel Hackers Manual</productname>
14813 <date>July 2017</date>
14814</refentryinfo>
14815<refmeta>
14816 <refentrytitle><phrase>rpc_run_task</phrase></refentrytitle>
14817 <manvolnum>9</manvolnum>
14818 <refmiscinfo class="version">4.1.27</refmiscinfo>
14819</refmeta>
14820<refnamediv>
14821 <refname>rpc_run_task</refname>
14822 <refpurpose>
14823     Allocate a new RPC task, then run rpc_execute against it
14824 </refpurpose>
14825</refnamediv>
14826<refsynopsisdiv>
14827 <title>Synopsis</title>
14828  <funcsynopsis><funcprototype>
14829   <funcdef>struct rpc_task * <function>rpc_run_task </function></funcdef>
14830   <paramdef>const struct rpc_task_setup * <parameter>task_setup_data</parameter></paramdef>
14831  </funcprototype></funcsynopsis>
14832</refsynopsisdiv>
14833<refsect1>
14834 <title>Arguments</title>
14835 <variablelist>
14836  <varlistentry>
14837   <term><parameter>task_setup_data</parameter></term>
14838   <listitem>
14839    <para>
14840     pointer to task initialisation data
14841    </para>
14842   </listitem>
14843  </varlistentry>
14844 </variablelist>
14845</refsect1>
14846</refentry>
14847
14848<refentry id="API-rpc-call-sync">
14849<refentryinfo>
14850 <title>LINUX</title>
14851 <productname>Kernel Hackers Manual</productname>
14852 <date>July 2017</date>
14853</refentryinfo>
14854<refmeta>
14855 <refentrytitle><phrase>rpc_call_sync</phrase></refentrytitle>
14856 <manvolnum>9</manvolnum>
14857 <refmiscinfo class="version">4.1.27</refmiscinfo>
14858</refmeta>
14859<refnamediv>
14860 <refname>rpc_call_sync</refname>
14861 <refpurpose>
14862     Perform a synchronous RPC call
14863 </refpurpose>
14864</refnamediv>
14865<refsynopsisdiv>
14866 <title>Synopsis</title>
14867  <funcsynopsis><funcprototype>
14868   <funcdef>int <function>rpc_call_sync </function></funcdef>
14869   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
14870   <paramdef>const struct rpc_message * <parameter>msg</parameter></paramdef>
14871   <paramdef>int <parameter>flags</parameter></paramdef>
14872  </funcprototype></funcsynopsis>
14873</refsynopsisdiv>
14874<refsect1>
14875 <title>Arguments</title>
14876 <variablelist>
14877  <varlistentry>
14878   <term><parameter>clnt</parameter></term>
14879   <listitem>
14880    <para>
14881     pointer to RPC client
14882    </para>
14883   </listitem>
14884  </varlistentry>
14885  <varlistentry>
14886   <term><parameter>msg</parameter></term>
14887   <listitem>
14888    <para>
14889     RPC call parameters
14890    </para>
14891   </listitem>
14892  </varlistentry>
14893  <varlistentry>
14894   <term><parameter>flags</parameter></term>
14895   <listitem>
14896    <para>
14897     RPC call flags
14898    </para>
14899   </listitem>
14900  </varlistentry>
14901 </variablelist>
14902</refsect1>
14903</refentry>
14904
14905<refentry id="API-rpc-call-async">
14906<refentryinfo>
14907 <title>LINUX</title>
14908 <productname>Kernel Hackers Manual</productname>
14909 <date>July 2017</date>
14910</refentryinfo>
14911<refmeta>
14912 <refentrytitle><phrase>rpc_call_async</phrase></refentrytitle>
14913 <manvolnum>9</manvolnum>
14914 <refmiscinfo class="version">4.1.27</refmiscinfo>
14915</refmeta>
14916<refnamediv>
14917 <refname>rpc_call_async</refname>
14918 <refpurpose>
14919     Perform an asynchronous RPC call
14920 </refpurpose>
14921</refnamediv>
14922<refsynopsisdiv>
14923 <title>Synopsis</title>
14924  <funcsynopsis><funcprototype>
14925   <funcdef>int <function>rpc_call_async </function></funcdef>
14926   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
14927   <paramdef>const struct rpc_message * <parameter>msg</parameter></paramdef>
14928   <paramdef>int <parameter>flags</parameter></paramdef>
14929   <paramdef>const struct rpc_call_ops * <parameter>tk_ops</parameter></paramdef>
14930   <paramdef>void * <parameter>data</parameter></paramdef>
14931  </funcprototype></funcsynopsis>
14932</refsynopsisdiv>
14933<refsect1>
14934 <title>Arguments</title>
14935 <variablelist>
14936  <varlistentry>
14937   <term><parameter>clnt</parameter></term>
14938   <listitem>
14939    <para>
14940     pointer to RPC client
14941    </para>
14942   </listitem>
14943  </varlistentry>
14944  <varlistentry>
14945   <term><parameter>msg</parameter></term>
14946   <listitem>
14947    <para>
14948     RPC call parameters
14949    </para>
14950   </listitem>
14951  </varlistentry>
14952  <varlistentry>
14953   <term><parameter>flags</parameter></term>
14954   <listitem>
14955    <para>
14956     RPC call flags
14957    </para>
14958   </listitem>
14959  </varlistentry>
14960  <varlistentry>
14961   <term><parameter>tk_ops</parameter></term>
14962   <listitem>
14963    <para>
14964     RPC call ops
14965    </para>
14966   </listitem>
14967  </varlistentry>
14968  <varlistentry>
14969   <term><parameter>data</parameter></term>
14970   <listitem>
14971    <para>
14972     user call data
14973    </para>
14974   </listitem>
14975  </varlistentry>
14976 </variablelist>
14977</refsect1>
14978</refentry>
14979
14980<refentry id="API-rpc-peeraddr">
14981<refentryinfo>
14982 <title>LINUX</title>
14983 <productname>Kernel Hackers Manual</productname>
14984 <date>July 2017</date>
14985</refentryinfo>
14986<refmeta>
14987 <refentrytitle><phrase>rpc_peeraddr</phrase></refentrytitle>
14988 <manvolnum>9</manvolnum>
14989 <refmiscinfo class="version">4.1.27</refmiscinfo>
14990</refmeta>
14991<refnamediv>
14992 <refname>rpc_peeraddr</refname>
14993 <refpurpose>
14994     extract remote peer address from clnt's xprt
14995 </refpurpose>
14996</refnamediv>
14997<refsynopsisdiv>
14998 <title>Synopsis</title>
14999  <funcsynopsis><funcprototype>
15000   <funcdef>size_t <function>rpc_peeraddr </function></funcdef>
15001   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15002   <paramdef>struct sockaddr * <parameter>buf</parameter></paramdef>
15003   <paramdef>size_t <parameter>bufsize</parameter></paramdef>
15004  </funcprototype></funcsynopsis>
15005</refsynopsisdiv>
15006<refsect1>
15007 <title>Arguments</title>
15008 <variablelist>
15009  <varlistentry>
15010   <term><parameter>clnt</parameter></term>
15011   <listitem>
15012    <para>
15013     RPC client structure
15014    </para>
15015   </listitem>
15016  </varlistentry>
15017  <varlistentry>
15018   <term><parameter>buf</parameter></term>
15019   <listitem>
15020    <para>
15021     target buffer
15022    </para>
15023   </listitem>
15024  </varlistentry>
15025  <varlistentry>
15026   <term><parameter>bufsize</parameter></term>
15027   <listitem>
15028    <para>
15029     length of target buffer
15030    </para>
15031   </listitem>
15032  </varlistentry>
15033 </variablelist>
15034</refsect1>
15035<refsect1>
15036<title>Description</title>
15037<para>
15038   Returns the number of bytes that are actually in the stored address.
15039</para>
15040</refsect1>
15041</refentry>
15042
15043<refentry id="API-rpc-peeraddr2str">
15044<refentryinfo>
15045 <title>LINUX</title>
15046 <productname>Kernel Hackers Manual</productname>
15047 <date>July 2017</date>
15048</refentryinfo>
15049<refmeta>
15050 <refentrytitle><phrase>rpc_peeraddr2str</phrase></refentrytitle>
15051 <manvolnum>9</manvolnum>
15052 <refmiscinfo class="version">4.1.27</refmiscinfo>
15053</refmeta>
15054<refnamediv>
15055 <refname>rpc_peeraddr2str</refname>
15056 <refpurpose>
15057     return remote peer address in printable format
15058 </refpurpose>
15059</refnamediv>
15060<refsynopsisdiv>
15061 <title>Synopsis</title>
15062  <funcsynopsis><funcprototype>
15063   <funcdef>const char * <function>rpc_peeraddr2str </function></funcdef>
15064   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15065   <paramdef>enum rpc_display_format_t <parameter>format</parameter></paramdef>
15066  </funcprototype></funcsynopsis>
15067</refsynopsisdiv>
15068<refsect1>
15069 <title>Arguments</title>
15070 <variablelist>
15071  <varlistentry>
15072   <term><parameter>clnt</parameter></term>
15073   <listitem>
15074    <para>
15075     RPC client structure
15076    </para>
15077   </listitem>
15078  </varlistentry>
15079  <varlistentry>
15080   <term><parameter>format</parameter></term>
15081   <listitem>
15082    <para>
15083     address format
15084    </para>
15085   </listitem>
15086  </varlistentry>
15087 </variablelist>
15088</refsect1>
15089<refsect1>
15090<title>NB</title>
15091<para>
15092   the lifetime of the memory referenced by the returned pointer is
15093   the same as the rpc_xprt itself.  As long as the caller uses this
15094   pointer, it must hold the RCU read lock.
15095</para>
15096</refsect1>
15097</refentry>
15098
15099<refentry id="API-rpc-localaddr">
15100<refentryinfo>
15101 <title>LINUX</title>
15102 <productname>Kernel Hackers Manual</productname>
15103 <date>July 2017</date>
15104</refentryinfo>
15105<refmeta>
15106 <refentrytitle><phrase>rpc_localaddr</phrase></refentrytitle>
15107 <manvolnum>9</manvolnum>
15108 <refmiscinfo class="version">4.1.27</refmiscinfo>
15109</refmeta>
15110<refnamediv>
15111 <refname>rpc_localaddr</refname>
15112 <refpurpose>
15113     discover local endpoint address for an RPC client
15114 </refpurpose>
15115</refnamediv>
15116<refsynopsisdiv>
15117 <title>Synopsis</title>
15118  <funcsynopsis><funcprototype>
15119   <funcdef>int <function>rpc_localaddr </function></funcdef>
15120   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15121   <paramdef>struct sockaddr * <parameter>buf</parameter></paramdef>
15122   <paramdef>size_t <parameter>buflen</parameter></paramdef>
15123  </funcprototype></funcsynopsis>
15124</refsynopsisdiv>
15125<refsect1>
15126 <title>Arguments</title>
15127 <variablelist>
15128  <varlistentry>
15129   <term><parameter>clnt</parameter></term>
15130   <listitem>
15131    <para>
15132     RPC client structure
15133    </para>
15134   </listitem>
15135  </varlistentry>
15136  <varlistentry>
15137   <term><parameter>buf</parameter></term>
15138   <listitem>
15139    <para>
15140     target buffer
15141    </para>
15142   </listitem>
15143  </varlistentry>
15144  <varlistentry>
15145   <term><parameter>buflen</parameter></term>
15146   <listitem>
15147    <para>
15148     size of target buffer, in bytes
15149    </para>
15150   </listitem>
15151  </varlistentry>
15152 </variablelist>
15153</refsect1>
15154<refsect1>
15155<title>Description</title>
15156<para>
15157   Returns zero and fills in <quote>buf</quote> and <quote>buflen</quote> if successful;
15158   otherwise, a negative errno is returned.
15159   </para><para>
15160
15161   This works even if the underlying transport is not currently connected,
15162   or if the upper layer never previously provided a source address.
15163</para>
15164</refsect1>
15165<refsect1>
15166<title>The result of this function call is transient</title>
15167<para>
15168   multiple calls in
15169   succession may give different results, depending on how local
15170   networking configuration changes over time.
15171</para>
15172</refsect1>
15173</refentry>
15174
15175<refentry id="API-rpc-protocol">
15176<refentryinfo>
15177 <title>LINUX</title>
15178 <productname>Kernel Hackers Manual</productname>
15179 <date>July 2017</date>
15180</refentryinfo>
15181<refmeta>
15182 <refentrytitle><phrase>rpc_protocol</phrase></refentrytitle>
15183 <manvolnum>9</manvolnum>
15184 <refmiscinfo class="version">4.1.27</refmiscinfo>
15185</refmeta>
15186<refnamediv>
15187 <refname>rpc_protocol</refname>
15188 <refpurpose>
15189     Get transport protocol number for an RPC client
15190 </refpurpose>
15191</refnamediv>
15192<refsynopsisdiv>
15193 <title>Synopsis</title>
15194  <funcsynopsis><funcprototype>
15195   <funcdef>int <function>rpc_protocol </function></funcdef>
15196   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15197  </funcprototype></funcsynopsis>
15198</refsynopsisdiv>
15199<refsect1>
15200 <title>Arguments</title>
15201 <variablelist>
15202  <varlistentry>
15203   <term><parameter>clnt</parameter></term>
15204   <listitem>
15205    <para>
15206     RPC client to query
15207    </para>
15208   </listitem>
15209  </varlistentry>
15210 </variablelist>
15211</refsect1>
15212</refentry>
15213
15214<refentry id="API-rpc-net-ns">
15215<refentryinfo>
15216 <title>LINUX</title>
15217 <productname>Kernel Hackers Manual</productname>
15218 <date>July 2017</date>
15219</refentryinfo>
15220<refmeta>
15221 <refentrytitle><phrase>rpc_net_ns</phrase></refentrytitle>
15222 <manvolnum>9</manvolnum>
15223 <refmiscinfo class="version">4.1.27</refmiscinfo>
15224</refmeta>
15225<refnamediv>
15226 <refname>rpc_net_ns</refname>
15227 <refpurpose>
15228     Get the network namespace for this RPC client
15229 </refpurpose>
15230</refnamediv>
15231<refsynopsisdiv>
15232 <title>Synopsis</title>
15233  <funcsynopsis><funcprototype>
15234   <funcdef>struct net * <function>rpc_net_ns </function></funcdef>
15235   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15236  </funcprototype></funcsynopsis>
15237</refsynopsisdiv>
15238<refsect1>
15239 <title>Arguments</title>
15240 <variablelist>
15241  <varlistentry>
15242   <term><parameter>clnt</parameter></term>
15243   <listitem>
15244    <para>
15245     RPC client to query
15246    </para>
15247   </listitem>
15248  </varlistentry>
15249 </variablelist>
15250</refsect1>
15251</refentry>
15252
15253<refentry id="API-rpc-max-payload">
15254<refentryinfo>
15255 <title>LINUX</title>
15256 <productname>Kernel Hackers Manual</productname>
15257 <date>July 2017</date>
15258</refentryinfo>
15259<refmeta>
15260 <refentrytitle><phrase>rpc_max_payload</phrase></refentrytitle>
15261 <manvolnum>9</manvolnum>
15262 <refmiscinfo class="version">4.1.27</refmiscinfo>
15263</refmeta>
15264<refnamediv>
15265 <refname>rpc_max_payload</refname>
15266 <refpurpose>
15267     Get maximum payload size for a transport, in bytes
15268 </refpurpose>
15269</refnamediv>
15270<refsynopsisdiv>
15271 <title>Synopsis</title>
15272  <funcsynopsis><funcprototype>
15273   <funcdef>size_t <function>rpc_max_payload </function></funcdef>
15274   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15275  </funcprototype></funcsynopsis>
15276</refsynopsisdiv>
15277<refsect1>
15278 <title>Arguments</title>
15279 <variablelist>
15280  <varlistentry>
15281   <term><parameter>clnt</parameter></term>
15282   <listitem>
15283    <para>
15284     RPC client to query
15285    </para>
15286   </listitem>
15287  </varlistentry>
15288 </variablelist>
15289</refsect1>
15290<refsect1>
15291<title>Description</title>
15292<para>
15293   For stream transports, this is one RPC record fragment (see RFC
15294   1831), as we don't support multi-record requests yet.  For datagram
15295   transports, this is the size of an IP packet minus the IP, UDP, and
15296   RPC header sizes.
15297</para>
15298</refsect1>
15299</refentry>
15300
15301<refentry id="API-rpc-get-timeout">
15302<refentryinfo>
15303 <title>LINUX</title>
15304 <productname>Kernel Hackers Manual</productname>
15305 <date>July 2017</date>
15306</refentryinfo>
15307<refmeta>
15308 <refentrytitle><phrase>rpc_get_timeout</phrase></refentrytitle>
15309 <manvolnum>9</manvolnum>
15310 <refmiscinfo class="version">4.1.27</refmiscinfo>
15311</refmeta>
15312<refnamediv>
15313 <refname>rpc_get_timeout</refname>
15314 <refpurpose>
15315     Get timeout for transport in units of HZ
15316 </refpurpose>
15317</refnamediv>
15318<refsynopsisdiv>
15319 <title>Synopsis</title>
15320  <funcsynopsis><funcprototype>
15321   <funcdef>unsigned long <function>rpc_get_timeout </function></funcdef>
15322   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15323  </funcprototype></funcsynopsis>
15324</refsynopsisdiv>
15325<refsect1>
15326 <title>Arguments</title>
15327 <variablelist>
15328  <varlistentry>
15329   <term><parameter>clnt</parameter></term>
15330   <listitem>
15331    <para>
15332     RPC client to query
15333    </para>
15334   </listitem>
15335  </varlistentry>
15336 </variablelist>
15337</refsect1>
15338</refentry>
15339
15340<refentry id="API-rpc-force-rebind">
15341<refentryinfo>
15342 <title>LINUX</title>
15343 <productname>Kernel Hackers Manual</productname>
15344 <date>July 2017</date>
15345</refentryinfo>
15346<refmeta>
15347 <refentrytitle><phrase>rpc_force_rebind</phrase></refentrytitle>
15348 <manvolnum>9</manvolnum>
15349 <refmiscinfo class="version">4.1.27</refmiscinfo>
15350</refmeta>
15351<refnamediv>
15352 <refname>rpc_force_rebind</refname>
15353 <refpurpose>
15354     force transport to check that remote port is unchanged
15355 </refpurpose>
15356</refnamediv>
15357<refsynopsisdiv>
15358 <title>Synopsis</title>
15359  <funcsynopsis><funcprototype>
15360   <funcdef>void <function>rpc_force_rebind </function></funcdef>
15361   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
15362  </funcprototype></funcsynopsis>
15363</refsynopsisdiv>
15364<refsect1>
15365 <title>Arguments</title>
15366 <variablelist>
15367  <varlistentry>
15368   <term><parameter>clnt</parameter></term>
15369   <listitem>
15370    <para>
15371     client to rebind
15372    </para>
15373   </listitem>
15374  </varlistentry>
15375 </variablelist>
15376</refsect1>
15377</refentry>
15378
15379     </sect1>
15380     <sect1><title>WiMAX</title>
15381<!-- net/wimax/op-msg.c -->
15382<refentry id="API-wimax-msg-alloc">
15383<refentryinfo>
15384 <title>LINUX</title>
15385 <productname>Kernel Hackers Manual</productname>
15386 <date>July 2017</date>
15387</refentryinfo>
15388<refmeta>
15389 <refentrytitle><phrase>wimax_msg_alloc</phrase></refentrytitle>
15390 <manvolnum>9</manvolnum>
15391 <refmiscinfo class="version">4.1.27</refmiscinfo>
15392</refmeta>
15393<refnamediv>
15394 <refname>wimax_msg_alloc</refname>
15395 <refpurpose>
15396  Create a new skb for sending a message to userspace
15397 </refpurpose>
15398</refnamediv>
15399<refsynopsisdiv>
15400 <title>Synopsis</title>
15401  <funcsynopsis><funcprototype>
15402   <funcdef>struct sk_buff * <function>wimax_msg_alloc </function></funcdef>
15403   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
15404   <paramdef>const char * <parameter>pipe_name</parameter></paramdef>
15405   <paramdef>const void * <parameter>msg</parameter></paramdef>
15406   <paramdef>size_t <parameter>size</parameter></paramdef>
15407   <paramdef>gfp_t <parameter>gfp_flags</parameter></paramdef>
15408  </funcprototype></funcsynopsis>
15409</refsynopsisdiv>
15410<refsect1>
15411 <title>Arguments</title>
15412 <variablelist>
15413  <varlistentry>
15414   <term><parameter>wimax_dev</parameter></term>
15415   <listitem>
15416    <para>
15417     WiMAX device descriptor
15418    </para>
15419   </listitem>
15420  </varlistentry>
15421  <varlistentry>
15422   <term><parameter>pipe_name</parameter></term>
15423   <listitem>
15424    <para>
15425     "named pipe" the message will be sent to
15426    </para>
15427   </listitem>
15428  </varlistentry>
15429  <varlistentry>
15430   <term><parameter>msg</parameter></term>
15431   <listitem>
15432    <para>
15433     pointer to the message data to send
15434    </para>
15435   </listitem>
15436  </varlistentry>
15437  <varlistentry>
15438   <term><parameter>size</parameter></term>
15439   <listitem>
15440    <para>
15441     size of the message to send (in bytes), including the header.
15442    </para>
15443   </listitem>
15444  </varlistentry>
15445  <varlistentry>
15446   <term><parameter>gfp_flags</parameter></term>
15447   <listitem>
15448    <para>
15449     flags for memory allocation.
15450    </para>
15451   </listitem>
15452  </varlistentry>
15453 </variablelist>
15454</refsect1>
15455<refsect1>
15456<title>Returns</title>
15457<para>
15458   <constant>0</constant> if ok, negative errno code on error
15459</para>
15460</refsect1>
15461<refsect1>
15462<title>Description</title>
15463<para>
15464   </para><para>
15465
15466   Allocates an skb that will contain the message to send to user
15467   space over the messaging pipe and initializes it, copying the
15468   payload.
15469   </para><para>
15470
15471   Once this call is done, you can deliver it with
15472   <function>wimax_msg_send</function>.
15473</para>
15474</refsect1>
15475<refsect1>
15476<title>IMPORTANT</title>
15477<para>
15478   </para><para>
15479
15480   Don't use <function>skb_push</function>/<function>skb_pull</function>/<function>skb_reserve</function> on the skb, as
15481   <function>wimax_msg_send</function> depends on skb-&gt;data being placed at the
15482   beginning of the user message.
15483   </para><para>
15484
15485   Unlike other WiMAX stack calls, this call can be used way early,
15486   even before <function>wimax_dev_add</function> is called, as long as the
15487   wimax_dev-&gt;net_dev pointer is set to point to a proper
15488   net_dev. This is so that drivers can use it early in case they need
15489   to send stuff around or communicate with user space.
15490</para>
15491</refsect1>
15492</refentry>
15493
15494<refentry id="API-wimax-msg-data-len">
15495<refentryinfo>
15496 <title>LINUX</title>
15497 <productname>Kernel Hackers Manual</productname>
15498 <date>July 2017</date>
15499</refentryinfo>
15500<refmeta>
15501 <refentrytitle><phrase>wimax_msg_data_len</phrase></refentrytitle>
15502 <manvolnum>9</manvolnum>
15503 <refmiscinfo class="version">4.1.27</refmiscinfo>
15504</refmeta>
15505<refnamediv>
15506 <refname>wimax_msg_data_len</refname>
15507 <refpurpose>
15508     Return a pointer and size of a message's payload
15509 </refpurpose>
15510</refnamediv>
15511<refsynopsisdiv>
15512 <title>Synopsis</title>
15513  <funcsynopsis><funcprototype>
15514   <funcdef>const void * <function>wimax_msg_data_len </function></funcdef>
15515   <paramdef>struct sk_buff * <parameter>msg</parameter></paramdef>
15516   <paramdef>size_t * <parameter>size</parameter></paramdef>
15517  </funcprototype></funcsynopsis>
15518</refsynopsisdiv>
15519<refsect1>
15520 <title>Arguments</title>
15521 <variablelist>
15522  <varlistentry>
15523   <term><parameter>msg</parameter></term>
15524   <listitem>
15525    <para>
15526     Pointer to a message created with <function>wimax_msg_alloc</function>
15527    </para>
15528   </listitem>
15529  </varlistentry>
15530  <varlistentry>
15531   <term><parameter>size</parameter></term>
15532   <listitem>
15533    <para>
15534     Pointer to where to store the message's size
15535    </para>
15536   </listitem>
15537  </varlistentry>
15538 </variablelist>
15539</refsect1>
15540<refsect1>
15541<title>Description</title>
15542<para>
15543   Returns the pointer to the message data.
15544</para>
15545</refsect1>
15546</refentry>
15547
15548<refentry id="API-wimax-msg-data">
15549<refentryinfo>
15550 <title>LINUX</title>
15551 <productname>Kernel Hackers Manual</productname>
15552 <date>July 2017</date>
15553</refentryinfo>
15554<refmeta>
15555 <refentrytitle><phrase>wimax_msg_data</phrase></refentrytitle>
15556 <manvolnum>9</manvolnum>
15557 <refmiscinfo class="version">4.1.27</refmiscinfo>
15558</refmeta>
15559<refnamediv>
15560 <refname>wimax_msg_data</refname>
15561 <refpurpose>
15562     Return a pointer to a message's payload
15563 </refpurpose>
15564</refnamediv>
15565<refsynopsisdiv>
15566 <title>Synopsis</title>
15567  <funcsynopsis><funcprototype>
15568   <funcdef>const void * <function>wimax_msg_data </function></funcdef>
15569   <paramdef>struct sk_buff * <parameter>msg</parameter></paramdef>
15570  </funcprototype></funcsynopsis>
15571</refsynopsisdiv>
15572<refsect1>
15573 <title>Arguments</title>
15574 <variablelist>
15575  <varlistentry>
15576   <term><parameter>msg</parameter></term>
15577   <listitem>
15578    <para>
15579     Pointer to a message created with <function>wimax_msg_alloc</function>
15580    </para>
15581   </listitem>
15582  </varlistentry>
15583 </variablelist>
15584</refsect1>
15585</refentry>
15586
15587<refentry id="API-wimax-msg-len">
15588<refentryinfo>
15589 <title>LINUX</title>
15590 <productname>Kernel Hackers Manual</productname>
15591 <date>July 2017</date>
15592</refentryinfo>
15593<refmeta>
15594 <refentrytitle><phrase>wimax_msg_len</phrase></refentrytitle>
15595 <manvolnum>9</manvolnum>
15596 <refmiscinfo class="version">4.1.27</refmiscinfo>
15597</refmeta>
15598<refnamediv>
15599 <refname>wimax_msg_len</refname>
15600 <refpurpose>
15601     Return a message's payload length
15602 </refpurpose>
15603</refnamediv>
15604<refsynopsisdiv>
15605 <title>Synopsis</title>
15606  <funcsynopsis><funcprototype>
15607   <funcdef>ssize_t <function>wimax_msg_len </function></funcdef>
15608   <paramdef>struct sk_buff * <parameter>msg</parameter></paramdef>
15609  </funcprototype></funcsynopsis>
15610</refsynopsisdiv>
15611<refsect1>
15612 <title>Arguments</title>
15613 <variablelist>
15614  <varlistentry>
15615   <term><parameter>msg</parameter></term>
15616   <listitem>
15617    <para>
15618     Pointer to a message created with <function>wimax_msg_alloc</function>
15619    </para>
15620   </listitem>
15621  </varlistentry>
15622 </variablelist>
15623</refsect1>
15624</refentry>
15625
15626<refentry id="API-wimax-msg-send">
15627<refentryinfo>
15628 <title>LINUX</title>
15629 <productname>Kernel Hackers Manual</productname>
15630 <date>July 2017</date>
15631</refentryinfo>
15632<refmeta>
15633 <refentrytitle><phrase>wimax_msg_send</phrase></refentrytitle>
15634 <manvolnum>9</manvolnum>
15635 <refmiscinfo class="version">4.1.27</refmiscinfo>
15636</refmeta>
15637<refnamediv>
15638 <refname>wimax_msg_send</refname>
15639 <refpurpose>
15640     Send a pre-allocated message to user space
15641 </refpurpose>
15642</refnamediv>
15643<refsynopsisdiv>
15644 <title>Synopsis</title>
15645  <funcsynopsis><funcprototype>
15646   <funcdef>int <function>wimax_msg_send </function></funcdef>
15647   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
15648   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
15649  </funcprototype></funcsynopsis>
15650</refsynopsisdiv>
15651<refsect1>
15652 <title>Arguments</title>
15653 <variablelist>
15654  <varlistentry>
15655   <term><parameter>wimax_dev</parameter></term>
15656   <listitem>
15657    <para>
15658     WiMAX device descriptor
15659    </para>
15660   </listitem>
15661  </varlistentry>
15662  <varlistentry>
15663   <term><parameter>skb</parameter></term>
15664   <listitem>
15665    <para>
15666     <structname>struct sk_buff</structname> returned by <function>wimax_msg_alloc</function>. Note the
15667     ownership of <parameter>skb</parameter> is transferred to this function.
15668    </para>
15669   </listitem>
15670  </varlistentry>
15671 </variablelist>
15672</refsect1>
15673<refsect1>
15674<title>Returns</title>
15675<para>
15676   0 if ok, &lt; 0 errno code on error
15677</para>
15678</refsect1>
15679<refsect1>
15680<title>Description</title>
15681<para>
15682   </para><para>
15683
15684   Sends a free-form message that was preallocated with
15685   <function>wimax_msg_alloc</function> and filled up.
15686   </para><para>
15687
15688   Assumes that once you pass an skb to this function for sending, it
15689   owns it and will release it when done (on success).
15690</para>
15691</refsect1>
15692<refsect1>
15693<title>IMPORTANT</title>
15694<para>
15695   </para><para>
15696
15697   Don't use <function>skb_push</function>/<function>skb_pull</function>/<function>skb_reserve</function> on the skb, as
15698   <function>wimax_msg_send</function> depends on skb-&gt;data being placed at the
15699   beginning of the user message.
15700   </para><para>
15701
15702   Unlike other WiMAX stack calls, this call can be used way early,
15703   even before <function>wimax_dev_add</function> is called, as long as the
15704   wimax_dev-&gt;net_dev pointer is set to point to a proper
15705   net_dev. This is so that drivers can use it early in case they need
15706   to send stuff around or communicate with user space.
15707</para>
15708</refsect1>
15709</refentry>
15710
15711<refentry id="API-wimax-msg">
15712<refentryinfo>
15713 <title>LINUX</title>
15714 <productname>Kernel Hackers Manual</productname>
15715 <date>July 2017</date>
15716</refentryinfo>
15717<refmeta>
15718 <refentrytitle><phrase>wimax_msg</phrase></refentrytitle>
15719 <manvolnum>9</manvolnum>
15720 <refmiscinfo class="version">4.1.27</refmiscinfo>
15721</refmeta>
15722<refnamediv>
15723 <refname>wimax_msg</refname>
15724 <refpurpose>
15725     Send a message to user space
15726 </refpurpose>
15727</refnamediv>
15728<refsynopsisdiv>
15729 <title>Synopsis</title>
15730  <funcsynopsis><funcprototype>
15731   <funcdef>int <function>wimax_msg </function></funcdef>
15732   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
15733   <paramdef>const char * <parameter>pipe_name</parameter></paramdef>
15734   <paramdef>const void * <parameter>buf</parameter></paramdef>
15735   <paramdef>size_t <parameter>size</parameter></paramdef>
15736   <paramdef>gfp_t <parameter>gfp_flags</parameter></paramdef>
15737  </funcprototype></funcsynopsis>
15738</refsynopsisdiv>
15739<refsect1>
15740 <title>Arguments</title>
15741 <variablelist>
15742  <varlistentry>
15743   <term><parameter>wimax_dev</parameter></term>
15744   <listitem>
15745    <para>
15746     WiMAX device descriptor (properly referenced)
15747    </para>
15748   </listitem>
15749  </varlistentry>
15750  <varlistentry>
15751   <term><parameter>pipe_name</parameter></term>
15752   <listitem>
15753    <para>
15754     "named pipe" the message will be sent to
15755    </para>
15756   </listitem>
15757  </varlistentry>
15758  <varlistentry>
15759   <term><parameter>buf</parameter></term>
15760   <listitem>
15761    <para>
15762     pointer to the message to send.
15763    </para>
15764   </listitem>
15765  </varlistentry>
15766  <varlistentry>
15767   <term><parameter>size</parameter></term>
15768   <listitem>
15769    <para>
15770     size of the buffer pointed to by <parameter>buf</parameter> (in bytes).
15771    </para>
15772   </listitem>
15773  </varlistentry>
15774  <varlistentry>
15775   <term><parameter>gfp_flags</parameter></term>
15776   <listitem>
15777    <para>
15778     flags for memory allocation.
15779    </para>
15780   </listitem>
15781  </varlistentry>
15782 </variablelist>
15783</refsect1>
15784<refsect1>
15785<title>Returns</title>
15786<para>
15787   <constant>0</constant> if ok, negative errno code on error.
15788</para>
15789</refsect1>
15790<refsect1>
15791<title>Description</title>
15792<para>
15793   </para><para>
15794
15795   Sends a free-form message to user space on the device <parameter>wimax_dev</parameter>.
15796</para>
15797</refsect1>
15798<refsect1>
15799<title>NOTES</title>
15800<para>
15801   </para><para>
15802
15803   Once the <parameter>skb</parameter> is given to this function, who will own it and will
15804   release it when done (unless it returns error).
15805</para>
15806</refsect1>
15807</refentry>
15808
15809<!-- net/wimax/op-reset.c -->
15810<refentry id="API-wimax-reset">
15811<refentryinfo>
15812 <title>LINUX</title>
15813 <productname>Kernel Hackers Manual</productname>
15814 <date>July 2017</date>
15815</refentryinfo>
15816<refmeta>
15817 <refentrytitle><phrase>wimax_reset</phrase></refentrytitle>
15818 <manvolnum>9</manvolnum>
15819 <refmiscinfo class="version">4.1.27</refmiscinfo>
15820</refmeta>
15821<refnamediv>
15822 <refname>wimax_reset</refname>
15823 <refpurpose>
15824  Reset a WiMAX device
15825 </refpurpose>
15826</refnamediv>
15827<refsynopsisdiv>
15828 <title>Synopsis</title>
15829  <funcsynopsis><funcprototype>
15830   <funcdef>int <function>wimax_reset </function></funcdef>
15831   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
15832  </funcprototype></funcsynopsis>
15833</refsynopsisdiv>
15834<refsect1>
15835 <title>Arguments</title>
15836 <variablelist>
15837  <varlistentry>
15838   <term><parameter>wimax_dev</parameter></term>
15839   <listitem>
15840    <para>
15841     WiMAX device descriptor
15842    </para>
15843   </listitem>
15844  </varlistentry>
15845 </variablelist>
15846</refsect1>
15847<refsect1>
15848<title>Returns</title>
15849<para>
15850   </para><para>
15851
15852   <constant>0</constant> if ok and a warm reset was done (the device still exists in
15853   the system).
15854   </para><para>
15855
15856   -<constant>ENODEV</constant> if a cold/bus reset had to be done (device has
15857   disconnected and reconnected, so current handle is not valid
15858   any more).
15859   </para><para>
15860
15861   -<constant>EINVAL</constant> if the device is not even registered.
15862   </para><para>
15863
15864   Any other negative error code shall be considered as
15865   non-recoverable.
15866</para>
15867</refsect1>
15868<refsect1>
15869<title>Description</title>
15870<para>
15871   </para><para>
15872
15873   Called when wanting to reset the device for any reason. Device is
15874   taken back to power on status.
15875   </para><para>
15876
15877   This call blocks; on successful return, the device has completed the
15878   reset process and is ready to operate.
15879</para>
15880</refsect1>
15881</refentry>
15882
15883<!-- net/wimax/op-rfkill.c -->
15884<refentry id="API-wimax-report-rfkill-hw">
15885<refentryinfo>
15886 <title>LINUX</title>
15887 <productname>Kernel Hackers Manual</productname>
15888 <date>July 2017</date>
15889</refentryinfo>
15890<refmeta>
15891 <refentrytitle><phrase>wimax_report_rfkill_hw</phrase></refentrytitle>
15892 <manvolnum>9</manvolnum>
15893 <refmiscinfo class="version">4.1.27</refmiscinfo>
15894</refmeta>
15895<refnamediv>
15896 <refname>wimax_report_rfkill_hw</refname>
15897 <refpurpose>
15898  Reports changes in the hardware RF switch
15899 </refpurpose>
15900</refnamediv>
15901<refsynopsisdiv>
15902 <title>Synopsis</title>
15903  <funcsynopsis><funcprototype>
15904   <funcdef>void <function>wimax_report_rfkill_hw </function></funcdef>
15905   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
15906   <paramdef>enum wimax_rf_state <parameter>state</parameter></paramdef>
15907  </funcprototype></funcsynopsis>
15908</refsynopsisdiv>
15909<refsect1>
15910 <title>Arguments</title>
15911 <variablelist>
15912  <varlistentry>
15913   <term><parameter>wimax_dev</parameter></term>
15914   <listitem>
15915    <para>
15916     WiMAX device descriptor
15917    </para>
15918   </listitem>
15919  </varlistentry>
15920  <varlistentry>
15921   <term><parameter>state</parameter></term>
15922   <listitem>
15923    <para>
15924     New state of the RF Kill switch. <constant>WIMAX_RF_ON</constant> radio on,
15925     <constant>WIMAX_RF_OFF</constant> radio off.
15926    </para>
15927   </listitem>
15928  </varlistentry>
15929 </variablelist>
15930</refsect1>
15931<refsect1>
15932<title>Description</title>
15933<para>
15934   When the device detects a change in the state of thehardware RF
15935   switch, it must call this function to let the WiMAX kernel stack
15936   know that the state has changed so it can be properly propagated.
15937   </para><para>
15938
15939   The WiMAX stack caches the state (the driver doesn't need to). As
15940   well, as the change is propagated it will come back as a request to
15941   change the software state to mirror the hardware state.
15942   </para><para>
15943
15944   If the device doesn't have a hardware kill switch, just report
15945   it on initialization as always on (<constant>WIMAX_RF_ON</constant>, radio on).
15946</para>
15947</refsect1>
15948</refentry>
15949
15950<refentry id="API-wimax-report-rfkill-sw">
15951<refentryinfo>
15952 <title>LINUX</title>
15953 <productname>Kernel Hackers Manual</productname>
15954 <date>July 2017</date>
15955</refentryinfo>
15956<refmeta>
15957 <refentrytitle><phrase>wimax_report_rfkill_sw</phrase></refentrytitle>
15958 <manvolnum>9</manvolnum>
15959 <refmiscinfo class="version">4.1.27</refmiscinfo>
15960</refmeta>
15961<refnamediv>
15962 <refname>wimax_report_rfkill_sw</refname>
15963 <refpurpose>
15964     Reports changes in the software RF switch
15965 </refpurpose>
15966</refnamediv>
15967<refsynopsisdiv>
15968 <title>Synopsis</title>
15969  <funcsynopsis><funcprototype>
15970   <funcdef>void <function>wimax_report_rfkill_sw </function></funcdef>
15971   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
15972   <paramdef>enum wimax_rf_state <parameter>state</parameter></paramdef>
15973  </funcprototype></funcsynopsis>
15974</refsynopsisdiv>
15975<refsect1>
15976 <title>Arguments</title>
15977 <variablelist>
15978  <varlistentry>
15979   <term><parameter>wimax_dev</parameter></term>
15980   <listitem>
15981    <para>
15982     WiMAX device descriptor
15983    </para>
15984   </listitem>
15985  </varlistentry>
15986  <varlistentry>
15987   <term><parameter>state</parameter></term>
15988   <listitem>
15989    <para>
15990     New state of the RF kill switch. <constant>WIMAX_RF_ON</constant> radio on,
15991     <constant>WIMAX_RF_OFF</constant> radio off.
15992    </para>
15993   </listitem>
15994  </varlistentry>
15995 </variablelist>
15996</refsect1>
15997<refsect1>
15998<title>Description</title>
15999<para>
16000   Reports changes in the software RF switch state to the the WiMAX
16001   stack.
16002   </para><para>
16003
16004   The main use is during initialization, so the driver can query the
16005   device for its current software radio kill switch state and feed it
16006   to the system.
16007   </para><para>
16008
16009   On the side, the device does not change the software state by
16010   itself. In practice, this can happen, as the device might decide to
16011   switch (in software) the radio off for different reasons.
16012</para>
16013</refsect1>
16014</refentry>
16015
16016<refentry id="API-wimax-rfkill">
16017<refentryinfo>
16018 <title>LINUX</title>
16019 <productname>Kernel Hackers Manual</productname>
16020 <date>July 2017</date>
16021</refentryinfo>
16022<refmeta>
16023 <refentrytitle><phrase>wimax_rfkill</phrase></refentrytitle>
16024 <manvolnum>9</manvolnum>
16025 <refmiscinfo class="version">4.1.27</refmiscinfo>
16026</refmeta>
16027<refnamediv>
16028 <refname>wimax_rfkill</refname>
16029 <refpurpose>
16030     Set the software RF switch state for a WiMAX device
16031 </refpurpose>
16032</refnamediv>
16033<refsynopsisdiv>
16034 <title>Synopsis</title>
16035  <funcsynopsis><funcprototype>
16036   <funcdef>int <function>wimax_rfkill </function></funcdef>
16037   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
16038   <paramdef>enum wimax_rf_state <parameter>state</parameter></paramdef>
16039  </funcprototype></funcsynopsis>
16040</refsynopsisdiv>
16041<refsect1>
16042 <title>Arguments</title>
16043 <variablelist>
16044  <varlistentry>
16045   <term><parameter>wimax_dev</parameter></term>
16046   <listitem>
16047    <para>
16048     WiMAX device descriptor
16049    </para>
16050   </listitem>
16051  </varlistentry>
16052  <varlistentry>
16053   <term><parameter>state</parameter></term>
16054   <listitem>
16055    <para>
16056     New RF state.
16057    </para>
16058   </listitem>
16059  </varlistentry>
16060 </variablelist>
16061</refsect1>
16062<refsect1>
16063<title>Returns</title>
16064<para>
16065   </para><para>
16066
16067   &gt;= 0 toggle state if ok, &lt; 0 errno code on error. The toggle state
16068   is returned as a bitmap, bit 0 being the hardware RF state, bit 1
16069   the software RF state.
16070   </para><para>
16071
16072   0 means disabled (<constant>WIMAX_RF_ON</constant>, radio on), 1 means enabled radio
16073   off (<constant>WIMAX_RF_OFF</constant>).
16074</para>
16075</refsect1>
16076<refsect1>
16077<title>Description</title>
16078<para>
16079   </para><para>
16080
16081   Called by the user when he wants to request the WiMAX radio to be
16082   switched on (<constant>WIMAX_RF_ON</constant>) or off (<constant>WIMAX_RF_OFF</constant>). With
16083   <constant>WIMAX_RF_QUERY</constant>, just the current state is returned.
16084</para>
16085</refsect1>
16086<refsect1>
16087<title>NOTE</title>
16088<para>
16089   </para><para>
16090
16091   This call will block until the operation is complete.
16092</para>
16093</refsect1>
16094</refentry>
16095
16096<!-- net/wimax/stack.c -->
16097<refentry id="API-wimax-state-change">
16098<refentryinfo>
16099 <title>LINUX</title>
16100 <productname>Kernel Hackers Manual</productname>
16101 <date>July 2017</date>
16102</refentryinfo>
16103<refmeta>
16104 <refentrytitle><phrase>wimax_state_change</phrase></refentrytitle>
16105 <manvolnum>9</manvolnum>
16106 <refmiscinfo class="version">4.1.27</refmiscinfo>
16107</refmeta>
16108<refnamediv>
16109 <refname>wimax_state_change</refname>
16110 <refpurpose>
16111  Set the current state of a WiMAX device
16112 </refpurpose>
16113</refnamediv>
16114<refsynopsisdiv>
16115 <title>Synopsis</title>
16116  <funcsynopsis><funcprototype>
16117   <funcdef>void <function>wimax_state_change </function></funcdef>
16118   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
16119   <paramdef>enum wimax_st <parameter>new_state</parameter></paramdef>
16120  </funcprototype></funcsynopsis>
16121</refsynopsisdiv>
16122<refsect1>
16123 <title>Arguments</title>
16124 <variablelist>
16125  <varlistentry>
16126   <term><parameter>wimax_dev</parameter></term>
16127   <listitem>
16128    <para>
16129     WiMAX device descriptor (properly referenced)
16130    </para>
16131   </listitem>
16132  </varlistentry>
16133  <varlistentry>
16134   <term><parameter>new_state</parameter></term>
16135   <listitem>
16136    <para>
16137     New state to switch to
16138    </para>
16139   </listitem>
16140  </varlistentry>
16141 </variablelist>
16142</refsect1>
16143<refsect1>
16144<title>Description</title>
16145<para>
16146   This implements the state changes for the wimax devices. It will
16147   </para><para>
16148
16149   - verify that the state transition is legal (for now it'll just
16150   print a warning if not) according to the table in
16151   linux/wimax.h's documentation for 'enum wimax_st'.
16152   </para><para>
16153
16154   - perform the actions needed for leaving the current state and
16155   whichever are needed for entering the new state.
16156   </para><para>
16157
16158   - issue a report to user space indicating the new state (and an
16159   optional payload with information about the new state).
16160</para>
16161</refsect1>
16162<refsect1>
16163<title>NOTE</title>
16164<para>
16165   <parameter>wimax_dev</parameter> must be locked
16166</para>
16167</refsect1>
16168</refentry>
16169
16170<refentry id="API-wimax-state-get">
16171<refentryinfo>
16172 <title>LINUX</title>
16173 <productname>Kernel Hackers Manual</productname>
16174 <date>July 2017</date>
16175</refentryinfo>
16176<refmeta>
16177 <refentrytitle><phrase>wimax_state_get</phrase></refentrytitle>
16178 <manvolnum>9</manvolnum>
16179 <refmiscinfo class="version">4.1.27</refmiscinfo>
16180</refmeta>
16181<refnamediv>
16182 <refname>wimax_state_get</refname>
16183 <refpurpose>
16184     Return the current state of a WiMAX device
16185 </refpurpose>
16186</refnamediv>
16187<refsynopsisdiv>
16188 <title>Synopsis</title>
16189  <funcsynopsis><funcprototype>
16190   <funcdef>enum wimax_st <function>wimax_state_get </function></funcdef>
16191   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
16192  </funcprototype></funcsynopsis>
16193</refsynopsisdiv>
16194<refsect1>
16195 <title>Arguments</title>
16196 <variablelist>
16197  <varlistentry>
16198   <term><parameter>wimax_dev</parameter></term>
16199   <listitem>
16200    <para>
16201     WiMAX device descriptor
16202    </para>
16203   </listitem>
16204  </varlistentry>
16205 </variablelist>
16206</refsect1>
16207<refsect1>
16208<title>Returns</title>
16209<para>
16210   Current state of the device according to its driver.
16211</para>
16212</refsect1>
16213</refentry>
16214
16215<refentry id="API-wimax-dev-init">
16216<refentryinfo>
16217 <title>LINUX</title>
16218 <productname>Kernel Hackers Manual</productname>
16219 <date>July 2017</date>
16220</refentryinfo>
16221<refmeta>
16222 <refentrytitle><phrase>wimax_dev_init</phrase></refentrytitle>
16223 <manvolnum>9</manvolnum>
16224 <refmiscinfo class="version">4.1.27</refmiscinfo>
16225</refmeta>
16226<refnamediv>
16227 <refname>wimax_dev_init</refname>
16228 <refpurpose>
16229     initialize a newly allocated instance
16230 </refpurpose>
16231</refnamediv>
16232<refsynopsisdiv>
16233 <title>Synopsis</title>
16234  <funcsynopsis><funcprototype>
16235   <funcdef>void <function>wimax_dev_init </function></funcdef>
16236   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
16237  </funcprototype></funcsynopsis>
16238</refsynopsisdiv>
16239<refsect1>
16240 <title>Arguments</title>
16241 <variablelist>
16242  <varlistentry>
16243   <term><parameter>wimax_dev</parameter></term>
16244   <listitem>
16245    <para>
16246     WiMAX device descriptor to initialize.
16247    </para>
16248   </listitem>
16249  </varlistentry>
16250 </variablelist>
16251</refsect1>
16252<refsect1>
16253<title>Description</title>
16254<para>
16255   Initializes fields of a freshly allocated <parameter>wimax_dev</parameter> instance. This
16256   function assumes that after allocation, the memory occupied by
16257   <parameter>wimax_dev</parameter> was zeroed.
16258</para>
16259</refsect1>
16260</refentry>
16261
16262<refentry id="API-wimax-dev-add">
16263<refentryinfo>
16264 <title>LINUX</title>
16265 <productname>Kernel Hackers Manual</productname>
16266 <date>July 2017</date>
16267</refentryinfo>
16268<refmeta>
16269 <refentrytitle><phrase>wimax_dev_add</phrase></refentrytitle>
16270 <manvolnum>9</manvolnum>
16271 <refmiscinfo class="version">4.1.27</refmiscinfo>
16272</refmeta>
16273<refnamediv>
16274 <refname>wimax_dev_add</refname>
16275 <refpurpose>
16276     Register a new WiMAX device
16277 </refpurpose>
16278</refnamediv>
16279<refsynopsisdiv>
16280 <title>Synopsis</title>
16281  <funcsynopsis><funcprototype>
16282   <funcdef>int <function>wimax_dev_add </function></funcdef>
16283   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
16284   <paramdef>struct net_device * <parameter>net_dev</parameter></paramdef>
16285  </funcprototype></funcsynopsis>
16286</refsynopsisdiv>
16287<refsect1>
16288 <title>Arguments</title>
16289 <variablelist>
16290  <varlistentry>
16291   <term><parameter>wimax_dev</parameter></term>
16292   <listitem>
16293    <para>
16294     WiMAX device descriptor (as embedded in your <parameter>net_dev</parameter>'s
16295     priv data). You must have called <function>wimax_dev_init</function> on it before.
16296    </para>
16297   </listitem>
16298  </varlistentry>
16299  <varlistentry>
16300   <term><parameter>net_dev</parameter></term>
16301   <listitem>
16302    <para>
16303     net device the <parameter>wimax_dev</parameter> is associated with. The
16304     function expects <function>SET_NETDEV_DEV</function> and <function>register_netdev</function> were
16305     already called on it.
16306    </para>
16307   </listitem>
16308  </varlistentry>
16309 </variablelist>
16310</refsect1>
16311<refsect1>
16312<title>Description</title>
16313<para>
16314   Registers the new WiMAX device, sets up the user-kernel control
16315   interface (generic netlink) and common WiMAX infrastructure.
16316   </para><para>
16317
16318   Note that the parts that will allow interaction with user space are
16319   setup at the very end, when the rest is in place, as once that
16320   happens, the driver might get user space control requests via
16321   netlink or from debugfs that might translate into calls into
16322   wimax_dev-&gt;op_*().
16323</para>
16324</refsect1>
16325</refentry>
16326
16327<refentry id="API-wimax-dev-rm">
16328<refentryinfo>
16329 <title>LINUX</title>
16330 <productname>Kernel Hackers Manual</productname>
16331 <date>July 2017</date>
16332</refentryinfo>
16333<refmeta>
16334 <refentrytitle><phrase>wimax_dev_rm</phrase></refentrytitle>
16335 <manvolnum>9</manvolnum>
16336 <refmiscinfo class="version">4.1.27</refmiscinfo>
16337</refmeta>
16338<refnamediv>
16339 <refname>wimax_dev_rm</refname>
16340 <refpurpose>
16341     Unregister an existing WiMAX device
16342 </refpurpose>
16343</refnamediv>
16344<refsynopsisdiv>
16345 <title>Synopsis</title>
16346  <funcsynopsis><funcprototype>
16347   <funcdef>void <function>wimax_dev_rm </function></funcdef>
16348   <paramdef>struct wimax_dev * <parameter>wimax_dev</parameter></paramdef>
16349  </funcprototype></funcsynopsis>
16350</refsynopsisdiv>
16351<refsect1>
16352 <title>Arguments</title>
16353 <variablelist>
16354  <varlistentry>
16355   <term><parameter>wimax_dev</parameter></term>
16356   <listitem>
16357    <para>
16358     WiMAX device descriptor
16359    </para>
16360   </listitem>
16361  </varlistentry>
16362 </variablelist>
16363</refsect1>
16364<refsect1>
16365<title>Description</title>
16366<para>
16367   Unregisters a WiMAX device previously registered for use with
16368   <function>wimax_add_rm</function>.
16369   </para><para>
16370
16371   IMPORTANT! Must call before calling <function>unregister_netdev</function>.
16372   </para><para>
16373
16374   After this function returns, you will not get any more user space
16375   control requests (via netlink or debugfs) and thus to wimax_dev-&gt;ops.
16376   </para><para>
16377
16378   Reentrancy control is ensured by setting the state to
16379   <constant>__WIMAX_ST_QUIESCING</constant>. rfkill operations coming through
16380   wimax_*rfkill*() will be stopped by the quiescing state; ops coming
16381   from the rfkill subsystem will be stopped by the support being
16382   removed by <function>wimax_rfkill_rm</function>.
16383</para>
16384</refsect1>
16385</refentry>
16386
16387<!-- include/net/wimax.h -->
16388<refentry id="API-struct-wimax-dev">
16389<refentryinfo>
16390 <title>LINUX</title>
16391 <productname>Kernel Hackers Manual</productname>
16392 <date>July 2017</date>
16393</refentryinfo>
16394<refmeta>
16395 <refentrytitle><phrase>struct wimax_dev</phrase></refentrytitle>
16396 <manvolnum>9</manvolnum>
16397 <refmiscinfo class="version">4.1.27</refmiscinfo>
16398</refmeta>
16399<refnamediv>
16400 <refname>struct wimax_dev</refname>
16401 <refpurpose>
16402  Generic WiMAX device
16403 </refpurpose>
16404</refnamediv>
16405<refsynopsisdiv>
16406 <title>Synopsis</title>
16407  <programlisting>
16408struct wimax_dev {
16409  struct net_device * net_dev;
16410  struct list_head id_table_node;
16411  struct mutex mutex;
16412  struct mutex mutex_reset;
16413  enum wimax_st state;
16414  int (* op_msg_from_user) (struct wimax_dev *wimax_dev,const char *,const void *, size_t,const struct genl_info *info);
16415  int (* op_rfkill_sw_toggle) (struct wimax_dev *wimax_dev,enum wimax_rf_state);
16416  int (* op_reset) (struct wimax_dev *wimax_dev);
16417  struct rfkill * rfkill;
16418  unsigned int rf_hw;
16419  unsigned int rf_sw;
16420  char name[32];
16421  struct dentry * debugfs_dentry;
16422};  </programlisting>
16423</refsynopsisdiv>
16424 <refsect1>
16425  <title>Members</title>
16426  <variablelist>
16427    <varlistentry>      <term>net_dev</term>
16428      <listitem><para>
16429[fill] Pointer to the <structname>struct net_device</structname> this WiMAX
16430device implements.
16431      </para></listitem>
16432    </varlistentry>
16433    <varlistentry>      <term>id_table_node</term>
16434      <listitem><para>
16435[private] link to the list of wimax devices kept by
16436id-table.c. Protected by it's own spinlock.
16437      </para></listitem>
16438    </varlistentry>
16439    <varlistentry>      <term>mutex</term>
16440      <listitem><para>
16441[private] Serializes all concurrent access and execution of
16442operations.
16443      </para></listitem>
16444    </varlistentry>
16445    <varlistentry>      <term>mutex_reset</term>
16446      <listitem><para>
16447[private] Serializes reset operations. Needs to be a
16448different mutex because as part of the reset operation, the
16449driver has to call back into the stack to do things such as
16450state change, that require wimax_dev-&gt;mutex.
16451      </para></listitem>
16452    </varlistentry>
16453    <varlistentry>      <term>state</term>
16454      <listitem><para>
16455[private] Current state of the WiMAX device.
16456      </para></listitem>
16457    </varlistentry>
16458    <varlistentry>      <term>op_msg_from_user</term>
16459      <listitem><para>
16460[fill] Driver-specific operation to
16461handle a raw message from user space to the driver. The
16462driver can send messages to user space using with
16463<function>wimax_msg_to_user</function>.
16464      </para></listitem>
16465    </varlistentry>
16466    <varlistentry>      <term>op_rfkill_sw_toggle</term>
16467      <listitem><para>
16468[fill] Driver-specific operation to act on
16469userspace (or any other agent) requesting the WiMAX device to
16470change the RF Kill software switch (WIMAX_RF_ON or
16471WIMAX_RF_OFF).
16472If such hardware support is not present, it is assumed the
16473radio cannot be switched off and it is always on (and the stack
16474will error out when trying to switch it off). In such case,
16475this function pointer can be left as NULL.
16476      </para></listitem>
16477    </varlistentry>
16478    <varlistentry>      <term>op_reset</term>
16479      <listitem><para>
16480[fill] Driver specific operation to reset the
16481device.
16482This operation should always attempt first a warm reset that
16483does not disconnect the device from the bus and return 0.
16484If that fails, it should resort to some sort of cold or bus
16485reset (even if it implies a bus disconnection and device
16486disappearance). In that case, -ENODEV should be returned to
16487indicate the device is gone.
16488This operation has to be synchronous, and return only when the
16489reset is complete. In case of having had to resort to bus/cold
16490reset implying a device disconnection, the call is allowed to
16491return immediately.
16492      </para></listitem>
16493    </varlistentry>
16494    <varlistentry>      <term>rfkill</term>
16495      <listitem><para>
16496[private] integration into the RF-Kill infrastructure.
16497      </para></listitem>
16498    </varlistentry>
16499    <varlistentry>      <term>rf_hw</term>
16500      <listitem><para>
16501[private] State of the hardware radio switch (OFF/ON)
16502      </para></listitem>
16503    </varlistentry>
16504    <varlistentry>      <term>rf_sw</term>
16505      <listitem><para>
16506[private] State of the software radio switch (OFF/ON)
16507      </para></listitem>
16508    </varlistentry>
16509    <varlistentry>      <term>name[32]</term>
16510      <listitem><para>
16511[fill] A way to identify this device. We need to register a
16512name with many subsystems (rfkill, workqueue creation, etc).
16513We can't use the network device name as that
16514might change and in some instances we don't know it yet (until
16515we don't call <function>register_netdev</function>). So we generate an unique one
16516using the driver name and device bus id, place it here and use
16517it across the board. Recommended naming:
16518DRIVERNAME-BUSNAME:BUSID (dev-&gt;bus-&gt;name, dev-&gt;bus_id).
16519      </para></listitem>
16520    </varlistentry>
16521    <varlistentry>      <term>debugfs_dentry</term>
16522      <listitem><para>
16523[private] Used to hook up a debugfs entry. This
16524shows up in the debugfs root as wimax\:DEVICENAME.
16525      </para></listitem>
16526    </varlistentry>
16527  </variablelist>
16528 </refsect1>
16529<refsect1>
16530<title>NOTE</title>
16531<para>
16532   wimax_dev-&gt;mutex is NOT locked when this op is being
16533   called; however, wimax_dev-&gt;mutex_reset IS locked to ensure
16534   serialization of calls to <function>wimax_reset</function>.
16535   See <function>wimax_reset</function>'s documentation.
16536</para>
16537</refsect1>
16538<refsect1>
16539<title>Description</title>
16540<para>
16541   This structure defines a common interface to access all WiMAX
16542   devices from different vendors and provides a common API as well as
16543   a free-form device-specific messaging channel.
16544</para>
16545</refsect1>
16546<refsect1>
16547<title>Usage</title>
16548<para>
16549   1. Embed a <structname>struct wimax_dev</structname> at *the beginning* the network
16550   device structure so that <function>netdev_priv</function> points to it.
16551   </para><para>
16552
16553   2. <function>memset</function> it to zero
16554   </para><para>
16555
16556   3. Initialize with <function>wimax_dev_init</function>. This will leave the WiMAX
16557   device in the <constant>__WIMAX_ST_NULL</constant> state.
16558   </para><para>
16559
16560   4. Fill all the fields marked with [fill]; once called
16561   <function>wimax_dev_add</function>, those fields CANNOT be modified.
16562   </para><para>
16563
16564   5. Call <function>wimax_dev_add</function> *after* registering the network
16565   device. This will leave the WiMAX device in the <constant>WIMAX_ST_DOWN</constant>
16566   state.
16567   Protect the driver's net_device-&gt;<function>open</function> against succeeding if
16568   the wimax device state is lower than <constant>WIMAX_ST_DOWN</constant>.
16569   </para><para>
16570
16571   6. Select when the device is going to be turned on/initialized;
16572   for example, it could be initialized on 'ifconfig up' (when the
16573   netdev op '<function>open</function>' is called on the driver).
16574   </para><para>
16575
16576   When the device is initialized (at `ifconfig up` time, or right
16577   after calling <function>wimax_dev_add</function> from <function>_probe</function>, make sure the
16578   following steps are taken
16579   </para><para>
16580
16581   a. Move the device to <constant>WIMAX_ST_UNINITIALIZED</constant>. This is needed so
16582   some API calls that shouldn't work until the device is ready
16583   can be blocked.
16584   </para><para>
16585
16586   b. Initialize the device. Make sure to turn the SW radio switch
16587   off and move the device to state <constant>WIMAX_ST_RADIO_OFF</constant> when
16588   done. When just initialized, a device should be left in RADIO
16589   OFF state until user space devices to turn it on.
16590   </para><para>
16591
16592   c. Query the device for the state of the hardware rfkill switch
16593   and call <function>wimax_rfkill_report_hw</function> and <function>wimax_rfkill_report_sw</function>
16594   as needed. See below.
16595   </para><para>
16596
16597   <function>wimax_dev_rm</function> undoes before unregistering the network device. Once
16598   <function>wimax_dev_add</function> is called, the driver can get called on the
16599   wimax_dev-&gt;op_* function pointers
16600</para>
16601</refsect1>
16602<refsect1>
16603<title>CONCURRENCY</title>
16604<para>
16605   </para><para>
16606
16607   The stack provides a mutex for each device that will disallow API
16608   calls happening concurrently; thus, op calls into the driver
16609   through the wimax_dev-&gt;op*() function pointers will always be
16610   serialized and *never* concurrent.
16611   </para><para>
16612
16613   For locking, take wimax_dev-&gt;mutex is taken; (most) operations in
16614   the API have to check for <function>wimax_dev_is_ready</function> to return 0 before
16615   continuing (this is done internally).
16616</para>
16617</refsect1>
16618<refsect1>
16619<title>REFERENCE COUNTING</title>
16620<para>
16621   </para><para>
16622
16623   The WiMAX device is reference counted by the associated network
16624   device. The only operation that can be used to reference the device
16625   is <function>wimax_dev_get_by_genl_info</function>, and the reference it acquires has
16626   to be released with dev_put(wimax_dev-&gt;net_dev).
16627</para>
16628</refsect1>
16629<refsect1>
16630<title>RFKILL</title>
16631<para>
16632   </para><para>
16633
16634   At startup, both HW and SW radio switchess are assumed to be off.
16635   </para><para>
16636
16637   At initialization time [after calling <function>wimax_dev_add</function>], have the
16638   driver query the device for the status of the software and hardware
16639   RF kill switches and call <function>wimax_report_rfkill_hw</function> and
16640   <function>wimax_rfkill_report_sw</function> to indicate their state. If any is
16641   missing, just call it to indicate it is ON (radio always on).
16642   </para><para>
16643
16644   Whenever the driver detects a change in the state of the RF kill
16645   switches, it should call <function>wimax_report_rfkill_hw</function> or
16646   <function>wimax_report_rfkill_sw</function> to report it to the stack.
16647</para>
16648</refsect1>
16649</refentry>
16650
16651<!-- include/uapi/linux/wimax.h -->
16652<refentry id="API-enum-wimax-st">
16653<refentryinfo>
16654 <title>LINUX</title>
16655 <productname>Kernel Hackers Manual</productname>
16656 <date>July 2017</date>
16657</refentryinfo>
16658<refmeta>
16659 <refentrytitle><phrase>enum wimax_st</phrase></refentrytitle>
16660 <manvolnum>9</manvolnum>
16661 <refmiscinfo class="version">4.1.27</refmiscinfo>
16662</refmeta>
16663<refnamediv>
16664 <refname>enum wimax_st</refname>
16665 <refpurpose>
16666  The different states of a WiMAX device
16667 </refpurpose>
16668</refnamediv>
16669<refsynopsisdiv>
16670 <title>Synopsis</title>
16671  <programlisting>
16672enum wimax_st {
16673  __WIMAX_ST_NULL,
16674  WIMAX_ST_DOWN,
16675  __WIMAX_ST_QUIESCING,
16676  WIMAX_ST_UNINITIALIZED,
16677  WIMAX_ST_RADIO_OFF,
16678  WIMAX_ST_READY,
16679  WIMAX_ST_SCANNING,
16680  WIMAX_ST_CONNECTING,
16681  WIMAX_ST_CONNECTED,
16682  __WIMAX_ST_INVALID
16683};  </programlisting>
16684</refsynopsisdiv>
16685<refsect1>
16686 <title>Constants</title>
16687  <variablelist>
16688    <varlistentry>      <term>__WIMAX_ST_NULL</term>
16689      <listitem><para>
16690The device structure has been allocated and zeroed,
16691but still <function>wimax_dev_add</function> hasn't been called. There is no state.
16692      </para></listitem>
16693    </varlistentry>
16694    <varlistentry>      <term>WIMAX_ST_DOWN</term>
16695      <listitem><para>
16696The device has been registered with the WiMAX and
16697networking stacks, but it is not initialized (normally that is
16698done with 'ifconfig DEV up' [or equivalent], which can upload
16699firmware and enable communications with the device).
16700In this state, the device is powered down and using as less
16701power as possible.
16702This state is the default after a call to <function>wimax_dev_add</function>. It
16703is ok to have drivers move directly to <constant>WIMAX_ST_UNINITIALIZED</constant>
16704or <constant>WIMAX_ST_RADIO_OFF</constant> in <function>_probe</function> after the call to
16705<function>wimax_dev_add</function>.
16706It is recommended that the driver leaves this state when
16707calling 'ifconfig DEV up' and enters it back on 'ifconfig DEV
16708down'.
16709      </para></listitem>
16710    </varlistentry>
16711    <varlistentry>      <term>__WIMAX_ST_QUIESCING</term>
16712      <listitem><para>
16713The device is being torn down, so no API
16714operations are allowed to proceed except the ones needed to
16715complete the device clean up process.
16716      </para></listitem>
16717    </varlistentry>
16718    <varlistentry>      <term>WIMAX_ST_UNINITIALIZED</term>
16719      <listitem><para>
16720[optional] Communication with the device
16721is setup, but the device still requires some configuration
16722before being operational.
16723Some WiMAX API calls might work.
16724      </para></listitem>
16725    </varlistentry>
16726    <varlistentry>      <term>WIMAX_ST_RADIO_OFF</term>
16727      <listitem><para>
16728The device is fully up; radio is off (wether
16729by hardware or software switches).
16730It is recommended to always leave the device in this state
16731after initialization.
16732      </para></listitem>
16733    </varlistentry>
16734    <varlistentry>      <term>WIMAX_ST_READY</term>
16735      <listitem><para>
16736The device is fully up and radio is on.
16737      </para></listitem>
16738    </varlistentry>
16739    <varlistentry>      <term>WIMAX_ST_SCANNING</term>
16740      <listitem><para>
16741[optional] The device has been instructed to
16742scan. In this state, the device cannot be actively connected to
16743a network.
16744      </para></listitem>
16745    </varlistentry>
16746    <varlistentry>      <term>WIMAX_ST_CONNECTING</term>
16747      <listitem><para>
16748The device is connecting to a network. This
16749state exists because in some devices, the connect process can
16750include a number of negotiations between user space, kernel
16751space and the device. User space needs to know what the device
16752is doing. If the connect sequence in a device is atomic and
16753fast, the device can transition directly to CONNECTED
16754      </para></listitem>
16755    </varlistentry>
16756    <varlistentry>      <term>WIMAX_ST_CONNECTED</term>
16757      <listitem><para>
16758The device is connected to a network.
16759      </para></listitem>
16760    </varlistentry>
16761    <varlistentry>      <term>__WIMAX_ST_INVALID</term>
16762      <listitem><para>
16763This is an invalid state used to mark the
16764maximum numeric value of states.
16765      </para></listitem>
16766    </varlistentry>
16767  </variablelist>
16768</refsect1>
16769<refsect1>
16770<title>Description</title>
16771<para>
16772   </para><para>
16773
16774   Transitions from one state to another one are atomic and can only
16775   be caused in kernel space with <function>wimax_state_change</function>. To read the
16776   state, use <function>wimax_state_get</function>.
16777   </para><para>
16778
16779   States starting with __ are internal and shall not be used or
16780   referred to by drivers or userspace. They look ugly, but that's the
16781   point -- if any use is made non-internal to the stack, it is easier
16782   to catch on review.
16783   </para><para>
16784
16785   All API operations [with well defined exceptions] will take the
16786   device mutex before starting and then check the state. If the state
16787   is <constant>__WIMAX_ST_NULL</constant>, <constant>WIMAX_ST_DOWN</constant>, <constant>WIMAX_ST_UNINITIALIZED</constant> or
16788   <constant>__WIMAX_ST_QUIESCING</constant>, it will drop the lock and quit with
16789   -<constant>EINVAL</constant>, -<constant>ENOMEDIUM</constant>, -<constant>ENOTCONN</constant> or -<constant>ESHUTDOWN</constant>.
16790   </para><para>
16791
16792   The order of the definitions is important, so we can do numerical
16793   comparisons (eg: &lt; <constant>WIMAX_ST_RADIO_OFF</constant> means the device is not ready
16794   to operate).
16795</para>
16796</refsect1>
16797</refentry>
16798
16799     </sect1>
16800  </chapter>
16801
16802  <chapter id="netdev">
16803     <title>Network device support</title>
16804     <sect1><title>Driver Support</title>
16805<!-- net/core/dev.c -->
16806<refentry id="API-dev-add-pack">
16807<refentryinfo>
16808 <title>LINUX</title>
16809 <productname>Kernel Hackers Manual</productname>
16810 <date>July 2017</date>
16811</refentryinfo>
16812<refmeta>
16813 <refentrytitle><phrase>dev_add_pack</phrase></refentrytitle>
16814 <manvolnum>9</manvolnum>
16815 <refmiscinfo class="version">4.1.27</refmiscinfo>
16816</refmeta>
16817<refnamediv>
16818 <refname>dev_add_pack</refname>
16819 <refpurpose>
16820  add packet handler
16821 </refpurpose>
16822</refnamediv>
16823<refsynopsisdiv>
16824 <title>Synopsis</title>
16825  <funcsynopsis><funcprototype>
16826   <funcdef>void <function>dev_add_pack </function></funcdef>
16827   <paramdef>struct packet_type * <parameter>pt</parameter></paramdef>
16828  </funcprototype></funcsynopsis>
16829</refsynopsisdiv>
16830<refsect1>
16831 <title>Arguments</title>
16832 <variablelist>
16833  <varlistentry>
16834   <term><parameter>pt</parameter></term>
16835   <listitem>
16836    <para>
16837     packet type declaration
16838    </para>
16839   </listitem>
16840  </varlistentry>
16841 </variablelist>
16842</refsect1>
16843<refsect1>
16844<title>Description</title>
16845<para>
16846   Add a protocol handler to the networking stack. The passed <structname>packet_type</structname>
16847   is linked into kernel lists and may not be freed until it has been
16848   removed from the kernel lists.
16849   </para><para>
16850
16851   This call does not sleep therefore it can not
16852   guarantee all CPU's that are in middle of receiving packets
16853   will see the new packet type (until the next received packet).
16854</para>
16855</refsect1>
16856</refentry>
16857
16858<refentry id="API---dev-remove-pack">
16859<refentryinfo>
16860 <title>LINUX</title>
16861 <productname>Kernel Hackers Manual</productname>
16862 <date>July 2017</date>
16863</refentryinfo>
16864<refmeta>
16865 <refentrytitle><phrase>__dev_remove_pack</phrase></refentrytitle>
16866 <manvolnum>9</manvolnum>
16867 <refmiscinfo class="version">4.1.27</refmiscinfo>
16868</refmeta>
16869<refnamediv>
16870 <refname>__dev_remove_pack</refname>
16871 <refpurpose>
16872     remove packet handler
16873 </refpurpose>
16874</refnamediv>
16875<refsynopsisdiv>
16876 <title>Synopsis</title>
16877  <funcsynopsis><funcprototype>
16878   <funcdef>void <function>__dev_remove_pack </function></funcdef>
16879   <paramdef>struct packet_type * <parameter>pt</parameter></paramdef>
16880  </funcprototype></funcsynopsis>
16881</refsynopsisdiv>
16882<refsect1>
16883 <title>Arguments</title>
16884 <variablelist>
16885  <varlistentry>
16886   <term><parameter>pt</parameter></term>
16887   <listitem>
16888    <para>
16889     packet type declaration
16890    </para>
16891   </listitem>
16892  </varlistentry>
16893 </variablelist>
16894</refsect1>
16895<refsect1>
16896<title>Description</title>
16897<para>
16898   Remove a protocol handler that was previously added to the kernel
16899   protocol handlers by <function>dev_add_pack</function>. The passed <structname>packet_type</structname> is removed
16900   from the kernel lists and can be freed or reused once this function
16901   returns.
16902   </para><para>
16903
16904   The packet type might still be in use by receivers
16905   and must not be freed until after all the CPU's have gone
16906   through a quiescent state.
16907</para>
16908</refsect1>
16909</refentry>
16910
16911<refentry id="API-dev-remove-pack">
16912<refentryinfo>
16913 <title>LINUX</title>
16914 <productname>Kernel Hackers Manual</productname>
16915 <date>July 2017</date>
16916</refentryinfo>
16917<refmeta>
16918 <refentrytitle><phrase>dev_remove_pack</phrase></refentrytitle>
16919 <manvolnum>9</manvolnum>
16920 <refmiscinfo class="version">4.1.27</refmiscinfo>
16921</refmeta>
16922<refnamediv>
16923 <refname>dev_remove_pack</refname>
16924 <refpurpose>
16925     remove packet handler
16926 </refpurpose>
16927</refnamediv>
16928<refsynopsisdiv>
16929 <title>Synopsis</title>
16930  <funcsynopsis><funcprototype>
16931   <funcdef>void <function>dev_remove_pack </function></funcdef>
16932   <paramdef>struct packet_type * <parameter>pt</parameter></paramdef>
16933  </funcprototype></funcsynopsis>
16934</refsynopsisdiv>
16935<refsect1>
16936 <title>Arguments</title>
16937 <variablelist>
16938  <varlistentry>
16939   <term><parameter>pt</parameter></term>
16940   <listitem>
16941    <para>
16942     packet type declaration
16943    </para>
16944   </listitem>
16945  </varlistentry>
16946 </variablelist>
16947</refsect1>
16948<refsect1>
16949<title>Description</title>
16950<para>
16951   Remove a protocol handler that was previously added to the kernel
16952   protocol handlers by <function>dev_add_pack</function>. The passed <structname>packet_type</structname> is removed
16953   from the kernel lists and can be freed or reused once this function
16954   returns.
16955   </para><para>
16956
16957   This call sleeps to guarantee that no CPU is looking at the packet
16958   type after return.
16959</para>
16960</refsect1>
16961</refentry>
16962
16963<refentry id="API-dev-add-offload">
16964<refentryinfo>
16965 <title>LINUX</title>
16966 <productname>Kernel Hackers Manual</productname>
16967 <date>July 2017</date>
16968</refentryinfo>
16969<refmeta>
16970 <refentrytitle><phrase>dev_add_offload</phrase></refentrytitle>
16971 <manvolnum>9</manvolnum>
16972 <refmiscinfo class="version">4.1.27</refmiscinfo>
16973</refmeta>
16974<refnamediv>
16975 <refname>dev_add_offload</refname>
16976 <refpurpose>
16977     register offload handlers
16978 </refpurpose>
16979</refnamediv>
16980<refsynopsisdiv>
16981 <title>Synopsis</title>
16982  <funcsynopsis><funcprototype>
16983   <funcdef>void <function>dev_add_offload </function></funcdef>
16984   <paramdef>struct packet_offload * <parameter>po</parameter></paramdef>
16985  </funcprototype></funcsynopsis>
16986</refsynopsisdiv>
16987<refsect1>
16988 <title>Arguments</title>
16989 <variablelist>
16990  <varlistentry>
16991   <term><parameter>po</parameter></term>
16992   <listitem>
16993    <para>
16994     protocol offload declaration
16995    </para>
16996   </listitem>
16997  </varlistentry>
16998 </variablelist>
16999</refsect1>
17000<refsect1>
17001<title>Description</title>
17002<para>
17003   Add protocol offload handlers to the networking stack. The passed
17004   <structname>proto_offload</structname> is linked into kernel lists and may not be freed until
17005   it has been removed from the kernel lists.
17006   </para><para>
17007
17008   This call does not sleep therefore it can not
17009   guarantee all CPU's that are in middle of receiving packets
17010   will see the new offload handlers (until the next received packet).
17011</para>
17012</refsect1>
17013</refentry>
17014
17015<refentry id="API-dev-remove-offload">
17016<refentryinfo>
17017 <title>LINUX</title>
17018 <productname>Kernel Hackers Manual</productname>
17019 <date>July 2017</date>
17020</refentryinfo>
17021<refmeta>
17022 <refentrytitle><phrase>dev_remove_offload</phrase></refentrytitle>
17023 <manvolnum>9</manvolnum>
17024 <refmiscinfo class="version">4.1.27</refmiscinfo>
17025</refmeta>
17026<refnamediv>
17027 <refname>dev_remove_offload</refname>
17028 <refpurpose>
17029     remove packet offload handler
17030 </refpurpose>
17031</refnamediv>
17032<refsynopsisdiv>
17033 <title>Synopsis</title>
17034  <funcsynopsis><funcprototype>
17035   <funcdef>void <function>dev_remove_offload </function></funcdef>
17036   <paramdef>struct packet_offload * <parameter>po</parameter></paramdef>
17037  </funcprototype></funcsynopsis>
17038</refsynopsisdiv>
17039<refsect1>
17040 <title>Arguments</title>
17041 <variablelist>
17042  <varlistentry>
17043   <term><parameter>po</parameter></term>
17044   <listitem>
17045    <para>
17046     packet offload declaration
17047    </para>
17048   </listitem>
17049  </varlistentry>
17050 </variablelist>
17051</refsect1>
17052<refsect1>
17053<title>Description</title>
17054<para>
17055   Remove a packet offload handler that was previously added to the kernel
17056   offload handlers by <function>dev_add_offload</function>. The passed <structname>offload_type</structname> is
17057   removed from the kernel lists and can be freed or reused once this
17058   function returns.
17059   </para><para>
17060
17061   This call sleeps to guarantee that no CPU is looking at the packet
17062   type after return.
17063</para>
17064</refsect1>
17065</refentry>
17066
17067<refentry id="API-netdev-boot-setup-check">
17068<refentryinfo>
17069 <title>LINUX</title>
17070 <productname>Kernel Hackers Manual</productname>
17071 <date>July 2017</date>
17072</refentryinfo>
17073<refmeta>
17074 <refentrytitle><phrase>netdev_boot_setup_check</phrase></refentrytitle>
17075 <manvolnum>9</manvolnum>
17076 <refmiscinfo class="version">4.1.27</refmiscinfo>
17077</refmeta>
17078<refnamediv>
17079 <refname>netdev_boot_setup_check</refname>
17080 <refpurpose>
17081     check boot time settings
17082 </refpurpose>
17083</refnamediv>
17084<refsynopsisdiv>
17085 <title>Synopsis</title>
17086  <funcsynopsis><funcprototype>
17087   <funcdef>int <function>netdev_boot_setup_check </function></funcdef>
17088   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
17089  </funcprototype></funcsynopsis>
17090</refsynopsisdiv>
17091<refsect1>
17092 <title>Arguments</title>
17093 <variablelist>
17094  <varlistentry>
17095   <term><parameter>dev</parameter></term>
17096   <listitem>
17097    <para>
17098     the netdevice
17099    </para>
17100   </listitem>
17101  </varlistentry>
17102 </variablelist>
17103</refsect1>
17104<refsect1>
17105<title>Description</title>
17106<para>
17107   Check boot time settings for the device.
17108   The found settings are set for the device to be used
17109   later in the device probing.
17110   Returns 0 if no settings found, 1 if they are.
17111</para>
17112</refsect1>
17113</refentry>
17114
17115<refentry id="API-dev-get-iflink">
17116<refentryinfo>
17117 <title>LINUX</title>
17118 <productname>Kernel Hackers Manual</productname>
17119 <date>July 2017</date>
17120</refentryinfo>
17121<refmeta>
17122 <refentrytitle><phrase>dev_get_iflink</phrase></refentrytitle>
17123 <manvolnum>9</manvolnum>
17124 <refmiscinfo class="version">4.1.27</refmiscinfo>
17125</refmeta>
17126<refnamediv>
17127 <refname>dev_get_iflink</refname>
17128 <refpurpose>
17129     get 'iflink' value of a interface
17130 </refpurpose>
17131</refnamediv>
17132<refsynopsisdiv>
17133 <title>Synopsis</title>
17134  <funcsynopsis><funcprototype>
17135   <funcdef>int <function>dev_get_iflink </function></funcdef>
17136   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
17137  </funcprototype></funcsynopsis>
17138</refsynopsisdiv>
17139<refsect1>
17140 <title>Arguments</title>
17141 <variablelist>
17142  <varlistentry>
17143   <term><parameter>dev</parameter></term>
17144   <listitem>
17145    <para>
17146     targeted interface
17147    </para>
17148   </listitem>
17149  </varlistentry>
17150 </variablelist>
17151</refsect1>
17152<refsect1>
17153<title>Description</title>
17154<para>
17155   Indicates the ifindex the interface is linked to.
17156   Physical interfaces have the same 'ifindex' and 'iflink' values.
17157</para>
17158</refsect1>
17159</refentry>
17160
17161<refentry id="API---dev-get-by-name">
17162<refentryinfo>
17163 <title>LINUX</title>
17164 <productname>Kernel Hackers Manual</productname>
17165 <date>July 2017</date>
17166</refentryinfo>
17167<refmeta>
17168 <refentrytitle><phrase>__dev_get_by_name</phrase></refentrytitle>
17169 <manvolnum>9</manvolnum>
17170 <refmiscinfo class="version">4.1.27</refmiscinfo>
17171</refmeta>
17172<refnamediv>
17173 <refname>__dev_get_by_name</refname>
17174 <refpurpose>
17175     find a device by its name
17176 </refpurpose>
17177</refnamediv>
17178<refsynopsisdiv>
17179 <title>Synopsis</title>
17180  <funcsynopsis><funcprototype>
17181   <funcdef>struct net_device * <function>__dev_get_by_name </function></funcdef>
17182   <paramdef>struct net * <parameter>net</parameter></paramdef>
17183   <paramdef>const char * <parameter>name</parameter></paramdef>
17184  </funcprototype></funcsynopsis>
17185</refsynopsisdiv>
17186<refsect1>
17187 <title>Arguments</title>
17188 <variablelist>
17189  <varlistentry>
17190   <term><parameter>net</parameter></term>
17191   <listitem>
17192    <para>
17193     the applicable net namespace
17194    </para>
17195   </listitem>
17196  </varlistentry>
17197  <varlistentry>
17198   <term><parameter>name</parameter></term>
17199   <listitem>
17200    <para>
17201     name to find
17202    </para>
17203   </listitem>
17204  </varlistentry>
17205 </variablelist>
17206</refsect1>
17207<refsect1>
17208<title>Description</title>
17209<para>
17210   Find an interface by name. Must be called under RTNL semaphore
17211   or <parameter>dev_base_lock</parameter>. If the name is found a pointer to the device
17212   is returned. If the name is not found then <constant>NULL</constant> is returned. The
17213   reference counters are not incremented so the caller must be
17214   careful with locks.
17215</para>
17216</refsect1>
17217</refentry>
17218
17219<refentry id="API-dev-get-by-name-rcu">
17220<refentryinfo>
17221 <title>LINUX</title>
17222 <productname>Kernel Hackers Manual</productname>
17223 <date>July 2017</date>
17224</refentryinfo>
17225<refmeta>
17226 <refentrytitle><phrase>dev_get_by_name_rcu</phrase></refentrytitle>
17227 <manvolnum>9</manvolnum>
17228 <refmiscinfo class="version">4.1.27</refmiscinfo>
17229</refmeta>
17230<refnamediv>
17231 <refname>dev_get_by_name_rcu</refname>
17232 <refpurpose>
17233     find a device by its name
17234 </refpurpose>
17235</refnamediv>
17236<refsynopsisdiv>
17237 <title>Synopsis</title>
17238  <funcsynopsis><funcprototype>
17239   <funcdef>struct net_device * <function>dev_get_by_name_rcu </function></funcdef>
17240   <paramdef>struct net * <parameter>net</parameter></paramdef>
17241   <paramdef>const char * <parameter>name</parameter></paramdef>
17242  </funcprototype></funcsynopsis>
17243</refsynopsisdiv>
17244<refsect1>
17245 <title>Arguments</title>
17246 <variablelist>
17247  <varlistentry>
17248   <term><parameter>net</parameter></term>
17249   <listitem>
17250    <para>
17251     the applicable net namespace
17252    </para>
17253   </listitem>
17254  </varlistentry>
17255  <varlistentry>
17256   <term><parameter>name</parameter></term>
17257   <listitem>
17258    <para>
17259     name to find
17260    </para>
17261   </listitem>
17262  </varlistentry>
17263 </variablelist>
17264</refsect1>
17265<refsect1>
17266<title>Description</title>
17267<para>
17268   Find an interface by name.
17269   If the name is found a pointer to the device is returned.
17270   If the name is not found then <constant>NULL</constant> is returned.
17271   The reference counters are not incremented so the caller must be
17272   careful with locks. The caller must hold RCU lock.
17273</para>
17274</refsect1>
17275</refentry>
17276
17277<refentry id="API-dev-get-by-name">
17278<refentryinfo>
17279 <title>LINUX</title>
17280 <productname>Kernel Hackers Manual</productname>
17281 <date>July 2017</date>
17282</refentryinfo>
17283<refmeta>
17284 <refentrytitle><phrase>dev_get_by_name</phrase></refentrytitle>
17285 <manvolnum>9</manvolnum>
17286 <refmiscinfo class="version">4.1.27</refmiscinfo>
17287</refmeta>
17288<refnamediv>
17289 <refname>dev_get_by_name</refname>
17290 <refpurpose>
17291     find a device by its name
17292 </refpurpose>
17293</refnamediv>
17294<refsynopsisdiv>
17295 <title>Synopsis</title>
17296  <funcsynopsis><funcprototype>
17297   <funcdef>struct net_device * <function>dev_get_by_name </function></funcdef>
17298   <paramdef>struct net * <parameter>net</parameter></paramdef>
17299   <paramdef>const char * <parameter>name</parameter></paramdef>
17300  </funcprototype></funcsynopsis>
17301</refsynopsisdiv>
17302<refsect1>
17303 <title>Arguments</title>
17304 <variablelist>
17305  <varlistentry>
17306   <term><parameter>net</parameter></term>
17307   <listitem>
17308    <para>
17309     the applicable net namespace
17310    </para>
17311   </listitem>
17312  </varlistentry>
17313  <varlistentry>
17314   <term><parameter>name</parameter></term>
17315   <listitem>
17316    <para>
17317     name to find
17318    </para>
17319   </listitem>
17320  </varlistentry>
17321 </variablelist>
17322</refsect1>
17323<refsect1>
17324<title>Description</title>
17325<para>
17326   Find an interface by name. This can be called from any
17327   context and does its own locking. The returned handle has
17328   the usage count incremented and the caller must use <function>dev_put</function> to
17329   release it when it is no longer needed. <constant>NULL</constant> is returned if no
17330   matching device is found.
17331</para>
17332</refsect1>
17333</refentry>
17334
17335<refentry id="API---dev-get-by-index">
17336<refentryinfo>
17337 <title>LINUX</title>
17338 <productname>Kernel Hackers Manual</productname>
17339 <date>July 2017</date>
17340</refentryinfo>
17341<refmeta>
17342 <refentrytitle><phrase>__dev_get_by_index</phrase></refentrytitle>
17343 <manvolnum>9</manvolnum>
17344 <refmiscinfo class="version">4.1.27</refmiscinfo>
17345</refmeta>
17346<refnamediv>
17347 <refname>__dev_get_by_index</refname>
17348 <refpurpose>
17349     find a device by its ifindex
17350 </refpurpose>
17351</refnamediv>
17352<refsynopsisdiv>
17353 <title>Synopsis</title>
17354  <funcsynopsis><funcprototype>
17355   <funcdef>struct net_device * <function>__dev_get_by_index </function></funcdef>
17356   <paramdef>struct net * <parameter>net</parameter></paramdef>
17357   <paramdef>int <parameter>ifindex</parameter></paramdef>
17358  </funcprototype></funcsynopsis>
17359</refsynopsisdiv>
17360<refsect1>
17361 <title>Arguments</title>
17362 <variablelist>
17363  <varlistentry>
17364   <term><parameter>net</parameter></term>
17365   <listitem>
17366    <para>
17367     the applicable net namespace
17368    </para>
17369   </listitem>
17370  </varlistentry>
17371  <varlistentry>
17372   <term><parameter>ifindex</parameter></term>
17373   <listitem>
17374    <para>
17375     index of device
17376    </para>
17377   </listitem>
17378  </varlistentry>
17379 </variablelist>
17380</refsect1>
17381<refsect1>
17382<title>Description</title>
17383<para>
17384   Search for an interface by index. Returns <constant>NULL</constant> if the device
17385   is not found or a pointer to the device. The device has not
17386   had its reference counter increased so the caller must be careful
17387   about locking. The caller must hold either the RTNL semaphore
17388   or <parameter>dev_base_lock</parameter>.
17389</para>
17390</refsect1>
17391</refentry>
17392
17393<refentry id="API-dev-get-by-index-rcu">
17394<refentryinfo>
17395 <title>LINUX</title>
17396 <productname>Kernel Hackers Manual</productname>
17397 <date>July 2017</date>
17398</refentryinfo>
17399<refmeta>
17400 <refentrytitle><phrase>dev_get_by_index_rcu</phrase></refentrytitle>
17401 <manvolnum>9</manvolnum>
17402 <refmiscinfo class="version">4.1.27</refmiscinfo>
17403</refmeta>
17404<refnamediv>
17405 <refname>dev_get_by_index_rcu</refname>
17406 <refpurpose>
17407     find a device by its ifindex
17408 </refpurpose>
17409</refnamediv>
17410<refsynopsisdiv>
17411 <title>Synopsis</title>
17412  <funcsynopsis><funcprototype>
17413   <funcdef>struct net_device * <function>dev_get_by_index_rcu </function></funcdef>
17414   <paramdef>struct net * <parameter>net</parameter></paramdef>
17415   <paramdef>int <parameter>ifindex</parameter></paramdef>
17416  </funcprototype></funcsynopsis>
17417</refsynopsisdiv>
17418<refsect1>
17419 <title>Arguments</title>
17420 <variablelist>
17421  <varlistentry>
17422   <term><parameter>net</parameter></term>
17423   <listitem>
17424    <para>
17425     the applicable net namespace
17426    </para>
17427   </listitem>
17428  </varlistentry>
17429  <varlistentry>
17430   <term><parameter>ifindex</parameter></term>
17431   <listitem>
17432    <para>
17433     index of device
17434    </para>
17435   </listitem>
17436  </varlistentry>
17437 </variablelist>
17438</refsect1>
17439<refsect1>
17440<title>Description</title>
17441<para>
17442   Search for an interface by index. Returns <constant>NULL</constant> if the device
17443   is not found or a pointer to the device. The device has not
17444   had its reference counter increased so the caller must be careful
17445   about locking. The caller must hold RCU lock.
17446</para>
17447</refsect1>
17448</refentry>
17449
17450<refentry id="API-dev-get-by-index">
17451<refentryinfo>
17452 <title>LINUX</title>
17453 <productname>Kernel Hackers Manual</productname>
17454 <date>July 2017</date>
17455</refentryinfo>
17456<refmeta>
17457 <refentrytitle><phrase>dev_get_by_index</phrase></refentrytitle>
17458 <manvolnum>9</manvolnum>
17459 <refmiscinfo class="version">4.1.27</refmiscinfo>
17460</refmeta>
17461<refnamediv>
17462 <refname>dev_get_by_index</refname>
17463 <refpurpose>
17464     find a device by its ifindex
17465 </refpurpose>
17466</refnamediv>
17467<refsynopsisdiv>
17468 <title>Synopsis</title>
17469  <funcsynopsis><funcprototype>
17470   <funcdef>struct net_device * <function>dev_get_by_index </function></funcdef>
17471   <paramdef>struct net * <parameter>net</parameter></paramdef>
17472   <paramdef>int <parameter>ifindex</parameter></paramdef>
17473  </funcprototype></funcsynopsis>
17474</refsynopsisdiv>
17475<refsect1>
17476 <title>Arguments</title>
17477 <variablelist>
17478  <varlistentry>
17479   <term><parameter>net</parameter></term>
17480   <listitem>
17481    <para>
17482     the applicable net namespace
17483    </para>
17484   </listitem>
17485  </varlistentry>
17486  <varlistentry>
17487   <term><parameter>ifindex</parameter></term>
17488   <listitem>
17489    <para>
17490     index of device
17491    </para>
17492   </listitem>
17493  </varlistentry>
17494 </variablelist>
17495</refsect1>
17496<refsect1>
17497<title>Description</title>
17498<para>
17499   Search for an interface by index. Returns NULL if the device
17500   is not found or a pointer to the device. The device returned has
17501   had a reference added and the pointer is safe until the user calls
17502   dev_put to indicate they have finished with it.
17503</para>
17504</refsect1>
17505</refentry>
17506
17507<refentry id="API-dev-getbyhwaddr-rcu">
17508<refentryinfo>
17509 <title>LINUX</title>
17510 <productname>Kernel Hackers Manual</productname>
17511 <date>July 2017</date>
17512</refentryinfo>
17513<refmeta>
17514 <refentrytitle><phrase>dev_getbyhwaddr_rcu</phrase></refentrytitle>
17515 <manvolnum>9</manvolnum>
17516 <refmiscinfo class="version">4.1.27</refmiscinfo>
17517</refmeta>
17518<refnamediv>
17519 <refname>dev_getbyhwaddr_rcu</refname>
17520 <refpurpose>
17521     find a device by its hardware address
17522 </refpurpose>
17523</refnamediv>
17524<refsynopsisdiv>
17525 <title>Synopsis</title>
17526  <funcsynopsis><funcprototype>
17527   <funcdef>struct net_device * <function>dev_getbyhwaddr_rcu </function></funcdef>
17528   <paramdef>struct net * <parameter>net</parameter></paramdef>
17529   <paramdef>unsigned short <parameter>type</parameter></paramdef>
17530   <paramdef>const char * <parameter>ha</parameter></paramdef>
17531  </funcprototype></funcsynopsis>
17532</refsynopsisdiv>
17533<refsect1>
17534 <title>Arguments</title>
17535 <variablelist>
17536  <varlistentry>
17537   <term><parameter>net</parameter></term>
17538   <listitem>
17539    <para>
17540     the applicable net namespace
17541    </para>
17542   </listitem>
17543  </varlistentry>
17544  <varlistentry>
17545   <term><parameter>type</parameter></term>
17546   <listitem>
17547    <para>
17548     media type of device
17549    </para>
17550   </listitem>
17551  </varlistentry>
17552  <varlistentry>
17553   <term><parameter>ha</parameter></term>
17554   <listitem>
17555    <para>
17556     hardware address
17557    </para>
17558   </listitem>
17559  </varlistentry>
17560 </variablelist>
17561</refsect1>
17562<refsect1>
17563<title>Description</title>
17564<para>
17565   Search for an interface by MAC address. Returns NULL if the device
17566   is not found or a pointer to the device.
17567   The caller must hold RCU or RTNL.
17568   The returned device has not had its ref count increased
17569   and the caller must therefore be careful about locking
17570</para>
17571</refsect1>
17572</refentry>
17573
17574<refentry id="API---dev-get-by-flags">
17575<refentryinfo>
17576 <title>LINUX</title>
17577 <productname>Kernel Hackers Manual</productname>
17578 <date>July 2017</date>
17579</refentryinfo>
17580<refmeta>
17581 <refentrytitle><phrase>__dev_get_by_flags</phrase></refentrytitle>
17582 <manvolnum>9</manvolnum>
17583 <refmiscinfo class="version">4.1.27</refmiscinfo>
17584</refmeta>
17585<refnamediv>
17586 <refname>__dev_get_by_flags</refname>
17587 <refpurpose>
17588     find any device with given flags
17589 </refpurpose>
17590</refnamediv>
17591<refsynopsisdiv>
17592 <title>Synopsis</title>
17593  <funcsynopsis><funcprototype>
17594   <funcdef>struct net_device * <function>__dev_get_by_flags </function></funcdef>
17595   <paramdef>struct net * <parameter>net</parameter></paramdef>
17596   <paramdef>unsigned short <parameter>if_flags</parameter></paramdef>
17597   <paramdef>unsigned short <parameter>mask</parameter></paramdef>
17598  </funcprototype></funcsynopsis>
17599</refsynopsisdiv>
17600<refsect1>
17601 <title>Arguments</title>
17602 <variablelist>
17603  <varlistentry>
17604   <term><parameter>net</parameter></term>
17605   <listitem>
17606    <para>
17607     the applicable net namespace
17608    </para>
17609   </listitem>
17610  </varlistentry>
17611  <varlistentry>
17612   <term><parameter>if_flags</parameter></term>
17613   <listitem>
17614    <para>
17615     IFF_* values
17616    </para>
17617   </listitem>
17618  </varlistentry>
17619  <varlistentry>
17620   <term><parameter>mask</parameter></term>
17621   <listitem>
17622    <para>
17623     bitmask of bits in if_flags to check
17624    </para>
17625   </listitem>
17626  </varlistentry>
17627 </variablelist>
17628</refsect1>
17629<refsect1>
17630<title>Description</title>
17631<para>
17632   Search for any interface with the given flags. Returns NULL if a device
17633   is not found or a pointer to the device. Must be called inside
17634   <function>rtnl_lock</function>, and result refcount is unchanged.
17635</para>
17636</refsect1>
17637</refentry>
17638
17639<refentry id="API-dev-valid-name">
17640<refentryinfo>
17641 <title>LINUX</title>
17642 <productname>Kernel Hackers Manual</productname>
17643 <date>July 2017</date>
17644</refentryinfo>
17645<refmeta>
17646 <refentrytitle><phrase>dev_valid_name</phrase></refentrytitle>
17647 <manvolnum>9</manvolnum>
17648 <refmiscinfo class="version">4.1.27</refmiscinfo>
17649</refmeta>
17650<refnamediv>
17651 <refname>dev_valid_name</refname>
17652 <refpurpose>
17653     check if name is okay for network device
17654 </refpurpose>
17655</refnamediv>
17656<refsynopsisdiv>
17657 <title>Synopsis</title>
17658  <funcsynopsis><funcprototype>
17659   <funcdef>bool <function>dev_valid_name </function></funcdef>
17660   <paramdef>const char * <parameter>name</parameter></paramdef>
17661  </funcprototype></funcsynopsis>
17662</refsynopsisdiv>
17663<refsect1>
17664 <title>Arguments</title>
17665 <variablelist>
17666  <varlistentry>
17667   <term><parameter>name</parameter></term>
17668   <listitem>
17669    <para>
17670     name string
17671    </para>
17672   </listitem>
17673  </varlistentry>
17674 </variablelist>
17675</refsect1>
17676<refsect1>
17677<title>Description</title>
17678<para>
17679   Network device names need to be valid file names to
17680   to allow sysfs to work.  We also disallow any kind of
17681   whitespace.
17682</para>
17683</refsect1>
17684</refentry>
17685
17686<refentry id="API-dev-alloc-name">
17687<refentryinfo>
17688 <title>LINUX</title>
17689 <productname>Kernel Hackers Manual</productname>
17690 <date>July 2017</date>
17691</refentryinfo>
17692<refmeta>
17693 <refentrytitle><phrase>dev_alloc_name</phrase></refentrytitle>
17694 <manvolnum>9</manvolnum>
17695 <refmiscinfo class="version">4.1.27</refmiscinfo>
17696</refmeta>
17697<refnamediv>
17698 <refname>dev_alloc_name</refname>
17699 <refpurpose>
17700     allocate a name for a device
17701 </refpurpose>
17702</refnamediv>
17703<refsynopsisdiv>
17704 <title>Synopsis</title>
17705  <funcsynopsis><funcprototype>
17706   <funcdef>int <function>dev_alloc_name </function></funcdef>
17707   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
17708   <paramdef>const char * <parameter>name</parameter></paramdef>
17709  </funcprototype></funcsynopsis>
17710</refsynopsisdiv>
17711<refsect1>
17712 <title>Arguments</title>
17713 <variablelist>
17714  <varlistentry>
17715   <term><parameter>dev</parameter></term>
17716   <listitem>
17717    <para>
17718     device
17719    </para>
17720   </listitem>
17721  </varlistentry>
17722  <varlistentry>
17723   <term><parameter>name</parameter></term>
17724   <listitem>
17725    <para>
17726     name format string
17727    </para>
17728   </listitem>
17729  </varlistentry>
17730 </variablelist>
17731</refsect1>
17732<refsect1>
17733<title>Description</title>
17734<para>
17735   Passed a format string - eg <quote>lt<constant>d</constant></quote> it will try and find a suitable
17736   id. It scans list of devices to build up a free map, then chooses
17737   the first empty slot. The caller must hold the dev_base or rtnl lock
17738   while allocating the name and adding the device in order to avoid
17739   duplicates.
17740   Limited to bits_per_byte * page size devices (ie 32K on most platforms).
17741   Returns the number of the unit assigned or a negative errno code.
17742</para>
17743</refsect1>
17744</refentry>
17745
17746<refentry id="API-netdev-features-change">
17747<refentryinfo>
17748 <title>LINUX</title>
17749 <productname>Kernel Hackers Manual</productname>
17750 <date>July 2017</date>
17751</refentryinfo>
17752<refmeta>
17753 <refentrytitle><phrase>netdev_features_change</phrase></refentrytitle>
17754 <manvolnum>9</manvolnum>
17755 <refmiscinfo class="version">4.1.27</refmiscinfo>
17756</refmeta>
17757<refnamediv>
17758 <refname>netdev_features_change</refname>
17759 <refpurpose>
17760     device changes features
17761 </refpurpose>
17762</refnamediv>
17763<refsynopsisdiv>
17764 <title>Synopsis</title>
17765  <funcsynopsis><funcprototype>
17766   <funcdef>void <function>netdev_features_change </function></funcdef>
17767   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
17768  </funcprototype></funcsynopsis>
17769</refsynopsisdiv>
17770<refsect1>
17771 <title>Arguments</title>
17772 <variablelist>
17773  <varlistentry>
17774   <term><parameter>dev</parameter></term>
17775   <listitem>
17776    <para>
17777     device to cause notification
17778    </para>
17779   </listitem>
17780  </varlistentry>
17781 </variablelist>
17782</refsect1>
17783<refsect1>
17784<title>Description</title>
17785<para>
17786   Called to indicate a device has changed features.
17787</para>
17788</refsect1>
17789</refentry>
17790
17791<refentry id="API-netdev-state-change">
17792<refentryinfo>
17793 <title>LINUX</title>
17794 <productname>Kernel Hackers Manual</productname>
17795 <date>July 2017</date>
17796</refentryinfo>
17797<refmeta>
17798 <refentrytitle><phrase>netdev_state_change</phrase></refentrytitle>
17799 <manvolnum>9</manvolnum>
17800 <refmiscinfo class="version">4.1.27</refmiscinfo>
17801</refmeta>
17802<refnamediv>
17803 <refname>netdev_state_change</refname>
17804 <refpurpose>
17805     device changes state
17806 </refpurpose>
17807</refnamediv>
17808<refsynopsisdiv>
17809 <title>Synopsis</title>
17810  <funcsynopsis><funcprototype>
17811   <funcdef>void <function>netdev_state_change </function></funcdef>
17812   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
17813  </funcprototype></funcsynopsis>
17814</refsynopsisdiv>
17815<refsect1>
17816 <title>Arguments</title>
17817 <variablelist>
17818  <varlistentry>
17819   <term><parameter>dev</parameter></term>
17820   <listitem>
17821    <para>
17822     device to cause notification
17823    </para>
17824   </listitem>
17825  </varlistentry>
17826 </variablelist>
17827</refsect1>
17828<refsect1>
17829<title>Description</title>
17830<para>
17831   Called to indicate a device has changed state. This function calls
17832   the notifier chains for netdev_chain and sends a NEWLINK message
17833   to the routing socket.
17834</para>
17835</refsect1>
17836</refentry>
17837
17838<refentry id="API-netdev-notify-peers">
17839<refentryinfo>
17840 <title>LINUX</title>
17841 <productname>Kernel Hackers Manual</productname>
17842 <date>July 2017</date>
17843</refentryinfo>
17844<refmeta>
17845 <refentrytitle><phrase>netdev_notify_peers</phrase></refentrytitle>
17846 <manvolnum>9</manvolnum>
17847 <refmiscinfo class="version">4.1.27</refmiscinfo>
17848</refmeta>
17849<refnamediv>
17850 <refname>netdev_notify_peers</refname>
17851 <refpurpose>
17852     notify network peers about existence of <parameter>dev</parameter>
17853 </refpurpose>
17854</refnamediv>
17855<refsynopsisdiv>
17856 <title>Synopsis</title>
17857  <funcsynopsis><funcprototype>
17858   <funcdef>void <function>netdev_notify_peers </function></funcdef>
17859   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
17860  </funcprototype></funcsynopsis>
17861</refsynopsisdiv>
17862<refsect1>
17863 <title>Arguments</title>
17864 <variablelist>
17865  <varlistentry>
17866   <term><parameter>dev</parameter></term>
17867   <listitem>
17868    <para>
17869     network device
17870    </para>
17871   </listitem>
17872  </varlistentry>
17873 </variablelist>
17874</refsect1>
17875<refsect1>
17876<title>Description</title>
17877<para>
17878   Generate traffic such that interested network peers are aware of
17879   <parameter>dev</parameter>, such as by generating a gratuitous ARP. This may be used when
17880   a device wants to inform the rest of the network about some sort of
17881   reconfiguration such as a failover event or virtual machine
17882   migration.
17883</para>
17884</refsect1>
17885</refentry>
17886
17887<refentry id="API-dev-open">
17888<refentryinfo>
17889 <title>LINUX</title>
17890 <productname>Kernel Hackers Manual</productname>
17891 <date>July 2017</date>
17892</refentryinfo>
17893<refmeta>
17894 <refentrytitle><phrase>dev_open</phrase></refentrytitle>
17895 <manvolnum>9</manvolnum>
17896 <refmiscinfo class="version">4.1.27</refmiscinfo>
17897</refmeta>
17898<refnamediv>
17899 <refname>dev_open</refname>
17900 <refpurpose>
17901     prepare an interface for use.
17902 </refpurpose>
17903</refnamediv>
17904<refsynopsisdiv>
17905 <title>Synopsis</title>
17906  <funcsynopsis><funcprototype>
17907   <funcdef>int <function>dev_open </function></funcdef>
17908   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
17909  </funcprototype></funcsynopsis>
17910</refsynopsisdiv>
17911<refsect1>
17912 <title>Arguments</title>
17913 <variablelist>
17914  <varlistentry>
17915   <term><parameter>dev</parameter></term>
17916   <listitem>
17917    <para>
17918     device to open
17919    </para>
17920   </listitem>
17921  </varlistentry>
17922 </variablelist>
17923</refsect1>
17924<refsect1>
17925<title>Description</title>
17926<para>
17927   Takes a device from down to up state. The device's private open
17928   function is invoked and then the multicast lists are loaded. Finally
17929   the device is moved into the up state and a <constant>NETDEV_UP</constant> message is
17930   sent to the netdev notifier chain.
17931   </para><para>
17932
17933   Calling this function on an active interface is a nop. On a failure
17934   a negative errno code is returned.
17935</para>
17936</refsect1>
17937</refentry>
17938
17939<refentry id="API-dev-close">
17940<refentryinfo>
17941 <title>LINUX</title>
17942 <productname>Kernel Hackers Manual</productname>
17943 <date>July 2017</date>
17944</refentryinfo>
17945<refmeta>
17946 <refentrytitle><phrase>dev_close</phrase></refentrytitle>
17947 <manvolnum>9</manvolnum>
17948 <refmiscinfo class="version">4.1.27</refmiscinfo>
17949</refmeta>
17950<refnamediv>
17951 <refname>dev_close</refname>
17952 <refpurpose>
17953     shutdown an interface.
17954 </refpurpose>
17955</refnamediv>
17956<refsynopsisdiv>
17957 <title>Synopsis</title>
17958  <funcsynopsis><funcprototype>
17959   <funcdef>int <function>dev_close </function></funcdef>
17960   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
17961  </funcprototype></funcsynopsis>
17962</refsynopsisdiv>
17963<refsect1>
17964 <title>Arguments</title>
17965 <variablelist>
17966  <varlistentry>
17967   <term><parameter>dev</parameter></term>
17968   <listitem>
17969    <para>
17970     device to shutdown
17971    </para>
17972   </listitem>
17973  </varlistentry>
17974 </variablelist>
17975</refsect1>
17976<refsect1>
17977<title>Description</title>
17978<para>
17979   This function moves an active device into down state. A
17980   <constant>NETDEV_GOING_DOWN</constant> is sent to the netdev notifier chain. The device
17981   is then deactivated and finally a <constant>NETDEV_DOWN</constant> is sent to the notifier
17982   chain.
17983</para>
17984</refsect1>
17985</refentry>
17986
17987<refentry id="API-dev-disable-lro">
17988<refentryinfo>
17989 <title>LINUX</title>
17990 <productname>Kernel Hackers Manual</productname>
17991 <date>July 2017</date>
17992</refentryinfo>
17993<refmeta>
17994 <refentrytitle><phrase>dev_disable_lro</phrase></refentrytitle>
17995 <manvolnum>9</manvolnum>
17996 <refmiscinfo class="version">4.1.27</refmiscinfo>
17997</refmeta>
17998<refnamediv>
17999 <refname>dev_disable_lro</refname>
18000 <refpurpose>
18001     disable Large Receive Offload on a device
18002 </refpurpose>
18003</refnamediv>
18004<refsynopsisdiv>
18005 <title>Synopsis</title>
18006  <funcsynopsis><funcprototype>
18007   <funcdef>void <function>dev_disable_lro </function></funcdef>
18008   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18009  </funcprototype></funcsynopsis>
18010</refsynopsisdiv>
18011<refsect1>
18012 <title>Arguments</title>
18013 <variablelist>
18014  <varlistentry>
18015   <term><parameter>dev</parameter></term>
18016   <listitem>
18017    <para>
18018     device
18019    </para>
18020   </listitem>
18021  </varlistentry>
18022 </variablelist>
18023</refsect1>
18024<refsect1>
18025<title>Description</title>
18026<para>
18027   Disable Large Receive Offload (LRO) on a net device.  Must be
18028   called under RTNL.  This is needed if received packets may be
18029   forwarded to another interface.
18030</para>
18031</refsect1>
18032</refentry>
18033
18034<refentry id="API-register-netdevice-notifier">
18035<refentryinfo>
18036 <title>LINUX</title>
18037 <productname>Kernel Hackers Manual</productname>
18038 <date>July 2017</date>
18039</refentryinfo>
18040<refmeta>
18041 <refentrytitle><phrase>register_netdevice_notifier</phrase></refentrytitle>
18042 <manvolnum>9</manvolnum>
18043 <refmiscinfo class="version">4.1.27</refmiscinfo>
18044</refmeta>
18045<refnamediv>
18046 <refname>register_netdevice_notifier</refname>
18047 <refpurpose>
18048     register a network notifier block
18049 </refpurpose>
18050</refnamediv>
18051<refsynopsisdiv>
18052 <title>Synopsis</title>
18053  <funcsynopsis><funcprototype>
18054   <funcdef>int <function>register_netdevice_notifier </function></funcdef>
18055   <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef>
18056  </funcprototype></funcsynopsis>
18057</refsynopsisdiv>
18058<refsect1>
18059 <title>Arguments</title>
18060 <variablelist>
18061  <varlistentry>
18062   <term><parameter>nb</parameter></term>
18063   <listitem>
18064    <para>
18065     notifier
18066    </para>
18067   </listitem>
18068  </varlistentry>
18069 </variablelist>
18070</refsect1>
18071<refsect1>
18072<title>Description</title>
18073<para>
18074   Register a notifier to be called when network device events occur.
18075   The notifier passed is linked into the kernel structures and must
18076   not be reused until it has been unregistered. A negative errno code
18077   is returned on a failure.
18078   </para><para>
18079
18080   When registered all registration and up events are replayed
18081   to the new notifier to allow device to have a race free
18082   view of the network device list.
18083</para>
18084</refsect1>
18085</refentry>
18086
18087<refentry id="API-unregister-netdevice-notifier">
18088<refentryinfo>
18089 <title>LINUX</title>
18090 <productname>Kernel Hackers Manual</productname>
18091 <date>July 2017</date>
18092</refentryinfo>
18093<refmeta>
18094 <refentrytitle><phrase>unregister_netdevice_notifier</phrase></refentrytitle>
18095 <manvolnum>9</manvolnum>
18096 <refmiscinfo class="version">4.1.27</refmiscinfo>
18097</refmeta>
18098<refnamediv>
18099 <refname>unregister_netdevice_notifier</refname>
18100 <refpurpose>
18101     unregister a network notifier block
18102 </refpurpose>
18103</refnamediv>
18104<refsynopsisdiv>
18105 <title>Synopsis</title>
18106  <funcsynopsis><funcprototype>
18107   <funcdef>int <function>unregister_netdevice_notifier </function></funcdef>
18108   <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef>
18109  </funcprototype></funcsynopsis>
18110</refsynopsisdiv>
18111<refsect1>
18112 <title>Arguments</title>
18113 <variablelist>
18114  <varlistentry>
18115   <term><parameter>nb</parameter></term>
18116   <listitem>
18117    <para>
18118     notifier
18119    </para>
18120   </listitem>
18121  </varlistentry>
18122 </variablelist>
18123</refsect1>
18124<refsect1>
18125<title>Description</title>
18126<para>
18127   Unregister a notifier previously registered by
18128   <function>register_netdevice_notifier</function>. The notifier is unlinked into the
18129   kernel structures and may then be reused. A negative errno code
18130   is returned on a failure.
18131   </para><para>
18132
18133   After unregistering unregister and down device events are synthesized
18134   for all devices on the device list to the removed notifier to remove
18135   the need for special case cleanup code.
18136</para>
18137</refsect1>
18138</refentry>
18139
18140<refentry id="API-call-netdevice-notifiers">
18141<refentryinfo>
18142 <title>LINUX</title>
18143 <productname>Kernel Hackers Manual</productname>
18144 <date>July 2017</date>
18145</refentryinfo>
18146<refmeta>
18147 <refentrytitle><phrase>call_netdevice_notifiers</phrase></refentrytitle>
18148 <manvolnum>9</manvolnum>
18149 <refmiscinfo class="version">4.1.27</refmiscinfo>
18150</refmeta>
18151<refnamediv>
18152 <refname>call_netdevice_notifiers</refname>
18153 <refpurpose>
18154     call all network notifier blocks
18155 </refpurpose>
18156</refnamediv>
18157<refsynopsisdiv>
18158 <title>Synopsis</title>
18159  <funcsynopsis><funcprototype>
18160   <funcdef>int <function>call_netdevice_notifiers </function></funcdef>
18161   <paramdef>unsigned long <parameter>val</parameter></paramdef>
18162   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18163  </funcprototype></funcsynopsis>
18164</refsynopsisdiv>
18165<refsect1>
18166 <title>Arguments</title>
18167 <variablelist>
18168  <varlistentry>
18169   <term><parameter>val</parameter></term>
18170   <listitem>
18171    <para>
18172     value passed unmodified to notifier function
18173    </para>
18174   </listitem>
18175  </varlistentry>
18176  <varlistentry>
18177   <term><parameter>dev</parameter></term>
18178   <listitem>
18179    <para>
18180     net_device pointer passed unmodified to notifier function
18181    </para>
18182   </listitem>
18183  </varlistentry>
18184 </variablelist>
18185</refsect1>
18186<refsect1>
18187<title>Description</title>
18188<para>
18189   Call all network notifier blocks.  Parameters and return value
18190   are as for <function>raw_notifier_call_chain</function>.
18191</para>
18192</refsect1>
18193</refentry>
18194
18195<refentry id="API-dev-forward-skb">
18196<refentryinfo>
18197 <title>LINUX</title>
18198 <productname>Kernel Hackers Manual</productname>
18199 <date>July 2017</date>
18200</refentryinfo>
18201<refmeta>
18202 <refentrytitle><phrase>dev_forward_skb</phrase></refentrytitle>
18203 <manvolnum>9</manvolnum>
18204 <refmiscinfo class="version">4.1.27</refmiscinfo>
18205</refmeta>
18206<refnamediv>
18207 <refname>dev_forward_skb</refname>
18208 <refpurpose>
18209     loopback an skb to another netif
18210 </refpurpose>
18211</refnamediv>
18212<refsynopsisdiv>
18213 <title>Synopsis</title>
18214  <funcsynopsis><funcprototype>
18215   <funcdef>int <function>dev_forward_skb </function></funcdef>
18216   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18217   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
18218  </funcprototype></funcsynopsis>
18219</refsynopsisdiv>
18220<refsect1>
18221 <title>Arguments</title>
18222 <variablelist>
18223  <varlistentry>
18224   <term><parameter>dev</parameter></term>
18225   <listitem>
18226    <para>
18227     destination network device
18228    </para>
18229   </listitem>
18230  </varlistentry>
18231  <varlistentry>
18232   <term><parameter>skb</parameter></term>
18233   <listitem>
18234    <para>
18235     buffer to forward
18236    </para>
18237   </listitem>
18238  </varlistentry>
18239 </variablelist>
18240</refsect1>
18241<refsect1>
18242<title>return values</title>
18243<para>
18244   NET_RX_SUCCESS	(no congestion)
18245   NET_RX_DROP     (packet was dropped, but freed)
18246   </para><para>
18247
18248   dev_forward_skb can be used for injecting an skb from the
18249   start_xmit function of one device into the receive queue
18250   of another device.
18251   </para><para>
18252
18253   The receiving device may be in another namespace, so
18254   we have to clear all information in the skb that could
18255   impact namespace isolation.
18256</para>
18257</refsect1>
18258</refentry>
18259
18260<refentry id="API-netif-set-real-num-rx-queues">
18261<refentryinfo>
18262 <title>LINUX</title>
18263 <productname>Kernel Hackers Manual</productname>
18264 <date>July 2017</date>
18265</refentryinfo>
18266<refmeta>
18267 <refentrytitle><phrase>netif_set_real_num_rx_queues</phrase></refentrytitle>
18268 <manvolnum>9</manvolnum>
18269 <refmiscinfo class="version">4.1.27</refmiscinfo>
18270</refmeta>
18271<refnamediv>
18272 <refname>netif_set_real_num_rx_queues</refname>
18273 <refpurpose>
18274     set actual number of RX queues used
18275 </refpurpose>
18276</refnamediv>
18277<refsynopsisdiv>
18278 <title>Synopsis</title>
18279  <funcsynopsis><funcprototype>
18280   <funcdef>int <function>netif_set_real_num_rx_queues </function></funcdef>
18281   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18282   <paramdef>unsigned int <parameter>rxq</parameter></paramdef>
18283  </funcprototype></funcsynopsis>
18284</refsynopsisdiv>
18285<refsect1>
18286 <title>Arguments</title>
18287 <variablelist>
18288  <varlistentry>
18289   <term><parameter>dev</parameter></term>
18290   <listitem>
18291    <para>
18292     Network device
18293    </para>
18294   </listitem>
18295  </varlistentry>
18296  <varlistentry>
18297   <term><parameter>rxq</parameter></term>
18298   <listitem>
18299    <para>
18300     Actual number of RX queues
18301    </para>
18302   </listitem>
18303  </varlistentry>
18304 </variablelist>
18305</refsect1>
18306<refsect1>
18307<title>Description</title>
18308<para>
18309   This must be called either with the rtnl_lock held or before
18310   registration of the net device.  Returns 0 on success, or a
18311   negative error code.  If called before registration, it always
18312   succeeds.
18313</para>
18314</refsect1>
18315</refentry>
18316
18317<refentry id="API-netif-get-num-default-rss-queues">
18318<refentryinfo>
18319 <title>LINUX</title>
18320 <productname>Kernel Hackers Manual</productname>
18321 <date>July 2017</date>
18322</refentryinfo>
18323<refmeta>
18324 <refentrytitle><phrase>netif_get_num_default_rss_queues</phrase></refentrytitle>
18325 <manvolnum>9</manvolnum>
18326 <refmiscinfo class="version">4.1.27</refmiscinfo>
18327</refmeta>
18328<refnamediv>
18329 <refname>netif_get_num_default_rss_queues</refname>
18330 <refpurpose>
18331     default number of RSS queues
18332 </refpurpose>
18333</refnamediv>
18334<refsynopsisdiv>
18335 <title>Synopsis</title>
18336  <funcsynopsis><funcprototype>
18337   <funcdef>int <function>netif_get_num_default_rss_queues </function></funcdef>
18338   <paramdef> <parameter>void</parameter></paramdef>
18339  </funcprototype></funcsynopsis>
18340</refsynopsisdiv>
18341<refsect1>
18342 <title>Arguments</title>
18343 <variablelist>
18344  <varlistentry>
18345   <term><parameter>void</parameter></term>
18346   <listitem>
18347    <para>
18348     no arguments
18349    </para>
18350   </listitem>
18351  </varlistentry>
18352 </variablelist>
18353</refsect1>
18354<refsect1>
18355<title>Description</title>
18356<para>
18357   </para><para>
18358
18359   This routine should set an upper limit on the number of RSS queues
18360   used by default by multiqueue devices.
18361</para>
18362</refsect1>
18363</refentry>
18364
18365<refentry id="API-netif-wake-subqueue">
18366<refentryinfo>
18367 <title>LINUX</title>
18368 <productname>Kernel Hackers Manual</productname>
18369 <date>July 2017</date>
18370</refentryinfo>
18371<refmeta>
18372 <refentrytitle><phrase>netif_wake_subqueue</phrase></refentrytitle>
18373 <manvolnum>9</manvolnum>
18374 <refmiscinfo class="version">4.1.27</refmiscinfo>
18375</refmeta>
18376<refnamediv>
18377 <refname>netif_wake_subqueue</refname>
18378 <refpurpose>
18379     allow sending packets on subqueue
18380 </refpurpose>
18381</refnamediv>
18382<refsynopsisdiv>
18383 <title>Synopsis</title>
18384  <funcsynopsis><funcprototype>
18385   <funcdef>void <function>netif_wake_subqueue </function></funcdef>
18386   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18387   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
18388  </funcprototype></funcsynopsis>
18389</refsynopsisdiv>
18390<refsect1>
18391 <title>Arguments</title>
18392 <variablelist>
18393  <varlistentry>
18394   <term><parameter>dev</parameter></term>
18395   <listitem>
18396    <para>
18397     network device
18398    </para>
18399   </listitem>
18400  </varlistentry>
18401  <varlistentry>
18402   <term><parameter>queue_index</parameter></term>
18403   <listitem>
18404    <para>
18405     sub queue index
18406    </para>
18407   </listitem>
18408  </varlistentry>
18409 </variablelist>
18410</refsect1>
18411<refsect1>
18412<title>Description</title>
18413<para>
18414   Resume individual transmit queue of a device with multiple transmit queues.
18415</para>
18416</refsect1>
18417</refentry>
18418
18419<refentry id="API-netif-device-detach">
18420<refentryinfo>
18421 <title>LINUX</title>
18422 <productname>Kernel Hackers Manual</productname>
18423 <date>July 2017</date>
18424</refentryinfo>
18425<refmeta>
18426 <refentrytitle><phrase>netif_device_detach</phrase></refentrytitle>
18427 <manvolnum>9</manvolnum>
18428 <refmiscinfo class="version">4.1.27</refmiscinfo>
18429</refmeta>
18430<refnamediv>
18431 <refname>netif_device_detach</refname>
18432 <refpurpose>
18433     mark device as removed
18434 </refpurpose>
18435</refnamediv>
18436<refsynopsisdiv>
18437 <title>Synopsis</title>
18438  <funcsynopsis><funcprototype>
18439   <funcdef>void <function>netif_device_detach </function></funcdef>
18440   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18441  </funcprototype></funcsynopsis>
18442</refsynopsisdiv>
18443<refsect1>
18444 <title>Arguments</title>
18445 <variablelist>
18446  <varlistentry>
18447   <term><parameter>dev</parameter></term>
18448   <listitem>
18449    <para>
18450     network device
18451    </para>
18452   </listitem>
18453  </varlistentry>
18454 </variablelist>
18455</refsect1>
18456<refsect1>
18457<title>Description</title>
18458<para>
18459   Mark device as removed from system and therefore no longer available.
18460</para>
18461</refsect1>
18462</refentry>
18463
18464<refentry id="API-netif-device-attach">
18465<refentryinfo>
18466 <title>LINUX</title>
18467 <productname>Kernel Hackers Manual</productname>
18468 <date>July 2017</date>
18469</refentryinfo>
18470<refmeta>
18471 <refentrytitle><phrase>netif_device_attach</phrase></refentrytitle>
18472 <manvolnum>9</manvolnum>
18473 <refmiscinfo class="version">4.1.27</refmiscinfo>
18474</refmeta>
18475<refnamediv>
18476 <refname>netif_device_attach</refname>
18477 <refpurpose>
18478     mark device as attached
18479 </refpurpose>
18480</refnamediv>
18481<refsynopsisdiv>
18482 <title>Synopsis</title>
18483  <funcsynopsis><funcprototype>
18484   <funcdef>void <function>netif_device_attach </function></funcdef>
18485   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18486  </funcprototype></funcsynopsis>
18487</refsynopsisdiv>
18488<refsect1>
18489 <title>Arguments</title>
18490 <variablelist>
18491  <varlistentry>
18492   <term><parameter>dev</parameter></term>
18493   <listitem>
18494    <para>
18495     network device
18496    </para>
18497   </listitem>
18498  </varlistentry>
18499 </variablelist>
18500</refsect1>
18501<refsect1>
18502<title>Description</title>
18503<para>
18504   Mark device as attached from system and restart if needed.
18505</para>
18506</refsect1>
18507</refentry>
18508
18509<refentry id="API-skb-mac-gso-segment">
18510<refentryinfo>
18511 <title>LINUX</title>
18512 <productname>Kernel Hackers Manual</productname>
18513 <date>July 2017</date>
18514</refentryinfo>
18515<refmeta>
18516 <refentrytitle><phrase>skb_mac_gso_segment</phrase></refentrytitle>
18517 <manvolnum>9</manvolnum>
18518 <refmiscinfo class="version">4.1.27</refmiscinfo>
18519</refmeta>
18520<refnamediv>
18521 <refname>skb_mac_gso_segment</refname>
18522 <refpurpose>
18523     mac layer segmentation handler.
18524 </refpurpose>
18525</refnamediv>
18526<refsynopsisdiv>
18527 <title>Synopsis</title>
18528  <funcsynopsis><funcprototype>
18529   <funcdef>struct sk_buff * <function>skb_mac_gso_segment </function></funcdef>
18530   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
18531   <paramdef>netdev_features_t <parameter>features</parameter></paramdef>
18532  </funcprototype></funcsynopsis>
18533</refsynopsisdiv>
18534<refsect1>
18535 <title>Arguments</title>
18536 <variablelist>
18537  <varlistentry>
18538   <term><parameter>skb</parameter></term>
18539   <listitem>
18540    <para>
18541     buffer to segment
18542    </para>
18543   </listitem>
18544  </varlistentry>
18545  <varlistentry>
18546   <term><parameter>features</parameter></term>
18547   <listitem>
18548    <para>
18549     features for the output path (see dev-&gt;features)
18550    </para>
18551   </listitem>
18552  </varlistentry>
18553 </variablelist>
18554</refsect1>
18555</refentry>
18556
18557<refentry id="API---skb-gso-segment">
18558<refentryinfo>
18559 <title>LINUX</title>
18560 <productname>Kernel Hackers Manual</productname>
18561 <date>July 2017</date>
18562</refentryinfo>
18563<refmeta>
18564 <refentrytitle><phrase>__skb_gso_segment</phrase></refentrytitle>
18565 <manvolnum>9</manvolnum>
18566 <refmiscinfo class="version">4.1.27</refmiscinfo>
18567</refmeta>
18568<refnamediv>
18569 <refname>__skb_gso_segment</refname>
18570 <refpurpose>
18571     Perform segmentation on skb.
18572 </refpurpose>
18573</refnamediv>
18574<refsynopsisdiv>
18575 <title>Synopsis</title>
18576  <funcsynopsis><funcprototype>
18577   <funcdef>struct sk_buff * <function>__skb_gso_segment </function></funcdef>
18578   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
18579   <paramdef>netdev_features_t <parameter>features</parameter></paramdef>
18580   <paramdef>bool <parameter>tx_path</parameter></paramdef>
18581  </funcprototype></funcsynopsis>
18582</refsynopsisdiv>
18583<refsect1>
18584 <title>Arguments</title>
18585 <variablelist>
18586  <varlistentry>
18587   <term><parameter>skb</parameter></term>
18588   <listitem>
18589    <para>
18590     buffer to segment
18591    </para>
18592   </listitem>
18593  </varlistentry>
18594  <varlistentry>
18595   <term><parameter>features</parameter></term>
18596   <listitem>
18597    <para>
18598     features for the output path (see dev-&gt;features)
18599    </para>
18600   </listitem>
18601  </varlistentry>
18602  <varlistentry>
18603   <term><parameter>tx_path</parameter></term>
18604   <listitem>
18605    <para>
18606     whether it is called in TX path
18607    </para>
18608   </listitem>
18609  </varlistentry>
18610 </variablelist>
18611</refsect1>
18612<refsect1>
18613<title>Description</title>
18614<para>
18615   This function segments the given skb and returns a list of segments.
18616   </para><para>
18617
18618   It may return NULL if the skb requires no segmentation.  This is
18619   only possible when GSO is used for verifying header integrity.
18620   </para><para>
18621
18622   Segmentation preserves SKB_SGO_CB_OFFSET bytes of previous skb cb.
18623</para>
18624</refsect1>
18625</refentry>
18626
18627<refentry id="API-dev-loopback-xmit">
18628<refentryinfo>
18629 <title>LINUX</title>
18630 <productname>Kernel Hackers Manual</productname>
18631 <date>July 2017</date>
18632</refentryinfo>
18633<refmeta>
18634 <refentrytitle><phrase>dev_loopback_xmit</phrase></refentrytitle>
18635 <manvolnum>9</manvolnum>
18636 <refmiscinfo class="version">4.1.27</refmiscinfo>
18637</refmeta>
18638<refnamediv>
18639 <refname>dev_loopback_xmit</refname>
18640 <refpurpose>
18641     loop back <parameter>skb</parameter>
18642 </refpurpose>
18643</refnamediv>
18644<refsynopsisdiv>
18645 <title>Synopsis</title>
18646  <funcsynopsis><funcprototype>
18647   <funcdef>int <function>dev_loopback_xmit </function></funcdef>
18648   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
18649   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
18650  </funcprototype></funcsynopsis>
18651</refsynopsisdiv>
18652<refsect1>
18653 <title>Arguments</title>
18654 <variablelist>
18655  <varlistentry>
18656   <term><parameter>sk</parameter></term>
18657   <listitem>
18658    <para>
18659     -- undescribed --
18660    </para>
18661   </listitem>
18662  </varlistentry>
18663  <varlistentry>
18664   <term><parameter>skb</parameter></term>
18665   <listitem>
18666    <para>
18667     buffer to transmit
18668    </para>
18669   </listitem>
18670  </varlistentry>
18671 </variablelist>
18672</refsect1>
18673</refentry>
18674
18675<refentry id="API-rps-may-expire-flow">
18676<refentryinfo>
18677 <title>LINUX</title>
18678 <productname>Kernel Hackers Manual</productname>
18679 <date>July 2017</date>
18680</refentryinfo>
18681<refmeta>
18682 <refentrytitle><phrase>rps_may_expire_flow</phrase></refentrytitle>
18683 <manvolnum>9</manvolnum>
18684 <refmiscinfo class="version">4.1.27</refmiscinfo>
18685</refmeta>
18686<refnamediv>
18687 <refname>rps_may_expire_flow</refname>
18688 <refpurpose>
18689     check whether an RFS hardware filter may be removed
18690 </refpurpose>
18691</refnamediv>
18692<refsynopsisdiv>
18693 <title>Synopsis</title>
18694  <funcsynopsis><funcprototype>
18695   <funcdef>bool <function>rps_may_expire_flow </function></funcdef>
18696   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18697   <paramdef>u16 <parameter>rxq_index</parameter></paramdef>
18698   <paramdef>u32 <parameter>flow_id</parameter></paramdef>
18699   <paramdef>u16 <parameter>filter_id</parameter></paramdef>
18700  </funcprototype></funcsynopsis>
18701</refsynopsisdiv>
18702<refsect1>
18703 <title>Arguments</title>
18704 <variablelist>
18705  <varlistentry>
18706   <term><parameter>dev</parameter></term>
18707   <listitem>
18708    <para>
18709     Device on which the filter was set
18710    </para>
18711   </listitem>
18712  </varlistentry>
18713  <varlistentry>
18714   <term><parameter>rxq_index</parameter></term>
18715   <listitem>
18716    <para>
18717     RX queue index
18718    </para>
18719   </listitem>
18720  </varlistentry>
18721  <varlistentry>
18722   <term><parameter>flow_id</parameter></term>
18723   <listitem>
18724    <para>
18725     Flow ID passed to <function>ndo_rx_flow_steer</function>
18726    </para>
18727   </listitem>
18728  </varlistentry>
18729  <varlistentry>
18730   <term><parameter>filter_id</parameter></term>
18731   <listitem>
18732    <para>
18733     Filter ID returned by <function>ndo_rx_flow_steer</function>
18734    </para>
18735   </listitem>
18736  </varlistentry>
18737 </variablelist>
18738</refsect1>
18739<refsect1>
18740<title>Description</title>
18741<para>
18742   Drivers that implement <function>ndo_rx_flow_steer</function> should periodically call
18743   this function for each installed filter and remove the filters for
18744   which it returns <constant>true</constant>.
18745</para>
18746</refsect1>
18747</refentry>
18748
18749<refentry id="API-netif-rx">
18750<refentryinfo>
18751 <title>LINUX</title>
18752 <productname>Kernel Hackers Manual</productname>
18753 <date>July 2017</date>
18754</refentryinfo>
18755<refmeta>
18756 <refentrytitle><phrase>netif_rx</phrase></refentrytitle>
18757 <manvolnum>9</manvolnum>
18758 <refmiscinfo class="version">4.1.27</refmiscinfo>
18759</refmeta>
18760<refnamediv>
18761 <refname>netif_rx</refname>
18762 <refpurpose>
18763     post buffer to the network code
18764 </refpurpose>
18765</refnamediv>
18766<refsynopsisdiv>
18767 <title>Synopsis</title>
18768  <funcsynopsis><funcprototype>
18769   <funcdef>int <function>netif_rx </function></funcdef>
18770   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
18771  </funcprototype></funcsynopsis>
18772</refsynopsisdiv>
18773<refsect1>
18774 <title>Arguments</title>
18775 <variablelist>
18776  <varlistentry>
18777   <term><parameter>skb</parameter></term>
18778   <listitem>
18779    <para>
18780     buffer to post
18781    </para>
18782   </listitem>
18783  </varlistentry>
18784 </variablelist>
18785</refsect1>
18786<refsect1>
18787<title>Description</title>
18788<para>
18789   This function receives a packet from a device driver and queues it for
18790   the upper (protocol) levels to process.  It always succeeds. The buffer
18791   may be dropped during processing for congestion control or by the
18792   protocol layers.
18793</para>
18794</refsect1>
18795<refsect1>
18796<title>return values</title>
18797<para>
18798   NET_RX_SUCCESS	(no congestion)
18799   NET_RX_DROP     (packet was dropped)
18800</para>
18801</refsect1>
18802</refentry>
18803
18804<refentry id="API-netdev-rx-handler-register">
18805<refentryinfo>
18806 <title>LINUX</title>
18807 <productname>Kernel Hackers Manual</productname>
18808 <date>July 2017</date>
18809</refentryinfo>
18810<refmeta>
18811 <refentrytitle><phrase>netdev_rx_handler_register</phrase></refentrytitle>
18812 <manvolnum>9</manvolnum>
18813 <refmiscinfo class="version">4.1.27</refmiscinfo>
18814</refmeta>
18815<refnamediv>
18816 <refname>netdev_rx_handler_register</refname>
18817 <refpurpose>
18818     register receive handler
18819 </refpurpose>
18820</refnamediv>
18821<refsynopsisdiv>
18822 <title>Synopsis</title>
18823  <funcsynopsis><funcprototype>
18824   <funcdef>int <function>netdev_rx_handler_register </function></funcdef>
18825   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18826   <paramdef>rx_handler_func_t * <parameter>rx_handler</parameter></paramdef>
18827   <paramdef>void * <parameter>rx_handler_data</parameter></paramdef>
18828  </funcprototype></funcsynopsis>
18829</refsynopsisdiv>
18830<refsect1>
18831 <title>Arguments</title>
18832 <variablelist>
18833  <varlistentry>
18834   <term><parameter>dev</parameter></term>
18835   <listitem>
18836    <para>
18837     device to register a handler for
18838    </para>
18839   </listitem>
18840  </varlistentry>
18841  <varlistentry>
18842   <term><parameter>rx_handler</parameter></term>
18843   <listitem>
18844    <para>
18845     receive handler to register
18846    </para>
18847   </listitem>
18848  </varlistentry>
18849  <varlistentry>
18850   <term><parameter>rx_handler_data</parameter></term>
18851   <listitem>
18852    <para>
18853     data pointer that is used by rx handler
18854    </para>
18855   </listitem>
18856  </varlistentry>
18857 </variablelist>
18858</refsect1>
18859<refsect1>
18860<title>Description</title>
18861<para>
18862   Register a receive handler for a device. This handler will then be
18863   called from __netif_receive_skb. A negative errno code is returned
18864   on a failure.
18865   </para><para>
18866
18867   The caller must hold the rtnl_mutex.
18868   </para><para>
18869
18870   For a general description of rx_handler, see enum rx_handler_result.
18871</para>
18872</refsect1>
18873</refentry>
18874
18875<refentry id="API-netdev-rx-handler-unregister">
18876<refentryinfo>
18877 <title>LINUX</title>
18878 <productname>Kernel Hackers Manual</productname>
18879 <date>July 2017</date>
18880</refentryinfo>
18881<refmeta>
18882 <refentrytitle><phrase>netdev_rx_handler_unregister</phrase></refentrytitle>
18883 <manvolnum>9</manvolnum>
18884 <refmiscinfo class="version">4.1.27</refmiscinfo>
18885</refmeta>
18886<refnamediv>
18887 <refname>netdev_rx_handler_unregister</refname>
18888 <refpurpose>
18889     unregister receive handler
18890 </refpurpose>
18891</refnamediv>
18892<refsynopsisdiv>
18893 <title>Synopsis</title>
18894  <funcsynopsis><funcprototype>
18895   <funcdef>void <function>netdev_rx_handler_unregister </function></funcdef>
18896   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
18897  </funcprototype></funcsynopsis>
18898</refsynopsisdiv>
18899<refsect1>
18900 <title>Arguments</title>
18901 <variablelist>
18902  <varlistentry>
18903   <term><parameter>dev</parameter></term>
18904   <listitem>
18905    <para>
18906     device to unregister a handler from
18907    </para>
18908   </listitem>
18909  </varlistentry>
18910 </variablelist>
18911</refsect1>
18912<refsect1>
18913<title>Description</title>
18914<para>
18915   Unregister a receive handler from a device.
18916   </para><para>
18917
18918   The caller must hold the rtnl_mutex.
18919</para>
18920</refsect1>
18921</refentry>
18922
18923<refentry id="API-netif-receive-skb-sk">
18924<refentryinfo>
18925 <title>LINUX</title>
18926 <productname>Kernel Hackers Manual</productname>
18927 <date>July 2017</date>
18928</refentryinfo>
18929<refmeta>
18930 <refentrytitle><phrase>netif_receive_skb_sk</phrase></refentrytitle>
18931 <manvolnum>9</manvolnum>
18932 <refmiscinfo class="version">4.1.27</refmiscinfo>
18933</refmeta>
18934<refnamediv>
18935 <refname>netif_receive_skb_sk</refname>
18936 <refpurpose>
18937     process receive buffer from network
18938 </refpurpose>
18939</refnamediv>
18940<refsynopsisdiv>
18941 <title>Synopsis</title>
18942  <funcsynopsis><funcprototype>
18943   <funcdef>int <function>netif_receive_skb_sk </function></funcdef>
18944   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
18945   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
18946  </funcprototype></funcsynopsis>
18947</refsynopsisdiv>
18948<refsect1>
18949 <title>Arguments</title>
18950 <variablelist>
18951  <varlistentry>
18952   <term><parameter>sk</parameter></term>
18953   <listitem>
18954    <para>
18955     -- undescribed --
18956    </para>
18957   </listitem>
18958  </varlistentry>
18959  <varlistentry>
18960   <term><parameter>skb</parameter></term>
18961   <listitem>
18962    <para>
18963     buffer to process
18964    </para>
18965   </listitem>
18966  </varlistentry>
18967 </variablelist>
18968</refsect1>
18969<refsect1>
18970<title>Description</title>
18971<para>
18972   <function>netif_receive_skb</function> is the main receive data processing function.
18973   It always succeeds. The buffer may be dropped during processing
18974   for congestion control or by the protocol layers.
18975   </para><para>
18976
18977   This function may only be called from softirq context and interrupts
18978   should be enabled.
18979   </para><para>
18980
18981   Return values (usually ignored):
18982</para>
18983</refsect1>
18984<refsect1>
18985<title>NET_RX_SUCCESS</title>
18986<para>
18987   no congestion
18988</para>
18989</refsect1>
18990<refsect1>
18991<title>NET_RX_DROP</title>
18992<para>
18993   packet was dropped
18994</para>
18995</refsect1>
18996</refentry>
18997
18998<refentry id="API---napi-schedule">
18999<refentryinfo>
19000 <title>LINUX</title>
19001 <productname>Kernel Hackers Manual</productname>
19002 <date>July 2017</date>
19003</refentryinfo>
19004<refmeta>
19005 <refentrytitle><phrase>__napi_schedule</phrase></refentrytitle>
19006 <manvolnum>9</manvolnum>
19007 <refmiscinfo class="version">4.1.27</refmiscinfo>
19008</refmeta>
19009<refnamediv>
19010 <refname>__napi_schedule</refname>
19011 <refpurpose>
19012     schedule for receive
19013 </refpurpose>
19014</refnamediv>
19015<refsynopsisdiv>
19016 <title>Synopsis</title>
19017  <funcsynopsis><funcprototype>
19018   <funcdef>void <function>__napi_schedule </function></funcdef>
19019   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
19020  </funcprototype></funcsynopsis>
19021</refsynopsisdiv>
19022<refsect1>
19023 <title>Arguments</title>
19024 <variablelist>
19025  <varlistentry>
19026   <term><parameter>n</parameter></term>
19027   <listitem>
19028    <para>
19029     entry to schedule
19030    </para>
19031   </listitem>
19032  </varlistentry>
19033 </variablelist>
19034</refsect1>
19035<refsect1>
19036<title>Description</title>
19037<para>
19038   The entry's receive function will be scheduled to run.
19039   Consider using <function>__napi_schedule_irqoff</function> if hard irqs are masked.
19040</para>
19041</refsect1>
19042</refentry>
19043
19044<refentry id="API---napi-schedule-irqoff">
19045<refentryinfo>
19046 <title>LINUX</title>
19047 <productname>Kernel Hackers Manual</productname>
19048 <date>July 2017</date>
19049</refentryinfo>
19050<refmeta>
19051 <refentrytitle><phrase>__napi_schedule_irqoff</phrase></refentrytitle>
19052 <manvolnum>9</manvolnum>
19053 <refmiscinfo class="version">4.1.27</refmiscinfo>
19054</refmeta>
19055<refnamediv>
19056 <refname>__napi_schedule_irqoff</refname>
19057 <refpurpose>
19058     schedule for receive
19059 </refpurpose>
19060</refnamediv>
19061<refsynopsisdiv>
19062 <title>Synopsis</title>
19063  <funcsynopsis><funcprototype>
19064   <funcdef>void <function>__napi_schedule_irqoff </function></funcdef>
19065   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
19066  </funcprototype></funcsynopsis>
19067</refsynopsisdiv>
19068<refsect1>
19069 <title>Arguments</title>
19070 <variablelist>
19071  <varlistentry>
19072   <term><parameter>n</parameter></term>
19073   <listitem>
19074    <para>
19075     entry to schedule
19076    </para>
19077   </listitem>
19078  </varlistentry>
19079 </variablelist>
19080</refsect1>
19081<refsect1>
19082<title>Description</title>
19083<para>
19084   Variant of <function>__napi_schedule</function> assuming hard irqs are masked
19085</para>
19086</refsect1>
19087</refentry>
19088
19089<refentry id="API-netdev-has-upper-dev">
19090<refentryinfo>
19091 <title>LINUX</title>
19092 <productname>Kernel Hackers Manual</productname>
19093 <date>July 2017</date>
19094</refentryinfo>
19095<refmeta>
19096 <refentrytitle><phrase>netdev_has_upper_dev</phrase></refentrytitle>
19097 <manvolnum>9</manvolnum>
19098 <refmiscinfo class="version">4.1.27</refmiscinfo>
19099</refmeta>
19100<refnamediv>
19101 <refname>netdev_has_upper_dev</refname>
19102 <refpurpose>
19103     Check if device is linked to an upper device
19104 </refpurpose>
19105</refnamediv>
19106<refsynopsisdiv>
19107 <title>Synopsis</title>
19108  <funcsynopsis><funcprototype>
19109   <funcdef>bool <function>netdev_has_upper_dev </function></funcdef>
19110   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19111   <paramdef>struct net_device * <parameter>upper_dev</parameter></paramdef>
19112  </funcprototype></funcsynopsis>
19113</refsynopsisdiv>
19114<refsect1>
19115 <title>Arguments</title>
19116 <variablelist>
19117  <varlistentry>
19118   <term><parameter>dev</parameter></term>
19119   <listitem>
19120    <para>
19121     device
19122    </para>
19123   </listitem>
19124  </varlistentry>
19125  <varlistentry>
19126   <term><parameter>upper_dev</parameter></term>
19127   <listitem>
19128    <para>
19129     upper device to check
19130    </para>
19131   </listitem>
19132  </varlistentry>
19133 </variablelist>
19134</refsect1>
19135<refsect1>
19136<title>Description</title>
19137<para>
19138   Find out if a device is linked to specified upper device and return true
19139   in case it is. Note that this checks only immediate upper device,
19140   not through a complete stack of devices. The caller must hold the RTNL lock.
19141</para>
19142</refsect1>
19143</refentry>
19144
19145<refentry id="API-netdev-master-upper-dev-get">
19146<refentryinfo>
19147 <title>LINUX</title>
19148 <productname>Kernel Hackers Manual</productname>
19149 <date>July 2017</date>
19150</refentryinfo>
19151<refmeta>
19152 <refentrytitle><phrase>netdev_master_upper_dev_get</phrase></refentrytitle>
19153 <manvolnum>9</manvolnum>
19154 <refmiscinfo class="version">4.1.27</refmiscinfo>
19155</refmeta>
19156<refnamediv>
19157 <refname>netdev_master_upper_dev_get</refname>
19158 <refpurpose>
19159     Get master upper device
19160 </refpurpose>
19161</refnamediv>
19162<refsynopsisdiv>
19163 <title>Synopsis</title>
19164  <funcsynopsis><funcprototype>
19165   <funcdef>struct net_device * <function>netdev_master_upper_dev_get </function></funcdef>
19166   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19167  </funcprototype></funcsynopsis>
19168</refsynopsisdiv>
19169<refsect1>
19170 <title>Arguments</title>
19171 <variablelist>
19172  <varlistentry>
19173   <term><parameter>dev</parameter></term>
19174   <listitem>
19175    <para>
19176     device
19177    </para>
19178   </listitem>
19179  </varlistentry>
19180 </variablelist>
19181</refsect1>
19182<refsect1>
19183<title>Description</title>
19184<para>
19185   Find a master upper device and return pointer to it or NULL in case
19186   it's not there. The caller must hold the RTNL lock.
19187</para>
19188</refsect1>
19189</refentry>
19190
19191<refentry id="API-netdev-upper-get-next-dev-rcu">
19192<refentryinfo>
19193 <title>LINUX</title>
19194 <productname>Kernel Hackers Manual</productname>
19195 <date>July 2017</date>
19196</refentryinfo>
19197<refmeta>
19198 <refentrytitle><phrase>netdev_upper_get_next_dev_rcu</phrase></refentrytitle>
19199 <manvolnum>9</manvolnum>
19200 <refmiscinfo class="version">4.1.27</refmiscinfo>
19201</refmeta>
19202<refnamediv>
19203 <refname>netdev_upper_get_next_dev_rcu</refname>
19204 <refpurpose>
19205     Get the next dev from upper list
19206 </refpurpose>
19207</refnamediv>
19208<refsynopsisdiv>
19209 <title>Synopsis</title>
19210  <funcsynopsis><funcprototype>
19211   <funcdef>struct net_device * <function>netdev_upper_get_next_dev_rcu </function></funcdef>
19212   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19213   <paramdef>struct list_head ** <parameter>iter</parameter></paramdef>
19214  </funcprototype></funcsynopsis>
19215</refsynopsisdiv>
19216<refsect1>
19217 <title>Arguments</title>
19218 <variablelist>
19219  <varlistentry>
19220   <term><parameter>dev</parameter></term>
19221   <listitem>
19222    <para>
19223     device
19224    </para>
19225   </listitem>
19226  </varlistentry>
19227  <varlistentry>
19228   <term><parameter>iter</parameter></term>
19229   <listitem>
19230    <para>
19231     list_head ** of the current position
19232    </para>
19233   </listitem>
19234  </varlistentry>
19235 </variablelist>
19236</refsect1>
19237<refsect1>
19238<title>Description</title>
19239<para>
19240   Gets the next device from the dev's upper list, starting from iter
19241   position. The caller must hold RCU read lock.
19242</para>
19243</refsect1>
19244</refentry>
19245
19246<refentry id="API-netdev-all-upper-get-next-dev-rcu">
19247<refentryinfo>
19248 <title>LINUX</title>
19249 <productname>Kernel Hackers Manual</productname>
19250 <date>July 2017</date>
19251</refentryinfo>
19252<refmeta>
19253 <refentrytitle><phrase>netdev_all_upper_get_next_dev_rcu</phrase></refentrytitle>
19254 <manvolnum>9</manvolnum>
19255 <refmiscinfo class="version">4.1.27</refmiscinfo>
19256</refmeta>
19257<refnamediv>
19258 <refname>netdev_all_upper_get_next_dev_rcu</refname>
19259 <refpurpose>
19260     Get the next dev from upper list
19261 </refpurpose>
19262</refnamediv>
19263<refsynopsisdiv>
19264 <title>Synopsis</title>
19265  <funcsynopsis><funcprototype>
19266   <funcdef>struct net_device * <function>netdev_all_upper_get_next_dev_rcu </function></funcdef>
19267   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19268   <paramdef>struct list_head ** <parameter>iter</parameter></paramdef>
19269  </funcprototype></funcsynopsis>
19270</refsynopsisdiv>
19271<refsect1>
19272 <title>Arguments</title>
19273 <variablelist>
19274  <varlistentry>
19275   <term><parameter>dev</parameter></term>
19276   <listitem>
19277    <para>
19278     device
19279    </para>
19280   </listitem>
19281  </varlistentry>
19282  <varlistentry>
19283   <term><parameter>iter</parameter></term>
19284   <listitem>
19285    <para>
19286     list_head ** of the current position
19287    </para>
19288   </listitem>
19289  </varlistentry>
19290 </variablelist>
19291</refsect1>
19292<refsect1>
19293<title>Description</title>
19294<para>
19295   Gets the next device from the dev's upper list, starting from iter
19296   position. The caller must hold RCU read lock.
19297</para>
19298</refsect1>
19299</refentry>
19300
19301<refentry id="API-netdev-lower-get-next-private">
19302<refentryinfo>
19303 <title>LINUX</title>
19304 <productname>Kernel Hackers Manual</productname>
19305 <date>July 2017</date>
19306</refentryinfo>
19307<refmeta>
19308 <refentrytitle><phrase>netdev_lower_get_next_private</phrase></refentrytitle>
19309 <manvolnum>9</manvolnum>
19310 <refmiscinfo class="version">4.1.27</refmiscinfo>
19311</refmeta>
19312<refnamediv>
19313 <refname>netdev_lower_get_next_private</refname>
19314 <refpurpose>
19315     Get the next -&gt;private from the lower neighbour list
19316 </refpurpose>
19317</refnamediv>
19318<refsynopsisdiv>
19319 <title>Synopsis</title>
19320  <funcsynopsis><funcprototype>
19321   <funcdef>void * <function>netdev_lower_get_next_private </function></funcdef>
19322   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19323   <paramdef>struct list_head ** <parameter>iter</parameter></paramdef>
19324  </funcprototype></funcsynopsis>
19325</refsynopsisdiv>
19326<refsect1>
19327 <title>Arguments</title>
19328 <variablelist>
19329  <varlistentry>
19330   <term><parameter>dev</parameter></term>
19331   <listitem>
19332    <para>
19333     device
19334    </para>
19335   </listitem>
19336  </varlistentry>
19337  <varlistentry>
19338   <term><parameter>iter</parameter></term>
19339   <listitem>
19340    <para>
19341     list_head ** of the current position
19342    </para>
19343   </listitem>
19344  </varlistentry>
19345 </variablelist>
19346</refsect1>
19347<refsect1>
19348<title>Description</title>
19349<para>
19350   Gets the next netdev_adjacent-&gt;private from the dev's lower neighbour
19351   list, starting from iter position. The caller must hold either hold the
19352   RTNL lock or its own locking that guarantees that the neighbour lower
19353   list will remain unchainged.
19354</para>
19355</refsect1>
19356</refentry>
19357
19358<refentry id="API-netdev-lower-get-next-private-rcu">
19359<refentryinfo>
19360 <title>LINUX</title>
19361 <productname>Kernel Hackers Manual</productname>
19362 <date>July 2017</date>
19363</refentryinfo>
19364<refmeta>
19365 <refentrytitle><phrase>netdev_lower_get_next_private_rcu</phrase></refentrytitle>
19366 <manvolnum>9</manvolnum>
19367 <refmiscinfo class="version">4.1.27</refmiscinfo>
19368</refmeta>
19369<refnamediv>
19370 <refname>netdev_lower_get_next_private_rcu</refname>
19371 <refpurpose>
19372     Get the next -&gt;private from the lower neighbour list, RCU variant
19373 </refpurpose>
19374</refnamediv>
19375<refsynopsisdiv>
19376 <title>Synopsis</title>
19377  <funcsynopsis><funcprototype>
19378   <funcdef>void * <function>netdev_lower_get_next_private_rcu </function></funcdef>
19379   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19380   <paramdef>struct list_head ** <parameter>iter</parameter></paramdef>
19381  </funcprototype></funcsynopsis>
19382</refsynopsisdiv>
19383<refsect1>
19384 <title>Arguments</title>
19385 <variablelist>
19386  <varlistentry>
19387   <term><parameter>dev</parameter></term>
19388   <listitem>
19389    <para>
19390     device
19391    </para>
19392   </listitem>
19393  </varlistentry>
19394  <varlistentry>
19395   <term><parameter>iter</parameter></term>
19396   <listitem>
19397    <para>
19398     list_head ** of the current position
19399    </para>
19400   </listitem>
19401  </varlistentry>
19402 </variablelist>
19403</refsect1>
19404<refsect1>
19405<title>Description</title>
19406<para>
19407   Gets the next netdev_adjacent-&gt;private from the dev's lower neighbour
19408   list, starting from iter position. The caller must hold RCU read lock.
19409</para>
19410</refsect1>
19411</refentry>
19412
19413<refentry id="API-netdev-lower-get-next">
19414<refentryinfo>
19415 <title>LINUX</title>
19416 <productname>Kernel Hackers Manual</productname>
19417 <date>July 2017</date>
19418</refentryinfo>
19419<refmeta>
19420 <refentrytitle><phrase>netdev_lower_get_next</phrase></refentrytitle>
19421 <manvolnum>9</manvolnum>
19422 <refmiscinfo class="version">4.1.27</refmiscinfo>
19423</refmeta>
19424<refnamediv>
19425 <refname>netdev_lower_get_next</refname>
19426 <refpurpose>
19427     Get the next device from the lower neighbour list
19428 </refpurpose>
19429</refnamediv>
19430<refsynopsisdiv>
19431 <title>Synopsis</title>
19432  <funcsynopsis><funcprototype>
19433   <funcdef>void * <function>netdev_lower_get_next </function></funcdef>
19434   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19435   <paramdef>struct list_head ** <parameter>iter</parameter></paramdef>
19436  </funcprototype></funcsynopsis>
19437</refsynopsisdiv>
19438<refsect1>
19439 <title>Arguments</title>
19440 <variablelist>
19441  <varlistentry>
19442   <term><parameter>dev</parameter></term>
19443   <listitem>
19444    <para>
19445     device
19446    </para>
19447   </listitem>
19448  </varlistentry>
19449  <varlistentry>
19450   <term><parameter>iter</parameter></term>
19451   <listitem>
19452    <para>
19453     list_head ** of the current position
19454    </para>
19455   </listitem>
19456  </varlistentry>
19457 </variablelist>
19458</refsect1>
19459<refsect1>
19460<title>Description</title>
19461<para>
19462   Gets the next netdev_adjacent from the dev's lower neighbour
19463   list, starting from iter position. The caller must hold RTNL lock or
19464   its own locking that guarantees that the neighbour lower
19465   list will remain unchainged.
19466</para>
19467</refsect1>
19468</refentry>
19469
19470<refentry id="API-netdev-lower-get-first-private-rcu">
19471<refentryinfo>
19472 <title>LINUX</title>
19473 <productname>Kernel Hackers Manual</productname>
19474 <date>July 2017</date>
19475</refentryinfo>
19476<refmeta>
19477 <refentrytitle><phrase>netdev_lower_get_first_private_rcu</phrase></refentrytitle>
19478 <manvolnum>9</manvolnum>
19479 <refmiscinfo class="version">4.1.27</refmiscinfo>
19480</refmeta>
19481<refnamediv>
19482 <refname>netdev_lower_get_first_private_rcu</refname>
19483 <refpurpose>
19484     Get the first -&gt;private from the lower neighbour list, RCU variant
19485 </refpurpose>
19486</refnamediv>
19487<refsynopsisdiv>
19488 <title>Synopsis</title>
19489  <funcsynopsis><funcprototype>
19490   <funcdef>void * <function>netdev_lower_get_first_private_rcu </function></funcdef>
19491   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19492  </funcprototype></funcsynopsis>
19493</refsynopsisdiv>
19494<refsect1>
19495 <title>Arguments</title>
19496 <variablelist>
19497  <varlistentry>
19498   <term><parameter>dev</parameter></term>
19499   <listitem>
19500    <para>
19501     device
19502    </para>
19503   </listitem>
19504  </varlistentry>
19505 </variablelist>
19506</refsect1>
19507<refsect1>
19508<title>Description</title>
19509<para>
19510   Gets the first netdev_adjacent-&gt;private from the dev's lower neighbour
19511   list. The caller must hold RCU read lock.
19512</para>
19513</refsect1>
19514</refentry>
19515
19516<refentry id="API-netdev-master-upper-dev-get-rcu">
19517<refentryinfo>
19518 <title>LINUX</title>
19519 <productname>Kernel Hackers Manual</productname>
19520 <date>July 2017</date>
19521</refentryinfo>
19522<refmeta>
19523 <refentrytitle><phrase>netdev_master_upper_dev_get_rcu</phrase></refentrytitle>
19524 <manvolnum>9</manvolnum>
19525 <refmiscinfo class="version">4.1.27</refmiscinfo>
19526</refmeta>
19527<refnamediv>
19528 <refname>netdev_master_upper_dev_get_rcu</refname>
19529 <refpurpose>
19530     Get master upper device
19531 </refpurpose>
19532</refnamediv>
19533<refsynopsisdiv>
19534 <title>Synopsis</title>
19535  <funcsynopsis><funcprototype>
19536   <funcdef>struct net_device * <function>netdev_master_upper_dev_get_rcu </function></funcdef>
19537   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19538  </funcprototype></funcsynopsis>
19539</refsynopsisdiv>
19540<refsect1>
19541 <title>Arguments</title>
19542 <variablelist>
19543  <varlistentry>
19544   <term><parameter>dev</parameter></term>
19545   <listitem>
19546    <para>
19547     device
19548    </para>
19549   </listitem>
19550  </varlistentry>
19551 </variablelist>
19552</refsect1>
19553<refsect1>
19554<title>Description</title>
19555<para>
19556   Find a master upper device and return pointer to it or NULL in case
19557   it's not there. The caller must hold the RCU read lock.
19558</para>
19559</refsect1>
19560</refentry>
19561
19562<refentry id="API-netdev-upper-dev-link">
19563<refentryinfo>
19564 <title>LINUX</title>
19565 <productname>Kernel Hackers Manual</productname>
19566 <date>July 2017</date>
19567</refentryinfo>
19568<refmeta>
19569 <refentrytitle><phrase>netdev_upper_dev_link</phrase></refentrytitle>
19570 <manvolnum>9</manvolnum>
19571 <refmiscinfo class="version">4.1.27</refmiscinfo>
19572</refmeta>
19573<refnamediv>
19574 <refname>netdev_upper_dev_link</refname>
19575 <refpurpose>
19576     Add a link to the upper device
19577 </refpurpose>
19578</refnamediv>
19579<refsynopsisdiv>
19580 <title>Synopsis</title>
19581  <funcsynopsis><funcprototype>
19582   <funcdef>int <function>netdev_upper_dev_link </function></funcdef>
19583   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19584   <paramdef>struct net_device * <parameter>upper_dev</parameter></paramdef>
19585  </funcprototype></funcsynopsis>
19586</refsynopsisdiv>
19587<refsect1>
19588 <title>Arguments</title>
19589 <variablelist>
19590  <varlistentry>
19591   <term><parameter>dev</parameter></term>
19592   <listitem>
19593    <para>
19594     device
19595    </para>
19596   </listitem>
19597  </varlistentry>
19598  <varlistentry>
19599   <term><parameter>upper_dev</parameter></term>
19600   <listitem>
19601    <para>
19602     new upper device
19603    </para>
19604   </listitem>
19605  </varlistentry>
19606 </variablelist>
19607</refsect1>
19608<refsect1>
19609<title>Description</title>
19610<para>
19611   Adds a link to device which is upper to this one. The caller must hold
19612   the RTNL lock. On a failure a negative errno code is returned.
19613   On success the reference counts are adjusted and the function
19614   returns zero.
19615</para>
19616</refsect1>
19617</refentry>
19618
19619<refentry id="API-netdev-master-upper-dev-link">
19620<refentryinfo>
19621 <title>LINUX</title>
19622 <productname>Kernel Hackers Manual</productname>
19623 <date>July 2017</date>
19624</refentryinfo>
19625<refmeta>
19626 <refentrytitle><phrase>netdev_master_upper_dev_link</phrase></refentrytitle>
19627 <manvolnum>9</manvolnum>
19628 <refmiscinfo class="version">4.1.27</refmiscinfo>
19629</refmeta>
19630<refnamediv>
19631 <refname>netdev_master_upper_dev_link</refname>
19632 <refpurpose>
19633     Add a master link to the upper device
19634 </refpurpose>
19635</refnamediv>
19636<refsynopsisdiv>
19637 <title>Synopsis</title>
19638  <funcsynopsis><funcprototype>
19639   <funcdef>int <function>netdev_master_upper_dev_link </function></funcdef>
19640   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19641   <paramdef>struct net_device * <parameter>upper_dev</parameter></paramdef>
19642  </funcprototype></funcsynopsis>
19643</refsynopsisdiv>
19644<refsect1>
19645 <title>Arguments</title>
19646 <variablelist>
19647  <varlistentry>
19648   <term><parameter>dev</parameter></term>
19649   <listitem>
19650    <para>
19651     device
19652    </para>
19653   </listitem>
19654  </varlistentry>
19655  <varlistentry>
19656   <term><parameter>upper_dev</parameter></term>
19657   <listitem>
19658    <para>
19659     new upper device
19660    </para>
19661   </listitem>
19662  </varlistentry>
19663 </variablelist>
19664</refsect1>
19665<refsect1>
19666<title>Description</title>
19667<para>
19668   Adds a link to device which is upper to this one. In this case, only
19669   one master upper device can be linked, although other non-master devices
19670   might be linked as well. The caller must hold the RTNL lock.
19671   On a failure a negative errno code is returned. On success the reference
19672   counts are adjusted and the function returns zero.
19673</para>
19674</refsect1>
19675</refentry>
19676
19677<refentry id="API-netdev-upper-dev-unlink">
19678<refentryinfo>
19679 <title>LINUX</title>
19680 <productname>Kernel Hackers Manual</productname>
19681 <date>July 2017</date>
19682</refentryinfo>
19683<refmeta>
19684 <refentrytitle><phrase>netdev_upper_dev_unlink</phrase></refentrytitle>
19685 <manvolnum>9</manvolnum>
19686 <refmiscinfo class="version">4.1.27</refmiscinfo>
19687</refmeta>
19688<refnamediv>
19689 <refname>netdev_upper_dev_unlink</refname>
19690 <refpurpose>
19691     Removes a link to upper device
19692 </refpurpose>
19693</refnamediv>
19694<refsynopsisdiv>
19695 <title>Synopsis</title>
19696  <funcsynopsis><funcprototype>
19697   <funcdef>void <function>netdev_upper_dev_unlink </function></funcdef>
19698   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19699   <paramdef>struct net_device * <parameter>upper_dev</parameter></paramdef>
19700  </funcprototype></funcsynopsis>
19701</refsynopsisdiv>
19702<refsect1>
19703 <title>Arguments</title>
19704 <variablelist>
19705  <varlistentry>
19706   <term><parameter>dev</parameter></term>
19707   <listitem>
19708    <para>
19709     device
19710    </para>
19711   </listitem>
19712  </varlistentry>
19713  <varlistentry>
19714   <term><parameter>upper_dev</parameter></term>
19715   <listitem>
19716    <para>
19717     new upper device
19718    </para>
19719   </listitem>
19720  </varlistentry>
19721 </variablelist>
19722</refsect1>
19723<refsect1>
19724<title>Description</title>
19725<para>
19726   Removes a link to device which is upper to this one. The caller must hold
19727   the RTNL lock.
19728</para>
19729</refsect1>
19730</refentry>
19731
19732<refentry id="API-netdev-bonding-info-change">
19733<refentryinfo>
19734 <title>LINUX</title>
19735 <productname>Kernel Hackers Manual</productname>
19736 <date>July 2017</date>
19737</refentryinfo>
19738<refmeta>
19739 <refentrytitle><phrase>netdev_bonding_info_change</phrase></refentrytitle>
19740 <manvolnum>9</manvolnum>
19741 <refmiscinfo class="version">4.1.27</refmiscinfo>
19742</refmeta>
19743<refnamediv>
19744 <refname>netdev_bonding_info_change</refname>
19745 <refpurpose>
19746     Dispatch event about slave change
19747 </refpurpose>
19748</refnamediv>
19749<refsynopsisdiv>
19750 <title>Synopsis</title>
19751  <funcsynopsis><funcprototype>
19752   <funcdef>void <function>netdev_bonding_info_change </function></funcdef>
19753   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19754   <paramdef>struct netdev_bonding_info * <parameter>bonding_info</parameter></paramdef>
19755  </funcprototype></funcsynopsis>
19756</refsynopsisdiv>
19757<refsect1>
19758 <title>Arguments</title>
19759 <variablelist>
19760  <varlistentry>
19761   <term><parameter>dev</parameter></term>
19762   <listitem>
19763    <para>
19764     device
19765    </para>
19766   </listitem>
19767  </varlistentry>
19768  <varlistentry>
19769   <term><parameter>bonding_info</parameter></term>
19770   <listitem>
19771    <para>
19772     info to dispatch
19773    </para>
19774   </listitem>
19775  </varlistentry>
19776 </variablelist>
19777</refsect1>
19778<refsect1>
19779<title>Description</title>
19780<para>
19781   Send NETDEV_BONDING_INFO to netdev notifiers with info.
19782   The caller must hold the RTNL lock.
19783</para>
19784</refsect1>
19785</refentry>
19786
19787<refentry id="API-dev-set-promiscuity">
19788<refentryinfo>
19789 <title>LINUX</title>
19790 <productname>Kernel Hackers Manual</productname>
19791 <date>July 2017</date>
19792</refentryinfo>
19793<refmeta>
19794 <refentrytitle><phrase>dev_set_promiscuity</phrase></refentrytitle>
19795 <manvolnum>9</manvolnum>
19796 <refmiscinfo class="version">4.1.27</refmiscinfo>
19797</refmeta>
19798<refnamediv>
19799 <refname>dev_set_promiscuity</refname>
19800 <refpurpose>
19801     update promiscuity count on a device
19802 </refpurpose>
19803</refnamediv>
19804<refsynopsisdiv>
19805 <title>Synopsis</title>
19806  <funcsynopsis><funcprototype>
19807   <funcdef>int <function>dev_set_promiscuity </function></funcdef>
19808   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19809   <paramdef>int <parameter>inc</parameter></paramdef>
19810  </funcprototype></funcsynopsis>
19811</refsynopsisdiv>
19812<refsect1>
19813 <title>Arguments</title>
19814 <variablelist>
19815  <varlistentry>
19816   <term><parameter>dev</parameter></term>
19817   <listitem>
19818    <para>
19819     device
19820    </para>
19821   </listitem>
19822  </varlistentry>
19823  <varlistentry>
19824   <term><parameter>inc</parameter></term>
19825   <listitem>
19826    <para>
19827     modifier
19828    </para>
19829   </listitem>
19830  </varlistentry>
19831 </variablelist>
19832</refsect1>
19833<refsect1>
19834<title>Description</title>
19835<para>
19836   Add or remove promiscuity from a device. While the count in the device
19837   remains above zero the interface remains promiscuous. Once it hits zero
19838   the device reverts back to normal filtering operation. A negative inc
19839   value is used to drop promiscuity on the device.
19840   Return 0 if successful or a negative errno code on error.
19841</para>
19842</refsect1>
19843</refentry>
19844
19845<refentry id="API-dev-set-allmulti">
19846<refentryinfo>
19847 <title>LINUX</title>
19848 <productname>Kernel Hackers Manual</productname>
19849 <date>July 2017</date>
19850</refentryinfo>
19851<refmeta>
19852 <refentrytitle><phrase>dev_set_allmulti</phrase></refentrytitle>
19853 <manvolnum>9</manvolnum>
19854 <refmiscinfo class="version">4.1.27</refmiscinfo>
19855</refmeta>
19856<refnamediv>
19857 <refname>dev_set_allmulti</refname>
19858 <refpurpose>
19859     update allmulti count on a device
19860 </refpurpose>
19861</refnamediv>
19862<refsynopsisdiv>
19863 <title>Synopsis</title>
19864  <funcsynopsis><funcprototype>
19865   <funcdef>int <function>dev_set_allmulti </function></funcdef>
19866   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19867   <paramdef>int <parameter>inc</parameter></paramdef>
19868  </funcprototype></funcsynopsis>
19869</refsynopsisdiv>
19870<refsect1>
19871 <title>Arguments</title>
19872 <variablelist>
19873  <varlistentry>
19874   <term><parameter>dev</parameter></term>
19875   <listitem>
19876    <para>
19877     device
19878    </para>
19879   </listitem>
19880  </varlistentry>
19881  <varlistentry>
19882   <term><parameter>inc</parameter></term>
19883   <listitem>
19884    <para>
19885     modifier
19886    </para>
19887   </listitem>
19888  </varlistentry>
19889 </variablelist>
19890</refsect1>
19891<refsect1>
19892<title>Description</title>
19893<para>
19894   Add or remove reception of all multicast frames to a device. While the
19895   count in the device remains above zero the interface remains listening
19896   to all interfaces. Once it hits zero the device reverts back to normal
19897   filtering operation. A negative <parameter>inc</parameter> value is used to drop the counter
19898   when releasing a resource needing all multicasts.
19899   Return 0 if successful or a negative errno code on error.
19900</para>
19901</refsect1>
19902</refentry>
19903
19904<refentry id="API-dev-get-flags">
19905<refentryinfo>
19906 <title>LINUX</title>
19907 <productname>Kernel Hackers Manual</productname>
19908 <date>July 2017</date>
19909</refentryinfo>
19910<refmeta>
19911 <refentrytitle><phrase>dev_get_flags</phrase></refentrytitle>
19912 <manvolnum>9</manvolnum>
19913 <refmiscinfo class="version">4.1.27</refmiscinfo>
19914</refmeta>
19915<refnamediv>
19916 <refname>dev_get_flags</refname>
19917 <refpurpose>
19918     get flags reported to userspace
19919 </refpurpose>
19920</refnamediv>
19921<refsynopsisdiv>
19922 <title>Synopsis</title>
19923  <funcsynopsis><funcprototype>
19924   <funcdef>unsigned int <function>dev_get_flags </function></funcdef>
19925   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
19926  </funcprototype></funcsynopsis>
19927</refsynopsisdiv>
19928<refsect1>
19929 <title>Arguments</title>
19930 <variablelist>
19931  <varlistentry>
19932   <term><parameter>dev</parameter></term>
19933   <listitem>
19934    <para>
19935     device
19936    </para>
19937   </listitem>
19938  </varlistentry>
19939 </variablelist>
19940</refsect1>
19941<refsect1>
19942<title>Description</title>
19943<para>
19944   Get the combination of flag bits exported through APIs to userspace.
19945</para>
19946</refsect1>
19947</refentry>
19948
19949<refentry id="API-dev-change-flags">
19950<refentryinfo>
19951 <title>LINUX</title>
19952 <productname>Kernel Hackers Manual</productname>
19953 <date>July 2017</date>
19954</refentryinfo>
19955<refmeta>
19956 <refentrytitle><phrase>dev_change_flags</phrase></refentrytitle>
19957 <manvolnum>9</manvolnum>
19958 <refmiscinfo class="version">4.1.27</refmiscinfo>
19959</refmeta>
19960<refnamediv>
19961 <refname>dev_change_flags</refname>
19962 <refpurpose>
19963     change device settings
19964 </refpurpose>
19965</refnamediv>
19966<refsynopsisdiv>
19967 <title>Synopsis</title>
19968  <funcsynopsis><funcprototype>
19969   <funcdef>int <function>dev_change_flags </function></funcdef>
19970   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
19971   <paramdef>unsigned int <parameter>flags</parameter></paramdef>
19972  </funcprototype></funcsynopsis>
19973</refsynopsisdiv>
19974<refsect1>
19975 <title>Arguments</title>
19976 <variablelist>
19977  <varlistentry>
19978   <term><parameter>dev</parameter></term>
19979   <listitem>
19980    <para>
19981     device
19982    </para>
19983   </listitem>
19984  </varlistentry>
19985  <varlistentry>
19986   <term><parameter>flags</parameter></term>
19987   <listitem>
19988    <para>
19989     device state flags
19990    </para>
19991   </listitem>
19992  </varlistentry>
19993 </variablelist>
19994</refsect1>
19995<refsect1>
19996<title>Description</title>
19997<para>
19998   Change settings on device based state flags. The flags are
19999   in the userspace exported format.
20000</para>
20001</refsect1>
20002</refentry>
20003
20004<refentry id="API-dev-set-mtu">
20005<refentryinfo>
20006 <title>LINUX</title>
20007 <productname>Kernel Hackers Manual</productname>
20008 <date>July 2017</date>
20009</refentryinfo>
20010<refmeta>
20011 <refentrytitle><phrase>dev_set_mtu</phrase></refentrytitle>
20012 <manvolnum>9</manvolnum>
20013 <refmiscinfo class="version">4.1.27</refmiscinfo>
20014</refmeta>
20015<refnamediv>
20016 <refname>dev_set_mtu</refname>
20017 <refpurpose>
20018     Change maximum transfer unit
20019 </refpurpose>
20020</refnamediv>
20021<refsynopsisdiv>
20022 <title>Synopsis</title>
20023  <funcsynopsis><funcprototype>
20024   <funcdef>int <function>dev_set_mtu </function></funcdef>
20025   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20026   <paramdef>int <parameter>new_mtu</parameter></paramdef>
20027  </funcprototype></funcsynopsis>
20028</refsynopsisdiv>
20029<refsect1>
20030 <title>Arguments</title>
20031 <variablelist>
20032  <varlistentry>
20033   <term><parameter>dev</parameter></term>
20034   <listitem>
20035    <para>
20036     device
20037    </para>
20038   </listitem>
20039  </varlistentry>
20040  <varlistentry>
20041   <term><parameter>new_mtu</parameter></term>
20042   <listitem>
20043    <para>
20044     new transfer unit
20045    </para>
20046   </listitem>
20047  </varlistentry>
20048 </variablelist>
20049</refsect1>
20050<refsect1>
20051<title>Description</title>
20052<para>
20053   Change the maximum transfer size of the network device.
20054</para>
20055</refsect1>
20056</refentry>
20057
20058<refentry id="API-dev-set-group">
20059<refentryinfo>
20060 <title>LINUX</title>
20061 <productname>Kernel Hackers Manual</productname>
20062 <date>July 2017</date>
20063</refentryinfo>
20064<refmeta>
20065 <refentrytitle><phrase>dev_set_group</phrase></refentrytitle>
20066 <manvolnum>9</manvolnum>
20067 <refmiscinfo class="version">4.1.27</refmiscinfo>
20068</refmeta>
20069<refnamediv>
20070 <refname>dev_set_group</refname>
20071 <refpurpose>
20072     Change group this device belongs to
20073 </refpurpose>
20074</refnamediv>
20075<refsynopsisdiv>
20076 <title>Synopsis</title>
20077  <funcsynopsis><funcprototype>
20078   <funcdef>void <function>dev_set_group </function></funcdef>
20079   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20080   <paramdef>int <parameter>new_group</parameter></paramdef>
20081  </funcprototype></funcsynopsis>
20082</refsynopsisdiv>
20083<refsect1>
20084 <title>Arguments</title>
20085 <variablelist>
20086  <varlistentry>
20087   <term><parameter>dev</parameter></term>
20088   <listitem>
20089    <para>
20090     device
20091    </para>
20092   </listitem>
20093  </varlistentry>
20094  <varlistentry>
20095   <term><parameter>new_group</parameter></term>
20096   <listitem>
20097    <para>
20098     group this device should belong to
20099    </para>
20100   </listitem>
20101  </varlistentry>
20102 </variablelist>
20103</refsect1>
20104</refentry>
20105
20106<refentry id="API-dev-set-mac-address">
20107<refentryinfo>
20108 <title>LINUX</title>
20109 <productname>Kernel Hackers Manual</productname>
20110 <date>July 2017</date>
20111</refentryinfo>
20112<refmeta>
20113 <refentrytitle><phrase>dev_set_mac_address</phrase></refentrytitle>
20114 <manvolnum>9</manvolnum>
20115 <refmiscinfo class="version">4.1.27</refmiscinfo>
20116</refmeta>
20117<refnamediv>
20118 <refname>dev_set_mac_address</refname>
20119 <refpurpose>
20120     Change Media Access Control Address
20121 </refpurpose>
20122</refnamediv>
20123<refsynopsisdiv>
20124 <title>Synopsis</title>
20125  <funcsynopsis><funcprototype>
20126   <funcdef>int <function>dev_set_mac_address </function></funcdef>
20127   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20128   <paramdef>struct sockaddr * <parameter>sa</parameter></paramdef>
20129  </funcprototype></funcsynopsis>
20130</refsynopsisdiv>
20131<refsect1>
20132 <title>Arguments</title>
20133 <variablelist>
20134  <varlistentry>
20135   <term><parameter>dev</parameter></term>
20136   <listitem>
20137    <para>
20138     device
20139    </para>
20140   </listitem>
20141  </varlistentry>
20142  <varlistentry>
20143   <term><parameter>sa</parameter></term>
20144   <listitem>
20145    <para>
20146     new address
20147    </para>
20148   </listitem>
20149  </varlistentry>
20150 </variablelist>
20151</refsect1>
20152<refsect1>
20153<title>Description</title>
20154<para>
20155   Change the hardware (MAC) address of the device
20156</para>
20157</refsect1>
20158</refentry>
20159
20160<refentry id="API-dev-change-carrier">
20161<refentryinfo>
20162 <title>LINUX</title>
20163 <productname>Kernel Hackers Manual</productname>
20164 <date>July 2017</date>
20165</refentryinfo>
20166<refmeta>
20167 <refentrytitle><phrase>dev_change_carrier</phrase></refentrytitle>
20168 <manvolnum>9</manvolnum>
20169 <refmiscinfo class="version">4.1.27</refmiscinfo>
20170</refmeta>
20171<refnamediv>
20172 <refname>dev_change_carrier</refname>
20173 <refpurpose>
20174     Change device carrier
20175 </refpurpose>
20176</refnamediv>
20177<refsynopsisdiv>
20178 <title>Synopsis</title>
20179  <funcsynopsis><funcprototype>
20180   <funcdef>int <function>dev_change_carrier </function></funcdef>
20181   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20182   <paramdef>bool <parameter>new_carrier</parameter></paramdef>
20183  </funcprototype></funcsynopsis>
20184</refsynopsisdiv>
20185<refsect1>
20186 <title>Arguments</title>
20187 <variablelist>
20188  <varlistentry>
20189   <term><parameter>dev</parameter></term>
20190   <listitem>
20191    <para>
20192     device
20193    </para>
20194   </listitem>
20195  </varlistentry>
20196  <varlistentry>
20197   <term><parameter>new_carrier</parameter></term>
20198   <listitem>
20199    <para>
20200     new value
20201    </para>
20202   </listitem>
20203  </varlistentry>
20204 </variablelist>
20205</refsect1>
20206<refsect1>
20207<title>Description</title>
20208<para>
20209   Change device carrier
20210</para>
20211</refsect1>
20212</refentry>
20213
20214<refentry id="API-dev-get-phys-port-id">
20215<refentryinfo>
20216 <title>LINUX</title>
20217 <productname>Kernel Hackers Manual</productname>
20218 <date>July 2017</date>
20219</refentryinfo>
20220<refmeta>
20221 <refentrytitle><phrase>dev_get_phys_port_id</phrase></refentrytitle>
20222 <manvolnum>9</manvolnum>
20223 <refmiscinfo class="version">4.1.27</refmiscinfo>
20224</refmeta>
20225<refnamediv>
20226 <refname>dev_get_phys_port_id</refname>
20227 <refpurpose>
20228     Get device physical port ID
20229 </refpurpose>
20230</refnamediv>
20231<refsynopsisdiv>
20232 <title>Synopsis</title>
20233  <funcsynopsis><funcprototype>
20234   <funcdef>int <function>dev_get_phys_port_id </function></funcdef>
20235   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20236   <paramdef>struct netdev_phys_item_id * <parameter>ppid</parameter></paramdef>
20237  </funcprototype></funcsynopsis>
20238</refsynopsisdiv>
20239<refsect1>
20240 <title>Arguments</title>
20241 <variablelist>
20242  <varlistentry>
20243   <term><parameter>dev</parameter></term>
20244   <listitem>
20245    <para>
20246     device
20247    </para>
20248   </listitem>
20249  </varlistentry>
20250  <varlistentry>
20251   <term><parameter>ppid</parameter></term>
20252   <listitem>
20253    <para>
20254     port ID
20255    </para>
20256   </listitem>
20257  </varlistentry>
20258 </variablelist>
20259</refsect1>
20260<refsect1>
20261<title>Description</title>
20262<para>
20263   Get device physical port ID
20264</para>
20265</refsect1>
20266</refentry>
20267
20268<refentry id="API-dev-get-phys-port-name">
20269<refentryinfo>
20270 <title>LINUX</title>
20271 <productname>Kernel Hackers Manual</productname>
20272 <date>July 2017</date>
20273</refentryinfo>
20274<refmeta>
20275 <refentrytitle><phrase>dev_get_phys_port_name</phrase></refentrytitle>
20276 <manvolnum>9</manvolnum>
20277 <refmiscinfo class="version">4.1.27</refmiscinfo>
20278</refmeta>
20279<refnamediv>
20280 <refname>dev_get_phys_port_name</refname>
20281 <refpurpose>
20282     Get device physical port name
20283 </refpurpose>
20284</refnamediv>
20285<refsynopsisdiv>
20286 <title>Synopsis</title>
20287  <funcsynopsis><funcprototype>
20288   <funcdef>int <function>dev_get_phys_port_name </function></funcdef>
20289   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20290   <paramdef>char * <parameter>name</parameter></paramdef>
20291   <paramdef>size_t <parameter>len</parameter></paramdef>
20292  </funcprototype></funcsynopsis>
20293</refsynopsisdiv>
20294<refsect1>
20295 <title>Arguments</title>
20296 <variablelist>
20297  <varlistentry>
20298   <term><parameter>dev</parameter></term>
20299   <listitem>
20300    <para>
20301     device
20302    </para>
20303   </listitem>
20304  </varlistentry>
20305  <varlistentry>
20306   <term><parameter>name</parameter></term>
20307   <listitem>
20308    <para>
20309     port name
20310    </para>
20311   </listitem>
20312  </varlistentry>
20313  <varlistentry>
20314   <term><parameter>len</parameter></term>
20315   <listitem>
20316    <para>
20317     -- undescribed --
20318    </para>
20319   </listitem>
20320  </varlistentry>
20321 </variablelist>
20322</refsect1>
20323<refsect1>
20324<title>Description</title>
20325<para>
20326   Get device physical port name
20327</para>
20328</refsect1>
20329</refentry>
20330
20331<refentry id="API-netdev-update-features">
20332<refentryinfo>
20333 <title>LINUX</title>
20334 <productname>Kernel Hackers Manual</productname>
20335 <date>July 2017</date>
20336</refentryinfo>
20337<refmeta>
20338 <refentrytitle><phrase>netdev_update_features</phrase></refentrytitle>
20339 <manvolnum>9</manvolnum>
20340 <refmiscinfo class="version">4.1.27</refmiscinfo>
20341</refmeta>
20342<refnamediv>
20343 <refname>netdev_update_features</refname>
20344 <refpurpose>
20345     recalculate device features
20346 </refpurpose>
20347</refnamediv>
20348<refsynopsisdiv>
20349 <title>Synopsis</title>
20350  <funcsynopsis><funcprototype>
20351   <funcdef>void <function>netdev_update_features </function></funcdef>
20352   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20353  </funcprototype></funcsynopsis>
20354</refsynopsisdiv>
20355<refsect1>
20356 <title>Arguments</title>
20357 <variablelist>
20358  <varlistentry>
20359   <term><parameter>dev</parameter></term>
20360   <listitem>
20361    <para>
20362     the device to check
20363    </para>
20364   </listitem>
20365  </varlistentry>
20366 </variablelist>
20367</refsect1>
20368<refsect1>
20369<title>Description</title>
20370<para>
20371   Recalculate dev-&gt;features set and send notifications if it
20372   has changed. Should be called after driver or hardware dependent
20373   conditions might have changed that influence the features.
20374</para>
20375</refsect1>
20376</refentry>
20377
20378<refentry id="API-netdev-change-features">
20379<refentryinfo>
20380 <title>LINUX</title>
20381 <productname>Kernel Hackers Manual</productname>
20382 <date>July 2017</date>
20383</refentryinfo>
20384<refmeta>
20385 <refentrytitle><phrase>netdev_change_features</phrase></refentrytitle>
20386 <manvolnum>9</manvolnum>
20387 <refmiscinfo class="version">4.1.27</refmiscinfo>
20388</refmeta>
20389<refnamediv>
20390 <refname>netdev_change_features</refname>
20391 <refpurpose>
20392     recalculate device features
20393 </refpurpose>
20394</refnamediv>
20395<refsynopsisdiv>
20396 <title>Synopsis</title>
20397  <funcsynopsis><funcprototype>
20398   <funcdef>void <function>netdev_change_features </function></funcdef>
20399   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20400  </funcprototype></funcsynopsis>
20401</refsynopsisdiv>
20402<refsect1>
20403 <title>Arguments</title>
20404 <variablelist>
20405  <varlistentry>
20406   <term><parameter>dev</parameter></term>
20407   <listitem>
20408    <para>
20409     the device to check
20410    </para>
20411   </listitem>
20412  </varlistentry>
20413 </variablelist>
20414</refsect1>
20415<refsect1>
20416<title>Description</title>
20417<para>
20418   Recalculate dev-&gt;features set and send notifications even
20419   if they have not changed. Should be called instead of
20420   <function>netdev_update_features</function> if also dev-&gt;vlan_features might
20421   have changed to allow the changes to be propagated to stacked
20422   VLAN devices.
20423</para>
20424</refsect1>
20425</refentry>
20426
20427<refentry id="API-netif-stacked-transfer-operstate">
20428<refentryinfo>
20429 <title>LINUX</title>
20430 <productname>Kernel Hackers Manual</productname>
20431 <date>July 2017</date>
20432</refentryinfo>
20433<refmeta>
20434 <refentrytitle><phrase>netif_stacked_transfer_operstate</phrase></refentrytitle>
20435 <manvolnum>9</manvolnum>
20436 <refmiscinfo class="version">4.1.27</refmiscinfo>
20437</refmeta>
20438<refnamediv>
20439 <refname>netif_stacked_transfer_operstate</refname>
20440 <refpurpose>
20441     transfer operstate
20442 </refpurpose>
20443</refnamediv>
20444<refsynopsisdiv>
20445 <title>Synopsis</title>
20446  <funcsynopsis><funcprototype>
20447   <funcdef>void <function>netif_stacked_transfer_operstate </function></funcdef>
20448   <paramdef>const struct net_device * <parameter>rootdev</parameter></paramdef>
20449   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20450  </funcprototype></funcsynopsis>
20451</refsynopsisdiv>
20452<refsect1>
20453 <title>Arguments</title>
20454 <variablelist>
20455  <varlistentry>
20456   <term><parameter>rootdev</parameter></term>
20457   <listitem>
20458    <para>
20459     the root or lower level device to transfer state from
20460    </para>
20461   </listitem>
20462  </varlistentry>
20463  <varlistentry>
20464   <term><parameter>dev</parameter></term>
20465   <listitem>
20466    <para>
20467     the device to transfer operstate to
20468    </para>
20469   </listitem>
20470  </varlistentry>
20471 </variablelist>
20472</refsect1>
20473<refsect1>
20474<title>Description</title>
20475<para>
20476   Transfer operational state from root to device. This is normally
20477   called when a stacking relationship exists between the root
20478   device and the device(a leaf device).
20479</para>
20480</refsect1>
20481</refentry>
20482
20483<refentry id="API-register-netdevice">
20484<refentryinfo>
20485 <title>LINUX</title>
20486 <productname>Kernel Hackers Manual</productname>
20487 <date>July 2017</date>
20488</refentryinfo>
20489<refmeta>
20490 <refentrytitle><phrase>register_netdevice</phrase></refentrytitle>
20491 <manvolnum>9</manvolnum>
20492 <refmiscinfo class="version">4.1.27</refmiscinfo>
20493</refmeta>
20494<refnamediv>
20495 <refname>register_netdevice</refname>
20496 <refpurpose>
20497     register a network device
20498 </refpurpose>
20499</refnamediv>
20500<refsynopsisdiv>
20501 <title>Synopsis</title>
20502  <funcsynopsis><funcprototype>
20503   <funcdef>int <function>register_netdevice </function></funcdef>
20504   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20505  </funcprototype></funcsynopsis>
20506</refsynopsisdiv>
20507<refsect1>
20508 <title>Arguments</title>
20509 <variablelist>
20510  <varlistentry>
20511   <term><parameter>dev</parameter></term>
20512   <listitem>
20513    <para>
20514     device to register
20515    </para>
20516   </listitem>
20517  </varlistentry>
20518 </variablelist>
20519</refsect1>
20520<refsect1>
20521<title>Description</title>
20522<para>
20523   Take a completed network device structure and add it to the kernel
20524   interfaces. A <constant>NETDEV_REGISTER</constant> message is sent to the netdev notifier
20525   chain. 0 is returned on success. A negative errno code is returned
20526   on a failure to set up the device, or if the name is a duplicate.
20527   </para><para>
20528
20529   Callers must hold the rtnl semaphore. You may want
20530   <function>register_netdev</function> instead of this.
20531</para>
20532</refsect1>
20533<refsect1>
20534<title>BUGS</title>
20535<para>
20536   The locking appears insufficient to guarantee two parallel registers
20537   will not get the same name.
20538</para>
20539</refsect1>
20540</refentry>
20541
20542<refentry id="API-init-dummy-netdev">
20543<refentryinfo>
20544 <title>LINUX</title>
20545 <productname>Kernel Hackers Manual</productname>
20546 <date>July 2017</date>
20547</refentryinfo>
20548<refmeta>
20549 <refentrytitle><phrase>init_dummy_netdev</phrase></refentrytitle>
20550 <manvolnum>9</manvolnum>
20551 <refmiscinfo class="version">4.1.27</refmiscinfo>
20552</refmeta>
20553<refnamediv>
20554 <refname>init_dummy_netdev</refname>
20555 <refpurpose>
20556     init a dummy network device for NAPI
20557 </refpurpose>
20558</refnamediv>
20559<refsynopsisdiv>
20560 <title>Synopsis</title>
20561  <funcsynopsis><funcprototype>
20562   <funcdef>int <function>init_dummy_netdev </function></funcdef>
20563   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20564  </funcprototype></funcsynopsis>
20565</refsynopsisdiv>
20566<refsect1>
20567 <title>Arguments</title>
20568 <variablelist>
20569  <varlistentry>
20570   <term><parameter>dev</parameter></term>
20571   <listitem>
20572    <para>
20573     device to init
20574    </para>
20575   </listitem>
20576  </varlistentry>
20577 </variablelist>
20578</refsect1>
20579<refsect1>
20580<title>Description</title>
20581<para>
20582   This takes a network device structure and initialize the minimum
20583   amount of fields so it can be used to schedule NAPI polls without
20584   registering a full blown interface. This is to be used by drivers
20585   that need to tie several hardware interfaces to a single NAPI
20586   poll scheduler due to HW limitations.
20587</para>
20588</refsect1>
20589</refentry>
20590
20591<refentry id="API-register-netdev">
20592<refentryinfo>
20593 <title>LINUX</title>
20594 <productname>Kernel Hackers Manual</productname>
20595 <date>July 2017</date>
20596</refentryinfo>
20597<refmeta>
20598 <refentrytitle><phrase>register_netdev</phrase></refentrytitle>
20599 <manvolnum>9</manvolnum>
20600 <refmiscinfo class="version">4.1.27</refmiscinfo>
20601</refmeta>
20602<refnamediv>
20603 <refname>register_netdev</refname>
20604 <refpurpose>
20605     register a network device
20606 </refpurpose>
20607</refnamediv>
20608<refsynopsisdiv>
20609 <title>Synopsis</title>
20610  <funcsynopsis><funcprototype>
20611   <funcdef>int <function>register_netdev </function></funcdef>
20612   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20613  </funcprototype></funcsynopsis>
20614</refsynopsisdiv>
20615<refsect1>
20616 <title>Arguments</title>
20617 <variablelist>
20618  <varlistentry>
20619   <term><parameter>dev</parameter></term>
20620   <listitem>
20621    <para>
20622     device to register
20623    </para>
20624   </listitem>
20625  </varlistentry>
20626 </variablelist>
20627</refsect1>
20628<refsect1>
20629<title>Description</title>
20630<para>
20631   Take a completed network device structure and add it to the kernel
20632   interfaces. A <constant>NETDEV_REGISTER</constant> message is sent to the netdev notifier
20633   chain. 0 is returned on success. A negative errno code is returned
20634   on a failure to set up the device, or if the name is a duplicate.
20635   </para><para>
20636
20637   This is a wrapper around register_netdevice that takes the rtnl semaphore
20638   and expands the device name if you passed a format string to
20639   alloc_netdev.
20640</para>
20641</refsect1>
20642</refentry>
20643
20644<refentry id="API-dev-get-stats">
20645<refentryinfo>
20646 <title>LINUX</title>
20647 <productname>Kernel Hackers Manual</productname>
20648 <date>July 2017</date>
20649</refentryinfo>
20650<refmeta>
20651 <refentrytitle><phrase>dev_get_stats</phrase></refentrytitle>
20652 <manvolnum>9</manvolnum>
20653 <refmiscinfo class="version">4.1.27</refmiscinfo>
20654</refmeta>
20655<refnamediv>
20656 <refname>dev_get_stats</refname>
20657 <refpurpose>
20658     get network device statistics
20659 </refpurpose>
20660</refnamediv>
20661<refsynopsisdiv>
20662 <title>Synopsis</title>
20663  <funcsynopsis><funcprototype>
20664   <funcdef>struct rtnl_link_stats64 * <function>dev_get_stats </function></funcdef>
20665   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20666   <paramdef>struct rtnl_link_stats64 * <parameter>storage</parameter></paramdef>
20667  </funcprototype></funcsynopsis>
20668</refsynopsisdiv>
20669<refsect1>
20670 <title>Arguments</title>
20671 <variablelist>
20672  <varlistentry>
20673   <term><parameter>dev</parameter></term>
20674   <listitem>
20675    <para>
20676     device to get statistics from
20677    </para>
20678   </listitem>
20679  </varlistentry>
20680  <varlistentry>
20681   <term><parameter>storage</parameter></term>
20682   <listitem>
20683    <para>
20684     place to store stats
20685    </para>
20686   </listitem>
20687  </varlistentry>
20688 </variablelist>
20689</refsect1>
20690<refsect1>
20691<title>Description</title>
20692<para>
20693   Get network statistics from device. Return <parameter>storage</parameter>.
20694   The device driver may provide its own method by setting
20695   dev-&gt;netdev_ops-&gt;get_stats64 or dev-&gt;netdev_ops-&gt;get_stats;
20696   otherwise the internal statistics structure is used.
20697</para>
20698</refsect1>
20699</refentry>
20700
20701<refentry id="API-alloc-netdev-mqs">
20702<refentryinfo>
20703 <title>LINUX</title>
20704 <productname>Kernel Hackers Manual</productname>
20705 <date>July 2017</date>
20706</refentryinfo>
20707<refmeta>
20708 <refentrytitle><phrase>alloc_netdev_mqs</phrase></refentrytitle>
20709 <manvolnum>9</manvolnum>
20710 <refmiscinfo class="version">4.1.27</refmiscinfo>
20711</refmeta>
20712<refnamediv>
20713 <refname>alloc_netdev_mqs</refname>
20714 <refpurpose>
20715     allocate network device
20716 </refpurpose>
20717</refnamediv>
20718<refsynopsisdiv>
20719 <title>Synopsis</title>
20720  <funcsynopsis><funcprototype>
20721   <funcdef>struct net_device * <function>alloc_netdev_mqs </function></funcdef>
20722   <paramdef>int <parameter>sizeof_priv</parameter></paramdef>
20723   <paramdef>const char * <parameter>name</parameter></paramdef>
20724   <paramdef>unsigned char <parameter>name_assign_type</parameter></paramdef>
20725   <paramdef>void (*<parameter>setup</parameter>)
20726     <funcparams>struct net_device *</funcparams></paramdef>
20727   <paramdef>unsigned int <parameter>txqs</parameter></paramdef>
20728   <paramdef>unsigned int <parameter>rxqs</parameter></paramdef>
20729  </funcprototype></funcsynopsis>
20730</refsynopsisdiv>
20731<refsect1>
20732 <title>Arguments</title>
20733 <variablelist>
20734  <varlistentry>
20735   <term><parameter>sizeof_priv</parameter></term>
20736   <listitem>
20737    <para>
20738     size of private data to allocate space for
20739    </para>
20740   </listitem>
20741  </varlistentry>
20742  <varlistentry>
20743   <term><parameter>name</parameter></term>
20744   <listitem>
20745    <para>
20746     device name format string
20747    </para>
20748   </listitem>
20749  </varlistentry>
20750  <varlistentry>
20751   <term><parameter>name_assign_type</parameter></term>
20752   <listitem>
20753    <para>
20754     origin of device name
20755    </para>
20756   </listitem>
20757  </varlistentry>
20758  <varlistentry>
20759   <term><parameter>setup</parameter></term>
20760   <listitem>
20761    <para>
20762     callback to initialize device
20763    </para>
20764   </listitem>
20765  </varlistentry>
20766  <varlistentry>
20767   <term><parameter>txqs</parameter></term>
20768   <listitem>
20769    <para>
20770     the number of TX subqueues to allocate
20771    </para>
20772   </listitem>
20773  </varlistentry>
20774  <varlistentry>
20775   <term><parameter>rxqs</parameter></term>
20776   <listitem>
20777    <para>
20778     the number of RX subqueues to allocate
20779    </para>
20780   </listitem>
20781  </varlistentry>
20782 </variablelist>
20783</refsect1>
20784<refsect1>
20785<title>Description</title>
20786<para>
20787   Allocates a struct net_device with private data area for driver use
20788   and performs basic initialization.  Also allocates subqueue structs
20789   for each queue on the device.
20790</para>
20791</refsect1>
20792</refentry>
20793
20794<refentry id="API-free-netdev">
20795<refentryinfo>
20796 <title>LINUX</title>
20797 <productname>Kernel Hackers Manual</productname>
20798 <date>July 2017</date>
20799</refentryinfo>
20800<refmeta>
20801 <refentrytitle><phrase>free_netdev</phrase></refentrytitle>
20802 <manvolnum>9</manvolnum>
20803 <refmiscinfo class="version">4.1.27</refmiscinfo>
20804</refmeta>
20805<refnamediv>
20806 <refname>free_netdev</refname>
20807 <refpurpose>
20808     free network device
20809 </refpurpose>
20810</refnamediv>
20811<refsynopsisdiv>
20812 <title>Synopsis</title>
20813  <funcsynopsis><funcprototype>
20814   <funcdef>void <function>free_netdev </function></funcdef>
20815   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20816  </funcprototype></funcsynopsis>
20817</refsynopsisdiv>
20818<refsect1>
20819 <title>Arguments</title>
20820 <variablelist>
20821  <varlistentry>
20822   <term><parameter>dev</parameter></term>
20823   <listitem>
20824    <para>
20825     device
20826    </para>
20827   </listitem>
20828  </varlistentry>
20829 </variablelist>
20830</refsect1>
20831<refsect1>
20832<title>Description</title>
20833<para>
20834   This function does the last stage of destroying an allocated device
20835   interface. The reference to the device object is released.
20836   If this is the last reference then it will be freed.
20837</para>
20838</refsect1>
20839</refentry>
20840
20841<refentry id="API-synchronize-net">
20842<refentryinfo>
20843 <title>LINUX</title>
20844 <productname>Kernel Hackers Manual</productname>
20845 <date>July 2017</date>
20846</refentryinfo>
20847<refmeta>
20848 <refentrytitle><phrase>synchronize_net</phrase></refentrytitle>
20849 <manvolnum>9</manvolnum>
20850 <refmiscinfo class="version">4.1.27</refmiscinfo>
20851</refmeta>
20852<refnamediv>
20853 <refname>synchronize_net</refname>
20854 <refpurpose>
20855     Synchronize with packet receive processing
20856 </refpurpose>
20857</refnamediv>
20858<refsynopsisdiv>
20859 <title>Synopsis</title>
20860  <funcsynopsis><funcprototype>
20861   <funcdef>void <function>synchronize_net </function></funcdef>
20862   <paramdef> <parameter>void</parameter></paramdef>
20863  </funcprototype></funcsynopsis>
20864</refsynopsisdiv>
20865<refsect1>
20866 <title>Arguments</title>
20867 <variablelist>
20868  <varlistentry>
20869   <term><parameter>void</parameter></term>
20870   <listitem>
20871    <para>
20872     no arguments
20873    </para>
20874   </listitem>
20875  </varlistentry>
20876 </variablelist>
20877</refsect1>
20878<refsect1>
20879<title>Description</title>
20880<para>
20881   </para><para>
20882
20883   Wait for packets currently being received to be done.
20884   Does not block later packets from starting.
20885</para>
20886</refsect1>
20887</refentry>
20888
20889<refentry id="API-unregister-netdevice-queue">
20890<refentryinfo>
20891 <title>LINUX</title>
20892 <productname>Kernel Hackers Manual</productname>
20893 <date>July 2017</date>
20894</refentryinfo>
20895<refmeta>
20896 <refentrytitle><phrase>unregister_netdevice_queue</phrase></refentrytitle>
20897 <manvolnum>9</manvolnum>
20898 <refmiscinfo class="version">4.1.27</refmiscinfo>
20899</refmeta>
20900<refnamediv>
20901 <refname>unregister_netdevice_queue</refname>
20902 <refpurpose>
20903     remove device from the kernel
20904 </refpurpose>
20905</refnamediv>
20906<refsynopsisdiv>
20907 <title>Synopsis</title>
20908  <funcsynopsis><funcprototype>
20909   <funcdef>void <function>unregister_netdevice_queue </function></funcdef>
20910   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
20911   <paramdef>struct list_head * <parameter>head</parameter></paramdef>
20912  </funcprototype></funcsynopsis>
20913</refsynopsisdiv>
20914<refsect1>
20915 <title>Arguments</title>
20916 <variablelist>
20917  <varlistentry>
20918   <term><parameter>dev</parameter></term>
20919   <listitem>
20920    <para>
20921     device
20922    </para>
20923   </listitem>
20924  </varlistentry>
20925  <varlistentry>
20926   <term><parameter>head</parameter></term>
20927   <listitem>
20928    <para>
20929     list
20930    </para>
20931   </listitem>
20932  </varlistentry>
20933 </variablelist>
20934</refsect1>
20935<refsect1>
20936<title>Description</title>
20937<para>
20938   This function shuts down a device interface and removes it
20939   from the kernel tables.
20940   If head not NULL, device is queued to be unregistered later.
20941   </para><para>
20942
20943   Callers must hold the rtnl semaphore.  You may want
20944   <function>unregister_netdev</function> instead of this.
20945</para>
20946</refsect1>
20947</refentry>
20948
20949<refentry id="API-unregister-netdevice-many">
20950<refentryinfo>
20951 <title>LINUX</title>
20952 <productname>Kernel Hackers Manual</productname>
20953 <date>July 2017</date>
20954</refentryinfo>
20955<refmeta>
20956 <refentrytitle><phrase>unregister_netdevice_many</phrase></refentrytitle>
20957 <manvolnum>9</manvolnum>
20958 <refmiscinfo class="version">4.1.27</refmiscinfo>
20959</refmeta>
20960<refnamediv>
20961 <refname>unregister_netdevice_many</refname>
20962 <refpurpose>
20963     unregister many devices
20964 </refpurpose>
20965</refnamediv>
20966<refsynopsisdiv>
20967 <title>Synopsis</title>
20968  <funcsynopsis><funcprototype>
20969   <funcdef>void <function>unregister_netdevice_many </function></funcdef>
20970   <paramdef>struct list_head * <parameter>head</parameter></paramdef>
20971  </funcprototype></funcsynopsis>
20972</refsynopsisdiv>
20973<refsect1>
20974 <title>Arguments</title>
20975 <variablelist>
20976  <varlistentry>
20977   <term><parameter>head</parameter></term>
20978   <listitem>
20979    <para>
20980     list of devices
20981    </para>
20982   </listitem>
20983  </varlistentry>
20984 </variablelist>
20985</refsect1>
20986<refsect1>
20987<title>Note</title>
20988<para>
20989   As most callers use a stack allocated list_head,
20990   we force a <function>list_del</function> to make sure stack wont be corrupted later.
20991</para>
20992</refsect1>
20993</refentry>
20994
20995<refentry id="API-unregister-netdev">
20996<refentryinfo>
20997 <title>LINUX</title>
20998 <productname>Kernel Hackers Manual</productname>
20999 <date>July 2017</date>
21000</refentryinfo>
21001<refmeta>
21002 <refentrytitle><phrase>unregister_netdev</phrase></refentrytitle>
21003 <manvolnum>9</manvolnum>
21004 <refmiscinfo class="version">4.1.27</refmiscinfo>
21005</refmeta>
21006<refnamediv>
21007 <refname>unregister_netdev</refname>
21008 <refpurpose>
21009     remove device from the kernel
21010 </refpurpose>
21011</refnamediv>
21012<refsynopsisdiv>
21013 <title>Synopsis</title>
21014  <funcsynopsis><funcprototype>
21015   <funcdef>void <function>unregister_netdev </function></funcdef>
21016   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21017  </funcprototype></funcsynopsis>
21018</refsynopsisdiv>
21019<refsect1>
21020 <title>Arguments</title>
21021 <variablelist>
21022  <varlistentry>
21023   <term><parameter>dev</parameter></term>
21024   <listitem>
21025    <para>
21026     device
21027    </para>
21028   </listitem>
21029  </varlistentry>
21030 </variablelist>
21031</refsect1>
21032<refsect1>
21033<title>Description</title>
21034<para>
21035   This function shuts down a device interface and removes it
21036   from the kernel tables.
21037   </para><para>
21038
21039   This is just a wrapper for unregister_netdevice that takes
21040   the rtnl semaphore.  In general you want to use this and not
21041   unregister_netdevice.
21042</para>
21043</refsect1>
21044</refentry>
21045
21046<refentry id="API-dev-change-net-namespace">
21047<refentryinfo>
21048 <title>LINUX</title>
21049 <productname>Kernel Hackers Manual</productname>
21050 <date>July 2017</date>
21051</refentryinfo>
21052<refmeta>
21053 <refentrytitle><phrase>dev_change_net_namespace</phrase></refentrytitle>
21054 <manvolnum>9</manvolnum>
21055 <refmiscinfo class="version">4.1.27</refmiscinfo>
21056</refmeta>
21057<refnamediv>
21058 <refname>dev_change_net_namespace</refname>
21059 <refpurpose>
21060     move device to different nethost namespace
21061 </refpurpose>
21062</refnamediv>
21063<refsynopsisdiv>
21064 <title>Synopsis</title>
21065  <funcsynopsis><funcprototype>
21066   <funcdef>int <function>dev_change_net_namespace </function></funcdef>
21067   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21068   <paramdef>struct net * <parameter>net</parameter></paramdef>
21069   <paramdef>const char * <parameter>pat</parameter></paramdef>
21070  </funcprototype></funcsynopsis>
21071</refsynopsisdiv>
21072<refsect1>
21073 <title>Arguments</title>
21074 <variablelist>
21075  <varlistentry>
21076   <term><parameter>dev</parameter></term>
21077   <listitem>
21078    <para>
21079     device
21080    </para>
21081   </listitem>
21082  </varlistentry>
21083  <varlistentry>
21084   <term><parameter>net</parameter></term>
21085   <listitem>
21086    <para>
21087     network namespace
21088    </para>
21089   </listitem>
21090  </varlistentry>
21091  <varlistentry>
21092   <term><parameter>pat</parameter></term>
21093   <listitem>
21094    <para>
21095     If not NULL name pattern to try if the current device name
21096     is already taken in the destination network namespace.
21097    </para>
21098   </listitem>
21099  </varlistentry>
21100 </variablelist>
21101</refsect1>
21102<refsect1>
21103<title>Description</title>
21104<para>
21105   This function shuts down a device interface and moves it
21106   to a new network namespace. On success 0 is returned, on
21107   a failure a netagive errno code is returned.
21108   </para><para>
21109
21110   Callers must hold the rtnl semaphore.
21111</para>
21112</refsect1>
21113</refentry>
21114
21115<refentry id="API-netdev-increment-features">
21116<refentryinfo>
21117 <title>LINUX</title>
21118 <productname>Kernel Hackers Manual</productname>
21119 <date>July 2017</date>
21120</refentryinfo>
21121<refmeta>
21122 <refentrytitle><phrase>netdev_increment_features</phrase></refentrytitle>
21123 <manvolnum>9</manvolnum>
21124 <refmiscinfo class="version">4.1.27</refmiscinfo>
21125</refmeta>
21126<refnamediv>
21127 <refname>netdev_increment_features</refname>
21128 <refpurpose>
21129     increment feature set by one
21130 </refpurpose>
21131</refnamediv>
21132<refsynopsisdiv>
21133 <title>Synopsis</title>
21134  <funcsynopsis><funcprototype>
21135   <funcdef>netdev_features_t <function>netdev_increment_features </function></funcdef>
21136   <paramdef>netdev_features_t <parameter>all</parameter></paramdef>
21137   <paramdef>netdev_features_t <parameter>one</parameter></paramdef>
21138   <paramdef>netdev_features_t <parameter>mask</parameter></paramdef>
21139  </funcprototype></funcsynopsis>
21140</refsynopsisdiv>
21141<refsect1>
21142 <title>Arguments</title>
21143 <variablelist>
21144  <varlistentry>
21145   <term><parameter>all</parameter></term>
21146   <listitem>
21147    <para>
21148     current feature set
21149    </para>
21150   </listitem>
21151  </varlistentry>
21152  <varlistentry>
21153   <term><parameter>one</parameter></term>
21154   <listitem>
21155    <para>
21156     new feature set
21157    </para>
21158   </listitem>
21159  </varlistentry>
21160  <varlistentry>
21161   <term><parameter>mask</parameter></term>
21162   <listitem>
21163    <para>
21164     mask feature set
21165    </para>
21166   </listitem>
21167  </varlistentry>
21168 </variablelist>
21169</refsect1>
21170<refsect1>
21171<title>Description</title>
21172<para>
21173   Computes a new feature set after adding a device with feature set
21174   <parameter>one</parameter> to the master device with current feature set <parameter>all</parameter>.  Will not
21175   enable anything that is off in <parameter>mask</parameter>. Returns the new feature set.
21176</para>
21177</refsect1>
21178</refentry>
21179
21180<!-- net/ethernet/eth.c -->
21181<refentry id="API-eth-header">
21182<refentryinfo>
21183 <title>LINUX</title>
21184 <productname>Kernel Hackers Manual</productname>
21185 <date>July 2017</date>
21186</refentryinfo>
21187<refmeta>
21188 <refentrytitle><phrase>eth_header</phrase></refentrytitle>
21189 <manvolnum>9</manvolnum>
21190 <refmiscinfo class="version">4.1.27</refmiscinfo>
21191</refmeta>
21192<refnamediv>
21193 <refname>eth_header</refname>
21194 <refpurpose>
21195  create the Ethernet header
21196 </refpurpose>
21197</refnamediv>
21198<refsynopsisdiv>
21199 <title>Synopsis</title>
21200  <funcsynopsis><funcprototype>
21201   <funcdef>int <function>eth_header </function></funcdef>
21202   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
21203   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21204   <paramdef>unsigned short <parameter>type</parameter></paramdef>
21205   <paramdef>const void * <parameter>daddr</parameter></paramdef>
21206   <paramdef>const void * <parameter>saddr</parameter></paramdef>
21207   <paramdef>unsigned int <parameter>len</parameter></paramdef>
21208  </funcprototype></funcsynopsis>
21209</refsynopsisdiv>
21210<refsect1>
21211 <title>Arguments</title>
21212 <variablelist>
21213  <varlistentry>
21214   <term><parameter>skb</parameter></term>
21215   <listitem>
21216    <para>
21217     buffer to alter
21218    </para>
21219   </listitem>
21220  </varlistentry>
21221  <varlistentry>
21222   <term><parameter>dev</parameter></term>
21223   <listitem>
21224    <para>
21225     source device
21226    </para>
21227   </listitem>
21228  </varlistentry>
21229  <varlistentry>
21230   <term><parameter>type</parameter></term>
21231   <listitem>
21232    <para>
21233     Ethernet type field
21234    </para>
21235   </listitem>
21236  </varlistentry>
21237  <varlistentry>
21238   <term><parameter>daddr</parameter></term>
21239   <listitem>
21240    <para>
21241     destination address (NULL leave destination address)
21242    </para>
21243   </listitem>
21244  </varlistentry>
21245  <varlistentry>
21246   <term><parameter>saddr</parameter></term>
21247   <listitem>
21248    <para>
21249     source address (NULL use device source address)
21250    </para>
21251   </listitem>
21252  </varlistentry>
21253  <varlistentry>
21254   <term><parameter>len</parameter></term>
21255   <listitem>
21256    <para>
21257     packet length (&lt;= skb-&gt;len)
21258    </para>
21259   </listitem>
21260  </varlistentry>
21261 </variablelist>
21262</refsect1>
21263<refsect1>
21264<title>Description</title>
21265<para>
21266   </para><para>
21267
21268   Set the protocol type. For a packet of type ETH_P_802_3/2 we put the length
21269   in here instead.
21270</para>
21271</refsect1>
21272</refentry>
21273
21274<refentry id="API-eth-get-headlen">
21275<refentryinfo>
21276 <title>LINUX</title>
21277 <productname>Kernel Hackers Manual</productname>
21278 <date>July 2017</date>
21279</refentryinfo>
21280<refmeta>
21281 <refentrytitle><phrase>eth_get_headlen</phrase></refentrytitle>
21282 <manvolnum>9</manvolnum>
21283 <refmiscinfo class="version">4.1.27</refmiscinfo>
21284</refmeta>
21285<refnamediv>
21286 <refname>eth_get_headlen</refname>
21287 <refpurpose>
21288     determine the the length of header for an ethernet frame
21289 </refpurpose>
21290</refnamediv>
21291<refsynopsisdiv>
21292 <title>Synopsis</title>
21293  <funcsynopsis><funcprototype>
21294   <funcdef>u32 <function>eth_get_headlen </function></funcdef>
21295   <paramdef>void * <parameter>data</parameter></paramdef>
21296   <paramdef>unsigned int <parameter>len</parameter></paramdef>
21297  </funcprototype></funcsynopsis>
21298</refsynopsisdiv>
21299<refsect1>
21300 <title>Arguments</title>
21301 <variablelist>
21302  <varlistentry>
21303   <term><parameter>data</parameter></term>
21304   <listitem>
21305    <para>
21306     pointer to start of frame
21307    </para>
21308   </listitem>
21309  </varlistentry>
21310  <varlistentry>
21311   <term><parameter>len</parameter></term>
21312   <listitem>
21313    <para>
21314     total length of frame
21315    </para>
21316   </listitem>
21317  </varlistentry>
21318 </variablelist>
21319</refsect1>
21320<refsect1>
21321<title>Description</title>
21322<para>
21323   Make a best effort attempt to pull the length for all of the headers for
21324   a given frame in a linear buffer.
21325</para>
21326</refsect1>
21327</refentry>
21328
21329<refentry id="API-eth-type-trans">
21330<refentryinfo>
21331 <title>LINUX</title>
21332 <productname>Kernel Hackers Manual</productname>
21333 <date>July 2017</date>
21334</refentryinfo>
21335<refmeta>
21336 <refentrytitle><phrase>eth_type_trans</phrase></refentrytitle>
21337 <manvolnum>9</manvolnum>
21338 <refmiscinfo class="version">4.1.27</refmiscinfo>
21339</refmeta>
21340<refnamediv>
21341 <refname>eth_type_trans</refname>
21342 <refpurpose>
21343     determine the packet's protocol ID.
21344 </refpurpose>
21345</refnamediv>
21346<refsynopsisdiv>
21347 <title>Synopsis</title>
21348  <funcsynopsis><funcprototype>
21349   <funcdef>__be16 <function>eth_type_trans </function></funcdef>
21350   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
21351   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21352  </funcprototype></funcsynopsis>
21353</refsynopsisdiv>
21354<refsect1>
21355 <title>Arguments</title>
21356 <variablelist>
21357  <varlistentry>
21358   <term><parameter>skb</parameter></term>
21359   <listitem>
21360    <para>
21361     received socket data
21362    </para>
21363   </listitem>
21364  </varlistentry>
21365  <varlistentry>
21366   <term><parameter>dev</parameter></term>
21367   <listitem>
21368    <para>
21369     receiving network device
21370    </para>
21371   </listitem>
21372  </varlistentry>
21373 </variablelist>
21374</refsect1>
21375<refsect1>
21376<title>Description</title>
21377<para>
21378   The rule here is that we
21379   assume 802.3 if the type field is short enough to be a length.
21380   This is normal practice and works for any 'now in use' protocol.
21381</para>
21382</refsect1>
21383</refentry>
21384
21385<refentry id="API-eth-header-parse">
21386<refentryinfo>
21387 <title>LINUX</title>
21388 <productname>Kernel Hackers Manual</productname>
21389 <date>July 2017</date>
21390</refentryinfo>
21391<refmeta>
21392 <refentrytitle><phrase>eth_header_parse</phrase></refentrytitle>
21393 <manvolnum>9</manvolnum>
21394 <refmiscinfo class="version">4.1.27</refmiscinfo>
21395</refmeta>
21396<refnamediv>
21397 <refname>eth_header_parse</refname>
21398 <refpurpose>
21399     extract hardware address from packet
21400 </refpurpose>
21401</refnamediv>
21402<refsynopsisdiv>
21403 <title>Synopsis</title>
21404  <funcsynopsis><funcprototype>
21405   <funcdef>int <function>eth_header_parse </function></funcdef>
21406   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
21407   <paramdef>unsigned char * <parameter>haddr</parameter></paramdef>
21408  </funcprototype></funcsynopsis>
21409</refsynopsisdiv>
21410<refsect1>
21411 <title>Arguments</title>
21412 <variablelist>
21413  <varlistentry>
21414   <term><parameter>skb</parameter></term>
21415   <listitem>
21416    <para>
21417     packet to extract header from
21418    </para>
21419   </listitem>
21420  </varlistentry>
21421  <varlistentry>
21422   <term><parameter>haddr</parameter></term>
21423   <listitem>
21424    <para>
21425     destination buffer
21426    </para>
21427   </listitem>
21428  </varlistentry>
21429 </variablelist>
21430</refsect1>
21431</refentry>
21432
21433<refentry id="API-eth-header-cache">
21434<refentryinfo>
21435 <title>LINUX</title>
21436 <productname>Kernel Hackers Manual</productname>
21437 <date>July 2017</date>
21438</refentryinfo>
21439<refmeta>
21440 <refentrytitle><phrase>eth_header_cache</phrase></refentrytitle>
21441 <manvolnum>9</manvolnum>
21442 <refmiscinfo class="version">4.1.27</refmiscinfo>
21443</refmeta>
21444<refnamediv>
21445 <refname>eth_header_cache</refname>
21446 <refpurpose>
21447     fill cache entry from neighbour
21448 </refpurpose>
21449</refnamediv>
21450<refsynopsisdiv>
21451 <title>Synopsis</title>
21452  <funcsynopsis><funcprototype>
21453   <funcdef>int <function>eth_header_cache </function></funcdef>
21454   <paramdef>const struct neighbour * <parameter>neigh</parameter></paramdef>
21455   <paramdef>struct hh_cache * <parameter>hh</parameter></paramdef>
21456   <paramdef>__be16 <parameter>type</parameter></paramdef>
21457  </funcprototype></funcsynopsis>
21458</refsynopsisdiv>
21459<refsect1>
21460 <title>Arguments</title>
21461 <variablelist>
21462  <varlistentry>
21463   <term><parameter>neigh</parameter></term>
21464   <listitem>
21465    <para>
21466     source neighbour
21467    </para>
21468   </listitem>
21469  </varlistentry>
21470  <varlistentry>
21471   <term><parameter>hh</parameter></term>
21472   <listitem>
21473    <para>
21474     destination cache entry
21475    </para>
21476   </listitem>
21477  </varlistentry>
21478  <varlistentry>
21479   <term><parameter>type</parameter></term>
21480   <listitem>
21481    <para>
21482     Ethernet type field
21483    </para>
21484   </listitem>
21485  </varlistentry>
21486 </variablelist>
21487</refsect1>
21488<refsect1>
21489<title>Description</title>
21490<para>
21491   Create an Ethernet header template from the neighbour.
21492</para>
21493</refsect1>
21494</refentry>
21495
21496<refentry id="API-eth-header-cache-update">
21497<refentryinfo>
21498 <title>LINUX</title>
21499 <productname>Kernel Hackers Manual</productname>
21500 <date>July 2017</date>
21501</refentryinfo>
21502<refmeta>
21503 <refentrytitle><phrase>eth_header_cache_update</phrase></refentrytitle>
21504 <manvolnum>9</manvolnum>
21505 <refmiscinfo class="version">4.1.27</refmiscinfo>
21506</refmeta>
21507<refnamediv>
21508 <refname>eth_header_cache_update</refname>
21509 <refpurpose>
21510     update cache entry
21511 </refpurpose>
21512</refnamediv>
21513<refsynopsisdiv>
21514 <title>Synopsis</title>
21515  <funcsynopsis><funcprototype>
21516   <funcdef>void <function>eth_header_cache_update </function></funcdef>
21517   <paramdef>struct hh_cache * <parameter>hh</parameter></paramdef>
21518   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
21519   <paramdef>const unsigned char * <parameter>haddr</parameter></paramdef>
21520  </funcprototype></funcsynopsis>
21521</refsynopsisdiv>
21522<refsect1>
21523 <title>Arguments</title>
21524 <variablelist>
21525  <varlistentry>
21526   <term><parameter>hh</parameter></term>
21527   <listitem>
21528    <para>
21529     destination cache entry
21530    </para>
21531   </listitem>
21532  </varlistentry>
21533  <varlistentry>
21534   <term><parameter>dev</parameter></term>
21535   <listitem>
21536    <para>
21537     network device
21538    </para>
21539   </listitem>
21540  </varlistentry>
21541  <varlistentry>
21542   <term><parameter>haddr</parameter></term>
21543   <listitem>
21544    <para>
21545     new hardware address
21546    </para>
21547   </listitem>
21548  </varlistentry>
21549 </variablelist>
21550</refsect1>
21551<refsect1>
21552<title>Description</title>
21553<para>
21554   Called by Address Resolution module to notify changes in address.
21555</para>
21556</refsect1>
21557</refentry>
21558
21559<refentry id="API-eth-prepare-mac-addr-change">
21560<refentryinfo>
21561 <title>LINUX</title>
21562 <productname>Kernel Hackers Manual</productname>
21563 <date>July 2017</date>
21564</refentryinfo>
21565<refmeta>
21566 <refentrytitle><phrase>eth_prepare_mac_addr_change</phrase></refentrytitle>
21567 <manvolnum>9</manvolnum>
21568 <refmiscinfo class="version">4.1.27</refmiscinfo>
21569</refmeta>
21570<refnamediv>
21571 <refname>eth_prepare_mac_addr_change</refname>
21572 <refpurpose>
21573     prepare for mac change
21574 </refpurpose>
21575</refnamediv>
21576<refsynopsisdiv>
21577 <title>Synopsis</title>
21578  <funcsynopsis><funcprototype>
21579   <funcdef>int <function>eth_prepare_mac_addr_change </function></funcdef>
21580   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21581   <paramdef>void * <parameter>p</parameter></paramdef>
21582  </funcprototype></funcsynopsis>
21583</refsynopsisdiv>
21584<refsect1>
21585 <title>Arguments</title>
21586 <variablelist>
21587  <varlistentry>
21588   <term><parameter>dev</parameter></term>
21589   <listitem>
21590    <para>
21591     network device
21592    </para>
21593   </listitem>
21594  </varlistentry>
21595  <varlistentry>
21596   <term><parameter>p</parameter></term>
21597   <listitem>
21598    <para>
21599     socket address
21600    </para>
21601   </listitem>
21602  </varlistentry>
21603 </variablelist>
21604</refsect1>
21605</refentry>
21606
21607<refentry id="API-eth-commit-mac-addr-change">
21608<refentryinfo>
21609 <title>LINUX</title>
21610 <productname>Kernel Hackers Manual</productname>
21611 <date>July 2017</date>
21612</refentryinfo>
21613<refmeta>
21614 <refentrytitle><phrase>eth_commit_mac_addr_change</phrase></refentrytitle>
21615 <manvolnum>9</manvolnum>
21616 <refmiscinfo class="version">4.1.27</refmiscinfo>
21617</refmeta>
21618<refnamediv>
21619 <refname>eth_commit_mac_addr_change</refname>
21620 <refpurpose>
21621     commit mac change
21622 </refpurpose>
21623</refnamediv>
21624<refsynopsisdiv>
21625 <title>Synopsis</title>
21626  <funcsynopsis><funcprototype>
21627   <funcdef>void <function>eth_commit_mac_addr_change </function></funcdef>
21628   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21629   <paramdef>void * <parameter>p</parameter></paramdef>
21630  </funcprototype></funcsynopsis>
21631</refsynopsisdiv>
21632<refsect1>
21633 <title>Arguments</title>
21634 <variablelist>
21635  <varlistentry>
21636   <term><parameter>dev</parameter></term>
21637   <listitem>
21638    <para>
21639     network device
21640    </para>
21641   </listitem>
21642  </varlistentry>
21643  <varlistentry>
21644   <term><parameter>p</parameter></term>
21645   <listitem>
21646    <para>
21647     socket address
21648    </para>
21649   </listitem>
21650  </varlistentry>
21651 </variablelist>
21652</refsect1>
21653</refentry>
21654
21655<refentry id="API-eth-mac-addr">
21656<refentryinfo>
21657 <title>LINUX</title>
21658 <productname>Kernel Hackers Manual</productname>
21659 <date>July 2017</date>
21660</refentryinfo>
21661<refmeta>
21662 <refentrytitle><phrase>eth_mac_addr</phrase></refentrytitle>
21663 <manvolnum>9</manvolnum>
21664 <refmiscinfo class="version">4.1.27</refmiscinfo>
21665</refmeta>
21666<refnamediv>
21667 <refname>eth_mac_addr</refname>
21668 <refpurpose>
21669     set new Ethernet hardware address
21670 </refpurpose>
21671</refnamediv>
21672<refsynopsisdiv>
21673 <title>Synopsis</title>
21674  <funcsynopsis><funcprototype>
21675   <funcdef>int <function>eth_mac_addr </function></funcdef>
21676   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21677   <paramdef>void * <parameter>p</parameter></paramdef>
21678  </funcprototype></funcsynopsis>
21679</refsynopsisdiv>
21680<refsect1>
21681 <title>Arguments</title>
21682 <variablelist>
21683  <varlistentry>
21684   <term><parameter>dev</parameter></term>
21685   <listitem>
21686    <para>
21687     network device
21688    </para>
21689   </listitem>
21690  </varlistentry>
21691  <varlistentry>
21692   <term><parameter>p</parameter></term>
21693   <listitem>
21694    <para>
21695     socket address
21696    </para>
21697   </listitem>
21698  </varlistentry>
21699 </variablelist>
21700</refsect1>
21701<refsect1>
21702<title>Description</title>
21703<para>
21704   Change hardware address of device.
21705   </para><para>
21706
21707   This doesn't change hardware matching, so needs to be overridden
21708   for most real devices.
21709</para>
21710</refsect1>
21711</refentry>
21712
21713<refentry id="API-eth-change-mtu">
21714<refentryinfo>
21715 <title>LINUX</title>
21716 <productname>Kernel Hackers Manual</productname>
21717 <date>July 2017</date>
21718</refentryinfo>
21719<refmeta>
21720 <refentrytitle><phrase>eth_change_mtu</phrase></refentrytitle>
21721 <manvolnum>9</manvolnum>
21722 <refmiscinfo class="version">4.1.27</refmiscinfo>
21723</refmeta>
21724<refnamediv>
21725 <refname>eth_change_mtu</refname>
21726 <refpurpose>
21727     set new MTU size
21728 </refpurpose>
21729</refnamediv>
21730<refsynopsisdiv>
21731 <title>Synopsis</title>
21732  <funcsynopsis><funcprototype>
21733   <funcdef>int <function>eth_change_mtu </function></funcdef>
21734   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21735   <paramdef>int <parameter>new_mtu</parameter></paramdef>
21736  </funcprototype></funcsynopsis>
21737</refsynopsisdiv>
21738<refsect1>
21739 <title>Arguments</title>
21740 <variablelist>
21741  <varlistentry>
21742   <term><parameter>dev</parameter></term>
21743   <listitem>
21744    <para>
21745     network device
21746    </para>
21747   </listitem>
21748  </varlistentry>
21749  <varlistentry>
21750   <term><parameter>new_mtu</parameter></term>
21751   <listitem>
21752    <para>
21753     new Maximum Transfer Unit
21754    </para>
21755   </listitem>
21756  </varlistentry>
21757 </variablelist>
21758</refsect1>
21759<refsect1>
21760<title>Description</title>
21761<para>
21762   Allow changing MTU size. Needs to be overridden for devices
21763   supporting jumbo frames.
21764</para>
21765</refsect1>
21766</refentry>
21767
21768<refentry id="API-ether-setup">
21769<refentryinfo>
21770 <title>LINUX</title>
21771 <productname>Kernel Hackers Manual</productname>
21772 <date>July 2017</date>
21773</refentryinfo>
21774<refmeta>
21775 <refentrytitle><phrase>ether_setup</phrase></refentrytitle>
21776 <manvolnum>9</manvolnum>
21777 <refmiscinfo class="version">4.1.27</refmiscinfo>
21778</refmeta>
21779<refnamediv>
21780 <refname>ether_setup</refname>
21781 <refpurpose>
21782     setup Ethernet network device
21783 </refpurpose>
21784</refnamediv>
21785<refsynopsisdiv>
21786 <title>Synopsis</title>
21787  <funcsynopsis><funcprototype>
21788   <funcdef>void <function>ether_setup </function></funcdef>
21789   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21790  </funcprototype></funcsynopsis>
21791</refsynopsisdiv>
21792<refsect1>
21793 <title>Arguments</title>
21794 <variablelist>
21795  <varlistentry>
21796   <term><parameter>dev</parameter></term>
21797   <listitem>
21798    <para>
21799     network device
21800    </para>
21801   </listitem>
21802  </varlistentry>
21803 </variablelist>
21804</refsect1>
21805<refsect1>
21806<title>Description</title>
21807<para>
21808   Fill in the fields of the device structure with Ethernet-generic values.
21809</para>
21810</refsect1>
21811</refentry>
21812
21813<refentry id="API-alloc-etherdev-mqs">
21814<refentryinfo>
21815 <title>LINUX</title>
21816 <productname>Kernel Hackers Manual</productname>
21817 <date>July 2017</date>
21818</refentryinfo>
21819<refmeta>
21820 <refentrytitle><phrase>alloc_etherdev_mqs</phrase></refentrytitle>
21821 <manvolnum>9</manvolnum>
21822 <refmiscinfo class="version">4.1.27</refmiscinfo>
21823</refmeta>
21824<refnamediv>
21825 <refname>alloc_etherdev_mqs</refname>
21826 <refpurpose>
21827     Allocates and sets up an Ethernet device
21828 </refpurpose>
21829</refnamediv>
21830<refsynopsisdiv>
21831 <title>Synopsis</title>
21832  <funcsynopsis><funcprototype>
21833   <funcdef>struct net_device * <function>alloc_etherdev_mqs </function></funcdef>
21834   <paramdef>int <parameter>sizeof_priv</parameter></paramdef>
21835   <paramdef>unsigned int <parameter>txqs</parameter></paramdef>
21836   <paramdef>unsigned int <parameter>rxqs</parameter></paramdef>
21837  </funcprototype></funcsynopsis>
21838</refsynopsisdiv>
21839<refsect1>
21840 <title>Arguments</title>
21841 <variablelist>
21842  <varlistentry>
21843   <term><parameter>sizeof_priv</parameter></term>
21844   <listitem>
21845    <para>
21846     Size of additional driver-private structure to be allocated
21847     for this Ethernet device
21848    </para>
21849   </listitem>
21850  </varlistentry>
21851  <varlistentry>
21852   <term><parameter>txqs</parameter></term>
21853   <listitem>
21854    <para>
21855     The number of TX queues this device has.
21856    </para>
21857   </listitem>
21858  </varlistentry>
21859  <varlistentry>
21860   <term><parameter>rxqs</parameter></term>
21861   <listitem>
21862    <para>
21863     The number of RX queues this device has.
21864    </para>
21865   </listitem>
21866  </varlistentry>
21867 </variablelist>
21868</refsect1>
21869<refsect1>
21870<title>Description</title>
21871<para>
21872   Fill in the fields of the device structure with Ethernet-generic
21873   values. Basically does everything except registering the device.
21874   </para><para>
21875
21876   Constructs a new net device, complete with a private data area of
21877   size (sizeof_priv).  A 32-byte (not bit) alignment is enforced for
21878   this private data area.
21879</para>
21880</refsect1>
21881</refentry>
21882
21883<!-- net/sched/sch_generic.c -->
21884<refentry id="API-netif-carrier-on">
21885<refentryinfo>
21886 <title>LINUX</title>
21887 <productname>Kernel Hackers Manual</productname>
21888 <date>July 2017</date>
21889</refentryinfo>
21890<refmeta>
21891 <refentrytitle><phrase>netif_carrier_on</phrase></refentrytitle>
21892 <manvolnum>9</manvolnum>
21893 <refmiscinfo class="version">4.1.27</refmiscinfo>
21894</refmeta>
21895<refnamediv>
21896 <refname>netif_carrier_on</refname>
21897 <refpurpose>
21898  set carrier
21899 </refpurpose>
21900</refnamediv>
21901<refsynopsisdiv>
21902 <title>Synopsis</title>
21903  <funcsynopsis><funcprototype>
21904   <funcdef>void <function>netif_carrier_on </function></funcdef>
21905   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21906  </funcprototype></funcsynopsis>
21907</refsynopsisdiv>
21908<refsect1>
21909 <title>Arguments</title>
21910 <variablelist>
21911  <varlistentry>
21912   <term><parameter>dev</parameter></term>
21913   <listitem>
21914    <para>
21915     network device
21916    </para>
21917   </listitem>
21918  </varlistentry>
21919 </variablelist>
21920</refsect1>
21921<refsect1>
21922<title>Description</title>
21923<para>
21924   Device has detected that carrier.
21925</para>
21926</refsect1>
21927</refentry>
21928
21929<refentry id="API-netif-carrier-off">
21930<refentryinfo>
21931 <title>LINUX</title>
21932 <productname>Kernel Hackers Manual</productname>
21933 <date>July 2017</date>
21934</refentryinfo>
21935<refmeta>
21936 <refentrytitle><phrase>netif_carrier_off</phrase></refentrytitle>
21937 <manvolnum>9</manvolnum>
21938 <refmiscinfo class="version">4.1.27</refmiscinfo>
21939</refmeta>
21940<refnamediv>
21941 <refname>netif_carrier_off</refname>
21942 <refpurpose>
21943     clear carrier
21944 </refpurpose>
21945</refnamediv>
21946<refsynopsisdiv>
21947 <title>Synopsis</title>
21948  <funcsynopsis><funcprototype>
21949   <funcdef>void <function>netif_carrier_off </function></funcdef>
21950   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
21951  </funcprototype></funcsynopsis>
21952</refsynopsisdiv>
21953<refsect1>
21954 <title>Arguments</title>
21955 <variablelist>
21956  <varlistentry>
21957   <term><parameter>dev</parameter></term>
21958   <listitem>
21959    <para>
21960     network device
21961    </para>
21962   </listitem>
21963  </varlistentry>
21964 </variablelist>
21965</refsect1>
21966<refsect1>
21967<title>Description</title>
21968<para>
21969   Device has detected loss of carrier.
21970</para>
21971</refsect1>
21972</refentry>
21973
21974<!-- include/linux/etherdevice.h -->
21975<refentry id="API-is-link-local-ether-addr">
21976<refentryinfo>
21977 <title>LINUX</title>
21978 <productname>Kernel Hackers Manual</productname>
21979 <date>July 2017</date>
21980</refentryinfo>
21981<refmeta>
21982 <refentrytitle><phrase>is_link_local_ether_addr</phrase></refentrytitle>
21983 <manvolnum>9</manvolnum>
21984 <refmiscinfo class="version">4.1.27</refmiscinfo>
21985</refmeta>
21986<refnamediv>
21987 <refname>is_link_local_ether_addr</refname>
21988 <refpurpose>
21989  Determine if given Ethernet address is link-local
21990 </refpurpose>
21991</refnamediv>
21992<refsynopsisdiv>
21993 <title>Synopsis</title>
21994  <funcsynopsis><funcprototype>
21995   <funcdef>bool <function>is_link_local_ether_addr </function></funcdef>
21996   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
21997  </funcprototype></funcsynopsis>
21998</refsynopsisdiv>
21999<refsect1>
22000 <title>Arguments</title>
22001 <variablelist>
22002  <varlistentry>
22003   <term><parameter>addr</parameter></term>
22004   <listitem>
22005    <para>
22006     Pointer to a six-byte array containing the Ethernet address
22007    </para>
22008   </listitem>
22009  </varlistentry>
22010 </variablelist>
22011</refsect1>
22012<refsect1>
22013<title>Description</title>
22014<para>
22015   Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
22016   IEEE 802.1Q 8.6.3 Frame filtering.
22017</para>
22018</refsect1>
22019<refsect1>
22020<title>Please note</title>
22021<para>
22022   addr must be aligned to u16.
22023</para>
22024</refsect1>
22025</refentry>
22026
22027<refentry id="API-is-zero-ether-addr">
22028<refentryinfo>
22029 <title>LINUX</title>
22030 <productname>Kernel Hackers Manual</productname>
22031 <date>July 2017</date>
22032</refentryinfo>
22033<refmeta>
22034 <refentrytitle><phrase>is_zero_ether_addr</phrase></refentrytitle>
22035 <manvolnum>9</manvolnum>
22036 <refmiscinfo class="version">4.1.27</refmiscinfo>
22037</refmeta>
22038<refnamediv>
22039 <refname>is_zero_ether_addr</refname>
22040 <refpurpose>
22041     Determine if give Ethernet address is all zeros.
22042 </refpurpose>
22043</refnamediv>
22044<refsynopsisdiv>
22045 <title>Synopsis</title>
22046  <funcsynopsis><funcprototype>
22047   <funcdef>bool <function>is_zero_ether_addr </function></funcdef>
22048   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
22049  </funcprototype></funcsynopsis>
22050</refsynopsisdiv>
22051<refsect1>
22052 <title>Arguments</title>
22053 <variablelist>
22054  <varlistentry>
22055   <term><parameter>addr</parameter></term>
22056   <listitem>
22057    <para>
22058     Pointer to a six-byte array containing the Ethernet address
22059    </para>
22060   </listitem>
22061  </varlistentry>
22062 </variablelist>
22063</refsect1>
22064<refsect1>
22065<title>Description</title>
22066<para>
22067   Return true if the address is all zeroes.
22068</para>
22069</refsect1>
22070<refsect1>
22071<title>Please note</title>
22072<para>
22073   addr must be aligned to u16.
22074</para>
22075</refsect1>
22076</refentry>
22077
22078<refentry id="API-is-multicast-ether-addr">
22079<refentryinfo>
22080 <title>LINUX</title>
22081 <productname>Kernel Hackers Manual</productname>
22082 <date>July 2017</date>
22083</refentryinfo>
22084<refmeta>
22085 <refentrytitle><phrase>is_multicast_ether_addr</phrase></refentrytitle>
22086 <manvolnum>9</manvolnum>
22087 <refmiscinfo class="version">4.1.27</refmiscinfo>
22088</refmeta>
22089<refnamediv>
22090 <refname>is_multicast_ether_addr</refname>
22091 <refpurpose>
22092     Determine if the Ethernet address is a multicast.
22093 </refpurpose>
22094</refnamediv>
22095<refsynopsisdiv>
22096 <title>Synopsis</title>
22097  <funcsynopsis><funcprototype>
22098   <funcdef>bool <function>is_multicast_ether_addr </function></funcdef>
22099   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
22100  </funcprototype></funcsynopsis>
22101</refsynopsisdiv>
22102<refsect1>
22103 <title>Arguments</title>
22104 <variablelist>
22105  <varlistentry>
22106   <term><parameter>addr</parameter></term>
22107   <listitem>
22108    <para>
22109     Pointer to a six-byte array containing the Ethernet address
22110    </para>
22111   </listitem>
22112  </varlistentry>
22113 </variablelist>
22114</refsect1>
22115<refsect1>
22116<title>Description</title>
22117<para>
22118   Return true if the address is a multicast address.
22119   By definition the broadcast address is also a multicast address.
22120</para>
22121</refsect1>
22122</refentry>
22123
22124<refentry id="API-is-local-ether-addr">
22125<refentryinfo>
22126 <title>LINUX</title>
22127 <productname>Kernel Hackers Manual</productname>
22128 <date>July 2017</date>
22129</refentryinfo>
22130<refmeta>
22131 <refentrytitle><phrase>is_local_ether_addr</phrase></refentrytitle>
22132 <manvolnum>9</manvolnum>
22133 <refmiscinfo class="version">4.1.27</refmiscinfo>
22134</refmeta>
22135<refnamediv>
22136 <refname>is_local_ether_addr</refname>
22137 <refpurpose>
22138     Determine if the Ethernet address is locally-assigned one (IEEE 802).
22139 </refpurpose>
22140</refnamediv>
22141<refsynopsisdiv>
22142 <title>Synopsis</title>
22143  <funcsynopsis><funcprototype>
22144   <funcdef>bool <function>is_local_ether_addr </function></funcdef>
22145   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
22146  </funcprototype></funcsynopsis>
22147</refsynopsisdiv>
22148<refsect1>
22149 <title>Arguments</title>
22150 <variablelist>
22151  <varlistentry>
22152   <term><parameter>addr</parameter></term>
22153   <listitem>
22154    <para>
22155     Pointer to a six-byte array containing the Ethernet address
22156    </para>
22157   </listitem>
22158  </varlistentry>
22159 </variablelist>
22160</refsect1>
22161<refsect1>
22162<title>Description</title>
22163<para>
22164   Return true if the address is a local address.
22165</para>
22166</refsect1>
22167</refentry>
22168
22169<refentry id="API-is-broadcast-ether-addr">
22170<refentryinfo>
22171 <title>LINUX</title>
22172 <productname>Kernel Hackers Manual</productname>
22173 <date>July 2017</date>
22174</refentryinfo>
22175<refmeta>
22176 <refentrytitle><phrase>is_broadcast_ether_addr</phrase></refentrytitle>
22177 <manvolnum>9</manvolnum>
22178 <refmiscinfo class="version">4.1.27</refmiscinfo>
22179</refmeta>
22180<refnamediv>
22181 <refname>is_broadcast_ether_addr</refname>
22182 <refpurpose>
22183     Determine if the Ethernet address is broadcast
22184 </refpurpose>
22185</refnamediv>
22186<refsynopsisdiv>
22187 <title>Synopsis</title>
22188  <funcsynopsis><funcprototype>
22189   <funcdef>bool <function>is_broadcast_ether_addr </function></funcdef>
22190   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
22191  </funcprototype></funcsynopsis>
22192</refsynopsisdiv>
22193<refsect1>
22194 <title>Arguments</title>
22195 <variablelist>
22196  <varlistentry>
22197   <term><parameter>addr</parameter></term>
22198   <listitem>
22199    <para>
22200     Pointer to a six-byte array containing the Ethernet address
22201    </para>
22202   </listitem>
22203  </varlistentry>
22204 </variablelist>
22205</refsect1>
22206<refsect1>
22207<title>Description</title>
22208<para>
22209   Return true if the address is the broadcast address.
22210</para>
22211</refsect1>
22212<refsect1>
22213<title>Please note</title>
22214<para>
22215   addr must be aligned to u16.
22216</para>
22217</refsect1>
22218</refentry>
22219
22220<refentry id="API-is-unicast-ether-addr">
22221<refentryinfo>
22222 <title>LINUX</title>
22223 <productname>Kernel Hackers Manual</productname>
22224 <date>July 2017</date>
22225</refentryinfo>
22226<refmeta>
22227 <refentrytitle><phrase>is_unicast_ether_addr</phrase></refentrytitle>
22228 <manvolnum>9</manvolnum>
22229 <refmiscinfo class="version">4.1.27</refmiscinfo>
22230</refmeta>
22231<refnamediv>
22232 <refname>is_unicast_ether_addr</refname>
22233 <refpurpose>
22234     Determine if the Ethernet address is unicast
22235 </refpurpose>
22236</refnamediv>
22237<refsynopsisdiv>
22238 <title>Synopsis</title>
22239  <funcsynopsis><funcprototype>
22240   <funcdef>bool <function>is_unicast_ether_addr </function></funcdef>
22241   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
22242  </funcprototype></funcsynopsis>
22243</refsynopsisdiv>
22244<refsect1>
22245 <title>Arguments</title>
22246 <variablelist>
22247  <varlistentry>
22248   <term><parameter>addr</parameter></term>
22249   <listitem>
22250    <para>
22251     Pointer to a six-byte array containing the Ethernet address
22252    </para>
22253   </listitem>
22254  </varlistentry>
22255 </variablelist>
22256</refsect1>
22257<refsect1>
22258<title>Description</title>
22259<para>
22260   Return true if the address is a unicast address.
22261</para>
22262</refsect1>
22263</refentry>
22264
22265<refentry id="API-is-valid-ether-addr">
22266<refentryinfo>
22267 <title>LINUX</title>
22268 <productname>Kernel Hackers Manual</productname>
22269 <date>July 2017</date>
22270</refentryinfo>
22271<refmeta>
22272 <refentrytitle><phrase>is_valid_ether_addr</phrase></refentrytitle>
22273 <manvolnum>9</manvolnum>
22274 <refmiscinfo class="version">4.1.27</refmiscinfo>
22275</refmeta>
22276<refnamediv>
22277 <refname>is_valid_ether_addr</refname>
22278 <refpurpose>
22279     Determine if the given Ethernet address is valid
22280 </refpurpose>
22281</refnamediv>
22282<refsynopsisdiv>
22283 <title>Synopsis</title>
22284  <funcsynopsis><funcprototype>
22285   <funcdef>bool <function>is_valid_ether_addr </function></funcdef>
22286   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
22287  </funcprototype></funcsynopsis>
22288</refsynopsisdiv>
22289<refsect1>
22290 <title>Arguments</title>
22291 <variablelist>
22292  <varlistentry>
22293   <term><parameter>addr</parameter></term>
22294   <listitem>
22295    <para>
22296     Pointer to a six-byte array containing the Ethernet address
22297    </para>
22298   </listitem>
22299  </varlistentry>
22300 </variablelist>
22301</refsect1>
22302<refsect1>
22303<title>Description</title>
22304<para>
22305   Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
22306   a multicast address, and is not FF:FF:FF:FF:FF:FF.
22307   </para><para>
22308
22309   Return true if the address is valid.
22310</para>
22311</refsect1>
22312<refsect1>
22313<title>Please note</title>
22314<para>
22315   addr must be aligned to u16.
22316</para>
22317</refsect1>
22318</refentry>
22319
22320<refentry id="API-eth-random-addr">
22321<refentryinfo>
22322 <title>LINUX</title>
22323 <productname>Kernel Hackers Manual</productname>
22324 <date>July 2017</date>
22325</refentryinfo>
22326<refmeta>
22327 <refentrytitle><phrase>eth_random_addr</phrase></refentrytitle>
22328 <manvolnum>9</manvolnum>
22329 <refmiscinfo class="version">4.1.27</refmiscinfo>
22330</refmeta>
22331<refnamediv>
22332 <refname>eth_random_addr</refname>
22333 <refpurpose>
22334     Generate software assigned random Ethernet address
22335 </refpurpose>
22336</refnamediv>
22337<refsynopsisdiv>
22338 <title>Synopsis</title>
22339  <funcsynopsis><funcprototype>
22340   <funcdef>void <function>eth_random_addr </function></funcdef>
22341   <paramdef>u8 * <parameter>addr</parameter></paramdef>
22342  </funcprototype></funcsynopsis>
22343</refsynopsisdiv>
22344<refsect1>
22345 <title>Arguments</title>
22346 <variablelist>
22347  <varlistentry>
22348   <term><parameter>addr</parameter></term>
22349   <listitem>
22350    <para>
22351     Pointer to a six-byte array containing the Ethernet address
22352    </para>
22353   </listitem>
22354  </varlistentry>
22355 </variablelist>
22356</refsect1>
22357<refsect1>
22358<title>Description</title>
22359<para>
22360   Generate a random Ethernet address (MAC) that is not multicast
22361   and has the local assigned bit set.
22362</para>
22363</refsect1>
22364</refentry>
22365
22366<refentry id="API-eth-broadcast-addr">
22367<refentryinfo>
22368 <title>LINUX</title>
22369 <productname>Kernel Hackers Manual</productname>
22370 <date>July 2017</date>
22371</refentryinfo>
22372<refmeta>
22373 <refentrytitle><phrase>eth_broadcast_addr</phrase></refentrytitle>
22374 <manvolnum>9</manvolnum>
22375 <refmiscinfo class="version">4.1.27</refmiscinfo>
22376</refmeta>
22377<refnamediv>
22378 <refname>eth_broadcast_addr</refname>
22379 <refpurpose>
22380     Assign broadcast address
22381 </refpurpose>
22382</refnamediv>
22383<refsynopsisdiv>
22384 <title>Synopsis</title>
22385  <funcsynopsis><funcprototype>
22386   <funcdef>void <function>eth_broadcast_addr </function></funcdef>
22387   <paramdef>u8 * <parameter>addr</parameter></paramdef>
22388  </funcprototype></funcsynopsis>
22389</refsynopsisdiv>
22390<refsect1>
22391 <title>Arguments</title>
22392 <variablelist>
22393  <varlistentry>
22394   <term><parameter>addr</parameter></term>
22395   <listitem>
22396    <para>
22397     Pointer to a six-byte array containing the Ethernet address
22398    </para>
22399   </listitem>
22400  </varlistentry>
22401 </variablelist>
22402</refsect1>
22403<refsect1>
22404<title>Description</title>
22405<para>
22406   Assign the broadcast address to the given address array.
22407</para>
22408</refsect1>
22409</refentry>
22410
22411<refentry id="API-eth-zero-addr">
22412<refentryinfo>
22413 <title>LINUX</title>
22414 <productname>Kernel Hackers Manual</productname>
22415 <date>July 2017</date>
22416</refentryinfo>
22417<refmeta>
22418 <refentrytitle><phrase>eth_zero_addr</phrase></refentrytitle>
22419 <manvolnum>9</manvolnum>
22420 <refmiscinfo class="version">4.1.27</refmiscinfo>
22421</refmeta>
22422<refnamediv>
22423 <refname>eth_zero_addr</refname>
22424 <refpurpose>
22425     Assign zero address
22426 </refpurpose>
22427</refnamediv>
22428<refsynopsisdiv>
22429 <title>Synopsis</title>
22430  <funcsynopsis><funcprototype>
22431   <funcdef>void <function>eth_zero_addr </function></funcdef>
22432   <paramdef>u8 * <parameter>addr</parameter></paramdef>
22433  </funcprototype></funcsynopsis>
22434</refsynopsisdiv>
22435<refsect1>
22436 <title>Arguments</title>
22437 <variablelist>
22438  <varlistentry>
22439   <term><parameter>addr</parameter></term>
22440   <listitem>
22441    <para>
22442     Pointer to a six-byte array containing the Ethernet address
22443    </para>
22444   </listitem>
22445  </varlistentry>
22446 </variablelist>
22447</refsect1>
22448<refsect1>
22449<title>Description</title>
22450<para>
22451   Assign the zero address to the given address array.
22452</para>
22453</refsect1>
22454</refentry>
22455
22456<refentry id="API-eth-hw-addr-random">
22457<refentryinfo>
22458 <title>LINUX</title>
22459 <productname>Kernel Hackers Manual</productname>
22460 <date>July 2017</date>
22461</refentryinfo>
22462<refmeta>
22463 <refentrytitle><phrase>eth_hw_addr_random</phrase></refentrytitle>
22464 <manvolnum>9</manvolnum>
22465 <refmiscinfo class="version">4.1.27</refmiscinfo>
22466</refmeta>
22467<refnamediv>
22468 <refname>eth_hw_addr_random</refname>
22469 <refpurpose>
22470     Generate software assigned random Ethernet and set device flag
22471 </refpurpose>
22472</refnamediv>
22473<refsynopsisdiv>
22474 <title>Synopsis</title>
22475  <funcsynopsis><funcprototype>
22476   <funcdef>void <function>eth_hw_addr_random </function></funcdef>
22477   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
22478  </funcprototype></funcsynopsis>
22479</refsynopsisdiv>
22480<refsect1>
22481 <title>Arguments</title>
22482 <variablelist>
22483  <varlistentry>
22484   <term><parameter>dev</parameter></term>
22485   <listitem>
22486    <para>
22487     pointer to net_device structure
22488    </para>
22489   </listitem>
22490  </varlistentry>
22491 </variablelist>
22492</refsect1>
22493<refsect1>
22494<title>Description</title>
22495<para>
22496   Generate a random Ethernet address (MAC) to be used by a net device
22497   and set addr_assign_type so the state can be read by sysfs and be
22498   used by userspace.
22499</para>
22500</refsect1>
22501</refentry>
22502
22503<refentry id="API-ether-addr-copy">
22504<refentryinfo>
22505 <title>LINUX</title>
22506 <productname>Kernel Hackers Manual</productname>
22507 <date>July 2017</date>
22508</refentryinfo>
22509<refmeta>
22510 <refentrytitle><phrase>ether_addr_copy</phrase></refentrytitle>
22511 <manvolnum>9</manvolnum>
22512 <refmiscinfo class="version">4.1.27</refmiscinfo>
22513</refmeta>
22514<refnamediv>
22515 <refname>ether_addr_copy</refname>
22516 <refpurpose>
22517     Copy an Ethernet address
22518 </refpurpose>
22519</refnamediv>
22520<refsynopsisdiv>
22521 <title>Synopsis</title>
22522  <funcsynopsis><funcprototype>
22523   <funcdef>void <function>ether_addr_copy </function></funcdef>
22524   <paramdef>u8 * <parameter>dst</parameter></paramdef>
22525   <paramdef>const u8 * <parameter>src</parameter></paramdef>
22526  </funcprototype></funcsynopsis>
22527</refsynopsisdiv>
22528<refsect1>
22529 <title>Arguments</title>
22530 <variablelist>
22531  <varlistentry>
22532   <term><parameter>dst</parameter></term>
22533   <listitem>
22534    <para>
22535     Pointer to a six-byte array Ethernet address destination
22536    </para>
22537   </listitem>
22538  </varlistentry>
22539  <varlistentry>
22540   <term><parameter>src</parameter></term>
22541   <listitem>
22542    <para>
22543     Pointer to a six-byte array Ethernet address source
22544    </para>
22545   </listitem>
22546  </varlistentry>
22547 </variablelist>
22548</refsect1>
22549<refsect1>
22550<title>Please note</title>
22551<para>
22552   dst &amp; src must both be aligned to u16.
22553</para>
22554</refsect1>
22555</refentry>
22556
22557<refentry id="API-eth-hw-addr-inherit">
22558<refentryinfo>
22559 <title>LINUX</title>
22560 <productname>Kernel Hackers Manual</productname>
22561 <date>July 2017</date>
22562</refentryinfo>
22563<refmeta>
22564 <refentrytitle><phrase>eth_hw_addr_inherit</phrase></refentrytitle>
22565 <manvolnum>9</manvolnum>
22566 <refmiscinfo class="version">4.1.27</refmiscinfo>
22567</refmeta>
22568<refnamediv>
22569 <refname>eth_hw_addr_inherit</refname>
22570 <refpurpose>
22571     Copy dev_addr from another net_device
22572 </refpurpose>
22573</refnamediv>
22574<refsynopsisdiv>
22575 <title>Synopsis</title>
22576  <funcsynopsis><funcprototype>
22577   <funcdef>void <function>eth_hw_addr_inherit </function></funcdef>
22578   <paramdef>struct net_device * <parameter>dst</parameter></paramdef>
22579   <paramdef>struct net_device * <parameter>src</parameter></paramdef>
22580  </funcprototype></funcsynopsis>
22581</refsynopsisdiv>
22582<refsect1>
22583 <title>Arguments</title>
22584 <variablelist>
22585  <varlistentry>
22586   <term><parameter>dst</parameter></term>
22587   <listitem>
22588    <para>
22589     pointer to net_device to copy dev_addr to
22590    </para>
22591   </listitem>
22592  </varlistentry>
22593  <varlistentry>
22594   <term><parameter>src</parameter></term>
22595   <listitem>
22596    <para>
22597     pointer to net_device to copy dev_addr from
22598    </para>
22599   </listitem>
22600  </varlistentry>
22601 </variablelist>
22602</refsect1>
22603<refsect1>
22604<title>Description</title>
22605<para>
22606   Copy the Ethernet address from one net_device to another along with
22607   the address attributes (addr_assign_type).
22608</para>
22609</refsect1>
22610</refentry>
22611
22612<refentry id="API-ether-addr-equal">
22613<refentryinfo>
22614 <title>LINUX</title>
22615 <productname>Kernel Hackers Manual</productname>
22616 <date>July 2017</date>
22617</refentryinfo>
22618<refmeta>
22619 <refentrytitle><phrase>ether_addr_equal</phrase></refentrytitle>
22620 <manvolnum>9</manvolnum>
22621 <refmiscinfo class="version">4.1.27</refmiscinfo>
22622</refmeta>
22623<refnamediv>
22624 <refname>ether_addr_equal</refname>
22625 <refpurpose>
22626     Compare two Ethernet addresses
22627 </refpurpose>
22628</refnamediv>
22629<refsynopsisdiv>
22630 <title>Synopsis</title>
22631  <funcsynopsis><funcprototype>
22632   <funcdef>bool <function>ether_addr_equal </function></funcdef>
22633   <paramdef>const u8 * <parameter>addr1</parameter></paramdef>
22634   <paramdef>const u8 * <parameter>addr2</parameter></paramdef>
22635  </funcprototype></funcsynopsis>
22636</refsynopsisdiv>
22637<refsect1>
22638 <title>Arguments</title>
22639 <variablelist>
22640  <varlistentry>
22641   <term><parameter>addr1</parameter></term>
22642   <listitem>
22643    <para>
22644     Pointer to a six-byte array containing the Ethernet address
22645    </para>
22646   </listitem>
22647  </varlistentry>
22648  <varlistentry>
22649   <term><parameter>addr2</parameter></term>
22650   <listitem>
22651    <para>
22652     Pointer other six-byte array containing the Ethernet address
22653    </para>
22654   </listitem>
22655  </varlistentry>
22656 </variablelist>
22657</refsect1>
22658<refsect1>
22659<title>Description</title>
22660<para>
22661   Compare two Ethernet addresses, returns true if equal
22662</para>
22663</refsect1>
22664<refsect1>
22665<title>Please note</title>
22666<para>
22667   addr1 &amp; addr2 must both be aligned to u16.
22668</para>
22669</refsect1>
22670</refentry>
22671
22672<refentry id="API-ether-addr-equal-64bits">
22673<refentryinfo>
22674 <title>LINUX</title>
22675 <productname>Kernel Hackers Manual</productname>
22676 <date>July 2017</date>
22677</refentryinfo>
22678<refmeta>
22679 <refentrytitle><phrase>ether_addr_equal_64bits</phrase></refentrytitle>
22680 <manvolnum>9</manvolnum>
22681 <refmiscinfo class="version">4.1.27</refmiscinfo>
22682</refmeta>
22683<refnamediv>
22684 <refname>ether_addr_equal_64bits</refname>
22685 <refpurpose>
22686     Compare two Ethernet addresses
22687 </refpurpose>
22688</refnamediv>
22689<refsynopsisdiv>
22690 <title>Synopsis</title>
22691  <funcsynopsis><funcprototype>
22692   <funcdef>bool <function>ether_addr_equal_64bits </function></funcdef>
22693   <paramdef>const u8 <parameter>addr1[6+2]</parameter></paramdef>
22694   <paramdef>const u8 <parameter>addr2[6+2]</parameter></paramdef>
22695  </funcprototype></funcsynopsis>
22696</refsynopsisdiv>
22697<refsect1>
22698 <title>Arguments</title>
22699 <variablelist>
22700  <varlistentry>
22701   <term><parameter>addr1[6+2]</parameter></term>
22702   <listitem>
22703    <para>
22704     Pointer to an array of 8 bytes
22705    </para>
22706   </listitem>
22707  </varlistentry>
22708  <varlistentry>
22709   <term><parameter>addr2[6+2]</parameter></term>
22710   <listitem>
22711    <para>
22712     Pointer to an other array of 8 bytes
22713    </para>
22714   </listitem>
22715  </varlistentry>
22716 </variablelist>
22717</refsect1>
22718<refsect1>
22719<title>Description</title>
22720<para>
22721   Compare two Ethernet addresses, returns true if equal, false otherwise.
22722   </para><para>
22723
22724   The function doesn't need any conditional branches and possibly uses
22725   word memory accesses on CPU allowing cheap unaligned memory reads.
22726   arrays = { byte1, byte2, byte3, byte4, byte5, byte6, pad1, pad2 }
22727   </para><para>
22728
22729   Please note that alignment of addr1 &amp; addr2 are only guaranteed to be 16 bits.
22730</para>
22731</refsect1>
22732</refentry>
22733
22734<refentry id="API-ether-addr-equal-unaligned">
22735<refentryinfo>
22736 <title>LINUX</title>
22737 <productname>Kernel Hackers Manual</productname>
22738 <date>July 2017</date>
22739</refentryinfo>
22740<refmeta>
22741 <refentrytitle><phrase>ether_addr_equal_unaligned</phrase></refentrytitle>
22742 <manvolnum>9</manvolnum>
22743 <refmiscinfo class="version">4.1.27</refmiscinfo>
22744</refmeta>
22745<refnamediv>
22746 <refname>ether_addr_equal_unaligned</refname>
22747 <refpurpose>
22748     Compare two not u16 aligned Ethernet addresses
22749 </refpurpose>
22750</refnamediv>
22751<refsynopsisdiv>
22752 <title>Synopsis</title>
22753  <funcsynopsis><funcprototype>
22754   <funcdef>bool <function>ether_addr_equal_unaligned </function></funcdef>
22755   <paramdef>const u8 * <parameter>addr1</parameter></paramdef>
22756   <paramdef>const u8 * <parameter>addr2</parameter></paramdef>
22757  </funcprototype></funcsynopsis>
22758</refsynopsisdiv>
22759<refsect1>
22760 <title>Arguments</title>
22761 <variablelist>
22762  <varlistentry>
22763   <term><parameter>addr1</parameter></term>
22764   <listitem>
22765    <para>
22766     Pointer to a six-byte array containing the Ethernet address
22767    </para>
22768   </listitem>
22769  </varlistentry>
22770  <varlistentry>
22771   <term><parameter>addr2</parameter></term>
22772   <listitem>
22773    <para>
22774     Pointer other six-byte array containing the Ethernet address
22775    </para>
22776   </listitem>
22777  </varlistentry>
22778 </variablelist>
22779</refsect1>
22780<refsect1>
22781<title>Description</title>
22782<para>
22783   Compare two Ethernet addresses, returns true if equal
22784</para>
22785</refsect1>
22786<refsect1>
22787<title>Please note</title>
22788<para>
22789   Use only when any Ethernet address may not be u16 aligned.
22790</para>
22791</refsect1>
22792</refentry>
22793
22794<refentry id="API-is-etherdev-addr">
22795<refentryinfo>
22796 <title>LINUX</title>
22797 <productname>Kernel Hackers Manual</productname>
22798 <date>July 2017</date>
22799</refentryinfo>
22800<refmeta>
22801 <refentrytitle><phrase>is_etherdev_addr</phrase></refentrytitle>
22802 <manvolnum>9</manvolnum>
22803 <refmiscinfo class="version">4.1.27</refmiscinfo>
22804</refmeta>
22805<refnamediv>
22806 <refname>is_etherdev_addr</refname>
22807 <refpurpose>
22808     Tell if given Ethernet address belongs to the device.
22809 </refpurpose>
22810</refnamediv>
22811<refsynopsisdiv>
22812 <title>Synopsis</title>
22813  <funcsynopsis><funcprototype>
22814   <funcdef>bool <function>is_etherdev_addr </function></funcdef>
22815   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
22816   <paramdef>const u8 <parameter>addr[6 + 2]</parameter></paramdef>
22817  </funcprototype></funcsynopsis>
22818</refsynopsisdiv>
22819<refsect1>
22820 <title>Arguments</title>
22821 <variablelist>
22822  <varlistentry>
22823   <term><parameter>dev</parameter></term>
22824   <listitem>
22825    <para>
22826     Pointer to a device structure
22827    </para>
22828   </listitem>
22829  </varlistentry>
22830  <varlistentry>
22831   <term><parameter>addr[6 + 2]</parameter></term>
22832   <listitem>
22833    <para>
22834     Pointer to a six-byte array containing the Ethernet address
22835    </para>
22836   </listitem>
22837  </varlistentry>
22838 </variablelist>
22839</refsect1>
22840<refsect1>
22841<title>Description</title>
22842<para>
22843   Compare passed address with all addresses of the device. Return true if the
22844   address if one of the device addresses.
22845   </para><para>
22846
22847   Note that this function calls <function>ether_addr_equal_64bits</function> so take care of
22848   the right padding.
22849</para>
22850</refsect1>
22851</refentry>
22852
22853<refentry id="API-compare-ether-header">
22854<refentryinfo>
22855 <title>LINUX</title>
22856 <productname>Kernel Hackers Manual</productname>
22857 <date>July 2017</date>
22858</refentryinfo>
22859<refmeta>
22860 <refentrytitle><phrase>compare_ether_header</phrase></refentrytitle>
22861 <manvolnum>9</manvolnum>
22862 <refmiscinfo class="version">4.1.27</refmiscinfo>
22863</refmeta>
22864<refnamediv>
22865 <refname>compare_ether_header</refname>
22866 <refpurpose>
22867     Compare two Ethernet headers
22868 </refpurpose>
22869</refnamediv>
22870<refsynopsisdiv>
22871 <title>Synopsis</title>
22872  <funcsynopsis><funcprototype>
22873   <funcdef>unsigned long <function>compare_ether_header </function></funcdef>
22874   <paramdef>const void * <parameter>a</parameter></paramdef>
22875   <paramdef>const void * <parameter>b</parameter></paramdef>
22876  </funcprototype></funcsynopsis>
22877</refsynopsisdiv>
22878<refsect1>
22879 <title>Arguments</title>
22880 <variablelist>
22881  <varlistentry>
22882   <term><parameter>a</parameter></term>
22883   <listitem>
22884    <para>
22885     Pointer to Ethernet header
22886    </para>
22887   </listitem>
22888  </varlistentry>
22889  <varlistentry>
22890   <term><parameter>b</parameter></term>
22891   <listitem>
22892    <para>
22893     Pointer to Ethernet header
22894    </para>
22895   </listitem>
22896  </varlistentry>
22897 </variablelist>
22898</refsect1>
22899<refsect1>
22900<title>Description</title>
22901<para>
22902   Compare two Ethernet headers, returns 0 if equal.
22903   This assumes that the network header (i.e., IP header) is 4-byte
22904   aligned OR the platform can handle unaligned access.  This is the
22905   case for all packets coming into netif_receive_skb or similar
22906   entry points.
22907</para>
22908</refsect1>
22909</refentry>
22910
22911<refentry id="API-eth-skb-pad">
22912<refentryinfo>
22913 <title>LINUX</title>
22914 <productname>Kernel Hackers Manual</productname>
22915 <date>July 2017</date>
22916</refentryinfo>
22917<refmeta>
22918 <refentrytitle><phrase>eth_skb_pad</phrase></refentrytitle>
22919 <manvolnum>9</manvolnum>
22920 <refmiscinfo class="version">4.1.27</refmiscinfo>
22921</refmeta>
22922<refnamediv>
22923 <refname>eth_skb_pad</refname>
22924 <refpurpose>
22925     Pad buffer to mininum number of octets for Ethernet frame
22926 </refpurpose>
22927</refnamediv>
22928<refsynopsisdiv>
22929 <title>Synopsis</title>
22930  <funcsynopsis><funcprototype>
22931   <funcdef>int <function>eth_skb_pad </function></funcdef>
22932   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
22933  </funcprototype></funcsynopsis>
22934</refsynopsisdiv>
22935<refsect1>
22936 <title>Arguments</title>
22937 <variablelist>
22938  <varlistentry>
22939   <term><parameter>skb</parameter></term>
22940   <listitem>
22941    <para>
22942     Buffer to pad
22943    </para>
22944   </listitem>
22945  </varlistentry>
22946 </variablelist>
22947</refsect1>
22948<refsect1>
22949<title>Description</title>
22950<para>
22951   An Ethernet frame should have a minimum size of 60 bytes.  This function
22952   takes short frames and pads them with zeros up to the 60 byte limit.
22953</para>
22954</refsect1>
22955</refentry>
22956
22957<!-- include/linux/netdevice.h -->
22958<refentry id="API-napi-schedule-prep">
22959<refentryinfo>
22960 <title>LINUX</title>
22961 <productname>Kernel Hackers Manual</productname>
22962 <date>July 2017</date>
22963</refentryinfo>
22964<refmeta>
22965 <refentrytitle><phrase>napi_schedule_prep</phrase></refentrytitle>
22966 <manvolnum>9</manvolnum>
22967 <refmiscinfo class="version">4.1.27</refmiscinfo>
22968</refmeta>
22969<refnamediv>
22970 <refname>napi_schedule_prep</refname>
22971 <refpurpose>
22972  check if napi can be scheduled
22973 </refpurpose>
22974</refnamediv>
22975<refsynopsisdiv>
22976 <title>Synopsis</title>
22977  <funcsynopsis><funcprototype>
22978   <funcdef>bool <function>napi_schedule_prep </function></funcdef>
22979   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
22980  </funcprototype></funcsynopsis>
22981</refsynopsisdiv>
22982<refsect1>
22983 <title>Arguments</title>
22984 <variablelist>
22985  <varlistentry>
22986   <term><parameter>n</parameter></term>
22987   <listitem>
22988    <para>
22989     napi context
22990    </para>
22991   </listitem>
22992  </varlistentry>
22993 </variablelist>
22994</refsect1>
22995<refsect1>
22996<title>Description</title>
22997<para>
22998   Test if NAPI routine is already running, and if not mark
22999   it as running.  This is used as a condition variable
23000   insure only one NAPI poll instance runs.  We also make
23001   sure there is no pending NAPI disable.
23002</para>
23003</refsect1>
23004</refentry>
23005
23006<refentry id="API-napi-schedule">
23007<refentryinfo>
23008 <title>LINUX</title>
23009 <productname>Kernel Hackers Manual</productname>
23010 <date>July 2017</date>
23011</refentryinfo>
23012<refmeta>
23013 <refentrytitle><phrase>napi_schedule</phrase></refentrytitle>
23014 <manvolnum>9</manvolnum>
23015 <refmiscinfo class="version">4.1.27</refmiscinfo>
23016</refmeta>
23017<refnamediv>
23018 <refname>napi_schedule</refname>
23019 <refpurpose>
23020     schedule NAPI poll
23021 </refpurpose>
23022</refnamediv>
23023<refsynopsisdiv>
23024 <title>Synopsis</title>
23025  <funcsynopsis><funcprototype>
23026   <funcdef>void <function>napi_schedule </function></funcdef>
23027   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
23028  </funcprototype></funcsynopsis>
23029</refsynopsisdiv>
23030<refsect1>
23031 <title>Arguments</title>
23032 <variablelist>
23033  <varlistentry>
23034   <term><parameter>n</parameter></term>
23035   <listitem>
23036    <para>
23037     napi context
23038    </para>
23039   </listitem>
23040  </varlistentry>
23041 </variablelist>
23042</refsect1>
23043<refsect1>
23044<title>Description</title>
23045<para>
23046   Schedule NAPI poll routine to be called if it is not already
23047   running.
23048</para>
23049</refsect1>
23050</refentry>
23051
23052<refentry id="API-napi-schedule-irqoff">
23053<refentryinfo>
23054 <title>LINUX</title>
23055 <productname>Kernel Hackers Manual</productname>
23056 <date>July 2017</date>
23057</refentryinfo>
23058<refmeta>
23059 <refentrytitle><phrase>napi_schedule_irqoff</phrase></refentrytitle>
23060 <manvolnum>9</manvolnum>
23061 <refmiscinfo class="version">4.1.27</refmiscinfo>
23062</refmeta>
23063<refnamediv>
23064 <refname>napi_schedule_irqoff</refname>
23065 <refpurpose>
23066     schedule NAPI poll
23067 </refpurpose>
23068</refnamediv>
23069<refsynopsisdiv>
23070 <title>Synopsis</title>
23071  <funcsynopsis><funcprototype>
23072   <funcdef>void <function>napi_schedule_irqoff </function></funcdef>
23073   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
23074  </funcprototype></funcsynopsis>
23075</refsynopsisdiv>
23076<refsect1>
23077 <title>Arguments</title>
23078 <variablelist>
23079  <varlistentry>
23080   <term><parameter>n</parameter></term>
23081   <listitem>
23082    <para>
23083     napi context
23084    </para>
23085   </listitem>
23086  </varlistentry>
23087 </variablelist>
23088</refsect1>
23089<refsect1>
23090<title>Description</title>
23091<para>
23092   Variant of <function>napi_schedule</function>, assuming hard irqs are masked.
23093</para>
23094</refsect1>
23095</refentry>
23096
23097<refentry id="API-napi-complete">
23098<refentryinfo>
23099 <title>LINUX</title>
23100 <productname>Kernel Hackers Manual</productname>
23101 <date>July 2017</date>
23102</refentryinfo>
23103<refmeta>
23104 <refentrytitle><phrase>napi_complete</phrase></refentrytitle>
23105 <manvolnum>9</manvolnum>
23106 <refmiscinfo class="version">4.1.27</refmiscinfo>
23107</refmeta>
23108<refnamediv>
23109 <refname>napi_complete</refname>
23110 <refpurpose>
23111     NAPI processing complete
23112 </refpurpose>
23113</refnamediv>
23114<refsynopsisdiv>
23115 <title>Synopsis</title>
23116  <funcsynopsis><funcprototype>
23117   <funcdef>void <function>napi_complete </function></funcdef>
23118   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
23119  </funcprototype></funcsynopsis>
23120</refsynopsisdiv>
23121<refsect1>
23122 <title>Arguments</title>
23123 <variablelist>
23124  <varlistentry>
23125   <term><parameter>n</parameter></term>
23126   <listitem>
23127    <para>
23128     napi context
23129    </para>
23130   </listitem>
23131  </varlistentry>
23132 </variablelist>
23133</refsect1>
23134<refsect1>
23135<title>Description</title>
23136<para>
23137   Mark NAPI processing as complete.
23138   Consider using <function>napi_complete_done</function> instead.
23139</para>
23140</refsect1>
23141</refentry>
23142
23143<refentry id="API-napi-enable">
23144<refentryinfo>
23145 <title>LINUX</title>
23146 <productname>Kernel Hackers Manual</productname>
23147 <date>July 2017</date>
23148</refentryinfo>
23149<refmeta>
23150 <refentrytitle><phrase>napi_enable</phrase></refentrytitle>
23151 <manvolnum>9</manvolnum>
23152 <refmiscinfo class="version">4.1.27</refmiscinfo>
23153</refmeta>
23154<refnamediv>
23155 <refname>napi_enable</refname>
23156 <refpurpose>
23157     enable NAPI scheduling
23158 </refpurpose>
23159</refnamediv>
23160<refsynopsisdiv>
23161 <title>Synopsis</title>
23162  <funcsynopsis><funcprototype>
23163   <funcdef>void <function>napi_enable </function></funcdef>
23164   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
23165  </funcprototype></funcsynopsis>
23166</refsynopsisdiv>
23167<refsect1>
23168 <title>Arguments</title>
23169 <variablelist>
23170  <varlistentry>
23171   <term><parameter>n</parameter></term>
23172   <listitem>
23173    <para>
23174     napi context
23175    </para>
23176   </listitem>
23177  </varlistentry>
23178 </variablelist>
23179</refsect1>
23180<refsect1>
23181<title>Description</title>
23182<para>
23183   Resume NAPI from being scheduled on this context.
23184   Must be paired with napi_disable.
23185</para>
23186</refsect1>
23187</refentry>
23188
23189<refentry id="API-napi-synchronize">
23190<refentryinfo>
23191 <title>LINUX</title>
23192 <productname>Kernel Hackers Manual</productname>
23193 <date>July 2017</date>
23194</refentryinfo>
23195<refmeta>
23196 <refentrytitle><phrase>napi_synchronize</phrase></refentrytitle>
23197 <manvolnum>9</manvolnum>
23198 <refmiscinfo class="version">4.1.27</refmiscinfo>
23199</refmeta>
23200<refnamediv>
23201 <refname>napi_synchronize</refname>
23202 <refpurpose>
23203     wait until NAPI is not running
23204 </refpurpose>
23205</refnamediv>
23206<refsynopsisdiv>
23207 <title>Synopsis</title>
23208  <funcsynopsis><funcprototype>
23209   <funcdef>void <function>napi_synchronize </function></funcdef>
23210   <paramdef>const struct napi_struct * <parameter>n</parameter></paramdef>
23211  </funcprototype></funcsynopsis>
23212</refsynopsisdiv>
23213<refsect1>
23214 <title>Arguments</title>
23215 <variablelist>
23216  <varlistentry>
23217   <term><parameter>n</parameter></term>
23218   <listitem>
23219    <para>
23220     napi context
23221    </para>
23222   </listitem>
23223  </varlistentry>
23224 </variablelist>
23225</refsect1>
23226<refsect1>
23227<title>Description</title>
23228<para>
23229   Wait until NAPI is done being scheduled on this context.
23230   Waits till any outstanding processing completes but
23231   does not disable future activations.
23232</para>
23233</refsect1>
23234</refentry>
23235
23236<refentry id="API-enum-netdev-priv-flags">
23237<refentryinfo>
23238 <title>LINUX</title>
23239 <productname>Kernel Hackers Manual</productname>
23240 <date>July 2017</date>
23241</refentryinfo>
23242<refmeta>
23243 <refentrytitle><phrase>enum netdev_priv_flags</phrase></refentrytitle>
23244 <manvolnum>9</manvolnum>
23245 <refmiscinfo class="version">4.1.27</refmiscinfo>
23246</refmeta>
23247<refnamediv>
23248 <refname>enum netdev_priv_flags</refname>
23249 <refpurpose>
23250     <structname>struct net_device</structname> priv_flags
23251 </refpurpose>
23252</refnamediv>
23253<refsynopsisdiv>
23254 <title>Synopsis</title>
23255  <programlisting>
23256enum netdev_priv_flags {
23257  IFF_802_1Q_VLAN,
23258  IFF_EBRIDGE,
23259  IFF_SLAVE_INACTIVE,
23260  IFF_MASTER_8023AD,
23261  IFF_MASTER_ALB,
23262  IFF_BONDING,
23263  IFF_SLAVE_NEEDARP,
23264  IFF_ISATAP,
23265  IFF_MASTER_ARPMON,
23266  IFF_WAN_HDLC,
23267  IFF_XMIT_DST_RELEASE,
23268  IFF_DONT_BRIDGE,
23269  IFF_DISABLE_NETPOLL,
23270  IFF_MACVLAN_PORT,
23271  IFF_BRIDGE_PORT,
23272  IFF_OVS_DATAPATH,
23273  IFF_TX_SKB_SHARING,
23274  IFF_UNICAST_FLT,
23275  IFF_TEAM_PORT,
23276  IFF_SUPP_NOFCS,
23277  IFF_LIVE_ADDR_CHANGE,
23278  IFF_MACVLAN,
23279  IFF_XMIT_DST_RELEASE_PERM,
23280  IFF_IPVLAN_MASTER,
23281  IFF_IPVLAN_SLAVE
23282};  </programlisting>
23283</refsynopsisdiv>
23284<refsect1>
23285 <title>Constants</title>
23286  <variablelist>
23287    <varlistentry>      <term>IFF_802_1Q_VLAN</term>
23288      <listitem><para>
23289   802.1Q VLAN device
23290      </para></listitem>
23291    </varlistentry>
23292    <varlistentry>      <term>IFF_EBRIDGE</term>
23293      <listitem><para>
23294   Ethernet bridging device
23295      </para></listitem>
23296    </varlistentry>
23297    <varlistentry>      <term>IFF_SLAVE_INACTIVE</term>
23298      <listitem><para>
23299   bonding slave not the curr. active
23300      </para></listitem>
23301    </varlistentry>
23302    <varlistentry>      <term>IFF_MASTER_8023AD</term>
23303      <listitem><para>
23304   bonding master, 802.3ad
23305      </para></listitem>
23306    </varlistentry>
23307    <varlistentry>      <term>IFF_MASTER_ALB</term>
23308      <listitem><para>
23309   bonding master, balance-alb
23310      </para></listitem>
23311    </varlistentry>
23312    <varlistentry>      <term>IFF_BONDING</term>
23313      <listitem><para>
23314   bonding master or slave
23315      </para></listitem>
23316    </varlistentry>
23317    <varlistentry>      <term>IFF_SLAVE_NEEDARP</term>
23318      <listitem><para>
23319   need ARPs for validation
23320      </para></listitem>
23321    </varlistentry>
23322    <varlistentry>      <term>IFF_ISATAP</term>
23323      <listitem><para>
23324   ISATAP interface (RFC4214)
23325      </para></listitem>
23326    </varlistentry>
23327    <varlistentry>      <term>IFF_MASTER_ARPMON</term>
23328      <listitem><para>
23329   bonding master, ARP mon in use
23330      </para></listitem>
23331    </varlistentry>
23332    <varlistentry>      <term>IFF_WAN_HDLC</term>
23333      <listitem><para>
23334   WAN HDLC device
23335      </para></listitem>
23336    </varlistentry>
23337    <varlistentry>      <term>IFF_XMIT_DST_RELEASE</term>
23338      <listitem><para>
23339   <function>dev_hard_start_xmit</function> is allowed to
23340   release skb-&gt;dst
23341      </para></listitem>
23342    </varlistentry>
23343    <varlistentry>      <term>IFF_DONT_BRIDGE</term>
23344      <listitem><para>
23345   disallow bridging this ether dev
23346      </para></listitem>
23347    </varlistentry>
23348    <varlistentry>      <term>IFF_DISABLE_NETPOLL</term>
23349      <listitem><para>
23350   disable netpoll at run-time
23351      </para></listitem>
23352    </varlistentry>
23353    <varlistentry>      <term>IFF_MACVLAN_PORT</term>
23354      <listitem><para>
23355   device used as macvlan port
23356      </para></listitem>
23357    </varlistentry>
23358    <varlistentry>      <term>IFF_BRIDGE_PORT</term>
23359      <listitem><para>
23360   device used as bridge port
23361      </para></listitem>
23362    </varlistentry>
23363    <varlistentry>      <term>IFF_OVS_DATAPATH</term>
23364      <listitem><para>
23365   device used as Open vSwitch datapath port
23366      </para></listitem>
23367    </varlistentry>
23368    <varlistentry>      <term>IFF_TX_SKB_SHARING</term>
23369      <listitem><para>
23370   The interface supports sharing skbs on transmit
23371      </para></listitem>
23372    </varlistentry>
23373    <varlistentry>      <term>IFF_UNICAST_FLT</term>
23374      <listitem><para>
23375   Supports unicast filtering
23376      </para></listitem>
23377    </varlistentry>
23378    <varlistentry>      <term>IFF_TEAM_PORT</term>
23379      <listitem><para>
23380   device used as team port
23381      </para></listitem>
23382    </varlistentry>
23383    <varlistentry>      <term>IFF_SUPP_NOFCS</term>
23384      <listitem><para>
23385   device supports sending custom FCS
23386      </para></listitem>
23387    </varlistentry>
23388    <varlistentry>      <term>IFF_LIVE_ADDR_CHANGE</term>
23389      <listitem><para>
23390   device supports hardware address
23391   change when it's running
23392      </para></listitem>
23393    </varlistentry>
23394    <varlistentry>      <term>IFF_MACVLAN</term>
23395      <listitem><para>
23396   Macvlan device
23397      </para></listitem>
23398    </varlistentry>
23399    <varlistentry>      <term>IFF_XMIT_DST_RELEASE_PERM</term>
23400      <listitem><para>
23401   -- undescribed --
23402      </para></listitem>
23403    </varlistentry>
23404    <varlistentry>      <term>IFF_IPVLAN_MASTER</term>
23405      <listitem><para>
23406   -- undescribed --
23407      </para></listitem>
23408    </varlistentry>
23409    <varlistentry>      <term>IFF_IPVLAN_SLAVE</term>
23410      <listitem><para>
23411   -- undescribed --
23412      </para></listitem>
23413    </varlistentry>
23414  </variablelist>
23415</refsect1>
23416<refsect1>
23417<title>Description</title>
23418<para>
23419   </para><para>
23420
23421   These are the <structname>struct net_device</structname>, they are only set internally
23422   by drivers and used in the kernel. These flags are invisible to
23423   userspace, this means that the order of these flags can change
23424   during any kernel release.
23425   </para><para>
23426
23427   You should have a pretty good reason to be extending these flags.
23428</para>
23429</refsect1>
23430</refentry>
23431
23432<refentry id="API-struct-net-device">
23433<refentryinfo>
23434 <title>LINUX</title>
23435 <productname>Kernel Hackers Manual</productname>
23436 <date>July 2017</date>
23437</refentryinfo>
23438<refmeta>
23439 <refentrytitle><phrase>struct net_device</phrase></refentrytitle>
23440 <manvolnum>9</manvolnum>
23441 <refmiscinfo class="version">4.1.27</refmiscinfo>
23442</refmeta>
23443<refnamediv>
23444 <refname>struct net_device</refname>
23445 <refpurpose>
23446     The DEVICE structure. Actually, this whole structure is a big mistake. It mixes I/O data with strictly <quote>high-level</quote> data, and it has to know about almost every data structure used in the INET module.
23447 </refpurpose>
23448</refnamediv>
23449<refsynopsisdiv>
23450 <title>Synopsis</title>
23451  <programlisting>
23452struct net_device {
23453  char name[IFNAMSIZ];
23454  struct hlist_node name_hlist;
23455  char * ifalias;
23456  unsigned long mem_end;
23457  unsigned long mem_start;
23458  unsigned long base_addr;
23459  int irq;
23460  atomic_t carrier_changes;
23461  unsigned long state;
23462  struct list_head dev_list;
23463  struct list_head napi_list;
23464  struct list_head unreg_list;
23465  struct list_head close_list;
23466  struct {unnamed_struct};
23467  struct garp_port __rcu * garp_port;
23468  struct mrp_port __rcu * mrp_port;
23469  struct device dev;
23470  const struct attribute_group * sysfs_groups[4];
23471  const struct attribute_group * sysfs_rx_queue_group;
23472  const struct rtnl_link_ops * rtnl_link_ops;
23473#define GSO_MAX_SIZE		65536
23474  unsigned int gso_max_size;
23475#define GSO_MAX_SEGS		65535
23476  u16 gso_max_segs;
23477  u16 gso_min_segs;
23478#ifdef CONFIG_DCB
23479  const struct dcbnl_rtnl_ops * dcbnl_ops;
23480#endif
23481  u8 num_tc;
23482  struct netdev_tc_txq tc_to_txq[TC_MAX_QUEUE];
23483  u8 prio_tc_map[TC_BITMASK + 1];
23484#if IS_ENABLED(CONFIG_FCOE)
23485  unsigned int fcoe_ddp_xid;
23486#endif
23487#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
23488  struct netprio_map __rcu * priomap;
23489#endif
23490  struct phy_device * phydev;
23491  struct lock_class_key * qdisc_tx_busylock;
23492};  </programlisting>
23493</refsynopsisdiv>
23494 <refsect1>
23495  <title>Members</title>
23496  <variablelist>
23497    <varlistentry>      <term>name[IFNAMSIZ]</term>
23498      <listitem><para>
23499   This is the first field of the <quote>visible</quote> part of this structure
23500   (i.e. as seen by users in the <quote>Space.c</quote> file).  It is the name
23501   of the interface.
23502      </para></listitem>
23503    </varlistentry>
23504    <varlistentry>      <term>name_hlist</term>
23505      <listitem><para>
23506   Device name hash chain, please keep it close to name[]
23507      </para></listitem>
23508    </varlistentry>
23509    <varlistentry>      <term>ifalias</term>
23510      <listitem><para>
23511   SNMP alias
23512      </para></listitem>
23513    </varlistentry>
23514    <varlistentry>      <term>mem_end</term>
23515      <listitem><para>
23516   Shared memory end
23517      </para></listitem>
23518    </varlistentry>
23519    <varlistentry>      <term>mem_start</term>
23520      <listitem><para>
23521   Shared memory start
23522      </para></listitem>
23523    </varlistentry>
23524    <varlistentry>      <term>base_addr</term>
23525      <listitem><para>
23526   Device I/O address
23527      </para></listitem>
23528    </varlistentry>
23529    <varlistentry>      <term>irq</term>
23530      <listitem><para>
23531   Device IRQ number
23532      </para></listitem>
23533    </varlistentry>
23534    <varlistentry>      <term>carrier_changes</term>
23535      <listitem><para>
23536   Stats to monitor carrier on&lt;-&gt;off transitions
23537      </para></listitem>
23538    </varlistentry>
23539    <varlistentry>      <term>state</term>
23540      <listitem><para>
23541   Generic network queuing layer state, see netdev_state_t
23542      </para></listitem>
23543    </varlistentry>
23544    <varlistentry>      <term>dev_list</term>
23545      <listitem><para>
23546   The global list of network devices
23547      </para></listitem>
23548    </varlistentry>
23549    <varlistentry>      <term>napi_list</term>
23550      <listitem><para>
23551   List entry, that is used for polling napi devices
23552      </para></listitem>
23553    </varlistentry>
23554    <varlistentry>      <term>unreg_list</term>
23555      <listitem><para>
23556   List entry, that is used, when we are unregistering the
23557   device, see the function unregister_netdev
23558      </para></listitem>
23559    </varlistentry>
23560    <varlistentry>      <term>close_list</term>
23561      <listitem><para>
23562   List entry, that is used, when we are closing the device
23563      </para></listitem>
23564    </varlistentry>
23565    <varlistentry>      <term>{unnamed_struct}</term>
23566      <listitem><para>
23567   anonymous
23568      </para></listitem>
23569    </varlistentry>
23570    <varlistentry>      <term>garp_port</term>
23571      <listitem><para>
23572   GARP
23573      </para></listitem>
23574    </varlistentry>
23575    <varlistentry>      <term>mrp_port</term>
23576      <listitem><para>
23577   MRP
23578      </para></listitem>
23579    </varlistentry>
23580    <varlistentry>      <term>dev</term>
23581      <listitem><para>
23582   Class/net/name entry
23583      </para></listitem>
23584    </varlistentry>
23585    <varlistentry>      <term>sysfs_groups[4]</term>
23586      <listitem><para>
23587   Space for optional device, statistics and wireless
23588   sysfs groups
23589      </para></listitem>
23590    </varlistentry>
23591    <varlistentry>      <term>sysfs_rx_queue_group</term>
23592      <listitem><para>
23593   Space for optional per-rx queue attributes
23594      </para></listitem>
23595    </varlistentry>
23596    <varlistentry>      <term>rtnl_link_ops</term>
23597      <listitem><para>
23598   Rtnl_link_ops
23599      </para></listitem>
23600    </varlistentry>
23601    <varlistentry>      <term>gso_max_size</term>
23602      <listitem><para>
23603   Maximum size of generic segmentation offload
23604      </para></listitem>
23605    </varlistentry>
23606    <varlistentry>      <term>gso_max_segs</term>
23607      <listitem><para>
23608   Maximum number of segments that can be passed to the
23609   NIC for GSO
23610      </para></listitem>
23611    </varlistentry>
23612    <varlistentry>      <term>gso_min_segs</term>
23613      <listitem><para>
23614   Minimum number of segments that can be passed to the
23615   NIC for GSO
23616      </para></listitem>
23617    </varlistentry>
23618    <varlistentry>      <term>dcbnl_ops</term>
23619      <listitem><para>
23620   Data Center Bridging netlink ops
23621      </para></listitem>
23622    </varlistentry>
23623    <varlistentry>      <term>num_tc</term>
23624      <listitem><para>
23625   Number of traffic classes in the net device
23626      </para></listitem>
23627    </varlistentry>
23628    <varlistentry>      <term>tc_to_txq[TC_MAX_QUEUE]</term>
23629      <listitem><para>
23630   XXX: need comments on this one
23631      </para></listitem>
23632    </varlistentry>
23633    <varlistentry>      <term>prio_tc_map[TC_BITMASK + 1]</term>
23634      <listitem><para>
23635   need comments on this one
23636      </para></listitem>
23637    </varlistentry>
23638    <varlistentry>      <term>fcoe_ddp_xid</term>
23639      <listitem><para>
23640   Max exchange id for FCoE LRO by ddp
23641      </para></listitem>
23642    </varlistentry>
23643    <varlistentry>      <term>priomap</term>
23644      <listitem><para>
23645   XXX: need comments on this one
23646      </para></listitem>
23647    </varlistentry>
23648    <varlistentry>      <term>phydev</term>
23649      <listitem><para>
23650   Physical device may attach itself
23651   for hardware timestamping
23652      </para></listitem>
23653    </varlistentry>
23654    <varlistentry>      <term>qdisc_tx_busylock</term>
23655      <listitem><para>
23656   XXX: need comments on this one
23657      </para></listitem>
23658    </varlistentry>
23659  </variablelist>
23660 </refsect1>
23661<refsect1>
23662<title>FIXME</title>
23663<para>
23664   cleanup struct net_device such that network protocol info
23665   moves out.
23666</para>
23667</refsect1>
23668</refentry>
23669
23670<refentry id="API-netdev-priv">
23671<refentryinfo>
23672 <title>LINUX</title>
23673 <productname>Kernel Hackers Manual</productname>
23674 <date>July 2017</date>
23675</refentryinfo>
23676<refmeta>
23677 <refentrytitle><phrase>netdev_priv</phrase></refentrytitle>
23678 <manvolnum>9</manvolnum>
23679 <refmiscinfo class="version">4.1.27</refmiscinfo>
23680</refmeta>
23681<refnamediv>
23682 <refname>netdev_priv</refname>
23683 <refpurpose>
23684     access network device private data
23685 </refpurpose>
23686</refnamediv>
23687<refsynopsisdiv>
23688 <title>Synopsis</title>
23689  <funcsynopsis><funcprototype>
23690   <funcdef>void * <function>netdev_priv </function></funcdef>
23691   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
23692  </funcprototype></funcsynopsis>
23693</refsynopsisdiv>
23694<refsect1>
23695 <title>Arguments</title>
23696 <variablelist>
23697  <varlistentry>
23698   <term><parameter>dev</parameter></term>
23699   <listitem>
23700    <para>
23701     network device
23702    </para>
23703   </listitem>
23704  </varlistentry>
23705 </variablelist>
23706</refsect1>
23707<refsect1>
23708<title>Description</title>
23709<para>
23710   Get network device private data
23711</para>
23712</refsect1>
23713</refentry>
23714
23715<refentry id="API-netif-start-queue">
23716<refentryinfo>
23717 <title>LINUX</title>
23718 <productname>Kernel Hackers Manual</productname>
23719 <date>July 2017</date>
23720</refentryinfo>
23721<refmeta>
23722 <refentrytitle><phrase>netif_start_queue</phrase></refentrytitle>
23723 <manvolnum>9</manvolnum>
23724 <refmiscinfo class="version">4.1.27</refmiscinfo>
23725</refmeta>
23726<refnamediv>
23727 <refname>netif_start_queue</refname>
23728 <refpurpose>
23729     allow transmit
23730 </refpurpose>
23731</refnamediv>
23732<refsynopsisdiv>
23733 <title>Synopsis</title>
23734  <funcsynopsis><funcprototype>
23735   <funcdef>void <function>netif_start_queue </function></funcdef>
23736   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
23737  </funcprototype></funcsynopsis>
23738</refsynopsisdiv>
23739<refsect1>
23740 <title>Arguments</title>
23741 <variablelist>
23742  <varlistentry>
23743   <term><parameter>dev</parameter></term>
23744   <listitem>
23745    <para>
23746     network device
23747    </para>
23748   </listitem>
23749  </varlistentry>
23750 </variablelist>
23751</refsect1>
23752<refsect1>
23753<title>Description</title>
23754<para>
23755   Allow upper layers to call the device hard_start_xmit routine.
23756</para>
23757</refsect1>
23758</refentry>
23759
23760<refentry id="API-netif-wake-queue">
23761<refentryinfo>
23762 <title>LINUX</title>
23763 <productname>Kernel Hackers Manual</productname>
23764 <date>July 2017</date>
23765</refentryinfo>
23766<refmeta>
23767 <refentrytitle><phrase>netif_wake_queue</phrase></refentrytitle>
23768 <manvolnum>9</manvolnum>
23769 <refmiscinfo class="version">4.1.27</refmiscinfo>
23770</refmeta>
23771<refnamediv>
23772 <refname>netif_wake_queue</refname>
23773 <refpurpose>
23774     restart transmit
23775 </refpurpose>
23776</refnamediv>
23777<refsynopsisdiv>
23778 <title>Synopsis</title>
23779  <funcsynopsis><funcprototype>
23780   <funcdef>void <function>netif_wake_queue </function></funcdef>
23781   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
23782  </funcprototype></funcsynopsis>
23783</refsynopsisdiv>
23784<refsect1>
23785 <title>Arguments</title>
23786 <variablelist>
23787  <varlistentry>
23788   <term><parameter>dev</parameter></term>
23789   <listitem>
23790    <para>
23791     network device
23792    </para>
23793   </listitem>
23794  </varlistentry>
23795 </variablelist>
23796</refsect1>
23797<refsect1>
23798<title>Description</title>
23799<para>
23800   Allow upper layers to call the device hard_start_xmit routine.
23801   Used for flow control when transmit resources are available.
23802</para>
23803</refsect1>
23804</refentry>
23805
23806<refentry id="API-netif-stop-queue">
23807<refentryinfo>
23808 <title>LINUX</title>
23809 <productname>Kernel Hackers Manual</productname>
23810 <date>July 2017</date>
23811</refentryinfo>
23812<refmeta>
23813 <refentrytitle><phrase>netif_stop_queue</phrase></refentrytitle>
23814 <manvolnum>9</manvolnum>
23815 <refmiscinfo class="version">4.1.27</refmiscinfo>
23816</refmeta>
23817<refnamediv>
23818 <refname>netif_stop_queue</refname>
23819 <refpurpose>
23820     stop transmitted packets
23821 </refpurpose>
23822</refnamediv>
23823<refsynopsisdiv>
23824 <title>Synopsis</title>
23825  <funcsynopsis><funcprototype>
23826   <funcdef>void <function>netif_stop_queue </function></funcdef>
23827   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
23828  </funcprototype></funcsynopsis>
23829</refsynopsisdiv>
23830<refsect1>
23831 <title>Arguments</title>
23832 <variablelist>
23833  <varlistentry>
23834   <term><parameter>dev</parameter></term>
23835   <listitem>
23836    <para>
23837     network device
23838    </para>
23839   </listitem>
23840  </varlistentry>
23841 </variablelist>
23842</refsect1>
23843<refsect1>
23844<title>Description</title>
23845<para>
23846   Stop upper layers calling the device hard_start_xmit routine.
23847   Used for flow control when transmit resources are unavailable.
23848</para>
23849</refsect1>
23850</refentry>
23851
23852<refentry id="API-netif-queue-stopped">
23853<refentryinfo>
23854 <title>LINUX</title>
23855 <productname>Kernel Hackers Manual</productname>
23856 <date>July 2017</date>
23857</refentryinfo>
23858<refmeta>
23859 <refentrytitle><phrase>netif_queue_stopped</phrase></refentrytitle>
23860 <manvolnum>9</manvolnum>
23861 <refmiscinfo class="version">4.1.27</refmiscinfo>
23862</refmeta>
23863<refnamediv>
23864 <refname>netif_queue_stopped</refname>
23865 <refpurpose>
23866     test if transmit queue is flowblocked
23867 </refpurpose>
23868</refnamediv>
23869<refsynopsisdiv>
23870 <title>Synopsis</title>
23871  <funcsynopsis><funcprototype>
23872   <funcdef>bool <function>netif_queue_stopped </function></funcdef>
23873   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
23874  </funcprototype></funcsynopsis>
23875</refsynopsisdiv>
23876<refsect1>
23877 <title>Arguments</title>
23878 <variablelist>
23879  <varlistentry>
23880   <term><parameter>dev</parameter></term>
23881   <listitem>
23882    <para>
23883     network device
23884    </para>
23885   </listitem>
23886  </varlistentry>
23887 </variablelist>
23888</refsect1>
23889<refsect1>
23890<title>Description</title>
23891<para>
23892   Test if transmit queue on device is currently unable to send.
23893</para>
23894</refsect1>
23895</refentry>
23896
23897<refentry id="API-netdev-txq-bql-enqueue-prefetchw">
23898<refentryinfo>
23899 <title>LINUX</title>
23900 <productname>Kernel Hackers Manual</productname>
23901 <date>July 2017</date>
23902</refentryinfo>
23903<refmeta>
23904 <refentrytitle><phrase>netdev_txq_bql_enqueue_prefetchw</phrase></refentrytitle>
23905 <manvolnum>9</manvolnum>
23906 <refmiscinfo class="version">4.1.27</refmiscinfo>
23907</refmeta>
23908<refnamediv>
23909 <refname>netdev_txq_bql_enqueue_prefetchw</refname>
23910 <refpurpose>
23911     prefetch bql data for write
23912 </refpurpose>
23913</refnamediv>
23914<refsynopsisdiv>
23915 <title>Synopsis</title>
23916  <funcsynopsis><funcprototype>
23917   <funcdef>void <function>netdev_txq_bql_enqueue_prefetchw </function></funcdef>
23918   <paramdef>struct netdev_queue * <parameter>dev_queue</parameter></paramdef>
23919  </funcprototype></funcsynopsis>
23920</refsynopsisdiv>
23921<refsect1>
23922 <title>Arguments</title>
23923 <variablelist>
23924  <varlistentry>
23925   <term><parameter>dev_queue</parameter></term>
23926   <listitem>
23927    <para>
23928     pointer to transmit queue
23929    </para>
23930   </listitem>
23931  </varlistentry>
23932 </variablelist>
23933</refsect1>
23934<refsect1>
23935<title>Description</title>
23936<para>
23937   BQL enabled drivers might use this helper in their <function>ndo_start_xmit</function>,
23938   to give appropriate hint to the cpu.
23939</para>
23940</refsect1>
23941</refentry>
23942
23943<refentry id="API-netdev-txq-bql-complete-prefetchw">
23944<refentryinfo>
23945 <title>LINUX</title>
23946 <productname>Kernel Hackers Manual</productname>
23947 <date>July 2017</date>
23948</refentryinfo>
23949<refmeta>
23950 <refentrytitle><phrase>netdev_txq_bql_complete_prefetchw</phrase></refentrytitle>
23951 <manvolnum>9</manvolnum>
23952 <refmiscinfo class="version">4.1.27</refmiscinfo>
23953</refmeta>
23954<refnamediv>
23955 <refname>netdev_txq_bql_complete_prefetchw</refname>
23956 <refpurpose>
23957     prefetch bql data for write
23958 </refpurpose>
23959</refnamediv>
23960<refsynopsisdiv>
23961 <title>Synopsis</title>
23962  <funcsynopsis><funcprototype>
23963   <funcdef>void <function>netdev_txq_bql_complete_prefetchw </function></funcdef>
23964   <paramdef>struct netdev_queue * <parameter>dev_queue</parameter></paramdef>
23965  </funcprototype></funcsynopsis>
23966</refsynopsisdiv>
23967<refsect1>
23968 <title>Arguments</title>
23969 <variablelist>
23970  <varlistentry>
23971   <term><parameter>dev_queue</parameter></term>
23972   <listitem>
23973    <para>
23974     pointer to transmit queue
23975    </para>
23976   </listitem>
23977  </varlistentry>
23978 </variablelist>
23979</refsect1>
23980<refsect1>
23981<title>Description</title>
23982<para>
23983   BQL enabled drivers might use this helper in their TX completion path,
23984   to give appropriate hint to the cpu.
23985</para>
23986</refsect1>
23987</refentry>
23988
23989<refentry id="API-netdev-sent-queue">
23990<refentryinfo>
23991 <title>LINUX</title>
23992 <productname>Kernel Hackers Manual</productname>
23993 <date>July 2017</date>
23994</refentryinfo>
23995<refmeta>
23996 <refentrytitle><phrase>netdev_sent_queue</phrase></refentrytitle>
23997 <manvolnum>9</manvolnum>
23998 <refmiscinfo class="version">4.1.27</refmiscinfo>
23999</refmeta>
24000<refnamediv>
24001 <refname>netdev_sent_queue</refname>
24002 <refpurpose>
24003     report the number of bytes queued to hardware
24004 </refpurpose>
24005</refnamediv>
24006<refsynopsisdiv>
24007 <title>Synopsis</title>
24008  <funcsynopsis><funcprototype>
24009   <funcdef>void <function>netdev_sent_queue </function></funcdef>
24010   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24011   <paramdef>unsigned int <parameter>bytes</parameter></paramdef>
24012  </funcprototype></funcsynopsis>
24013</refsynopsisdiv>
24014<refsect1>
24015 <title>Arguments</title>
24016 <variablelist>
24017  <varlistentry>
24018   <term><parameter>dev</parameter></term>
24019   <listitem>
24020    <para>
24021     network device
24022    </para>
24023   </listitem>
24024  </varlistentry>
24025  <varlistentry>
24026   <term><parameter>bytes</parameter></term>
24027   <listitem>
24028    <para>
24029     number of bytes queued to the hardware device queue
24030    </para>
24031   </listitem>
24032  </varlistentry>
24033 </variablelist>
24034</refsect1>
24035<refsect1>
24036<title>Description</title>
24037<para>
24038   Report the number of bytes queued for sending/completion to the network
24039   device hardware queue. <parameter>bytes</parameter> should be a good approximation and should
24040   exactly match <function>netdev_completed_queue</function> <parameter>bytes</parameter>
24041</para>
24042</refsect1>
24043</refentry>
24044
24045<refentry id="API-netdev-completed-queue">
24046<refentryinfo>
24047 <title>LINUX</title>
24048 <productname>Kernel Hackers Manual</productname>
24049 <date>July 2017</date>
24050</refentryinfo>
24051<refmeta>
24052 <refentrytitle><phrase>netdev_completed_queue</phrase></refentrytitle>
24053 <manvolnum>9</manvolnum>
24054 <refmiscinfo class="version">4.1.27</refmiscinfo>
24055</refmeta>
24056<refnamediv>
24057 <refname>netdev_completed_queue</refname>
24058 <refpurpose>
24059     report bytes and packets completed by device
24060 </refpurpose>
24061</refnamediv>
24062<refsynopsisdiv>
24063 <title>Synopsis</title>
24064  <funcsynopsis><funcprototype>
24065   <funcdef>void <function>netdev_completed_queue </function></funcdef>
24066   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24067   <paramdef>unsigned int <parameter>pkts</parameter></paramdef>
24068   <paramdef>unsigned int <parameter>bytes</parameter></paramdef>
24069  </funcprototype></funcsynopsis>
24070</refsynopsisdiv>
24071<refsect1>
24072 <title>Arguments</title>
24073 <variablelist>
24074  <varlistentry>
24075   <term><parameter>dev</parameter></term>
24076   <listitem>
24077    <para>
24078     network device
24079    </para>
24080   </listitem>
24081  </varlistentry>
24082  <varlistentry>
24083   <term><parameter>pkts</parameter></term>
24084   <listitem>
24085    <para>
24086     actual number of packets sent over the medium
24087    </para>
24088   </listitem>
24089  </varlistentry>
24090  <varlistentry>
24091   <term><parameter>bytes</parameter></term>
24092   <listitem>
24093    <para>
24094     actual number of bytes sent over the medium
24095    </para>
24096   </listitem>
24097  </varlistentry>
24098 </variablelist>
24099</refsect1>
24100<refsect1>
24101<title>Description</title>
24102<para>
24103   Report the number of bytes and packets transmitted by the network device
24104   hardware queue over the physical medium, <parameter>bytes</parameter> must exactly match the
24105   <parameter>bytes</parameter> amount passed to <function>netdev_sent_queue</function>
24106</para>
24107</refsect1>
24108</refentry>
24109
24110<refentry id="API-netdev-reset-queue">
24111<refentryinfo>
24112 <title>LINUX</title>
24113 <productname>Kernel Hackers Manual</productname>
24114 <date>July 2017</date>
24115</refentryinfo>
24116<refmeta>
24117 <refentrytitle><phrase>netdev_reset_queue</phrase></refentrytitle>
24118 <manvolnum>9</manvolnum>
24119 <refmiscinfo class="version">4.1.27</refmiscinfo>
24120</refmeta>
24121<refnamediv>
24122 <refname>netdev_reset_queue</refname>
24123 <refpurpose>
24124     reset the packets and bytes count of a network device
24125 </refpurpose>
24126</refnamediv>
24127<refsynopsisdiv>
24128 <title>Synopsis</title>
24129  <funcsynopsis><funcprototype>
24130   <funcdef>void <function>netdev_reset_queue </function></funcdef>
24131   <paramdef>struct net_device * <parameter>dev_queue</parameter></paramdef>
24132  </funcprototype></funcsynopsis>
24133</refsynopsisdiv>
24134<refsect1>
24135 <title>Arguments</title>
24136 <variablelist>
24137  <varlistentry>
24138   <term><parameter>dev_queue</parameter></term>
24139   <listitem>
24140    <para>
24141     network device
24142    </para>
24143   </listitem>
24144  </varlistentry>
24145 </variablelist>
24146</refsect1>
24147<refsect1>
24148<title>Description</title>
24149<para>
24150   Reset the bytes and packet count of a network device and clear the
24151   software flow control OFF bit for this network device
24152</para>
24153</refsect1>
24154</refentry>
24155
24156<refentry id="API-netdev-cap-txqueue">
24157<refentryinfo>
24158 <title>LINUX</title>
24159 <productname>Kernel Hackers Manual</productname>
24160 <date>July 2017</date>
24161</refentryinfo>
24162<refmeta>
24163 <refentrytitle><phrase>netdev_cap_txqueue</phrase></refentrytitle>
24164 <manvolnum>9</manvolnum>
24165 <refmiscinfo class="version">4.1.27</refmiscinfo>
24166</refmeta>
24167<refnamediv>
24168 <refname>netdev_cap_txqueue</refname>
24169 <refpurpose>
24170     check if selected tx queue exceeds device queues
24171 </refpurpose>
24172</refnamediv>
24173<refsynopsisdiv>
24174 <title>Synopsis</title>
24175  <funcsynopsis><funcprototype>
24176   <funcdef>u16 <function>netdev_cap_txqueue </function></funcdef>
24177   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24178   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
24179  </funcprototype></funcsynopsis>
24180</refsynopsisdiv>
24181<refsect1>
24182 <title>Arguments</title>
24183 <variablelist>
24184  <varlistentry>
24185   <term><parameter>dev</parameter></term>
24186   <listitem>
24187    <para>
24188     network device
24189    </para>
24190   </listitem>
24191  </varlistentry>
24192  <varlistentry>
24193   <term><parameter>queue_index</parameter></term>
24194   <listitem>
24195    <para>
24196     given tx queue index
24197    </para>
24198   </listitem>
24199  </varlistentry>
24200 </variablelist>
24201</refsect1>
24202<refsect1>
24203<title>Description</title>
24204<para>
24205   Returns 0 if given tx queue index &gt;= number of device tx queues,
24206   otherwise returns the originally passed tx queue index.
24207</para>
24208</refsect1>
24209</refentry>
24210
24211<refentry id="API-netif-running">
24212<refentryinfo>
24213 <title>LINUX</title>
24214 <productname>Kernel Hackers Manual</productname>
24215 <date>July 2017</date>
24216</refentryinfo>
24217<refmeta>
24218 <refentrytitle><phrase>netif_running</phrase></refentrytitle>
24219 <manvolnum>9</manvolnum>
24220 <refmiscinfo class="version">4.1.27</refmiscinfo>
24221</refmeta>
24222<refnamediv>
24223 <refname>netif_running</refname>
24224 <refpurpose>
24225     test if up
24226 </refpurpose>
24227</refnamediv>
24228<refsynopsisdiv>
24229 <title>Synopsis</title>
24230  <funcsynopsis><funcprototype>
24231   <funcdef>bool <function>netif_running </function></funcdef>
24232   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
24233  </funcprototype></funcsynopsis>
24234</refsynopsisdiv>
24235<refsect1>
24236 <title>Arguments</title>
24237 <variablelist>
24238  <varlistentry>
24239   <term><parameter>dev</parameter></term>
24240   <listitem>
24241    <para>
24242     network device
24243    </para>
24244   </listitem>
24245  </varlistentry>
24246 </variablelist>
24247</refsect1>
24248<refsect1>
24249<title>Description</title>
24250<para>
24251   Test if the device has been brought up.
24252</para>
24253</refsect1>
24254</refentry>
24255
24256<refentry id="API-netif-start-subqueue">
24257<refentryinfo>
24258 <title>LINUX</title>
24259 <productname>Kernel Hackers Manual</productname>
24260 <date>July 2017</date>
24261</refentryinfo>
24262<refmeta>
24263 <refentrytitle><phrase>netif_start_subqueue</phrase></refentrytitle>
24264 <manvolnum>9</manvolnum>
24265 <refmiscinfo class="version">4.1.27</refmiscinfo>
24266</refmeta>
24267<refnamediv>
24268 <refname>netif_start_subqueue</refname>
24269 <refpurpose>
24270     allow sending packets on subqueue
24271 </refpurpose>
24272</refnamediv>
24273<refsynopsisdiv>
24274 <title>Synopsis</title>
24275  <funcsynopsis><funcprototype>
24276   <funcdef>void <function>netif_start_subqueue </function></funcdef>
24277   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24278   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
24279  </funcprototype></funcsynopsis>
24280</refsynopsisdiv>
24281<refsect1>
24282 <title>Arguments</title>
24283 <variablelist>
24284  <varlistentry>
24285   <term><parameter>dev</parameter></term>
24286   <listitem>
24287    <para>
24288     network device
24289    </para>
24290   </listitem>
24291  </varlistentry>
24292  <varlistentry>
24293   <term><parameter>queue_index</parameter></term>
24294   <listitem>
24295    <para>
24296     sub queue index
24297    </para>
24298   </listitem>
24299  </varlistentry>
24300 </variablelist>
24301</refsect1>
24302<refsect1>
24303<title>Description</title>
24304<para>
24305   Start individual transmit queue of a device with multiple transmit queues.
24306</para>
24307</refsect1>
24308</refentry>
24309
24310<refentry id="API-netif-stop-subqueue">
24311<refentryinfo>
24312 <title>LINUX</title>
24313 <productname>Kernel Hackers Manual</productname>
24314 <date>July 2017</date>
24315</refentryinfo>
24316<refmeta>
24317 <refentrytitle><phrase>netif_stop_subqueue</phrase></refentrytitle>
24318 <manvolnum>9</manvolnum>
24319 <refmiscinfo class="version">4.1.27</refmiscinfo>
24320</refmeta>
24321<refnamediv>
24322 <refname>netif_stop_subqueue</refname>
24323 <refpurpose>
24324     stop sending packets on subqueue
24325 </refpurpose>
24326</refnamediv>
24327<refsynopsisdiv>
24328 <title>Synopsis</title>
24329  <funcsynopsis><funcprototype>
24330   <funcdef>void <function>netif_stop_subqueue </function></funcdef>
24331   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24332   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
24333  </funcprototype></funcsynopsis>
24334</refsynopsisdiv>
24335<refsect1>
24336 <title>Arguments</title>
24337 <variablelist>
24338  <varlistentry>
24339   <term><parameter>dev</parameter></term>
24340   <listitem>
24341    <para>
24342     network device
24343    </para>
24344   </listitem>
24345  </varlistentry>
24346  <varlistentry>
24347   <term><parameter>queue_index</parameter></term>
24348   <listitem>
24349    <para>
24350     sub queue index
24351    </para>
24352   </listitem>
24353  </varlistentry>
24354 </variablelist>
24355</refsect1>
24356<refsect1>
24357<title>Description</title>
24358<para>
24359   Stop individual transmit queue of a device with multiple transmit queues.
24360</para>
24361</refsect1>
24362</refentry>
24363
24364<refentry id="API---netif-subqueue-stopped">
24365<refentryinfo>
24366 <title>LINUX</title>
24367 <productname>Kernel Hackers Manual</productname>
24368 <date>July 2017</date>
24369</refentryinfo>
24370<refmeta>
24371 <refentrytitle><phrase>__netif_subqueue_stopped</phrase></refentrytitle>
24372 <manvolnum>9</manvolnum>
24373 <refmiscinfo class="version">4.1.27</refmiscinfo>
24374</refmeta>
24375<refnamediv>
24376 <refname>__netif_subqueue_stopped</refname>
24377 <refpurpose>
24378     test status of subqueue
24379 </refpurpose>
24380</refnamediv>
24381<refsynopsisdiv>
24382 <title>Synopsis</title>
24383  <funcsynopsis><funcprototype>
24384   <funcdef>bool <function>__netif_subqueue_stopped </function></funcdef>
24385   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
24386   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
24387  </funcprototype></funcsynopsis>
24388</refsynopsisdiv>
24389<refsect1>
24390 <title>Arguments</title>
24391 <variablelist>
24392  <varlistentry>
24393   <term><parameter>dev</parameter></term>
24394   <listitem>
24395    <para>
24396     network device
24397    </para>
24398   </listitem>
24399  </varlistentry>
24400  <varlistentry>
24401   <term><parameter>queue_index</parameter></term>
24402   <listitem>
24403    <para>
24404     sub queue index
24405    </para>
24406   </listitem>
24407  </varlistentry>
24408 </variablelist>
24409</refsect1>
24410<refsect1>
24411<title>Description</title>
24412<para>
24413   Check individual transmit queue of a device with multiple transmit queues.
24414</para>
24415</refsect1>
24416</refentry>
24417
24418<refentry id="API-netif-is-multiqueue">
24419<refentryinfo>
24420 <title>LINUX</title>
24421 <productname>Kernel Hackers Manual</productname>
24422 <date>July 2017</date>
24423</refentryinfo>
24424<refmeta>
24425 <refentrytitle><phrase>netif_is_multiqueue</phrase></refentrytitle>
24426 <manvolnum>9</manvolnum>
24427 <refmiscinfo class="version">4.1.27</refmiscinfo>
24428</refmeta>
24429<refnamediv>
24430 <refname>netif_is_multiqueue</refname>
24431 <refpurpose>
24432     test if device has multiple transmit queues
24433 </refpurpose>
24434</refnamediv>
24435<refsynopsisdiv>
24436 <title>Synopsis</title>
24437  <funcsynopsis><funcprototype>
24438   <funcdef>bool <function>netif_is_multiqueue </function></funcdef>
24439   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
24440  </funcprototype></funcsynopsis>
24441</refsynopsisdiv>
24442<refsect1>
24443 <title>Arguments</title>
24444 <variablelist>
24445  <varlistentry>
24446   <term><parameter>dev</parameter></term>
24447   <listitem>
24448    <para>
24449     network device
24450    </para>
24451   </listitem>
24452  </varlistentry>
24453 </variablelist>
24454</refsect1>
24455<refsect1>
24456<title>Description</title>
24457<para>
24458   Check if device has multiple transmit queues
24459</para>
24460</refsect1>
24461</refentry>
24462
24463<refentry id="API-dev-put">
24464<refentryinfo>
24465 <title>LINUX</title>
24466 <productname>Kernel Hackers Manual</productname>
24467 <date>July 2017</date>
24468</refentryinfo>
24469<refmeta>
24470 <refentrytitle><phrase>dev_put</phrase></refentrytitle>
24471 <manvolnum>9</manvolnum>
24472 <refmiscinfo class="version">4.1.27</refmiscinfo>
24473</refmeta>
24474<refnamediv>
24475 <refname>dev_put</refname>
24476 <refpurpose>
24477     release reference to device
24478 </refpurpose>
24479</refnamediv>
24480<refsynopsisdiv>
24481 <title>Synopsis</title>
24482  <funcsynopsis><funcprototype>
24483   <funcdef>void <function>dev_put </function></funcdef>
24484   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24485  </funcprototype></funcsynopsis>
24486</refsynopsisdiv>
24487<refsect1>
24488 <title>Arguments</title>
24489 <variablelist>
24490  <varlistentry>
24491   <term><parameter>dev</parameter></term>
24492   <listitem>
24493    <para>
24494     network device
24495    </para>
24496   </listitem>
24497  </varlistentry>
24498 </variablelist>
24499</refsect1>
24500<refsect1>
24501<title>Description</title>
24502<para>
24503   Release reference to device to allow it to be freed.
24504</para>
24505</refsect1>
24506</refentry>
24507
24508<refentry id="API-dev-hold">
24509<refentryinfo>
24510 <title>LINUX</title>
24511 <productname>Kernel Hackers Manual</productname>
24512 <date>July 2017</date>
24513</refentryinfo>
24514<refmeta>
24515 <refentrytitle><phrase>dev_hold</phrase></refentrytitle>
24516 <manvolnum>9</manvolnum>
24517 <refmiscinfo class="version">4.1.27</refmiscinfo>
24518</refmeta>
24519<refnamediv>
24520 <refname>dev_hold</refname>
24521 <refpurpose>
24522     get reference to device
24523 </refpurpose>
24524</refnamediv>
24525<refsynopsisdiv>
24526 <title>Synopsis</title>
24527  <funcsynopsis><funcprototype>
24528   <funcdef>void <function>dev_hold </function></funcdef>
24529   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24530  </funcprototype></funcsynopsis>
24531</refsynopsisdiv>
24532<refsect1>
24533 <title>Arguments</title>
24534 <variablelist>
24535  <varlistentry>
24536   <term><parameter>dev</parameter></term>
24537   <listitem>
24538    <para>
24539     network device
24540    </para>
24541   </listitem>
24542  </varlistentry>
24543 </variablelist>
24544</refsect1>
24545<refsect1>
24546<title>Description</title>
24547<para>
24548   Hold reference to device to keep it from being freed.
24549</para>
24550</refsect1>
24551</refentry>
24552
24553<refentry id="API-netif-carrier-ok">
24554<refentryinfo>
24555 <title>LINUX</title>
24556 <productname>Kernel Hackers Manual</productname>
24557 <date>July 2017</date>
24558</refentryinfo>
24559<refmeta>
24560 <refentrytitle><phrase>netif_carrier_ok</phrase></refentrytitle>
24561 <manvolnum>9</manvolnum>
24562 <refmiscinfo class="version">4.1.27</refmiscinfo>
24563</refmeta>
24564<refnamediv>
24565 <refname>netif_carrier_ok</refname>
24566 <refpurpose>
24567     test if carrier present
24568 </refpurpose>
24569</refnamediv>
24570<refsynopsisdiv>
24571 <title>Synopsis</title>
24572  <funcsynopsis><funcprototype>
24573   <funcdef>bool <function>netif_carrier_ok </function></funcdef>
24574   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
24575  </funcprototype></funcsynopsis>
24576</refsynopsisdiv>
24577<refsect1>
24578 <title>Arguments</title>
24579 <variablelist>
24580  <varlistentry>
24581   <term><parameter>dev</parameter></term>
24582   <listitem>
24583    <para>
24584     network device
24585    </para>
24586   </listitem>
24587  </varlistentry>
24588 </variablelist>
24589</refsect1>
24590<refsect1>
24591<title>Description</title>
24592<para>
24593   Check if carrier is present on device
24594</para>
24595</refsect1>
24596</refentry>
24597
24598<refentry id="API-netif-dormant-on">
24599<refentryinfo>
24600 <title>LINUX</title>
24601 <productname>Kernel Hackers Manual</productname>
24602 <date>July 2017</date>
24603</refentryinfo>
24604<refmeta>
24605 <refentrytitle><phrase>netif_dormant_on</phrase></refentrytitle>
24606 <manvolnum>9</manvolnum>
24607 <refmiscinfo class="version">4.1.27</refmiscinfo>
24608</refmeta>
24609<refnamediv>
24610 <refname>netif_dormant_on</refname>
24611 <refpurpose>
24612     mark device as dormant.
24613 </refpurpose>
24614</refnamediv>
24615<refsynopsisdiv>
24616 <title>Synopsis</title>
24617  <funcsynopsis><funcprototype>
24618   <funcdef>void <function>netif_dormant_on </function></funcdef>
24619   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24620  </funcprototype></funcsynopsis>
24621</refsynopsisdiv>
24622<refsect1>
24623 <title>Arguments</title>
24624 <variablelist>
24625  <varlistentry>
24626   <term><parameter>dev</parameter></term>
24627   <listitem>
24628    <para>
24629     network device
24630    </para>
24631   </listitem>
24632  </varlistentry>
24633 </variablelist>
24634</refsect1>
24635<refsect1>
24636<title>Description</title>
24637<para>
24638   Mark device as dormant (as per RFC2863).
24639   </para><para>
24640
24641   The dormant state indicates that the relevant interface is not
24642   actually in a condition to pass packets (i.e., it is not 'up') but is
24643   in a <quote>pending</quote> state, waiting for some external event.  For <quote>on-
24644   demand</quote> interfaces, this new state identifies the situation where the
24645   interface is waiting for events to place it in the up state.
24646</para>
24647</refsect1>
24648</refentry>
24649
24650<refentry id="API-netif-dormant-off">
24651<refentryinfo>
24652 <title>LINUX</title>
24653 <productname>Kernel Hackers Manual</productname>
24654 <date>July 2017</date>
24655</refentryinfo>
24656<refmeta>
24657 <refentrytitle><phrase>netif_dormant_off</phrase></refentrytitle>
24658 <manvolnum>9</manvolnum>
24659 <refmiscinfo class="version">4.1.27</refmiscinfo>
24660</refmeta>
24661<refnamediv>
24662 <refname>netif_dormant_off</refname>
24663 <refpurpose>
24664     set device as not dormant.
24665 </refpurpose>
24666</refnamediv>
24667<refsynopsisdiv>
24668 <title>Synopsis</title>
24669  <funcsynopsis><funcprototype>
24670   <funcdef>void <function>netif_dormant_off </function></funcdef>
24671   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24672  </funcprototype></funcsynopsis>
24673</refsynopsisdiv>
24674<refsect1>
24675 <title>Arguments</title>
24676 <variablelist>
24677  <varlistentry>
24678   <term><parameter>dev</parameter></term>
24679   <listitem>
24680    <para>
24681     network device
24682    </para>
24683   </listitem>
24684  </varlistentry>
24685 </variablelist>
24686</refsect1>
24687<refsect1>
24688<title>Description</title>
24689<para>
24690   Device is not in dormant state.
24691</para>
24692</refsect1>
24693</refentry>
24694
24695<refentry id="API-netif-dormant">
24696<refentryinfo>
24697 <title>LINUX</title>
24698 <productname>Kernel Hackers Manual</productname>
24699 <date>July 2017</date>
24700</refentryinfo>
24701<refmeta>
24702 <refentrytitle><phrase>netif_dormant</phrase></refentrytitle>
24703 <manvolnum>9</manvolnum>
24704 <refmiscinfo class="version">4.1.27</refmiscinfo>
24705</refmeta>
24706<refnamediv>
24707 <refname>netif_dormant</refname>
24708 <refpurpose>
24709     test if carrier present
24710 </refpurpose>
24711</refnamediv>
24712<refsynopsisdiv>
24713 <title>Synopsis</title>
24714  <funcsynopsis><funcprototype>
24715   <funcdef>bool <function>netif_dormant </function></funcdef>
24716   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
24717  </funcprototype></funcsynopsis>
24718</refsynopsisdiv>
24719<refsect1>
24720 <title>Arguments</title>
24721 <variablelist>
24722  <varlistentry>
24723   <term><parameter>dev</parameter></term>
24724   <listitem>
24725    <para>
24726     network device
24727    </para>
24728   </listitem>
24729  </varlistentry>
24730 </variablelist>
24731</refsect1>
24732<refsect1>
24733<title>Description</title>
24734<para>
24735   Check if carrier is present on device
24736</para>
24737</refsect1>
24738</refentry>
24739
24740<refentry id="API-netif-oper-up">
24741<refentryinfo>
24742 <title>LINUX</title>
24743 <productname>Kernel Hackers Manual</productname>
24744 <date>July 2017</date>
24745</refentryinfo>
24746<refmeta>
24747 <refentrytitle><phrase>netif_oper_up</phrase></refentrytitle>
24748 <manvolnum>9</manvolnum>
24749 <refmiscinfo class="version">4.1.27</refmiscinfo>
24750</refmeta>
24751<refnamediv>
24752 <refname>netif_oper_up</refname>
24753 <refpurpose>
24754     test if device is operational
24755 </refpurpose>
24756</refnamediv>
24757<refsynopsisdiv>
24758 <title>Synopsis</title>
24759  <funcsynopsis><funcprototype>
24760   <funcdef>bool <function>netif_oper_up </function></funcdef>
24761   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
24762  </funcprototype></funcsynopsis>
24763</refsynopsisdiv>
24764<refsect1>
24765 <title>Arguments</title>
24766 <variablelist>
24767  <varlistentry>
24768   <term><parameter>dev</parameter></term>
24769   <listitem>
24770    <para>
24771     network device
24772    </para>
24773   </listitem>
24774  </varlistentry>
24775 </variablelist>
24776</refsect1>
24777<refsect1>
24778<title>Description</title>
24779<para>
24780   Check if carrier is operational
24781</para>
24782</refsect1>
24783</refentry>
24784
24785<refentry id="API-netif-device-present">
24786<refentryinfo>
24787 <title>LINUX</title>
24788 <productname>Kernel Hackers Manual</productname>
24789 <date>July 2017</date>
24790</refentryinfo>
24791<refmeta>
24792 <refentrytitle><phrase>netif_device_present</phrase></refentrytitle>
24793 <manvolnum>9</manvolnum>
24794 <refmiscinfo class="version">4.1.27</refmiscinfo>
24795</refmeta>
24796<refnamediv>
24797 <refname>netif_device_present</refname>
24798 <refpurpose>
24799     is device available or removed
24800 </refpurpose>
24801</refnamediv>
24802<refsynopsisdiv>
24803 <title>Synopsis</title>
24804  <funcsynopsis><funcprototype>
24805   <funcdef>bool <function>netif_device_present </function></funcdef>
24806   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24807  </funcprototype></funcsynopsis>
24808</refsynopsisdiv>
24809<refsect1>
24810 <title>Arguments</title>
24811 <variablelist>
24812  <varlistentry>
24813   <term><parameter>dev</parameter></term>
24814   <listitem>
24815    <para>
24816     network device
24817    </para>
24818   </listitem>
24819  </varlistentry>
24820 </variablelist>
24821</refsect1>
24822<refsect1>
24823<title>Description</title>
24824<para>
24825   Check if device has not been removed from system.
24826</para>
24827</refsect1>
24828</refentry>
24829
24830<refentry id="API-netif-tx-lock">
24831<refentryinfo>
24832 <title>LINUX</title>
24833 <productname>Kernel Hackers Manual</productname>
24834 <date>July 2017</date>
24835</refentryinfo>
24836<refmeta>
24837 <refentrytitle><phrase>netif_tx_lock</phrase></refentrytitle>
24838 <manvolnum>9</manvolnum>
24839 <refmiscinfo class="version">4.1.27</refmiscinfo>
24840</refmeta>
24841<refnamediv>
24842 <refname>netif_tx_lock</refname>
24843 <refpurpose>
24844     grab network device transmit lock
24845 </refpurpose>
24846</refnamediv>
24847<refsynopsisdiv>
24848 <title>Synopsis</title>
24849  <funcsynopsis><funcprototype>
24850   <funcdef>void <function>netif_tx_lock </function></funcdef>
24851   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24852  </funcprototype></funcsynopsis>
24853</refsynopsisdiv>
24854<refsect1>
24855 <title>Arguments</title>
24856 <variablelist>
24857  <varlistentry>
24858   <term><parameter>dev</parameter></term>
24859   <listitem>
24860    <para>
24861     network device
24862    </para>
24863   </listitem>
24864  </varlistentry>
24865 </variablelist>
24866</refsect1>
24867<refsect1>
24868<title>Description</title>
24869<para>
24870   Get network device transmit lock
24871</para>
24872</refsect1>
24873</refentry>
24874
24875<refentry id="API---dev-uc-sync">
24876<refentryinfo>
24877 <title>LINUX</title>
24878 <productname>Kernel Hackers Manual</productname>
24879 <date>July 2017</date>
24880</refentryinfo>
24881<refmeta>
24882 <refentrytitle><phrase>__dev_uc_sync</phrase></refentrytitle>
24883 <manvolnum>9</manvolnum>
24884 <refmiscinfo class="version">4.1.27</refmiscinfo>
24885</refmeta>
24886<refnamediv>
24887 <refname>__dev_uc_sync</refname>
24888 <refpurpose>
24889     Synchonize device's unicast list
24890 </refpurpose>
24891</refnamediv>
24892<refsynopsisdiv>
24893 <title>Synopsis</title>
24894  <funcsynopsis><funcprototype>
24895   <funcdef>int <function>__dev_uc_sync </function></funcdef>
24896   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24897   <paramdef>int (*<parameter>sync</parameter>)
24898     <funcparams>struct net_device *, 					    const unsigned char *</funcparams></paramdef>
24899   <paramdef>int (*<parameter>unsync</parameter>)
24900     <funcparams>struct net_device *, 					      const unsigned char *</funcparams></paramdef>
24901  </funcprototype></funcsynopsis>
24902</refsynopsisdiv>
24903<refsect1>
24904 <title>Arguments</title>
24905 <variablelist>
24906  <varlistentry>
24907   <term><parameter>dev</parameter></term>
24908   <listitem>
24909    <para>
24910     device to sync
24911    </para>
24912   </listitem>
24913  </varlistentry>
24914  <varlistentry>
24915   <term><parameter>sync</parameter></term>
24916   <listitem>
24917    <para>
24918     function to call if address should be added
24919    </para>
24920   </listitem>
24921  </varlistentry>
24922  <varlistentry>
24923   <term><parameter>unsync</parameter></term>
24924   <listitem>
24925    <para>
24926     function to call if address should be removed
24927    </para>
24928   </listitem>
24929  </varlistentry>
24930 </variablelist>
24931</refsect1>
24932<refsect1>
24933<title>Description</title>
24934<para>
24935   Add newly added addresses to the interface, and release
24936   addresses that have been deleted.
24937</para>
24938</refsect1>
24939</refentry>
24940
24941<refentry id="API---dev-uc-unsync">
24942<refentryinfo>
24943 <title>LINUX</title>
24944 <productname>Kernel Hackers Manual</productname>
24945 <date>July 2017</date>
24946</refentryinfo>
24947<refmeta>
24948 <refentrytitle><phrase>__dev_uc_unsync</phrase></refentrytitle>
24949 <manvolnum>9</manvolnum>
24950 <refmiscinfo class="version">4.1.27</refmiscinfo>
24951</refmeta>
24952<refnamediv>
24953 <refname>__dev_uc_unsync</refname>
24954 <refpurpose>
24955     Remove synchronized addresses from device
24956 </refpurpose>
24957</refnamediv>
24958<refsynopsisdiv>
24959 <title>Synopsis</title>
24960  <funcsynopsis><funcprototype>
24961   <funcdef>void <function>__dev_uc_unsync </function></funcdef>
24962   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
24963   <paramdef>int (*<parameter>unsync</parameter>)
24964     <funcparams>struct net_device *, 						 const unsigned char *</funcparams></paramdef>
24965  </funcprototype></funcsynopsis>
24966</refsynopsisdiv>
24967<refsect1>
24968 <title>Arguments</title>
24969 <variablelist>
24970  <varlistentry>
24971   <term><parameter>dev</parameter></term>
24972   <listitem>
24973    <para>
24974     device to sync
24975    </para>
24976   </listitem>
24977  </varlistentry>
24978  <varlistentry>
24979   <term><parameter>unsync</parameter></term>
24980   <listitem>
24981    <para>
24982     function to call if address should be removed
24983    </para>
24984   </listitem>
24985  </varlistentry>
24986 </variablelist>
24987</refsect1>
24988<refsect1>
24989<title>Description</title>
24990<para>
24991   Remove all addresses that were added to the device by <function>dev_uc_sync</function>.
24992</para>
24993</refsect1>
24994</refentry>
24995
24996<refentry id="API---dev-mc-sync">
24997<refentryinfo>
24998 <title>LINUX</title>
24999 <productname>Kernel Hackers Manual</productname>
25000 <date>July 2017</date>
25001</refentryinfo>
25002<refmeta>
25003 <refentrytitle><phrase>__dev_mc_sync</phrase></refentrytitle>
25004 <manvolnum>9</manvolnum>
25005 <refmiscinfo class="version">4.1.27</refmiscinfo>
25006</refmeta>
25007<refnamediv>
25008 <refname>__dev_mc_sync</refname>
25009 <refpurpose>
25010     Synchonize device's multicast list
25011 </refpurpose>
25012</refnamediv>
25013<refsynopsisdiv>
25014 <title>Synopsis</title>
25015  <funcsynopsis><funcprototype>
25016   <funcdef>int <function>__dev_mc_sync </function></funcdef>
25017   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
25018   <paramdef>int (*<parameter>sync</parameter>)
25019     <funcparams>struct net_device *, 					    const unsigned char *</funcparams></paramdef>
25020   <paramdef>int (*<parameter>unsync</parameter>)
25021     <funcparams>struct net_device *, 					      const unsigned char *</funcparams></paramdef>
25022  </funcprototype></funcsynopsis>
25023</refsynopsisdiv>
25024<refsect1>
25025 <title>Arguments</title>
25026 <variablelist>
25027  <varlistentry>
25028   <term><parameter>dev</parameter></term>
25029   <listitem>
25030    <para>
25031     device to sync
25032    </para>
25033   </listitem>
25034  </varlistentry>
25035  <varlistentry>
25036   <term><parameter>sync</parameter></term>
25037   <listitem>
25038    <para>
25039     function to call if address should be added
25040    </para>
25041   </listitem>
25042  </varlistentry>
25043  <varlistentry>
25044   <term><parameter>unsync</parameter></term>
25045   <listitem>
25046    <para>
25047     function to call if address should be removed
25048    </para>
25049   </listitem>
25050  </varlistentry>
25051 </variablelist>
25052</refsect1>
25053<refsect1>
25054<title>Description</title>
25055<para>
25056   Add newly added addresses to the interface, and release
25057   addresses that have been deleted.
25058</para>
25059</refsect1>
25060</refentry>
25061
25062<refentry id="API---dev-mc-unsync">
25063<refentryinfo>
25064 <title>LINUX</title>
25065 <productname>Kernel Hackers Manual</productname>
25066 <date>July 2017</date>
25067</refentryinfo>
25068<refmeta>
25069 <refentrytitle><phrase>__dev_mc_unsync</phrase></refentrytitle>
25070 <manvolnum>9</manvolnum>
25071 <refmiscinfo class="version">4.1.27</refmiscinfo>
25072</refmeta>
25073<refnamediv>
25074 <refname>__dev_mc_unsync</refname>
25075 <refpurpose>
25076     Remove synchronized addresses from device
25077 </refpurpose>
25078</refnamediv>
25079<refsynopsisdiv>
25080 <title>Synopsis</title>
25081  <funcsynopsis><funcprototype>
25082   <funcdef>void <function>__dev_mc_unsync </function></funcdef>
25083   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
25084   <paramdef>int (*<parameter>unsync</parameter>)
25085     <funcparams>struct net_device *, 						 const unsigned char *</funcparams></paramdef>
25086  </funcprototype></funcsynopsis>
25087</refsynopsisdiv>
25088<refsect1>
25089 <title>Arguments</title>
25090 <variablelist>
25091  <varlistentry>
25092   <term><parameter>dev</parameter></term>
25093   <listitem>
25094    <para>
25095     device to sync
25096    </para>
25097   </listitem>
25098  </varlistentry>
25099  <varlistentry>
25100   <term><parameter>unsync</parameter></term>
25101   <listitem>
25102    <para>
25103     function to call if address should be removed
25104    </para>
25105   </listitem>
25106  </varlistentry>
25107 </variablelist>
25108</refsect1>
25109<refsect1>
25110<title>Description</title>
25111<para>
25112   Remove all addresses that were added to the device by <function>dev_mc_sync</function>.
25113</para>
25114</refsect1>
25115</refentry>
25116
25117     </sect1>
25118     <sect1><title>PHY Support</title>
25119<!-- drivers/net/phy/phy.c -->
25120<refentry id="API-phy-print-status">
25121<refentryinfo>
25122 <title>LINUX</title>
25123 <productname>Kernel Hackers Manual</productname>
25124 <date>July 2017</date>
25125</refentryinfo>
25126<refmeta>
25127 <refentrytitle><phrase>phy_print_status</phrase></refentrytitle>
25128 <manvolnum>9</manvolnum>
25129 <refmiscinfo class="version">4.1.27</refmiscinfo>
25130</refmeta>
25131<refnamediv>
25132 <refname>phy_print_status</refname>
25133 <refpurpose>
25134  Convenience function to print out the current phy status
25135 </refpurpose>
25136</refnamediv>
25137<refsynopsisdiv>
25138 <title>Synopsis</title>
25139  <funcsynopsis><funcprototype>
25140   <funcdef>void <function>phy_print_status </function></funcdef>
25141   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25142  </funcprototype></funcsynopsis>
25143</refsynopsisdiv>
25144<refsect1>
25145 <title>Arguments</title>
25146 <variablelist>
25147  <varlistentry>
25148   <term><parameter>phydev</parameter></term>
25149   <listitem>
25150    <para>
25151     the phy_device struct
25152    </para>
25153   </listitem>
25154  </varlistentry>
25155 </variablelist>
25156</refsect1>
25157</refentry>
25158
25159<refentry id="API-phy-ethtool-sset">
25160<refentryinfo>
25161 <title>LINUX</title>
25162 <productname>Kernel Hackers Manual</productname>
25163 <date>July 2017</date>
25164</refentryinfo>
25165<refmeta>
25166 <refentrytitle><phrase>phy_ethtool_sset</phrase></refentrytitle>
25167 <manvolnum>9</manvolnum>
25168 <refmiscinfo class="version">4.1.27</refmiscinfo>
25169</refmeta>
25170<refnamediv>
25171 <refname>phy_ethtool_sset</refname>
25172 <refpurpose>
25173     generic ethtool sset function, handles all the details
25174 </refpurpose>
25175</refnamediv>
25176<refsynopsisdiv>
25177 <title>Synopsis</title>
25178  <funcsynopsis><funcprototype>
25179   <funcdef>int <function>phy_ethtool_sset </function></funcdef>
25180   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25181   <paramdef>struct ethtool_cmd * <parameter>cmd</parameter></paramdef>
25182  </funcprototype></funcsynopsis>
25183</refsynopsisdiv>
25184<refsect1>
25185 <title>Arguments</title>
25186 <variablelist>
25187  <varlistentry>
25188   <term><parameter>phydev</parameter></term>
25189   <listitem>
25190    <para>
25191     target phy_device struct
25192    </para>
25193   </listitem>
25194  </varlistentry>
25195  <varlistentry>
25196   <term><parameter>cmd</parameter></term>
25197   <listitem>
25198    <para>
25199     ethtool_cmd
25200    </para>
25201   </listitem>
25202  </varlistentry>
25203 </variablelist>
25204</refsect1>
25205<refsect1>
25206<title>A few notes about parameter checking</title>
25207<para>
25208   - We don't set port or transceiver, so we don't care what they
25209   were set to.
25210   - <function>phy_start_aneg</function> will make sure forced settings are sane, and
25211   choose the next best ones from the ones selected, so we don't
25212   care if ethtool tries to give us bad values.
25213</para>
25214</refsect1>
25215</refentry>
25216
25217<refentry id="API-phy-mii-ioctl">
25218<refentryinfo>
25219 <title>LINUX</title>
25220 <productname>Kernel Hackers Manual</productname>
25221 <date>July 2017</date>
25222</refentryinfo>
25223<refmeta>
25224 <refentrytitle><phrase>phy_mii_ioctl</phrase></refentrytitle>
25225 <manvolnum>9</manvolnum>
25226 <refmiscinfo class="version">4.1.27</refmiscinfo>
25227</refmeta>
25228<refnamediv>
25229 <refname>phy_mii_ioctl</refname>
25230 <refpurpose>
25231     generic PHY MII ioctl interface
25232 </refpurpose>
25233</refnamediv>
25234<refsynopsisdiv>
25235 <title>Synopsis</title>
25236  <funcsynopsis><funcprototype>
25237   <funcdef>int <function>phy_mii_ioctl </function></funcdef>
25238   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25239   <paramdef>struct ifreq * <parameter>ifr</parameter></paramdef>
25240   <paramdef>int <parameter>cmd</parameter></paramdef>
25241  </funcprototype></funcsynopsis>
25242</refsynopsisdiv>
25243<refsect1>
25244 <title>Arguments</title>
25245 <variablelist>
25246  <varlistentry>
25247   <term><parameter>phydev</parameter></term>
25248   <listitem>
25249    <para>
25250     the phy_device struct
25251    </para>
25252   </listitem>
25253  </varlistentry>
25254  <varlistentry>
25255   <term><parameter>ifr</parameter></term>
25256   <listitem>
25257    <para>
25258     <structname>struct ifreq</structname> for socket ioctl's
25259    </para>
25260   </listitem>
25261  </varlistentry>
25262  <varlistentry>
25263   <term><parameter>cmd</parameter></term>
25264   <listitem>
25265    <para>
25266     ioctl cmd to execute
25267    </para>
25268   </listitem>
25269  </varlistentry>
25270 </variablelist>
25271</refsect1>
25272<refsect1>
25273<title>Description</title>
25274<para>
25275   Note that this function is currently incompatible with the
25276   PHYCONTROL layer.  It changes registers without regard to
25277   current state.  Use at own risk.
25278</para>
25279</refsect1>
25280</refentry>
25281
25282<refentry id="API-phy-start-aneg">
25283<refentryinfo>
25284 <title>LINUX</title>
25285 <productname>Kernel Hackers Manual</productname>
25286 <date>July 2017</date>
25287</refentryinfo>
25288<refmeta>
25289 <refentrytitle><phrase>phy_start_aneg</phrase></refentrytitle>
25290 <manvolnum>9</manvolnum>
25291 <refmiscinfo class="version">4.1.27</refmiscinfo>
25292</refmeta>
25293<refnamediv>
25294 <refname>phy_start_aneg</refname>
25295 <refpurpose>
25296     start auto-negotiation for this PHY device
25297 </refpurpose>
25298</refnamediv>
25299<refsynopsisdiv>
25300 <title>Synopsis</title>
25301  <funcsynopsis><funcprototype>
25302   <funcdef>int <function>phy_start_aneg </function></funcdef>
25303   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25304  </funcprototype></funcsynopsis>
25305</refsynopsisdiv>
25306<refsect1>
25307 <title>Arguments</title>
25308 <variablelist>
25309  <varlistentry>
25310   <term><parameter>phydev</parameter></term>
25311   <listitem>
25312    <para>
25313     the phy_device struct
25314    </para>
25315   </listitem>
25316  </varlistentry>
25317 </variablelist>
25318</refsect1>
25319<refsect1>
25320<title>Description</title>
25321<para>
25322   Sanitizes the settings (if we're not autonegotiating
25323   them), and then calls the driver's config_aneg function.
25324   If the PHYCONTROL Layer is operating, we change the state to
25325   reflect the beginning of Auto-negotiation or forcing.
25326</para>
25327</refsect1>
25328</refentry>
25329
25330<refentry id="API-phy-start-interrupts">
25331<refentryinfo>
25332 <title>LINUX</title>
25333 <productname>Kernel Hackers Manual</productname>
25334 <date>July 2017</date>
25335</refentryinfo>
25336<refmeta>
25337 <refentrytitle><phrase>phy_start_interrupts</phrase></refentrytitle>
25338 <manvolnum>9</manvolnum>
25339 <refmiscinfo class="version">4.1.27</refmiscinfo>
25340</refmeta>
25341<refnamediv>
25342 <refname>phy_start_interrupts</refname>
25343 <refpurpose>
25344     request and enable interrupts for a PHY device
25345 </refpurpose>
25346</refnamediv>
25347<refsynopsisdiv>
25348 <title>Synopsis</title>
25349  <funcsynopsis><funcprototype>
25350   <funcdef>int <function>phy_start_interrupts </function></funcdef>
25351   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25352  </funcprototype></funcsynopsis>
25353</refsynopsisdiv>
25354<refsect1>
25355 <title>Arguments</title>
25356 <variablelist>
25357  <varlistentry>
25358   <term><parameter>phydev</parameter></term>
25359   <listitem>
25360    <para>
25361     target phy_device struct
25362    </para>
25363   </listitem>
25364  </varlistentry>
25365 </variablelist>
25366</refsect1>
25367<refsect1>
25368<title>Description</title>
25369<para>
25370   Request the interrupt for the given PHY.
25371   If this fails, then we set irq to PHY_POLL.
25372   Otherwise, we enable the interrupts in the PHY.
25373   This should only be called with a valid IRQ number.
25374   Returns 0 on success or &lt; 0 on error.
25375</para>
25376</refsect1>
25377</refentry>
25378
25379<refentry id="API-phy-stop-interrupts">
25380<refentryinfo>
25381 <title>LINUX</title>
25382 <productname>Kernel Hackers Manual</productname>
25383 <date>July 2017</date>
25384</refentryinfo>
25385<refmeta>
25386 <refentrytitle><phrase>phy_stop_interrupts</phrase></refentrytitle>
25387 <manvolnum>9</manvolnum>
25388 <refmiscinfo class="version">4.1.27</refmiscinfo>
25389</refmeta>
25390<refnamediv>
25391 <refname>phy_stop_interrupts</refname>
25392 <refpurpose>
25393     disable interrupts from a PHY device
25394 </refpurpose>
25395</refnamediv>
25396<refsynopsisdiv>
25397 <title>Synopsis</title>
25398  <funcsynopsis><funcprototype>
25399   <funcdef>int <function>phy_stop_interrupts </function></funcdef>
25400   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25401  </funcprototype></funcsynopsis>
25402</refsynopsisdiv>
25403<refsect1>
25404 <title>Arguments</title>
25405 <variablelist>
25406  <varlistentry>
25407   <term><parameter>phydev</parameter></term>
25408   <listitem>
25409    <para>
25410     target phy_device struct
25411    </para>
25412   </listitem>
25413  </varlistentry>
25414 </variablelist>
25415</refsect1>
25416</refentry>
25417
25418<refentry id="API-phy-stop">
25419<refentryinfo>
25420 <title>LINUX</title>
25421 <productname>Kernel Hackers Manual</productname>
25422 <date>July 2017</date>
25423</refentryinfo>
25424<refmeta>
25425 <refentrytitle><phrase>phy_stop</phrase></refentrytitle>
25426 <manvolnum>9</manvolnum>
25427 <refmiscinfo class="version">4.1.27</refmiscinfo>
25428</refmeta>
25429<refnamediv>
25430 <refname>phy_stop</refname>
25431 <refpurpose>
25432     Bring down the PHY link, and stop checking the status
25433 </refpurpose>
25434</refnamediv>
25435<refsynopsisdiv>
25436 <title>Synopsis</title>
25437  <funcsynopsis><funcprototype>
25438   <funcdef>void <function>phy_stop </function></funcdef>
25439   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25440  </funcprototype></funcsynopsis>
25441</refsynopsisdiv>
25442<refsect1>
25443 <title>Arguments</title>
25444 <variablelist>
25445  <varlistentry>
25446   <term><parameter>phydev</parameter></term>
25447   <listitem>
25448    <para>
25449     target phy_device struct
25450    </para>
25451   </listitem>
25452  </varlistentry>
25453 </variablelist>
25454</refsect1>
25455</refentry>
25456
25457<refentry id="API-phy-start">
25458<refentryinfo>
25459 <title>LINUX</title>
25460 <productname>Kernel Hackers Manual</productname>
25461 <date>July 2017</date>
25462</refentryinfo>
25463<refmeta>
25464 <refentrytitle><phrase>phy_start</phrase></refentrytitle>
25465 <manvolnum>9</manvolnum>
25466 <refmiscinfo class="version">4.1.27</refmiscinfo>
25467</refmeta>
25468<refnamediv>
25469 <refname>phy_start</refname>
25470 <refpurpose>
25471     start or restart a PHY device
25472 </refpurpose>
25473</refnamediv>
25474<refsynopsisdiv>
25475 <title>Synopsis</title>
25476  <funcsynopsis><funcprototype>
25477   <funcdef>void <function>phy_start </function></funcdef>
25478   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25479  </funcprototype></funcsynopsis>
25480</refsynopsisdiv>
25481<refsect1>
25482 <title>Arguments</title>
25483 <variablelist>
25484  <varlistentry>
25485   <term><parameter>phydev</parameter></term>
25486   <listitem>
25487    <para>
25488     target phy_device struct
25489    </para>
25490   </listitem>
25491  </varlistentry>
25492 </variablelist>
25493</refsect1>
25494<refsect1>
25495<title>Description</title>
25496<para>
25497   Indicates the attached device's readiness to
25498   handle PHY-related work.  Used during startup to start the
25499   PHY, and after a call to <function>phy_stop</function> to resume operation.
25500   Also used to indicate the MDIO bus has cleared an error
25501   condition.
25502</para>
25503</refsect1>
25504</refentry>
25505
25506<refentry id="API-phy-read-mmd-indirect">
25507<refentryinfo>
25508 <title>LINUX</title>
25509 <productname>Kernel Hackers Manual</productname>
25510 <date>July 2017</date>
25511</refentryinfo>
25512<refmeta>
25513 <refentrytitle><phrase>phy_read_mmd_indirect</phrase></refentrytitle>
25514 <manvolnum>9</manvolnum>
25515 <refmiscinfo class="version">4.1.27</refmiscinfo>
25516</refmeta>
25517<refnamediv>
25518 <refname>phy_read_mmd_indirect</refname>
25519 <refpurpose>
25520     reads data from the MMD registers
25521 </refpurpose>
25522</refnamediv>
25523<refsynopsisdiv>
25524 <title>Synopsis</title>
25525  <funcsynopsis><funcprototype>
25526   <funcdef>int <function>phy_read_mmd_indirect </function></funcdef>
25527   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25528   <paramdef>int <parameter>prtad</parameter></paramdef>
25529   <paramdef>int <parameter>devad</parameter></paramdef>
25530   <paramdef>int <parameter>addr</parameter></paramdef>
25531  </funcprototype></funcsynopsis>
25532</refsynopsisdiv>
25533<refsect1>
25534 <title>Arguments</title>
25535 <variablelist>
25536  <varlistentry>
25537   <term><parameter>phydev</parameter></term>
25538   <listitem>
25539    <para>
25540     The PHY device bus
25541    </para>
25542   </listitem>
25543  </varlistentry>
25544  <varlistentry>
25545   <term><parameter>prtad</parameter></term>
25546   <listitem>
25547    <para>
25548     MMD Address
25549    </para>
25550   </listitem>
25551  </varlistentry>
25552  <varlistentry>
25553   <term><parameter>devad</parameter></term>
25554   <listitem>
25555    <para>
25556     MMD DEVAD
25557    </para>
25558   </listitem>
25559  </varlistentry>
25560  <varlistentry>
25561   <term><parameter>addr</parameter></term>
25562   <listitem>
25563    <para>
25564     PHY address on the MII bus
25565    </para>
25566   </listitem>
25567  </varlistentry>
25568 </variablelist>
25569</refsect1>
25570<refsect1>
25571<title>Description</title>
25572<para>
25573   it reads data from the MMD registers (clause 22 to access to
25574   clause 45) of the specified phy address.
25575</para>
25576</refsect1>
25577<refsect1>
25578<title>To read these register we have</title>
25579<para>
25580   1) Write reg 13 // DEVAD
25581   2) Write reg 14 // MMD Address
25582   3) Write reg 13 // MMD Data Command for MMD DEVAD
25583   3) Read  reg 14 // Read MMD data
25584</para>
25585</refsect1>
25586</refentry>
25587
25588<refentry id="API-phy-write-mmd-indirect">
25589<refentryinfo>
25590 <title>LINUX</title>
25591 <productname>Kernel Hackers Manual</productname>
25592 <date>July 2017</date>
25593</refentryinfo>
25594<refmeta>
25595 <refentrytitle><phrase>phy_write_mmd_indirect</phrase></refentrytitle>
25596 <manvolnum>9</manvolnum>
25597 <refmiscinfo class="version">4.1.27</refmiscinfo>
25598</refmeta>
25599<refnamediv>
25600 <refname>phy_write_mmd_indirect</refname>
25601 <refpurpose>
25602     writes data to the MMD registers
25603 </refpurpose>
25604</refnamediv>
25605<refsynopsisdiv>
25606 <title>Synopsis</title>
25607  <funcsynopsis><funcprototype>
25608   <funcdef>void <function>phy_write_mmd_indirect </function></funcdef>
25609   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25610   <paramdef>int <parameter>prtad</parameter></paramdef>
25611   <paramdef>int <parameter>devad</parameter></paramdef>
25612   <paramdef>int <parameter>addr</parameter></paramdef>
25613   <paramdef>u32 <parameter>data</parameter></paramdef>
25614  </funcprototype></funcsynopsis>
25615</refsynopsisdiv>
25616<refsect1>
25617 <title>Arguments</title>
25618 <variablelist>
25619  <varlistentry>
25620   <term><parameter>phydev</parameter></term>
25621   <listitem>
25622    <para>
25623     The PHY device
25624    </para>
25625   </listitem>
25626  </varlistentry>
25627  <varlistentry>
25628   <term><parameter>prtad</parameter></term>
25629   <listitem>
25630    <para>
25631     MMD Address
25632    </para>
25633   </listitem>
25634  </varlistentry>
25635  <varlistentry>
25636   <term><parameter>devad</parameter></term>
25637   <listitem>
25638    <para>
25639     MMD DEVAD
25640    </para>
25641   </listitem>
25642  </varlistentry>
25643  <varlistentry>
25644   <term><parameter>addr</parameter></term>
25645   <listitem>
25646    <para>
25647     PHY address on the MII bus
25648    </para>
25649   </listitem>
25650  </varlistentry>
25651  <varlistentry>
25652   <term><parameter>data</parameter></term>
25653   <listitem>
25654    <para>
25655     data to write in the MMD register
25656    </para>
25657   </listitem>
25658  </varlistentry>
25659 </variablelist>
25660</refsect1>
25661<refsect1>
25662<title>Description</title>
25663<para>
25664   Write data from the MMD registers of the specified
25665   phy address.
25666</para>
25667</refsect1>
25668<refsect1>
25669<title>To write these register we have</title>
25670<para>
25671   1) Write reg 13 // DEVAD
25672   2) Write reg 14 // MMD Address
25673   3) Write reg 13 // MMD Data Command for MMD DEVAD
25674   3) Write reg 14 // Write MMD data
25675</para>
25676</refsect1>
25677</refentry>
25678
25679<refentry id="API-phy-init-eee">
25680<refentryinfo>
25681 <title>LINUX</title>
25682 <productname>Kernel Hackers Manual</productname>
25683 <date>July 2017</date>
25684</refentryinfo>
25685<refmeta>
25686 <refentrytitle><phrase>phy_init_eee</phrase></refentrytitle>
25687 <manvolnum>9</manvolnum>
25688 <refmiscinfo class="version">4.1.27</refmiscinfo>
25689</refmeta>
25690<refnamediv>
25691 <refname>phy_init_eee</refname>
25692 <refpurpose>
25693     init and check the EEE feature
25694 </refpurpose>
25695</refnamediv>
25696<refsynopsisdiv>
25697 <title>Synopsis</title>
25698  <funcsynopsis><funcprototype>
25699   <funcdef>int <function>phy_init_eee </function></funcdef>
25700   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25701   <paramdef>bool <parameter>clk_stop_enable</parameter></paramdef>
25702  </funcprototype></funcsynopsis>
25703</refsynopsisdiv>
25704<refsect1>
25705 <title>Arguments</title>
25706 <variablelist>
25707  <varlistentry>
25708   <term><parameter>phydev</parameter></term>
25709   <listitem>
25710    <para>
25711     target phy_device struct
25712    </para>
25713   </listitem>
25714  </varlistentry>
25715  <varlistentry>
25716   <term><parameter>clk_stop_enable</parameter></term>
25717   <listitem>
25718    <para>
25719     PHY may stop the clock during LPI
25720    </para>
25721   </listitem>
25722  </varlistentry>
25723 </variablelist>
25724</refsect1>
25725<refsect1>
25726<title>Description</title>
25727<para>
25728   it checks if the Energy-Efficient Ethernet (EEE)
25729   is supported by looking at the MMD registers 3.20 and 7.60/61
25730   and it programs the MMD register 3.0 setting the <quote>Clock stop enable</quote>
25731   bit if required.
25732</para>
25733</refsect1>
25734</refentry>
25735
25736<refentry id="API-phy-get-eee-err">
25737<refentryinfo>
25738 <title>LINUX</title>
25739 <productname>Kernel Hackers Manual</productname>
25740 <date>July 2017</date>
25741</refentryinfo>
25742<refmeta>
25743 <refentrytitle><phrase>phy_get_eee_err</phrase></refentrytitle>
25744 <manvolnum>9</manvolnum>
25745 <refmiscinfo class="version">4.1.27</refmiscinfo>
25746</refmeta>
25747<refnamediv>
25748 <refname>phy_get_eee_err</refname>
25749 <refpurpose>
25750     report the EEE wake error count
25751 </refpurpose>
25752</refnamediv>
25753<refsynopsisdiv>
25754 <title>Synopsis</title>
25755  <funcsynopsis><funcprototype>
25756   <funcdef>int <function>phy_get_eee_err </function></funcdef>
25757   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25758  </funcprototype></funcsynopsis>
25759</refsynopsisdiv>
25760<refsect1>
25761 <title>Arguments</title>
25762 <variablelist>
25763  <varlistentry>
25764   <term><parameter>phydev</parameter></term>
25765   <listitem>
25766    <para>
25767     target phy_device struct
25768    </para>
25769   </listitem>
25770  </varlistentry>
25771 </variablelist>
25772</refsect1>
25773<refsect1>
25774<title>Description</title>
25775<para>
25776   it is to report the number of time where the PHY
25777   failed to complete its normal wake sequence.
25778</para>
25779</refsect1>
25780</refentry>
25781
25782<refentry id="API-phy-ethtool-get-eee">
25783<refentryinfo>
25784 <title>LINUX</title>
25785 <productname>Kernel Hackers Manual</productname>
25786 <date>July 2017</date>
25787</refentryinfo>
25788<refmeta>
25789 <refentrytitle><phrase>phy_ethtool_get_eee</phrase></refentrytitle>
25790 <manvolnum>9</manvolnum>
25791 <refmiscinfo class="version">4.1.27</refmiscinfo>
25792</refmeta>
25793<refnamediv>
25794 <refname>phy_ethtool_get_eee</refname>
25795 <refpurpose>
25796     get EEE supported and status
25797 </refpurpose>
25798</refnamediv>
25799<refsynopsisdiv>
25800 <title>Synopsis</title>
25801  <funcsynopsis><funcprototype>
25802   <funcdef>int <function>phy_ethtool_get_eee </function></funcdef>
25803   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25804   <paramdef>struct ethtool_eee * <parameter>data</parameter></paramdef>
25805  </funcprototype></funcsynopsis>
25806</refsynopsisdiv>
25807<refsect1>
25808 <title>Arguments</title>
25809 <variablelist>
25810  <varlistentry>
25811   <term><parameter>phydev</parameter></term>
25812   <listitem>
25813    <para>
25814     target phy_device struct
25815    </para>
25816   </listitem>
25817  </varlistentry>
25818  <varlistentry>
25819   <term><parameter>data</parameter></term>
25820   <listitem>
25821    <para>
25822     ethtool_eee data
25823    </para>
25824   </listitem>
25825  </varlistentry>
25826 </variablelist>
25827</refsect1>
25828<refsect1>
25829<title>Description</title>
25830<para>
25831   it reportes the Supported/Advertisement/LP Advertisement
25832   capabilities.
25833</para>
25834</refsect1>
25835</refentry>
25836
25837<refentry id="API-phy-ethtool-set-eee">
25838<refentryinfo>
25839 <title>LINUX</title>
25840 <productname>Kernel Hackers Manual</productname>
25841 <date>July 2017</date>
25842</refentryinfo>
25843<refmeta>
25844 <refentrytitle><phrase>phy_ethtool_set_eee</phrase></refentrytitle>
25845 <manvolnum>9</manvolnum>
25846 <refmiscinfo class="version">4.1.27</refmiscinfo>
25847</refmeta>
25848<refnamediv>
25849 <refname>phy_ethtool_set_eee</refname>
25850 <refpurpose>
25851     set EEE supported and status
25852 </refpurpose>
25853</refnamediv>
25854<refsynopsisdiv>
25855 <title>Synopsis</title>
25856  <funcsynopsis><funcprototype>
25857   <funcdef>int <function>phy_ethtool_set_eee </function></funcdef>
25858   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25859   <paramdef>struct ethtool_eee * <parameter>data</parameter></paramdef>
25860  </funcprototype></funcsynopsis>
25861</refsynopsisdiv>
25862<refsect1>
25863 <title>Arguments</title>
25864 <variablelist>
25865  <varlistentry>
25866   <term><parameter>phydev</parameter></term>
25867   <listitem>
25868    <para>
25869     target phy_device struct
25870    </para>
25871   </listitem>
25872  </varlistentry>
25873  <varlistentry>
25874   <term><parameter>data</parameter></term>
25875   <listitem>
25876    <para>
25877     ethtool_eee data
25878    </para>
25879   </listitem>
25880  </varlistentry>
25881 </variablelist>
25882</refsect1>
25883<refsect1>
25884<title>Description</title>
25885<para>
25886   it is to program the Advertisement EEE register.
25887</para>
25888</refsect1>
25889</refentry>
25890
25891<!-- drivers/net/phy/phy.c -->
25892<refentry id="API-phy-clear-interrupt">
25893<refentryinfo>
25894 <title>LINUX</title>
25895 <productname>Kernel Hackers Manual</productname>
25896 <date>July 2017</date>
25897</refentryinfo>
25898<refmeta>
25899 <refentrytitle><phrase>phy_clear_interrupt</phrase></refentrytitle>
25900 <manvolnum>9</manvolnum>
25901 <refmiscinfo class="version">4.1.27</refmiscinfo>
25902</refmeta>
25903<refnamediv>
25904 <refname>phy_clear_interrupt</refname>
25905 <refpurpose>
25906  Ack the phy device's interrupt
25907 </refpurpose>
25908</refnamediv>
25909<refsynopsisdiv>
25910 <title>Synopsis</title>
25911  <funcsynopsis><funcprototype>
25912   <funcdef>int <function>phy_clear_interrupt </function></funcdef>
25913   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25914  </funcprototype></funcsynopsis>
25915</refsynopsisdiv>
25916<refsect1>
25917 <title>Arguments</title>
25918 <variablelist>
25919  <varlistentry>
25920   <term><parameter>phydev</parameter></term>
25921   <listitem>
25922    <para>
25923     the phy_device struct
25924    </para>
25925   </listitem>
25926  </varlistentry>
25927 </variablelist>
25928</refsect1>
25929<refsect1>
25930<title>Description</title>
25931<para>
25932   If the <parameter>phydev</parameter> driver has an ack_interrupt function, call it to
25933   ack and clear the phy device's interrupt.
25934   </para><para>
25935
25936   Returns 0 on success or &lt; 0 on error.
25937</para>
25938</refsect1>
25939</refentry>
25940
25941<refentry id="API-phy-config-interrupt">
25942<refentryinfo>
25943 <title>LINUX</title>
25944 <productname>Kernel Hackers Manual</productname>
25945 <date>July 2017</date>
25946</refentryinfo>
25947<refmeta>
25948 <refentrytitle><phrase>phy_config_interrupt</phrase></refentrytitle>
25949 <manvolnum>9</manvolnum>
25950 <refmiscinfo class="version">4.1.27</refmiscinfo>
25951</refmeta>
25952<refnamediv>
25953 <refname>phy_config_interrupt</refname>
25954 <refpurpose>
25955     configure the PHY device for the requested interrupts
25956 </refpurpose>
25957</refnamediv>
25958<refsynopsisdiv>
25959 <title>Synopsis</title>
25960  <funcsynopsis><funcprototype>
25961   <funcdef>int <function>phy_config_interrupt </function></funcdef>
25962   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
25963   <paramdef>u32 <parameter>interrupts</parameter></paramdef>
25964  </funcprototype></funcsynopsis>
25965</refsynopsisdiv>
25966<refsect1>
25967 <title>Arguments</title>
25968 <variablelist>
25969  <varlistentry>
25970   <term><parameter>phydev</parameter></term>
25971   <listitem>
25972    <para>
25973     the phy_device struct
25974    </para>
25975   </listitem>
25976  </varlistentry>
25977  <varlistentry>
25978   <term><parameter>interrupts</parameter></term>
25979   <listitem>
25980    <para>
25981     interrupt flags to configure for this <parameter>phydev</parameter>
25982    </para>
25983   </listitem>
25984  </varlistentry>
25985 </variablelist>
25986</refsect1>
25987<refsect1>
25988<title>Description</title>
25989<para>
25990   Returns 0 on success or &lt; 0 on error.
25991</para>
25992</refsect1>
25993</refentry>
25994
25995<refentry id="API-phy-aneg-done">
25996<refentryinfo>
25997 <title>LINUX</title>
25998 <productname>Kernel Hackers Manual</productname>
25999 <date>July 2017</date>
26000</refentryinfo>
26001<refmeta>
26002 <refentrytitle><phrase>phy_aneg_done</phrase></refentrytitle>
26003 <manvolnum>9</manvolnum>
26004 <refmiscinfo class="version">4.1.27</refmiscinfo>
26005</refmeta>
26006<refnamediv>
26007 <refname>phy_aneg_done</refname>
26008 <refpurpose>
26009     return auto-negotiation status
26010 </refpurpose>
26011</refnamediv>
26012<refsynopsisdiv>
26013 <title>Synopsis</title>
26014  <funcsynopsis><funcprototype>
26015   <funcdef>int <function>phy_aneg_done </function></funcdef>
26016   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26017  </funcprototype></funcsynopsis>
26018</refsynopsisdiv>
26019<refsect1>
26020 <title>Arguments</title>
26021 <variablelist>
26022  <varlistentry>
26023   <term><parameter>phydev</parameter></term>
26024   <listitem>
26025    <para>
26026     target phy_device struct
26027    </para>
26028   </listitem>
26029  </varlistentry>
26030 </variablelist>
26031</refsect1>
26032<refsect1>
26033<title>Description</title>
26034<para>
26035   Return the auto-negotiation status from this <parameter>phydev</parameter>
26036   Returns &gt; 0 on success or &lt; 0 on error. 0 means that auto-negotiation
26037   is still pending.
26038</para>
26039</refsect1>
26040</refentry>
26041
26042<refentry id="API-phy-find-setting">
26043<refentryinfo>
26044 <title>LINUX</title>
26045 <productname>Kernel Hackers Manual</productname>
26046 <date>July 2017</date>
26047</refentryinfo>
26048<refmeta>
26049 <refentrytitle><phrase>phy_find_setting</phrase></refentrytitle>
26050 <manvolnum>9</manvolnum>
26051 <refmiscinfo class="version">4.1.27</refmiscinfo>
26052</refmeta>
26053<refnamediv>
26054 <refname>phy_find_setting</refname>
26055 <refpurpose>
26056     find a PHY settings array entry that matches speed &amp; duplex
26057 </refpurpose>
26058</refnamediv>
26059<refsynopsisdiv>
26060 <title>Synopsis</title>
26061  <funcsynopsis><funcprototype>
26062   <funcdef>unsigned int <function>phy_find_setting </function></funcdef>
26063   <paramdef>int <parameter>speed</parameter></paramdef>
26064   <paramdef>int <parameter>duplex</parameter></paramdef>
26065  </funcprototype></funcsynopsis>
26066</refsynopsisdiv>
26067<refsect1>
26068 <title>Arguments</title>
26069 <variablelist>
26070  <varlistentry>
26071   <term><parameter>speed</parameter></term>
26072   <listitem>
26073    <para>
26074     speed to match
26075    </para>
26076   </listitem>
26077  </varlistentry>
26078  <varlistentry>
26079   <term><parameter>duplex</parameter></term>
26080   <listitem>
26081    <para>
26082     duplex to match
26083    </para>
26084   </listitem>
26085  </varlistentry>
26086 </variablelist>
26087</refsect1>
26088<refsect1>
26089<title>Description</title>
26090<para>
26091   Searches the settings array for the setting which
26092   matches the desired speed and duplex, and returns the index
26093   of that setting.  Returns the index of the last setting if
26094   none of the others match.
26095</para>
26096</refsect1>
26097</refentry>
26098
26099<refentry id="API-phy-find-valid">
26100<refentryinfo>
26101 <title>LINUX</title>
26102 <productname>Kernel Hackers Manual</productname>
26103 <date>July 2017</date>
26104</refentryinfo>
26105<refmeta>
26106 <refentrytitle><phrase>phy_find_valid</phrase></refentrytitle>
26107 <manvolnum>9</manvolnum>
26108 <refmiscinfo class="version">4.1.27</refmiscinfo>
26109</refmeta>
26110<refnamediv>
26111 <refname>phy_find_valid</refname>
26112 <refpurpose>
26113     find a PHY setting that matches the requested features mask
26114 </refpurpose>
26115</refnamediv>
26116<refsynopsisdiv>
26117 <title>Synopsis</title>
26118  <funcsynopsis><funcprototype>
26119   <funcdef>unsigned int <function>phy_find_valid </function></funcdef>
26120   <paramdef>unsigned int <parameter>idx</parameter></paramdef>
26121   <paramdef>u32 <parameter>features</parameter></paramdef>
26122  </funcprototype></funcsynopsis>
26123</refsynopsisdiv>
26124<refsect1>
26125 <title>Arguments</title>
26126 <variablelist>
26127  <varlistentry>
26128   <term><parameter>idx</parameter></term>
26129   <listitem>
26130    <para>
26131     The first index in settings[] to search
26132    </para>
26133   </listitem>
26134  </varlistentry>
26135  <varlistentry>
26136   <term><parameter>features</parameter></term>
26137   <listitem>
26138    <para>
26139     A mask of the valid settings
26140    </para>
26141   </listitem>
26142  </varlistentry>
26143 </variablelist>
26144</refsect1>
26145<refsect1>
26146<title>Description</title>
26147<para>
26148   Returns the index of the first valid setting less
26149   than or equal to the one pointed to by idx, as determined by
26150   the mask in features.  Returns the index of the last setting
26151   if nothing else matches.
26152</para>
26153</refsect1>
26154</refentry>
26155
26156<refentry id="API-phy-check-valid">
26157<refentryinfo>
26158 <title>LINUX</title>
26159 <productname>Kernel Hackers Manual</productname>
26160 <date>July 2017</date>
26161</refentryinfo>
26162<refmeta>
26163 <refentrytitle><phrase>phy_check_valid</phrase></refentrytitle>
26164 <manvolnum>9</manvolnum>
26165 <refmiscinfo class="version">4.1.27</refmiscinfo>
26166</refmeta>
26167<refnamediv>
26168 <refname>phy_check_valid</refname>
26169 <refpurpose>
26170     check if there is a valid PHY setting which matches speed, duplex, and feature mask
26171 </refpurpose>
26172</refnamediv>
26173<refsynopsisdiv>
26174 <title>Synopsis</title>
26175  <funcsynopsis><funcprototype>
26176   <funcdef>bool <function>phy_check_valid </function></funcdef>
26177   <paramdef>int <parameter>speed</parameter></paramdef>
26178   <paramdef>int <parameter>duplex</parameter></paramdef>
26179   <paramdef>u32 <parameter>features</parameter></paramdef>
26180  </funcprototype></funcsynopsis>
26181</refsynopsisdiv>
26182<refsect1>
26183 <title>Arguments</title>
26184 <variablelist>
26185  <varlistentry>
26186   <term><parameter>speed</parameter></term>
26187   <listitem>
26188    <para>
26189     speed to match
26190    </para>
26191   </listitem>
26192  </varlistentry>
26193  <varlistentry>
26194   <term><parameter>duplex</parameter></term>
26195   <listitem>
26196    <para>
26197     duplex to match
26198    </para>
26199   </listitem>
26200  </varlistentry>
26201  <varlistentry>
26202   <term><parameter>features</parameter></term>
26203   <listitem>
26204    <para>
26205     A mask of the valid settings
26206    </para>
26207   </listitem>
26208  </varlistentry>
26209 </variablelist>
26210</refsect1>
26211<refsect1>
26212<title>Description</title>
26213<para>
26214   Returns true if there is a valid setting, false otherwise.
26215</para>
26216</refsect1>
26217</refentry>
26218
26219<refentry id="API-phy-sanitize-settings">
26220<refentryinfo>
26221 <title>LINUX</title>
26222 <productname>Kernel Hackers Manual</productname>
26223 <date>July 2017</date>
26224</refentryinfo>
26225<refmeta>
26226 <refentrytitle><phrase>phy_sanitize_settings</phrase></refentrytitle>
26227 <manvolnum>9</manvolnum>
26228 <refmiscinfo class="version">4.1.27</refmiscinfo>
26229</refmeta>
26230<refnamediv>
26231 <refname>phy_sanitize_settings</refname>
26232 <refpurpose>
26233     make sure the PHY is set to supported speed and duplex
26234 </refpurpose>
26235</refnamediv>
26236<refsynopsisdiv>
26237 <title>Synopsis</title>
26238  <funcsynopsis><funcprototype>
26239   <funcdef>void <function>phy_sanitize_settings </function></funcdef>
26240   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26241  </funcprototype></funcsynopsis>
26242</refsynopsisdiv>
26243<refsect1>
26244 <title>Arguments</title>
26245 <variablelist>
26246  <varlistentry>
26247   <term><parameter>phydev</parameter></term>
26248   <listitem>
26249    <para>
26250     the target phy_device struct
26251    </para>
26252   </listitem>
26253  </varlistentry>
26254 </variablelist>
26255</refsect1>
26256<refsect1>
26257<title>Description</title>
26258<para>
26259   Make sure the PHY is set to supported speeds and
26260   duplexes.  Drop down by one in this order:  1000/FULL,
26261   1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF.
26262</para>
26263</refsect1>
26264</refentry>
26265
26266<refentry id="API-phy-start-machine">
26267<refentryinfo>
26268 <title>LINUX</title>
26269 <productname>Kernel Hackers Manual</productname>
26270 <date>July 2017</date>
26271</refentryinfo>
26272<refmeta>
26273 <refentrytitle><phrase>phy_start_machine</phrase></refentrytitle>
26274 <manvolnum>9</manvolnum>
26275 <refmiscinfo class="version">4.1.27</refmiscinfo>
26276</refmeta>
26277<refnamediv>
26278 <refname>phy_start_machine</refname>
26279 <refpurpose>
26280     start PHY state machine tracking
26281 </refpurpose>
26282</refnamediv>
26283<refsynopsisdiv>
26284 <title>Synopsis</title>
26285  <funcsynopsis><funcprototype>
26286   <funcdef>void <function>phy_start_machine </function></funcdef>
26287   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26288  </funcprototype></funcsynopsis>
26289</refsynopsisdiv>
26290<refsect1>
26291 <title>Arguments</title>
26292 <variablelist>
26293  <varlistentry>
26294   <term><parameter>phydev</parameter></term>
26295   <listitem>
26296    <para>
26297     the phy_device struct
26298    </para>
26299   </listitem>
26300  </varlistentry>
26301 </variablelist>
26302</refsect1>
26303<refsect1>
26304<title>Description</title>
26305<para>
26306   The PHY infrastructure can run a state machine
26307   which tracks whether the PHY is starting up, negotiating,
26308   etc.  This function starts the timer which tracks the state
26309   of the PHY.  If you want to maintain your own state machine,
26310   do not call this function.
26311</para>
26312</refsect1>
26313</refentry>
26314
26315<refentry id="API-phy-stop-machine">
26316<refentryinfo>
26317 <title>LINUX</title>
26318 <productname>Kernel Hackers Manual</productname>
26319 <date>July 2017</date>
26320</refentryinfo>
26321<refmeta>
26322 <refentrytitle><phrase>phy_stop_machine</phrase></refentrytitle>
26323 <manvolnum>9</manvolnum>
26324 <refmiscinfo class="version">4.1.27</refmiscinfo>
26325</refmeta>
26326<refnamediv>
26327 <refname>phy_stop_machine</refname>
26328 <refpurpose>
26329     stop the PHY state machine tracking
26330 </refpurpose>
26331</refnamediv>
26332<refsynopsisdiv>
26333 <title>Synopsis</title>
26334  <funcsynopsis><funcprototype>
26335   <funcdef>void <function>phy_stop_machine </function></funcdef>
26336   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26337  </funcprototype></funcsynopsis>
26338</refsynopsisdiv>
26339<refsect1>
26340 <title>Arguments</title>
26341 <variablelist>
26342  <varlistentry>
26343   <term><parameter>phydev</parameter></term>
26344   <listitem>
26345    <para>
26346     target phy_device struct
26347    </para>
26348   </listitem>
26349  </varlistentry>
26350 </variablelist>
26351</refsect1>
26352<refsect1>
26353<title>Description</title>
26354<para>
26355   Stops the state machine timer, sets the state to UP
26356   (unless it wasn't up yet). This function must be called BEFORE
26357   phy_detach.
26358</para>
26359</refsect1>
26360</refentry>
26361
26362<refentry id="API-phy-error">
26363<refentryinfo>
26364 <title>LINUX</title>
26365 <productname>Kernel Hackers Manual</productname>
26366 <date>July 2017</date>
26367</refentryinfo>
26368<refmeta>
26369 <refentrytitle><phrase>phy_error</phrase></refentrytitle>
26370 <manvolnum>9</manvolnum>
26371 <refmiscinfo class="version">4.1.27</refmiscinfo>
26372</refmeta>
26373<refnamediv>
26374 <refname>phy_error</refname>
26375 <refpurpose>
26376     enter HALTED state for this PHY device
26377 </refpurpose>
26378</refnamediv>
26379<refsynopsisdiv>
26380 <title>Synopsis</title>
26381  <funcsynopsis><funcprototype>
26382   <funcdef>void <function>phy_error </function></funcdef>
26383   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26384  </funcprototype></funcsynopsis>
26385</refsynopsisdiv>
26386<refsect1>
26387 <title>Arguments</title>
26388 <variablelist>
26389  <varlistentry>
26390   <term><parameter>phydev</parameter></term>
26391   <listitem>
26392    <para>
26393     target phy_device struct
26394    </para>
26395   </listitem>
26396  </varlistentry>
26397 </variablelist>
26398</refsect1>
26399<refsect1>
26400<title>Description</title>
26401<para>
26402   Moves the PHY to the HALTED state in response to a read
26403   or write error, and tells the controller the link is down.
26404   Must not be called from interrupt context, or while the
26405   phydev-&gt;lock is held.
26406</para>
26407</refsect1>
26408</refentry>
26409
26410<refentry id="API-phy-interrupt">
26411<refentryinfo>
26412 <title>LINUX</title>
26413 <productname>Kernel Hackers Manual</productname>
26414 <date>July 2017</date>
26415</refentryinfo>
26416<refmeta>
26417 <refentrytitle><phrase>phy_interrupt</phrase></refentrytitle>
26418 <manvolnum>9</manvolnum>
26419 <refmiscinfo class="version">4.1.27</refmiscinfo>
26420</refmeta>
26421<refnamediv>
26422 <refname>phy_interrupt</refname>
26423 <refpurpose>
26424     PHY interrupt handler
26425 </refpurpose>
26426</refnamediv>
26427<refsynopsisdiv>
26428 <title>Synopsis</title>
26429  <funcsynopsis><funcprototype>
26430   <funcdef>irqreturn_t <function>phy_interrupt </function></funcdef>
26431   <paramdef>int <parameter>irq</parameter></paramdef>
26432   <paramdef>void * <parameter>phy_dat</parameter></paramdef>
26433  </funcprototype></funcsynopsis>
26434</refsynopsisdiv>
26435<refsect1>
26436 <title>Arguments</title>
26437 <variablelist>
26438  <varlistentry>
26439   <term><parameter>irq</parameter></term>
26440   <listitem>
26441    <para>
26442     interrupt line
26443    </para>
26444   </listitem>
26445  </varlistentry>
26446  <varlistentry>
26447   <term><parameter>phy_dat</parameter></term>
26448   <listitem>
26449    <para>
26450     phy_device pointer
26451    </para>
26452   </listitem>
26453  </varlistentry>
26454 </variablelist>
26455</refsect1>
26456<refsect1>
26457<title>Description</title>
26458<para>
26459   When a PHY interrupt occurs, the handler disables
26460   interrupts, and schedules a work task to clear the interrupt.
26461</para>
26462</refsect1>
26463</refentry>
26464
26465<refentry id="API-phy-enable-interrupts">
26466<refentryinfo>
26467 <title>LINUX</title>
26468 <productname>Kernel Hackers Manual</productname>
26469 <date>July 2017</date>
26470</refentryinfo>
26471<refmeta>
26472 <refentrytitle><phrase>phy_enable_interrupts</phrase></refentrytitle>
26473 <manvolnum>9</manvolnum>
26474 <refmiscinfo class="version">4.1.27</refmiscinfo>
26475</refmeta>
26476<refnamediv>
26477 <refname>phy_enable_interrupts</refname>
26478 <refpurpose>
26479     Enable the interrupts from the PHY side
26480 </refpurpose>
26481</refnamediv>
26482<refsynopsisdiv>
26483 <title>Synopsis</title>
26484  <funcsynopsis><funcprototype>
26485   <funcdef>int <function>phy_enable_interrupts </function></funcdef>
26486   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26487  </funcprototype></funcsynopsis>
26488</refsynopsisdiv>
26489<refsect1>
26490 <title>Arguments</title>
26491 <variablelist>
26492  <varlistentry>
26493   <term><parameter>phydev</parameter></term>
26494   <listitem>
26495    <para>
26496     target phy_device struct
26497    </para>
26498   </listitem>
26499  </varlistentry>
26500 </variablelist>
26501</refsect1>
26502</refentry>
26503
26504<refentry id="API-phy-disable-interrupts">
26505<refentryinfo>
26506 <title>LINUX</title>
26507 <productname>Kernel Hackers Manual</productname>
26508 <date>July 2017</date>
26509</refentryinfo>
26510<refmeta>
26511 <refentrytitle><phrase>phy_disable_interrupts</phrase></refentrytitle>
26512 <manvolnum>9</manvolnum>
26513 <refmiscinfo class="version">4.1.27</refmiscinfo>
26514</refmeta>
26515<refnamediv>
26516 <refname>phy_disable_interrupts</refname>
26517 <refpurpose>
26518     Disable the PHY interrupts from the PHY side
26519 </refpurpose>
26520</refnamediv>
26521<refsynopsisdiv>
26522 <title>Synopsis</title>
26523  <funcsynopsis><funcprototype>
26524   <funcdef>int <function>phy_disable_interrupts </function></funcdef>
26525   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26526  </funcprototype></funcsynopsis>
26527</refsynopsisdiv>
26528<refsect1>
26529 <title>Arguments</title>
26530 <variablelist>
26531  <varlistentry>
26532   <term><parameter>phydev</parameter></term>
26533   <listitem>
26534    <para>
26535     target phy_device struct
26536    </para>
26537   </listitem>
26538  </varlistentry>
26539 </variablelist>
26540</refsect1>
26541</refentry>
26542
26543<refentry id="API-phy-change">
26544<refentryinfo>
26545 <title>LINUX</title>
26546 <productname>Kernel Hackers Manual</productname>
26547 <date>July 2017</date>
26548</refentryinfo>
26549<refmeta>
26550 <refentrytitle><phrase>phy_change</phrase></refentrytitle>
26551 <manvolnum>9</manvolnum>
26552 <refmiscinfo class="version">4.1.27</refmiscinfo>
26553</refmeta>
26554<refnamediv>
26555 <refname>phy_change</refname>
26556 <refpurpose>
26557     Scheduled by the phy_interrupt/timer to handle PHY changes
26558 </refpurpose>
26559</refnamediv>
26560<refsynopsisdiv>
26561 <title>Synopsis</title>
26562  <funcsynopsis><funcprototype>
26563   <funcdef>void <function>phy_change </function></funcdef>
26564   <paramdef>struct work_struct * <parameter>work</parameter></paramdef>
26565  </funcprototype></funcsynopsis>
26566</refsynopsisdiv>
26567<refsect1>
26568 <title>Arguments</title>
26569 <variablelist>
26570  <varlistentry>
26571   <term><parameter>work</parameter></term>
26572   <listitem>
26573    <para>
26574     work_struct that describes the work to be done
26575    </para>
26576   </listitem>
26577  </varlistentry>
26578 </variablelist>
26579</refsect1>
26580</refentry>
26581
26582<refentry id="API-phy-state-machine">
26583<refentryinfo>
26584 <title>LINUX</title>
26585 <productname>Kernel Hackers Manual</productname>
26586 <date>July 2017</date>
26587</refentryinfo>
26588<refmeta>
26589 <refentrytitle><phrase>phy_state_machine</phrase></refentrytitle>
26590 <manvolnum>9</manvolnum>
26591 <refmiscinfo class="version">4.1.27</refmiscinfo>
26592</refmeta>
26593<refnamediv>
26594 <refname>phy_state_machine</refname>
26595 <refpurpose>
26596     Handle the state machine
26597 </refpurpose>
26598</refnamediv>
26599<refsynopsisdiv>
26600 <title>Synopsis</title>
26601  <funcsynopsis><funcprototype>
26602   <funcdef>void <function>phy_state_machine </function></funcdef>
26603   <paramdef>struct work_struct * <parameter>work</parameter></paramdef>
26604  </funcprototype></funcsynopsis>
26605</refsynopsisdiv>
26606<refsect1>
26607 <title>Arguments</title>
26608 <variablelist>
26609  <varlistentry>
26610   <term><parameter>work</parameter></term>
26611   <listitem>
26612    <para>
26613     work_struct that describes the work to be done
26614    </para>
26615   </listitem>
26616  </varlistentry>
26617 </variablelist>
26618</refsect1>
26619</refentry>
26620
26621<!-- drivers/net/phy/phy_device.c -->
26622<refentry id="API-phy-register-fixup">
26623<refentryinfo>
26624 <title>LINUX</title>
26625 <productname>Kernel Hackers Manual</productname>
26626 <date>July 2017</date>
26627</refentryinfo>
26628<refmeta>
26629 <refentrytitle><phrase>phy_register_fixup</phrase></refentrytitle>
26630 <manvolnum>9</manvolnum>
26631 <refmiscinfo class="version">4.1.27</refmiscinfo>
26632</refmeta>
26633<refnamediv>
26634 <refname>phy_register_fixup</refname>
26635 <refpurpose>
26636  creates a new phy_fixup and adds it to the list
26637 </refpurpose>
26638</refnamediv>
26639<refsynopsisdiv>
26640 <title>Synopsis</title>
26641  <funcsynopsis><funcprototype>
26642   <funcdef>int <function>phy_register_fixup </function></funcdef>
26643   <paramdef>const char * <parameter>bus_id</parameter></paramdef>
26644   <paramdef>u32 <parameter>phy_uid</parameter></paramdef>
26645   <paramdef>u32 <parameter>phy_uid_mask</parameter></paramdef>
26646   <paramdef>int (*<parameter>run</parameter>)
26647     <funcparams>struct phy_device *</funcparams></paramdef>
26648  </funcprototype></funcsynopsis>
26649</refsynopsisdiv>
26650<refsect1>
26651 <title>Arguments</title>
26652 <variablelist>
26653  <varlistentry>
26654   <term><parameter>bus_id</parameter></term>
26655   <listitem>
26656    <para>
26657     A string which matches phydev-&gt;dev.bus_id (or PHY_ANY_ID)
26658    </para>
26659   </listitem>
26660  </varlistentry>
26661  <varlistentry>
26662   <term><parameter>phy_uid</parameter></term>
26663   <listitem>
26664    <para>
26665     Used to match against phydev-&gt;phy_id (the UID of the PHY)
26666     It can also be PHY_ANY_UID
26667    </para>
26668   </listitem>
26669  </varlistentry>
26670  <varlistentry>
26671   <term><parameter>phy_uid_mask</parameter></term>
26672   <listitem>
26673    <para>
26674     Applied to phydev-&gt;phy_id and fixup-&gt;phy_uid before
26675     comparison
26676    </para>
26677   </listitem>
26678  </varlistentry>
26679  <varlistentry>
26680   <term><parameter>run</parameter></term>
26681   <listitem>
26682    <para>
26683     The actual code to be run when a matching PHY is found
26684    </para>
26685   </listitem>
26686  </varlistentry>
26687 </variablelist>
26688</refsect1>
26689</refentry>
26690
26691<refentry id="API-get-phy-device">
26692<refentryinfo>
26693 <title>LINUX</title>
26694 <productname>Kernel Hackers Manual</productname>
26695 <date>July 2017</date>
26696</refentryinfo>
26697<refmeta>
26698 <refentrytitle><phrase>get_phy_device</phrase></refentrytitle>
26699 <manvolnum>9</manvolnum>
26700 <refmiscinfo class="version">4.1.27</refmiscinfo>
26701</refmeta>
26702<refnamediv>
26703 <refname>get_phy_device</refname>
26704 <refpurpose>
26705     reads the specified PHY device and returns its <parameter>phy_device</parameter> struct
26706 </refpurpose>
26707</refnamediv>
26708<refsynopsisdiv>
26709 <title>Synopsis</title>
26710  <funcsynopsis><funcprototype>
26711   <funcdef>struct phy_device * <function>get_phy_device </function></funcdef>
26712   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
26713   <paramdef>int <parameter>addr</parameter></paramdef>
26714   <paramdef>bool <parameter>is_c45</parameter></paramdef>
26715  </funcprototype></funcsynopsis>
26716</refsynopsisdiv>
26717<refsect1>
26718 <title>Arguments</title>
26719 <variablelist>
26720  <varlistentry>
26721   <term><parameter>bus</parameter></term>
26722   <listitem>
26723    <para>
26724     the target MII bus
26725    </para>
26726   </listitem>
26727  </varlistentry>
26728  <varlistentry>
26729   <term><parameter>addr</parameter></term>
26730   <listitem>
26731    <para>
26732     PHY address on the MII bus
26733    </para>
26734   </listitem>
26735  </varlistentry>
26736  <varlistentry>
26737   <term><parameter>is_c45</parameter></term>
26738   <listitem>
26739    <para>
26740     If true the PHY uses the 802.3 clause 45 protocol
26741    </para>
26742   </listitem>
26743  </varlistentry>
26744 </variablelist>
26745</refsect1>
26746<refsect1>
26747<title>Description</title>
26748<para>
26749   Reads the ID registers of the PHY at <parameter>addr</parameter> on the
26750   <parameter>bus</parameter>, then allocates and returns the phy_device to represent it.
26751</para>
26752</refsect1>
26753</refentry>
26754
26755<refentry id="API-phy-device-register">
26756<refentryinfo>
26757 <title>LINUX</title>
26758 <productname>Kernel Hackers Manual</productname>
26759 <date>July 2017</date>
26760</refentryinfo>
26761<refmeta>
26762 <refentrytitle><phrase>phy_device_register</phrase></refentrytitle>
26763 <manvolnum>9</manvolnum>
26764 <refmiscinfo class="version">4.1.27</refmiscinfo>
26765</refmeta>
26766<refnamediv>
26767 <refname>phy_device_register</refname>
26768 <refpurpose>
26769     Register the phy device on the MDIO bus
26770 </refpurpose>
26771</refnamediv>
26772<refsynopsisdiv>
26773 <title>Synopsis</title>
26774  <funcsynopsis><funcprototype>
26775   <funcdef>int <function>phy_device_register </function></funcdef>
26776   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26777  </funcprototype></funcsynopsis>
26778</refsynopsisdiv>
26779<refsect1>
26780 <title>Arguments</title>
26781 <variablelist>
26782  <varlistentry>
26783   <term><parameter>phydev</parameter></term>
26784   <listitem>
26785    <para>
26786     phy_device structure to be added to the MDIO bus
26787    </para>
26788   </listitem>
26789  </varlistentry>
26790 </variablelist>
26791</refsect1>
26792</refentry>
26793
26794<refentry id="API-phy-find-first">
26795<refentryinfo>
26796 <title>LINUX</title>
26797 <productname>Kernel Hackers Manual</productname>
26798 <date>July 2017</date>
26799</refentryinfo>
26800<refmeta>
26801 <refentrytitle><phrase>phy_find_first</phrase></refentrytitle>
26802 <manvolnum>9</manvolnum>
26803 <refmiscinfo class="version">4.1.27</refmiscinfo>
26804</refmeta>
26805<refnamediv>
26806 <refname>phy_find_first</refname>
26807 <refpurpose>
26808     finds the first PHY device on the bus
26809 </refpurpose>
26810</refnamediv>
26811<refsynopsisdiv>
26812 <title>Synopsis</title>
26813  <funcsynopsis><funcprototype>
26814   <funcdef>struct phy_device * <function>phy_find_first </function></funcdef>
26815   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
26816  </funcprototype></funcsynopsis>
26817</refsynopsisdiv>
26818<refsect1>
26819 <title>Arguments</title>
26820 <variablelist>
26821  <varlistentry>
26822   <term><parameter>bus</parameter></term>
26823   <listitem>
26824    <para>
26825     the target MII bus
26826    </para>
26827   </listitem>
26828  </varlistentry>
26829 </variablelist>
26830</refsect1>
26831</refentry>
26832
26833<refentry id="API-phy-connect-direct">
26834<refentryinfo>
26835 <title>LINUX</title>
26836 <productname>Kernel Hackers Manual</productname>
26837 <date>July 2017</date>
26838</refentryinfo>
26839<refmeta>
26840 <refentrytitle><phrase>phy_connect_direct</phrase></refentrytitle>
26841 <manvolnum>9</manvolnum>
26842 <refmiscinfo class="version">4.1.27</refmiscinfo>
26843</refmeta>
26844<refnamediv>
26845 <refname>phy_connect_direct</refname>
26846 <refpurpose>
26847     connect an ethernet device to a specific phy_device
26848 </refpurpose>
26849</refnamediv>
26850<refsynopsisdiv>
26851 <title>Synopsis</title>
26852  <funcsynopsis><funcprototype>
26853   <funcdef>int <function>phy_connect_direct </function></funcdef>
26854   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
26855   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
26856   <paramdef>void (*<parameter>handler</parameter>)
26857     <funcparams>struct net_device *</funcparams></paramdef>
26858   <paramdef>phy_interface_t <parameter>interface</parameter></paramdef>
26859  </funcprototype></funcsynopsis>
26860</refsynopsisdiv>
26861<refsect1>
26862 <title>Arguments</title>
26863 <variablelist>
26864  <varlistentry>
26865   <term><parameter>dev</parameter></term>
26866   <listitem>
26867    <para>
26868     the network device to connect
26869    </para>
26870   </listitem>
26871  </varlistentry>
26872  <varlistentry>
26873   <term><parameter>phydev</parameter></term>
26874   <listitem>
26875    <para>
26876     the pointer to the phy device
26877    </para>
26878   </listitem>
26879  </varlistentry>
26880  <varlistentry>
26881   <term><parameter>handler</parameter></term>
26882   <listitem>
26883    <para>
26884     callback function for state change notifications
26885    </para>
26886   </listitem>
26887  </varlistentry>
26888  <varlistentry>
26889   <term><parameter>interface</parameter></term>
26890   <listitem>
26891    <para>
26892     PHY device's interface
26893    </para>
26894   </listitem>
26895  </varlistentry>
26896 </variablelist>
26897</refsect1>
26898</refentry>
26899
26900<refentry id="API-phy-connect">
26901<refentryinfo>
26902 <title>LINUX</title>
26903 <productname>Kernel Hackers Manual</productname>
26904 <date>July 2017</date>
26905</refentryinfo>
26906<refmeta>
26907 <refentrytitle><phrase>phy_connect</phrase></refentrytitle>
26908 <manvolnum>9</manvolnum>
26909 <refmiscinfo class="version">4.1.27</refmiscinfo>
26910</refmeta>
26911<refnamediv>
26912 <refname>phy_connect</refname>
26913 <refpurpose>
26914     connect an ethernet device to a PHY device
26915 </refpurpose>
26916</refnamediv>
26917<refsynopsisdiv>
26918 <title>Synopsis</title>
26919  <funcsynopsis><funcprototype>
26920   <funcdef>struct phy_device * <function>phy_connect </function></funcdef>
26921   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
26922   <paramdef>const char * <parameter>bus_id</parameter></paramdef>
26923   <paramdef>void (*<parameter>handler</parameter>)
26924     <funcparams>struct net_device *</funcparams></paramdef>
26925   <paramdef>phy_interface_t <parameter>interface</parameter></paramdef>
26926  </funcprototype></funcsynopsis>
26927</refsynopsisdiv>
26928<refsect1>
26929 <title>Arguments</title>
26930 <variablelist>
26931  <varlistentry>
26932   <term><parameter>dev</parameter></term>
26933   <listitem>
26934    <para>
26935     the network device to connect
26936    </para>
26937   </listitem>
26938  </varlistentry>
26939  <varlistentry>
26940   <term><parameter>bus_id</parameter></term>
26941   <listitem>
26942    <para>
26943     the id string of the PHY device to connect
26944    </para>
26945   </listitem>
26946  </varlistentry>
26947  <varlistentry>
26948   <term><parameter>handler</parameter></term>
26949   <listitem>
26950    <para>
26951     callback function for state change notifications
26952    </para>
26953   </listitem>
26954  </varlistentry>
26955  <varlistentry>
26956   <term><parameter>interface</parameter></term>
26957   <listitem>
26958    <para>
26959     PHY device's interface
26960    </para>
26961   </listitem>
26962  </varlistentry>
26963 </variablelist>
26964</refsect1>
26965<refsect1>
26966<title>Description</title>
26967<para>
26968   Convenience function for connecting ethernet
26969   devices to PHY devices.  The default behavior is for
26970   the PHY infrastructure to handle everything, and only notify
26971   the connected driver when the link status changes.  If you
26972   don't want, or can't use the provided functionality, you may
26973   choose to call only the subset of functions which provide
26974   the desired functionality.
26975</para>
26976</refsect1>
26977</refentry>
26978
26979<refentry id="API-phy-disconnect">
26980<refentryinfo>
26981 <title>LINUX</title>
26982 <productname>Kernel Hackers Manual</productname>
26983 <date>July 2017</date>
26984</refentryinfo>
26985<refmeta>
26986 <refentrytitle><phrase>phy_disconnect</phrase></refentrytitle>
26987 <manvolnum>9</manvolnum>
26988 <refmiscinfo class="version">4.1.27</refmiscinfo>
26989</refmeta>
26990<refnamediv>
26991 <refname>phy_disconnect</refname>
26992 <refpurpose>
26993     disable interrupts, stop state machine, and detach a PHY device
26994 </refpurpose>
26995</refnamediv>
26996<refsynopsisdiv>
26997 <title>Synopsis</title>
26998  <funcsynopsis><funcprototype>
26999   <funcdef>void <function>phy_disconnect </function></funcdef>
27000   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27001  </funcprototype></funcsynopsis>
27002</refsynopsisdiv>
27003<refsect1>
27004 <title>Arguments</title>
27005 <variablelist>
27006  <varlistentry>
27007   <term><parameter>phydev</parameter></term>
27008   <listitem>
27009    <para>
27010     target phy_device struct
27011    </para>
27012   </listitem>
27013  </varlistentry>
27014 </variablelist>
27015</refsect1>
27016</refentry>
27017
27018<refentry id="API-phy-attach-direct">
27019<refentryinfo>
27020 <title>LINUX</title>
27021 <productname>Kernel Hackers Manual</productname>
27022 <date>July 2017</date>
27023</refentryinfo>
27024<refmeta>
27025 <refentrytitle><phrase>phy_attach_direct</phrase></refentrytitle>
27026 <manvolnum>9</manvolnum>
27027 <refmiscinfo class="version">4.1.27</refmiscinfo>
27028</refmeta>
27029<refnamediv>
27030 <refname>phy_attach_direct</refname>
27031 <refpurpose>
27032     attach a network device to a given PHY device pointer
27033 </refpurpose>
27034</refnamediv>
27035<refsynopsisdiv>
27036 <title>Synopsis</title>
27037  <funcsynopsis><funcprototype>
27038   <funcdef>int <function>phy_attach_direct </function></funcdef>
27039   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
27040   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27041   <paramdef>u32 <parameter>flags</parameter></paramdef>
27042   <paramdef>phy_interface_t <parameter>interface</parameter></paramdef>
27043  </funcprototype></funcsynopsis>
27044</refsynopsisdiv>
27045<refsect1>
27046 <title>Arguments</title>
27047 <variablelist>
27048  <varlistentry>
27049   <term><parameter>dev</parameter></term>
27050   <listitem>
27051    <para>
27052     network device to attach
27053    </para>
27054   </listitem>
27055  </varlistentry>
27056  <varlistentry>
27057   <term><parameter>phydev</parameter></term>
27058   <listitem>
27059    <para>
27060     Pointer to phy_device to attach
27061    </para>
27062   </listitem>
27063  </varlistentry>
27064  <varlistentry>
27065   <term><parameter>flags</parameter></term>
27066   <listitem>
27067    <para>
27068     PHY device's dev_flags
27069    </para>
27070   </listitem>
27071  </varlistentry>
27072  <varlistentry>
27073   <term><parameter>interface</parameter></term>
27074   <listitem>
27075    <para>
27076     PHY device's interface
27077    </para>
27078   </listitem>
27079  </varlistentry>
27080 </variablelist>
27081</refsect1>
27082<refsect1>
27083<title>Description</title>
27084<para>
27085   Called by drivers to attach to a particular PHY
27086   device. The phy_device is found, and properly hooked up
27087   to the phy_driver.  If no driver is attached, then a
27088   generic driver is used.  The phy_device is given a ptr to
27089   the attaching device, and given a callback for link status
27090   change.  The phy_device is returned to the attaching driver.
27091</para>
27092</refsect1>
27093</refentry>
27094
27095<refentry id="API-phy-attach">
27096<refentryinfo>
27097 <title>LINUX</title>
27098 <productname>Kernel Hackers Manual</productname>
27099 <date>July 2017</date>
27100</refentryinfo>
27101<refmeta>
27102 <refentrytitle><phrase>phy_attach</phrase></refentrytitle>
27103 <manvolnum>9</manvolnum>
27104 <refmiscinfo class="version">4.1.27</refmiscinfo>
27105</refmeta>
27106<refnamediv>
27107 <refname>phy_attach</refname>
27108 <refpurpose>
27109     attach a network device to a particular PHY device
27110 </refpurpose>
27111</refnamediv>
27112<refsynopsisdiv>
27113 <title>Synopsis</title>
27114  <funcsynopsis><funcprototype>
27115   <funcdef>struct phy_device * <function>phy_attach </function></funcdef>
27116   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
27117   <paramdef>const char * <parameter>bus_id</parameter></paramdef>
27118   <paramdef>phy_interface_t <parameter>interface</parameter></paramdef>
27119  </funcprototype></funcsynopsis>
27120</refsynopsisdiv>
27121<refsect1>
27122 <title>Arguments</title>
27123 <variablelist>
27124  <varlistentry>
27125   <term><parameter>dev</parameter></term>
27126   <listitem>
27127    <para>
27128     network device to attach
27129    </para>
27130   </listitem>
27131  </varlistentry>
27132  <varlistentry>
27133   <term><parameter>bus_id</parameter></term>
27134   <listitem>
27135    <para>
27136     Bus ID of PHY device to attach
27137    </para>
27138   </listitem>
27139  </varlistentry>
27140  <varlistentry>
27141   <term><parameter>interface</parameter></term>
27142   <listitem>
27143    <para>
27144     PHY device's interface
27145    </para>
27146   </listitem>
27147  </varlistentry>
27148 </variablelist>
27149</refsect1>
27150<refsect1>
27151<title>Description</title>
27152<para>
27153   Same as <function>phy_attach_direct</function> except that a PHY bus_id
27154   string is passed instead of a pointer to a struct phy_device.
27155</para>
27156</refsect1>
27157</refentry>
27158
27159<refentry id="API-phy-detach">
27160<refentryinfo>
27161 <title>LINUX</title>
27162 <productname>Kernel Hackers Manual</productname>
27163 <date>July 2017</date>
27164</refentryinfo>
27165<refmeta>
27166 <refentrytitle><phrase>phy_detach</phrase></refentrytitle>
27167 <manvolnum>9</manvolnum>
27168 <refmiscinfo class="version">4.1.27</refmiscinfo>
27169</refmeta>
27170<refnamediv>
27171 <refname>phy_detach</refname>
27172 <refpurpose>
27173     detach a PHY device from its network device
27174 </refpurpose>
27175</refnamediv>
27176<refsynopsisdiv>
27177 <title>Synopsis</title>
27178  <funcsynopsis><funcprototype>
27179   <funcdef>void <function>phy_detach </function></funcdef>
27180   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27181  </funcprototype></funcsynopsis>
27182</refsynopsisdiv>
27183<refsect1>
27184 <title>Arguments</title>
27185 <variablelist>
27186  <varlistentry>
27187   <term><parameter>phydev</parameter></term>
27188   <listitem>
27189    <para>
27190     target phy_device struct
27191    </para>
27192   </listitem>
27193  </varlistentry>
27194 </variablelist>
27195</refsect1>
27196</refentry>
27197
27198<refentry id="API-genphy-setup-forced">
27199<refentryinfo>
27200 <title>LINUX</title>
27201 <productname>Kernel Hackers Manual</productname>
27202 <date>July 2017</date>
27203</refentryinfo>
27204<refmeta>
27205 <refentrytitle><phrase>genphy_setup_forced</phrase></refentrytitle>
27206 <manvolnum>9</manvolnum>
27207 <refmiscinfo class="version">4.1.27</refmiscinfo>
27208</refmeta>
27209<refnamediv>
27210 <refname>genphy_setup_forced</refname>
27211 <refpurpose>
27212     configures/forces speed/duplex from <parameter>phydev</parameter>
27213 </refpurpose>
27214</refnamediv>
27215<refsynopsisdiv>
27216 <title>Synopsis</title>
27217  <funcsynopsis><funcprototype>
27218   <funcdef>int <function>genphy_setup_forced </function></funcdef>
27219   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27220  </funcprototype></funcsynopsis>
27221</refsynopsisdiv>
27222<refsect1>
27223 <title>Arguments</title>
27224 <variablelist>
27225  <varlistentry>
27226   <term><parameter>phydev</parameter></term>
27227   <listitem>
27228    <para>
27229     target phy_device struct
27230    </para>
27231   </listitem>
27232  </varlistentry>
27233 </variablelist>
27234</refsect1>
27235<refsect1>
27236<title>Description</title>
27237<para>
27238   Configures MII_BMCR to force speed/duplex
27239   to the values in phydev. Assumes that the values are valid.
27240   Please see <function>phy_sanitize_settings</function>.
27241</para>
27242</refsect1>
27243</refentry>
27244
27245<refentry id="API-genphy-restart-aneg">
27246<refentryinfo>
27247 <title>LINUX</title>
27248 <productname>Kernel Hackers Manual</productname>
27249 <date>July 2017</date>
27250</refentryinfo>
27251<refmeta>
27252 <refentrytitle><phrase>genphy_restart_aneg</phrase></refentrytitle>
27253 <manvolnum>9</manvolnum>
27254 <refmiscinfo class="version">4.1.27</refmiscinfo>
27255</refmeta>
27256<refnamediv>
27257 <refname>genphy_restart_aneg</refname>
27258 <refpurpose>
27259     Enable and Restart Autonegotiation
27260 </refpurpose>
27261</refnamediv>
27262<refsynopsisdiv>
27263 <title>Synopsis</title>
27264  <funcsynopsis><funcprototype>
27265   <funcdef>int <function>genphy_restart_aneg </function></funcdef>
27266   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27267  </funcprototype></funcsynopsis>
27268</refsynopsisdiv>
27269<refsect1>
27270 <title>Arguments</title>
27271 <variablelist>
27272  <varlistentry>
27273   <term><parameter>phydev</parameter></term>
27274   <listitem>
27275    <para>
27276     target phy_device struct
27277    </para>
27278   </listitem>
27279  </varlistentry>
27280 </variablelist>
27281</refsect1>
27282</refentry>
27283
27284<refentry id="API-genphy-config-aneg">
27285<refentryinfo>
27286 <title>LINUX</title>
27287 <productname>Kernel Hackers Manual</productname>
27288 <date>July 2017</date>
27289</refentryinfo>
27290<refmeta>
27291 <refentrytitle><phrase>genphy_config_aneg</phrase></refentrytitle>
27292 <manvolnum>9</manvolnum>
27293 <refmiscinfo class="version">4.1.27</refmiscinfo>
27294</refmeta>
27295<refnamediv>
27296 <refname>genphy_config_aneg</refname>
27297 <refpurpose>
27298     restart auto-negotiation or write BMCR
27299 </refpurpose>
27300</refnamediv>
27301<refsynopsisdiv>
27302 <title>Synopsis</title>
27303  <funcsynopsis><funcprototype>
27304   <funcdef>int <function>genphy_config_aneg </function></funcdef>
27305   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27306  </funcprototype></funcsynopsis>
27307</refsynopsisdiv>
27308<refsect1>
27309 <title>Arguments</title>
27310 <variablelist>
27311  <varlistentry>
27312   <term><parameter>phydev</parameter></term>
27313   <listitem>
27314    <para>
27315     target phy_device struct
27316    </para>
27317   </listitem>
27318  </varlistentry>
27319 </variablelist>
27320</refsect1>
27321<refsect1>
27322<title>Description</title>
27323<para>
27324   If auto-negotiation is enabled, we configure the
27325   advertising, and then restart auto-negotiation.  If it is not
27326   enabled, then we write the BMCR.
27327</para>
27328</refsect1>
27329</refentry>
27330
27331<refentry id="API-genphy-aneg-done">
27332<refentryinfo>
27333 <title>LINUX</title>
27334 <productname>Kernel Hackers Manual</productname>
27335 <date>July 2017</date>
27336</refentryinfo>
27337<refmeta>
27338 <refentrytitle><phrase>genphy_aneg_done</phrase></refentrytitle>
27339 <manvolnum>9</manvolnum>
27340 <refmiscinfo class="version">4.1.27</refmiscinfo>
27341</refmeta>
27342<refnamediv>
27343 <refname>genphy_aneg_done</refname>
27344 <refpurpose>
27345     return auto-negotiation status
27346 </refpurpose>
27347</refnamediv>
27348<refsynopsisdiv>
27349 <title>Synopsis</title>
27350  <funcsynopsis><funcprototype>
27351   <funcdef>int <function>genphy_aneg_done </function></funcdef>
27352   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27353  </funcprototype></funcsynopsis>
27354</refsynopsisdiv>
27355<refsect1>
27356 <title>Arguments</title>
27357 <variablelist>
27358  <varlistentry>
27359   <term><parameter>phydev</parameter></term>
27360   <listitem>
27361    <para>
27362     target phy_device struct
27363    </para>
27364   </listitem>
27365  </varlistentry>
27366 </variablelist>
27367</refsect1>
27368<refsect1>
27369<title>Description</title>
27370<para>
27371   Reads the status register and returns 0 either if
27372   auto-negotiation is incomplete, or if there was an error.
27373   Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
27374</para>
27375</refsect1>
27376</refentry>
27377
27378<refentry id="API-genphy-update-link">
27379<refentryinfo>
27380 <title>LINUX</title>
27381 <productname>Kernel Hackers Manual</productname>
27382 <date>July 2017</date>
27383</refentryinfo>
27384<refmeta>
27385 <refentrytitle><phrase>genphy_update_link</phrase></refentrytitle>
27386 <manvolnum>9</manvolnum>
27387 <refmiscinfo class="version">4.1.27</refmiscinfo>
27388</refmeta>
27389<refnamediv>
27390 <refname>genphy_update_link</refname>
27391 <refpurpose>
27392     update link status in <parameter>phydev</parameter>
27393 </refpurpose>
27394</refnamediv>
27395<refsynopsisdiv>
27396 <title>Synopsis</title>
27397  <funcsynopsis><funcprototype>
27398   <funcdef>int <function>genphy_update_link </function></funcdef>
27399   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27400  </funcprototype></funcsynopsis>
27401</refsynopsisdiv>
27402<refsect1>
27403 <title>Arguments</title>
27404 <variablelist>
27405  <varlistentry>
27406   <term><parameter>phydev</parameter></term>
27407   <listitem>
27408    <para>
27409     target phy_device struct
27410    </para>
27411   </listitem>
27412  </varlistentry>
27413 </variablelist>
27414</refsect1>
27415<refsect1>
27416<title>Description</title>
27417<para>
27418   Update the value in phydev-&gt;link to reflect the
27419   current link value.  In order to do this, we need to read
27420   the status register twice, keeping the second value.
27421</para>
27422</refsect1>
27423</refentry>
27424
27425<refentry id="API-genphy-read-status">
27426<refentryinfo>
27427 <title>LINUX</title>
27428 <productname>Kernel Hackers Manual</productname>
27429 <date>July 2017</date>
27430</refentryinfo>
27431<refmeta>
27432 <refentrytitle><phrase>genphy_read_status</phrase></refentrytitle>
27433 <manvolnum>9</manvolnum>
27434 <refmiscinfo class="version">4.1.27</refmiscinfo>
27435</refmeta>
27436<refnamediv>
27437 <refname>genphy_read_status</refname>
27438 <refpurpose>
27439     check the link status and update current link state
27440 </refpurpose>
27441</refnamediv>
27442<refsynopsisdiv>
27443 <title>Synopsis</title>
27444  <funcsynopsis><funcprototype>
27445   <funcdef>int <function>genphy_read_status </function></funcdef>
27446   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27447  </funcprototype></funcsynopsis>
27448</refsynopsisdiv>
27449<refsect1>
27450 <title>Arguments</title>
27451 <variablelist>
27452  <varlistentry>
27453   <term><parameter>phydev</parameter></term>
27454   <listitem>
27455    <para>
27456     target phy_device struct
27457    </para>
27458   </listitem>
27459  </varlistentry>
27460 </variablelist>
27461</refsect1>
27462<refsect1>
27463<title>Description</title>
27464<para>
27465   Check the link, then figure out the current state
27466   by comparing what we advertise with what the link partner
27467   advertises.  Start by checking the gigabit possibilities,
27468   then move on to 10/100.
27469</para>
27470</refsect1>
27471</refentry>
27472
27473<refentry id="API-genphy-soft-reset">
27474<refentryinfo>
27475 <title>LINUX</title>
27476 <productname>Kernel Hackers Manual</productname>
27477 <date>July 2017</date>
27478</refentryinfo>
27479<refmeta>
27480 <refentrytitle><phrase>genphy_soft_reset</phrase></refentrytitle>
27481 <manvolnum>9</manvolnum>
27482 <refmiscinfo class="version">4.1.27</refmiscinfo>
27483</refmeta>
27484<refnamediv>
27485 <refname>genphy_soft_reset</refname>
27486 <refpurpose>
27487     software reset the PHY via BMCR_RESET bit
27488 </refpurpose>
27489</refnamediv>
27490<refsynopsisdiv>
27491 <title>Synopsis</title>
27492  <funcsynopsis><funcprototype>
27493   <funcdef>int <function>genphy_soft_reset </function></funcdef>
27494   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27495  </funcprototype></funcsynopsis>
27496</refsynopsisdiv>
27497<refsect1>
27498 <title>Arguments</title>
27499 <variablelist>
27500  <varlistentry>
27501   <term><parameter>phydev</parameter></term>
27502   <listitem>
27503    <para>
27504     target phy_device struct
27505    </para>
27506   </listitem>
27507  </varlistentry>
27508 </variablelist>
27509</refsect1>
27510<refsect1>
27511<title>Description</title>
27512<para>
27513   Perform a software PHY reset using the standard
27514   BMCR_RESET bit and poll for the reset bit to be cleared.
27515</para>
27516</refsect1>
27517<refsect1>
27518<title>Returns</title>
27519<para>
27520   0 on success, &lt; 0 on failure
27521</para>
27522</refsect1>
27523</refentry>
27524
27525<refentry id="API-phy-driver-register">
27526<refentryinfo>
27527 <title>LINUX</title>
27528 <productname>Kernel Hackers Manual</productname>
27529 <date>July 2017</date>
27530</refentryinfo>
27531<refmeta>
27532 <refentrytitle><phrase>phy_driver_register</phrase></refentrytitle>
27533 <manvolnum>9</manvolnum>
27534 <refmiscinfo class="version">4.1.27</refmiscinfo>
27535</refmeta>
27536<refnamediv>
27537 <refname>phy_driver_register</refname>
27538 <refpurpose>
27539     register a phy_driver with the PHY layer
27540 </refpurpose>
27541</refnamediv>
27542<refsynopsisdiv>
27543 <title>Synopsis</title>
27544  <funcsynopsis><funcprototype>
27545   <funcdef>int <function>phy_driver_register </function></funcdef>
27546   <paramdef>struct phy_driver * <parameter>new_driver</parameter></paramdef>
27547  </funcprototype></funcsynopsis>
27548</refsynopsisdiv>
27549<refsect1>
27550 <title>Arguments</title>
27551 <variablelist>
27552  <varlistentry>
27553   <term><parameter>new_driver</parameter></term>
27554   <listitem>
27555    <para>
27556     new phy_driver to register
27557    </para>
27558   </listitem>
27559  </varlistentry>
27560 </variablelist>
27561</refsect1>
27562</refentry>
27563
27564<!-- drivers/net/phy/phy_device.c -->
27565<refentry id="API-get-phy-c45-ids">
27566<refentryinfo>
27567 <title>LINUX</title>
27568 <productname>Kernel Hackers Manual</productname>
27569 <date>July 2017</date>
27570</refentryinfo>
27571<refmeta>
27572 <refentrytitle><phrase>get_phy_c45_ids</phrase></refentrytitle>
27573 <manvolnum>9</manvolnum>
27574 <refmiscinfo class="version">4.1.27</refmiscinfo>
27575</refmeta>
27576<refnamediv>
27577 <refname>get_phy_c45_ids</refname>
27578 <refpurpose>
27579  reads the specified addr for its 802.3-c45 IDs.
27580 </refpurpose>
27581</refnamediv>
27582<refsynopsisdiv>
27583 <title>Synopsis</title>
27584  <funcsynopsis><funcprototype>
27585   <funcdef>int <function>get_phy_c45_ids </function></funcdef>
27586   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
27587   <paramdef>int <parameter>addr</parameter></paramdef>
27588   <paramdef>u32 * <parameter>phy_id</parameter></paramdef>
27589   <paramdef>struct phy_c45_device_ids * <parameter>c45_ids</parameter></paramdef>
27590  </funcprototype></funcsynopsis>
27591</refsynopsisdiv>
27592<refsect1>
27593 <title>Arguments</title>
27594 <variablelist>
27595  <varlistentry>
27596   <term><parameter>bus</parameter></term>
27597   <listitem>
27598    <para>
27599     the target MII bus
27600    </para>
27601   </listitem>
27602  </varlistentry>
27603  <varlistentry>
27604   <term><parameter>addr</parameter></term>
27605   <listitem>
27606    <para>
27607     PHY address on the MII bus
27608    </para>
27609   </listitem>
27610  </varlistentry>
27611  <varlistentry>
27612   <term><parameter>phy_id</parameter></term>
27613   <listitem>
27614    <para>
27615     where to store the ID retrieved.
27616    </para>
27617   </listitem>
27618  </varlistentry>
27619  <varlistentry>
27620   <term><parameter>c45_ids</parameter></term>
27621   <listitem>
27622    <para>
27623     where to store the c45 ID information.
27624    </para>
27625   </listitem>
27626  </varlistentry>
27627 </variablelist>
27628</refsect1>
27629<refsect1>
27630<title>Description</title>
27631<para>
27632   If the PHY devices-in-package appears to be valid, it and the
27633   corresponding identifiers are stored in <parameter>c45_ids</parameter>, zero is stored
27634   in <parameter>phy_id</parameter>.  Otherwise 0xffffffff is stored in <parameter>phy_id</parameter>.  Returns
27635   zero on success.
27636</para>
27637</refsect1>
27638</refentry>
27639
27640<refentry id="API-get-phy-id">
27641<refentryinfo>
27642 <title>LINUX</title>
27643 <productname>Kernel Hackers Manual</productname>
27644 <date>July 2017</date>
27645</refentryinfo>
27646<refmeta>
27647 <refentrytitle><phrase>get_phy_id</phrase></refentrytitle>
27648 <manvolnum>9</manvolnum>
27649 <refmiscinfo class="version">4.1.27</refmiscinfo>
27650</refmeta>
27651<refnamediv>
27652 <refname>get_phy_id</refname>
27653 <refpurpose>
27654     reads the specified addr for its ID.
27655 </refpurpose>
27656</refnamediv>
27657<refsynopsisdiv>
27658 <title>Synopsis</title>
27659  <funcsynopsis><funcprototype>
27660   <funcdef>int <function>get_phy_id </function></funcdef>
27661   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
27662   <paramdef>int <parameter>addr</parameter></paramdef>
27663   <paramdef>u32 * <parameter>phy_id</parameter></paramdef>
27664   <paramdef>bool <parameter>is_c45</parameter></paramdef>
27665   <paramdef>struct phy_c45_device_ids * <parameter>c45_ids</parameter></paramdef>
27666  </funcprototype></funcsynopsis>
27667</refsynopsisdiv>
27668<refsect1>
27669 <title>Arguments</title>
27670 <variablelist>
27671  <varlistentry>
27672   <term><parameter>bus</parameter></term>
27673   <listitem>
27674    <para>
27675     the target MII bus
27676    </para>
27677   </listitem>
27678  </varlistentry>
27679  <varlistentry>
27680   <term><parameter>addr</parameter></term>
27681   <listitem>
27682    <para>
27683     PHY address on the MII bus
27684    </para>
27685   </listitem>
27686  </varlistentry>
27687  <varlistentry>
27688   <term><parameter>phy_id</parameter></term>
27689   <listitem>
27690    <para>
27691     where to store the ID retrieved.
27692    </para>
27693   </listitem>
27694  </varlistentry>
27695  <varlistentry>
27696   <term><parameter>is_c45</parameter></term>
27697   <listitem>
27698    <para>
27699     If true the PHY uses the 802.3 clause 45 protocol
27700    </para>
27701   </listitem>
27702  </varlistentry>
27703  <varlistentry>
27704   <term><parameter>c45_ids</parameter></term>
27705   <listitem>
27706    <para>
27707     where to store the c45 ID information.
27708    </para>
27709   </listitem>
27710  </varlistentry>
27711 </variablelist>
27712</refsect1>
27713<refsect1>
27714<title>Description</title>
27715<para>
27716   In the case of a 802.3-c22 PHY, reads the ID registers
27717   of the PHY at <parameter>addr</parameter> on the <parameter>bus</parameter>, stores it in <parameter>phy_id</parameter> and returns
27718   zero on success.
27719   </para><para>
27720
27721   In the case of a 802.3-c45 PHY, <function>get_phy_c45_ids</function> is invoked, and
27722   its return value is in turn returned.
27723</para>
27724</refsect1>
27725</refentry>
27726
27727<refentry id="API-phy-prepare-link">
27728<refentryinfo>
27729 <title>LINUX</title>
27730 <productname>Kernel Hackers Manual</productname>
27731 <date>July 2017</date>
27732</refentryinfo>
27733<refmeta>
27734 <refentrytitle><phrase>phy_prepare_link</phrase></refentrytitle>
27735 <manvolnum>9</manvolnum>
27736 <refmiscinfo class="version">4.1.27</refmiscinfo>
27737</refmeta>
27738<refnamediv>
27739 <refname>phy_prepare_link</refname>
27740 <refpurpose>
27741     prepares the PHY layer to monitor link status
27742 </refpurpose>
27743</refnamediv>
27744<refsynopsisdiv>
27745 <title>Synopsis</title>
27746  <funcsynopsis><funcprototype>
27747   <funcdef>void <function>phy_prepare_link </function></funcdef>
27748   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27749   <paramdef>void (*<parameter>handler</parameter>)
27750     <funcparams>struct net_device *</funcparams></paramdef>
27751  </funcprototype></funcsynopsis>
27752</refsynopsisdiv>
27753<refsect1>
27754 <title>Arguments</title>
27755 <variablelist>
27756  <varlistentry>
27757   <term><parameter>phydev</parameter></term>
27758   <listitem>
27759    <para>
27760     target phy_device struct
27761    </para>
27762   </listitem>
27763  </varlistentry>
27764  <varlistentry>
27765   <term><parameter>handler</parameter></term>
27766   <listitem>
27767    <para>
27768     callback function for link status change notifications
27769    </para>
27770   </listitem>
27771  </varlistentry>
27772 </variablelist>
27773</refsect1>
27774<refsect1>
27775<title>Description</title>
27776<para>
27777   Tells the PHY infrastructure to handle the
27778   gory details on monitoring link status (whether through
27779   polling or an interrupt), and to call back to the
27780   connected device driver when the link status changes.
27781   If you want to monitor your own link state, don't call
27782   this function.
27783</para>
27784</refsect1>
27785</refentry>
27786
27787<refentry id="API-phy-poll-reset">
27788<refentryinfo>
27789 <title>LINUX</title>
27790 <productname>Kernel Hackers Manual</productname>
27791 <date>July 2017</date>
27792</refentryinfo>
27793<refmeta>
27794 <refentrytitle><phrase>phy_poll_reset</phrase></refentrytitle>
27795 <manvolnum>9</manvolnum>
27796 <refmiscinfo class="version">4.1.27</refmiscinfo>
27797</refmeta>
27798<refnamediv>
27799 <refname>phy_poll_reset</refname>
27800 <refpurpose>
27801     Safely wait until a PHY reset has properly completed
27802 </refpurpose>
27803</refnamediv>
27804<refsynopsisdiv>
27805 <title>Synopsis</title>
27806  <funcsynopsis><funcprototype>
27807   <funcdef>int <function>phy_poll_reset </function></funcdef>
27808   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27809  </funcprototype></funcsynopsis>
27810</refsynopsisdiv>
27811<refsect1>
27812 <title>Arguments</title>
27813 <variablelist>
27814  <varlistentry>
27815   <term><parameter>phydev</parameter></term>
27816   <listitem>
27817    <para>
27818     The PHY device to poll
27819    </para>
27820   </listitem>
27821  </varlistentry>
27822 </variablelist>
27823</refsect1>
27824<refsect1>
27825<title>Description</title>
27826<para>
27827   According to IEEE 802.3, Section 2, Subsection 22.2.4.1.1, as
27828   published in 2008, a PHY reset may take up to 0.5 seconds.  The MII BMCR
27829   register must be polled until the BMCR_RESET bit clears.
27830   </para><para>
27831
27832   Furthermore, any attempts to write to PHY registers may have no effect
27833   or even generate MDIO bus errors until this is complete.
27834   </para><para>
27835
27836   Some PHYs (such as the Marvell 88E1111) don't entirely conform to the
27837   standard and do not fully reset after the BMCR_RESET bit is set, and may
27838   even *REQUIRE* a soft-reset to properly restart autonegotiation.  In an
27839   effort to support such broken PHYs, this function is separate from the
27840   standard <function>phy_init_hw</function> which will zero all the other bits in the BMCR
27841   and reapply all driver-specific and board-specific fixups.
27842</para>
27843</refsect1>
27844</refentry>
27845
27846<refentry id="API-genphy-config-advert">
27847<refentryinfo>
27848 <title>LINUX</title>
27849 <productname>Kernel Hackers Manual</productname>
27850 <date>July 2017</date>
27851</refentryinfo>
27852<refmeta>
27853 <refentrytitle><phrase>genphy_config_advert</phrase></refentrytitle>
27854 <manvolnum>9</manvolnum>
27855 <refmiscinfo class="version">4.1.27</refmiscinfo>
27856</refmeta>
27857<refnamediv>
27858 <refname>genphy_config_advert</refname>
27859 <refpurpose>
27860     sanitize and advertise auto-negotiation parameters
27861 </refpurpose>
27862</refnamediv>
27863<refsynopsisdiv>
27864 <title>Synopsis</title>
27865  <funcsynopsis><funcprototype>
27866   <funcdef>int <function>genphy_config_advert </function></funcdef>
27867   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
27868  </funcprototype></funcsynopsis>
27869</refsynopsisdiv>
27870<refsect1>
27871 <title>Arguments</title>
27872 <variablelist>
27873  <varlistentry>
27874   <term><parameter>phydev</parameter></term>
27875   <listitem>
27876    <para>
27877     target phy_device struct
27878    </para>
27879   </listitem>
27880  </varlistentry>
27881 </variablelist>
27882</refsect1>
27883<refsect1>
27884<title>Description</title>
27885<para>
27886   Writes MII_ADVERTISE with the appropriate values,
27887   after sanitizing the values to make sure we only advertise
27888   what is supported.  Returns &lt; 0 on error, 0 if the PHY's advertisement
27889   hasn't changed, and &gt; 0 if it has changed.
27890</para>
27891</refsect1>
27892</refentry>
27893
27894<refentry id="API-phy-probe">
27895<refentryinfo>
27896 <title>LINUX</title>
27897 <productname>Kernel Hackers Manual</productname>
27898 <date>July 2017</date>
27899</refentryinfo>
27900<refmeta>
27901 <refentrytitle><phrase>phy_probe</phrase></refentrytitle>
27902 <manvolnum>9</manvolnum>
27903 <refmiscinfo class="version">4.1.27</refmiscinfo>
27904</refmeta>
27905<refnamediv>
27906 <refname>phy_probe</refname>
27907 <refpurpose>
27908     probe and init a PHY device
27909 </refpurpose>
27910</refnamediv>
27911<refsynopsisdiv>
27912 <title>Synopsis</title>
27913  <funcsynopsis><funcprototype>
27914   <funcdef>int <function>phy_probe </function></funcdef>
27915   <paramdef>struct device * <parameter>dev</parameter></paramdef>
27916  </funcprototype></funcsynopsis>
27917</refsynopsisdiv>
27918<refsect1>
27919 <title>Arguments</title>
27920 <variablelist>
27921  <varlistentry>
27922   <term><parameter>dev</parameter></term>
27923   <listitem>
27924    <para>
27925     device to probe and init
27926    </para>
27927   </listitem>
27928  </varlistentry>
27929 </variablelist>
27930</refsect1>
27931<refsect1>
27932<title>Description</title>
27933<para>
27934   Take care of setting up the phy_device structure,
27935   set the state to READY (the driver's init function should
27936   set it to STARTING if needed).
27937</para>
27938</refsect1>
27939</refentry>
27940
27941<!-- drivers/net/phy/mdio_bus.c -->
27942<refentry id="API-mdiobus-alloc-size">
27943<refentryinfo>
27944 <title>LINUX</title>
27945 <productname>Kernel Hackers Manual</productname>
27946 <date>July 2017</date>
27947</refentryinfo>
27948<refmeta>
27949 <refentrytitle><phrase>mdiobus_alloc_size</phrase></refentrytitle>
27950 <manvolnum>9</manvolnum>
27951 <refmiscinfo class="version">4.1.27</refmiscinfo>
27952</refmeta>
27953<refnamediv>
27954 <refname>mdiobus_alloc_size</refname>
27955 <refpurpose>
27956  allocate a mii_bus structure
27957 </refpurpose>
27958</refnamediv>
27959<refsynopsisdiv>
27960 <title>Synopsis</title>
27961  <funcsynopsis><funcprototype>
27962   <funcdef>struct mii_bus * <function>mdiobus_alloc_size </function></funcdef>
27963   <paramdef>size_t <parameter>size</parameter></paramdef>
27964  </funcprototype></funcsynopsis>
27965</refsynopsisdiv>
27966<refsect1>
27967 <title>Arguments</title>
27968 <variablelist>
27969  <varlistentry>
27970   <term><parameter>size</parameter></term>
27971   <listitem>
27972    <para>
27973     extra amount of memory to allocate for private storage.
27974     If non-zero, then bus-&gt;priv is points to that memory.
27975    </para>
27976   </listitem>
27977  </varlistentry>
27978 </variablelist>
27979</refsect1>
27980<refsect1>
27981<title>Description</title>
27982<para>
27983   called by a bus driver to allocate an mii_bus
27984   structure to fill in.
27985</para>
27986</refsect1>
27987</refentry>
27988
27989<refentry id="API-devm-mdiobus-alloc-size">
27990<refentryinfo>
27991 <title>LINUX</title>
27992 <productname>Kernel Hackers Manual</productname>
27993 <date>July 2017</date>
27994</refentryinfo>
27995<refmeta>
27996 <refentrytitle><phrase>devm_mdiobus_alloc_size</phrase></refentrytitle>
27997 <manvolnum>9</manvolnum>
27998 <refmiscinfo class="version">4.1.27</refmiscinfo>
27999</refmeta>
28000<refnamediv>
28001 <refname>devm_mdiobus_alloc_size</refname>
28002 <refpurpose>
28003     Resource-managed <function>mdiobus_alloc_size</function>
28004 </refpurpose>
28005</refnamediv>
28006<refsynopsisdiv>
28007 <title>Synopsis</title>
28008  <funcsynopsis><funcprototype>
28009   <funcdef>struct mii_bus * <function>devm_mdiobus_alloc_size </function></funcdef>
28010   <paramdef>struct device * <parameter>dev</parameter></paramdef>
28011   <paramdef>int <parameter>sizeof_priv</parameter></paramdef>
28012  </funcprototype></funcsynopsis>
28013</refsynopsisdiv>
28014<refsect1>
28015 <title>Arguments</title>
28016 <variablelist>
28017  <varlistentry>
28018   <term><parameter>dev</parameter></term>
28019   <listitem>
28020    <para>
28021     Device to allocate mii_bus for
28022    </para>
28023   </listitem>
28024  </varlistentry>
28025  <varlistentry>
28026   <term><parameter>sizeof_priv</parameter></term>
28027   <listitem>
28028    <para>
28029     Space to allocate for private structure.
28030    </para>
28031   </listitem>
28032  </varlistentry>
28033 </variablelist>
28034</refsect1>
28035<refsect1>
28036<title>Description</title>
28037<para>
28038   Managed mdiobus_alloc_size. mii_bus allocated with this function is
28039   automatically freed on driver detach.
28040   </para><para>
28041
28042   If an mii_bus allocated with this function needs to be freed separately,
28043   <function>devm_mdiobus_free</function> must be used.
28044</para>
28045</refsect1>
28046<refsect1>
28047<title>RETURNS</title>
28048<para>
28049   Pointer to allocated mii_bus on success, NULL on failure.
28050</para>
28051</refsect1>
28052</refentry>
28053
28054<refentry id="API-devm-mdiobus-free">
28055<refentryinfo>
28056 <title>LINUX</title>
28057 <productname>Kernel Hackers Manual</productname>
28058 <date>July 2017</date>
28059</refentryinfo>
28060<refmeta>
28061 <refentrytitle><phrase>devm_mdiobus_free</phrase></refentrytitle>
28062 <manvolnum>9</manvolnum>
28063 <refmiscinfo class="version">4.1.27</refmiscinfo>
28064</refmeta>
28065<refnamediv>
28066 <refname>devm_mdiobus_free</refname>
28067 <refpurpose>
28068     Resource-managed <function>mdiobus_free</function>
28069 </refpurpose>
28070</refnamediv>
28071<refsynopsisdiv>
28072 <title>Synopsis</title>
28073  <funcsynopsis><funcprototype>
28074   <funcdef>void <function>devm_mdiobus_free </function></funcdef>
28075   <paramdef>struct device * <parameter>dev</parameter></paramdef>
28076   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
28077  </funcprototype></funcsynopsis>
28078</refsynopsisdiv>
28079<refsect1>
28080 <title>Arguments</title>
28081 <variablelist>
28082  <varlistentry>
28083   <term><parameter>dev</parameter></term>
28084   <listitem>
28085    <para>
28086     Device this mii_bus belongs to
28087    </para>
28088   </listitem>
28089  </varlistentry>
28090  <varlistentry>
28091   <term><parameter>bus</parameter></term>
28092   <listitem>
28093    <para>
28094     the mii_bus associated with the device
28095    </para>
28096   </listitem>
28097  </varlistentry>
28098 </variablelist>
28099</refsect1>
28100<refsect1>
28101<title>Description</title>
28102<para>
28103   Free mii_bus allocated with <function>devm_mdiobus_alloc_size</function>.
28104</para>
28105</refsect1>
28106</refentry>
28107
28108<refentry id="API-of-mdio-find-bus">
28109<refentryinfo>
28110 <title>LINUX</title>
28111 <productname>Kernel Hackers Manual</productname>
28112 <date>July 2017</date>
28113</refentryinfo>
28114<refmeta>
28115 <refentrytitle><phrase>of_mdio_find_bus</phrase></refentrytitle>
28116 <manvolnum>9</manvolnum>
28117 <refmiscinfo class="version">4.1.27</refmiscinfo>
28118</refmeta>
28119<refnamediv>
28120 <refname>of_mdio_find_bus</refname>
28121 <refpurpose>
28122     Given an mii_bus node, find the mii_bus.
28123 </refpurpose>
28124</refnamediv>
28125<refsynopsisdiv>
28126 <title>Synopsis</title>
28127  <funcsynopsis><funcprototype>
28128   <funcdef>struct mii_bus * <function>of_mdio_find_bus </function></funcdef>
28129   <paramdef>struct device_node * <parameter>mdio_bus_np</parameter></paramdef>
28130  </funcprototype></funcsynopsis>
28131</refsynopsisdiv>
28132<refsect1>
28133 <title>Arguments</title>
28134 <variablelist>
28135  <varlistentry>
28136   <term><parameter>mdio_bus_np</parameter></term>
28137   <listitem>
28138    <para>
28139     Pointer to the mii_bus.
28140    </para>
28141   </listitem>
28142  </varlistentry>
28143 </variablelist>
28144</refsect1>
28145<refsect1>
28146<title>Description</title>
28147<para>
28148   Returns a pointer to the mii_bus, or NULL if none found.
28149   </para><para>
28150
28151   Because the association of a device_node and mii_bus is made via
28152   <function>of_mdiobus_register</function>, the mii_bus cannot be found before it is
28153   registered with <function>of_mdiobus_register</function>.
28154</para>
28155</refsect1>
28156</refentry>
28157
28158<refentry id="API-mdiobus-register">
28159<refentryinfo>
28160 <title>LINUX</title>
28161 <productname>Kernel Hackers Manual</productname>
28162 <date>July 2017</date>
28163</refentryinfo>
28164<refmeta>
28165 <refentrytitle><phrase>mdiobus_register</phrase></refentrytitle>
28166 <manvolnum>9</manvolnum>
28167 <refmiscinfo class="version">4.1.27</refmiscinfo>
28168</refmeta>
28169<refnamediv>
28170 <refname>mdiobus_register</refname>
28171 <refpurpose>
28172     bring up all the PHYs on a given bus and attach them to bus
28173 </refpurpose>
28174</refnamediv>
28175<refsynopsisdiv>
28176 <title>Synopsis</title>
28177  <funcsynopsis><funcprototype>
28178   <funcdef>int <function>mdiobus_register </function></funcdef>
28179   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
28180  </funcprototype></funcsynopsis>
28181</refsynopsisdiv>
28182<refsect1>
28183 <title>Arguments</title>
28184 <variablelist>
28185  <varlistentry>
28186   <term><parameter>bus</parameter></term>
28187   <listitem>
28188    <para>
28189     target mii_bus
28190    </para>
28191   </listitem>
28192  </varlistentry>
28193 </variablelist>
28194</refsect1>
28195<refsect1>
28196<title>Description</title>
28197<para>
28198   Called by a bus driver to bring up all the PHYs
28199   on a given bus, and attach them to the bus.
28200   </para><para>
28201
28202   Returns 0 on success or &lt; 0 on error.
28203</para>
28204</refsect1>
28205</refentry>
28206
28207<refentry id="API-mdiobus-free">
28208<refentryinfo>
28209 <title>LINUX</title>
28210 <productname>Kernel Hackers Manual</productname>
28211 <date>July 2017</date>
28212</refentryinfo>
28213<refmeta>
28214 <refentrytitle><phrase>mdiobus_free</phrase></refentrytitle>
28215 <manvolnum>9</manvolnum>
28216 <refmiscinfo class="version">4.1.27</refmiscinfo>
28217</refmeta>
28218<refnamediv>
28219 <refname>mdiobus_free</refname>
28220 <refpurpose>
28221     free a struct mii_bus
28222 </refpurpose>
28223</refnamediv>
28224<refsynopsisdiv>
28225 <title>Synopsis</title>
28226  <funcsynopsis><funcprototype>
28227   <funcdef>void <function>mdiobus_free </function></funcdef>
28228   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
28229  </funcprototype></funcsynopsis>
28230</refsynopsisdiv>
28231<refsect1>
28232 <title>Arguments</title>
28233 <variablelist>
28234  <varlistentry>
28235   <term><parameter>bus</parameter></term>
28236   <listitem>
28237    <para>
28238     mii_bus to free
28239    </para>
28240   </listitem>
28241  </varlistentry>
28242 </variablelist>
28243</refsect1>
28244<refsect1>
28245<title>Description</title>
28246<para>
28247   This function releases the reference to the underlying device
28248   object in the mii_bus.  If this is the last reference, the mii_bus
28249   will be freed.
28250</para>
28251</refsect1>
28252</refentry>
28253
28254<refentry id="API-mdiobus-read">
28255<refentryinfo>
28256 <title>LINUX</title>
28257 <productname>Kernel Hackers Manual</productname>
28258 <date>July 2017</date>
28259</refentryinfo>
28260<refmeta>
28261 <refentrytitle><phrase>mdiobus_read</phrase></refentrytitle>
28262 <manvolnum>9</manvolnum>
28263 <refmiscinfo class="version">4.1.27</refmiscinfo>
28264</refmeta>
28265<refnamediv>
28266 <refname>mdiobus_read</refname>
28267 <refpurpose>
28268     Convenience function for reading a given MII mgmt register
28269 </refpurpose>
28270</refnamediv>
28271<refsynopsisdiv>
28272 <title>Synopsis</title>
28273  <funcsynopsis><funcprototype>
28274   <funcdef>int <function>mdiobus_read </function></funcdef>
28275   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
28276   <paramdef>int <parameter>addr</parameter></paramdef>
28277   <paramdef>u32 <parameter>regnum</parameter></paramdef>
28278  </funcprototype></funcsynopsis>
28279</refsynopsisdiv>
28280<refsect1>
28281 <title>Arguments</title>
28282 <variablelist>
28283  <varlistentry>
28284   <term><parameter>bus</parameter></term>
28285   <listitem>
28286    <para>
28287     the mii_bus struct
28288    </para>
28289   </listitem>
28290  </varlistentry>
28291  <varlistentry>
28292   <term><parameter>addr</parameter></term>
28293   <listitem>
28294    <para>
28295     the phy address
28296    </para>
28297   </listitem>
28298  </varlistentry>
28299  <varlistentry>
28300   <term><parameter>regnum</parameter></term>
28301   <listitem>
28302    <para>
28303     register number to read
28304    </para>
28305   </listitem>
28306  </varlistentry>
28307 </variablelist>
28308</refsect1>
28309<refsect1>
28310<title>NOTE</title>
28311<para>
28312   MUST NOT be called from interrupt context,
28313   because the bus read/write functions may wait for an interrupt
28314   to conclude the operation.
28315</para>
28316</refsect1>
28317</refentry>
28318
28319<refentry id="API-mdiobus-write">
28320<refentryinfo>
28321 <title>LINUX</title>
28322 <productname>Kernel Hackers Manual</productname>
28323 <date>July 2017</date>
28324</refentryinfo>
28325<refmeta>
28326 <refentrytitle><phrase>mdiobus_write</phrase></refentrytitle>
28327 <manvolnum>9</manvolnum>
28328 <refmiscinfo class="version">4.1.27</refmiscinfo>
28329</refmeta>
28330<refnamediv>
28331 <refname>mdiobus_write</refname>
28332 <refpurpose>
28333     Convenience function for writing a given MII mgmt register
28334 </refpurpose>
28335</refnamediv>
28336<refsynopsisdiv>
28337 <title>Synopsis</title>
28338  <funcsynopsis><funcprototype>
28339   <funcdef>int <function>mdiobus_write </function></funcdef>
28340   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
28341   <paramdef>int <parameter>addr</parameter></paramdef>
28342   <paramdef>u32 <parameter>regnum</parameter></paramdef>
28343   <paramdef>u16 <parameter>val</parameter></paramdef>
28344  </funcprototype></funcsynopsis>
28345</refsynopsisdiv>
28346<refsect1>
28347 <title>Arguments</title>
28348 <variablelist>
28349  <varlistentry>
28350   <term><parameter>bus</parameter></term>
28351   <listitem>
28352    <para>
28353     the mii_bus struct
28354    </para>
28355   </listitem>
28356  </varlistentry>
28357  <varlistentry>
28358   <term><parameter>addr</parameter></term>
28359   <listitem>
28360    <para>
28361     the phy address
28362    </para>
28363   </listitem>
28364  </varlistentry>
28365  <varlistentry>
28366   <term><parameter>regnum</parameter></term>
28367   <listitem>
28368    <para>
28369     register number to write
28370    </para>
28371   </listitem>
28372  </varlistentry>
28373  <varlistentry>
28374   <term><parameter>val</parameter></term>
28375   <listitem>
28376    <para>
28377     value to write to <parameter>regnum</parameter>
28378    </para>
28379   </listitem>
28380  </varlistentry>
28381 </variablelist>
28382</refsect1>
28383<refsect1>
28384<title>NOTE</title>
28385<para>
28386   MUST NOT be called from interrupt context,
28387   because the bus read/write functions may wait for an interrupt
28388   to conclude the operation.
28389</para>
28390</refsect1>
28391</refentry>
28392
28393<!-- drivers/net/phy/mdio_bus.c -->
28394<refentry id="API-mdiobus-release">
28395<refentryinfo>
28396 <title>LINUX</title>
28397 <productname>Kernel Hackers Manual</productname>
28398 <date>July 2017</date>
28399</refentryinfo>
28400<refmeta>
28401 <refentrytitle><phrase>mdiobus_release</phrase></refentrytitle>
28402 <manvolnum>9</manvolnum>
28403 <refmiscinfo class="version">4.1.27</refmiscinfo>
28404</refmeta>
28405<refnamediv>
28406 <refname>mdiobus_release</refname>
28407 <refpurpose>
28408  mii_bus device release callback
28409 </refpurpose>
28410</refnamediv>
28411<refsynopsisdiv>
28412 <title>Synopsis</title>
28413  <funcsynopsis><funcprototype>
28414   <funcdef>void <function>mdiobus_release </function></funcdef>
28415   <paramdef>struct device * <parameter>d</parameter></paramdef>
28416  </funcprototype></funcsynopsis>
28417</refsynopsisdiv>
28418<refsect1>
28419 <title>Arguments</title>
28420 <variablelist>
28421  <varlistentry>
28422   <term><parameter>d</parameter></term>
28423   <listitem>
28424    <para>
28425     the target struct device that contains the mii_bus
28426    </para>
28427   </listitem>
28428  </varlistentry>
28429 </variablelist>
28430</refsect1>
28431<refsect1>
28432<title>Description</title>
28433<para>
28434   called when the last reference to an mii_bus is
28435   dropped, to free the underlying memory.
28436</para>
28437</refsect1>
28438</refentry>
28439
28440<refentry id="API-mdio-bus-match">
28441<refentryinfo>
28442 <title>LINUX</title>
28443 <productname>Kernel Hackers Manual</productname>
28444 <date>July 2017</date>
28445</refentryinfo>
28446<refmeta>
28447 <refentrytitle><phrase>mdio_bus_match</phrase></refentrytitle>
28448 <manvolnum>9</manvolnum>
28449 <refmiscinfo class="version">4.1.27</refmiscinfo>
28450</refmeta>
28451<refnamediv>
28452 <refname>mdio_bus_match</refname>
28453 <refpurpose>
28454     determine if given PHY driver supports the given PHY device
28455 </refpurpose>
28456</refnamediv>
28457<refsynopsisdiv>
28458 <title>Synopsis</title>
28459  <funcsynopsis><funcprototype>
28460   <funcdef>int <function>mdio_bus_match </function></funcdef>
28461   <paramdef>struct device * <parameter>dev</parameter></paramdef>
28462   <paramdef>struct device_driver * <parameter>drv</parameter></paramdef>
28463  </funcprototype></funcsynopsis>
28464</refsynopsisdiv>
28465<refsect1>
28466 <title>Arguments</title>
28467 <variablelist>
28468  <varlistentry>
28469   <term><parameter>dev</parameter></term>
28470   <listitem>
28471    <para>
28472     target PHY device
28473    </para>
28474   </listitem>
28475  </varlistentry>
28476  <varlistentry>
28477   <term><parameter>drv</parameter></term>
28478   <listitem>
28479    <para>
28480     given PHY driver
28481    </para>
28482   </listitem>
28483  </varlistentry>
28484 </variablelist>
28485</refsect1>
28486<refsect1>
28487<title>Description</title>
28488<para>
28489   Given a PHY device, and a PHY driver, return 1 if
28490   the driver supports the device.  Otherwise, return 0.
28491</para>
28492</refsect1>
28493</refentry>
28494
28495     </sect1>
28496<!-- FIXME: Removed for now since no structured comments in source
28497     <sect1><title>Wireless</title>
28498X!Enet/core/wireless.c
28499     </sect1>
28500-->
28501  </chapter>
28502
28503</book>
28504