<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>

<book id="LinuxNetworking">
 <bookinfo>
  <title>Linux Networking and Network Devices APIs</title>

  <legalnotice>
   <para>
     This documentation is free software; you can redistribute
     it and/or modify it under the terms of the GNU General Public
     License as published by the Free Software Foundation; either
     version 2 of the License, or (at your option) any later
     version.
   </para>

   <para>
     This program is distributed in the hope that it will be
     useful, but WITHOUT ANY WARRANTY; without even the implied
     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the GNU General Public License for more details.
   </para>

   <para>
     You should have received a copy of the GNU General Public
     License along with this program; if not, write to the Free
     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
     MA 02111-1307 USA
   </para>

   <para>
     For more details see the file COPYING in the source
     distribution of Linux.
   </para>
  </legalnotice>
 </bookinfo>

<toc></toc>

  <chapter id="netcore">
     <title>Linux Networking</title>
     <sect1><title>Networking Base Types</title>
<!-- include/linux/net.h -->
<refentry id="API-enum-sock-type">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>enum sock_type</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>enum sock_type</refname>
 <refpurpose>
  Socket types
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
enum sock_type {
  SOCK_STREAM,
  SOCK_DGRAM,
  SOCK_RAW,
  SOCK_RDM,
  SOCK_SEQPACKET,
  SOCK_DCCP,
  SOCK_PACKET
};  </programlisting>
</refsynopsisdiv>
<refsect1>
 <title>Constants</title>
  <variablelist>
    <varlistentry>      <term>SOCK_STREAM</term>
      <listitem><para>
stream (connection) socket
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>SOCK_DGRAM</term>
      <listitem><para>
datagram (conn.less) socket
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>SOCK_RAW</term>
      <listitem><para>
raw socket
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>SOCK_RDM</term>
      <listitem><para>
reliably-delivered message
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>SOCK_SEQPACKET</term>
      <listitem><para>
sequential packet socket
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>SOCK_DCCP</term>
      <listitem><para>
Datagram Congestion Control Protocol socket
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>SOCK_PACKET</term>
      <listitem><para>
linux specific way of getting packets at the dev level.
For writing rarp and other similar things on the user level.
      </para></listitem>
    </varlistentry>
  </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   When adding some new socket type please
   grep ARCH_HAS_SOCKET_TYPE include/asm-* /socket.h, at least MIPS
   overrides this enum for binary compat reasons.
</para>
</refsect1>
</refentry>

<refentry id="API-struct-socket">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct socket</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct socket</refname>
 <refpurpose>
     general BSD socket
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct socket {
  socket_state state;
  unsigned long flags;
  const struct proto_ops * ops;
  struct fasync_struct * fasync_list;
  struct file * file;
  struct sock * sk;
  wait_queue_head_t wait;
  short type;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>state</term>
      <listitem><para>
   socket state (<constant>SS_CONNECTED</constant>, etc)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>flags</term>
      <listitem><para>
   socket flags (<constant>SOCK_ASYNC_NOSPACE</constant>, etc)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>ops</term>
      <listitem><para>
   protocol specific socket operations
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>fasync_list</term>
      <listitem><para>
   Asynchronous wake up list
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>file</term>
      <listitem><para>
   File back pointer for gc
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk</term>
      <listitem><para>
   internal networking protocol agnostic socket representation
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>wait</term>
      <listitem><para>
   wait queue for several uses
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>type</term>
      <listitem><para>
   socket type (<constant>SOCK_STREAM</constant>, etc)
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
</refentry>

     </sect1>
     <sect1><title>Socket Buffer Functions</title>
<!-- include/linux/skbuff.h -->
<refentry id="API-struct-sk-buff">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct sk_buff</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct sk_buff</refname>
 <refpurpose>
  socket buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct sk_buff {
  struct sk_buff * next;
  struct sk_buff * prev;
  struct sock * sk;
  ktime_t tstamp;
  struct net_device * dev;
  struct dst_entry * dst;
  struct sec_path * sp;
  char cb[48];
  unsigned int len;
  unsigned int data_len;
  __u16 mac_len;
  __u16 hdr_len;
  union {unnamed_union};
  __u32 priority;
  __u8 local_df:1;
  __u8 cloned:1;
  __u8 ip_summed:2;
  __u8 nohdr:1;
  __u8 nfctinfo:3;
  __u8 pkt_type:3;
  __u8 fclone:2;
  __u8 ipvs_property:1;
  __u8 nf_trace:1;
  __be16 protocol;
  void (* destructor) (struct sk_buff *skb);
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
  struct nf_conntrack * nfct;
  struct sk_buff * nfct_reasm;
#endif
#ifdef CONFIG_BRIDGE_NETFILTER
  struct nf_bridge_info * nf_bridge;
#endif
  int iif;
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
  __u16 queue_mapping;
#endif
#ifdef CONFIG_NET_SCHED
  __u16 tc_index;
#ifdef CONFIG_NET_CLS_ACT
  __u16 tc_verd;
#endif
#endif
#ifdef CONFIG_NET_DMA
  dma_cookie_t dma_cookie;
#endif
#ifdef CONFIG_NETWORK_SECMARK
  __u32 secmark;
#endif
  __u32 mark;
  sk_buff_data_t transport_header;
  sk_buff_data_t network_header;
  sk_buff_data_t mac_header;
  sk_buff_data_t tail;
  sk_buff_data_t end;
  unsigned char * head;
  unsigned char * data;
  unsigned int truesize;
  atomic_t users;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>next</term>
      <listitem><para>
Next buffer in list
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>prev</term>
      <listitem><para>
Previous buffer in list
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk</term>
      <listitem><para>
Socket we are owned by
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>tstamp</term>
      <listitem><para>
Time we arrived
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>dev</term>
      <listitem><para>
Device we arrived on/are leaving by
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>dst</term>
      <listitem><para>
destination entry
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sp</term>
      <listitem><para>
the security path, used for xfrm
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>cb[48]</term>
      <listitem><para>
Control buffer. Free for use by every layer. Put private vars here
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>len</term>
      <listitem><para>
Length of actual data
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>data_len</term>
      <listitem><para>
Data length
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>mac_len</term>
      <listitem><para>
Length of link layer header
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>hdr_len</term>
      <listitem><para>
writable header length of cloned skb
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>{unnamed_union}</term>
      <listitem><para>
anonymous
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>priority</term>
      <listitem><para>
Packet queueing priority
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>local_df</term>
      <listitem><para>
allow local fragmentation
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>cloned</term>
      <listitem><para>
Head may be cloned (check refcnt to be sure)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>ip_summed</term>
      <listitem><para>
Driver fed us an IP checksum
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>nohdr</term>
      <listitem><para>
Payload reference only, must not modify header
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>nfctinfo</term>
      <listitem><para>
Relationship of this skb to the connection
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>pkt_type</term>
      <listitem><para>
Packet class
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>fclone</term>
      <listitem><para>
skbuff clone status
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>ipvs_property</term>
      <listitem><para>
skbuff is owned by ipvs
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>nf_trace</term>
      <listitem><para>
netfilter packet trace flag
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>protocol</term>
      <listitem><para>
Packet protocol from driver
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>destructor</term>
      <listitem><para>
Destruct function
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>nfct</term>
      <listitem><para>
Associated connection, if any
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>nfct_reasm</term>
      <listitem><para>
netfilter conntrack re-assembly pointer
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>nf_bridge</term>
      <listitem><para>
Saved data about a bridged frame - see br_netfilter.c
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>iif</term>
      <listitem><para>
ifindex of device we arrived on
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>queue_mapping</term>
      <listitem><para>
Queue mapping for multiqueue devices
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>tc_index</term>
      <listitem><para>
Traffic control index
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>tc_verd</term>
      <listitem><para>
traffic control verdict
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>dma_cookie</term>
      <listitem><para>
a cookie to one of several possible DMA operations
done by skb DMA functions
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>secmark</term>
      <listitem><para>
security marking
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>mark</term>
      <listitem><para>
Generic packet mark
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>transport_header</term>
      <listitem><para>
Transport layer header
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>network_header</term>
      <listitem><para>
Network layer header
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>mac_header</term>
      <listitem><para>
Link layer header
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>tail</term>
      <listitem><para>
Tail pointer
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>end</term>
      <listitem><para>
End pointer
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>head</term>
      <listitem><para>
Head of buffer
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>data</term>
      <listitem><para>
Data head pointer
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>truesize</term>
      <listitem><para>
Buffer size 
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>users</term>
      <listitem><para>
User count - see {datagram,tcp}.c
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
</refentry>

<refentry id="API-skb-queue-empty">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_queue_empty</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_queue_empty</refname>
 <refpurpose>
     check if a queue is empty
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_queue_empty </function></funcdef>
   <paramdef>const struct sk_buff_head * <parameter>list</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     queue head
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns true if the queue is empty, false otherwise.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-get">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_get</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_get</refname>
 <refpurpose>
     reference buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_get </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to reference
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Makes another reference to a socket buffer and returns a pointer
   to the buffer.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-cloned">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_cloned</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_cloned</refname>
 <refpurpose>
     is the buffer a clone
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_cloned </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns true if the buffer was generated with <function>skb_clone</function> and is
   one of multiple shared copies of the buffer. Cloned buffers are
   shared data so must not be written to under normal circumstances.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-header-cloned">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_header_cloned</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_header_cloned</refname>
 <refpurpose>
     is the header a clone
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_header_cloned </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns true if modifying the header part of the buffer requires
   the data to be copied.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-header-release">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_header_release</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_header_release</refname>
 <refpurpose>
     release reference to header
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_header_release </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to operate on
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Drop a reference to the header part of the buffer.  This is done
   by acquiring a payload reference.  You must not read from the header
   part of skb-&gt;data after this.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-shared">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_shared</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_shared</refname>
 <refpurpose>
     is the buffer shared
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_shared </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns true if more than one person has a reference to this
   buffer.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-share-check">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_share_check</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_share_check</refname>
 <refpurpose>
     check if buffer is shared and if so clone it
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_share_check </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>gfp_t <parameter>pri</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>pri</parameter></term>
   <listitem>
    <para>
     priority for memory allocation
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If the buffer is shared the buffer is cloned and the old copy
   drops a reference. A new clone with a single reference is returned.
   If the buffer is not shared the original buffer is returned. When
   being called from interrupt status or with spinlocks held pri must
   be GFP_ATOMIC.
   </para><para>

   NULL is returned on a memory allocation failure.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-unshare">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_unshare</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_unshare</refname>
 <refpurpose>
     make a copy of a shared buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_unshare </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>gfp_t <parameter>pri</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>pri</parameter></term>
   <listitem>
    <para>
     priority for memory allocation
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If the socket buffer is a clone then this function creates a new
   copy of the data, drops a reference count on the old copy and returns
   the new copy with the reference count at 1. If the buffer is not a clone
   the original buffer is returned. When called with a spinlock held or
   from interrupt state <parameter>pri</parameter> must be <constant>GFP_ATOMIC</constant>
   </para><para>

   <constant>NULL</constant> is returned on a memory allocation failure.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-peek">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_peek</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_peek</refname>
 <refpurpose>
   </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_peek </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list_</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list_</parameter></term>
   <listitem>
    <para>
     list to peek at
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Peek an <structname>sk_buff</structname>. Unlike most other operations you _MUST_
   be careful with this one. A peek leaves the buffer on the
   list and someone else may run off with it. You must hold
   the appropriate locks or have a private queue to do this.
   </para><para>

   Returns <constant>NULL</constant> for an empty list or a pointer to the head element.
   The reference count is not incremented and the reference is therefore
   volatile. Use with caution.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-peek-tail">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_peek_tail</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_peek_tail</refname>
 <refpurpose>
   </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_peek_tail </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list_</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list_</parameter></term>
   <listitem>
    <para>
     list to peek at
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Peek an <structname>sk_buff</structname>. Unlike most other operations you _MUST_
   be careful with this one. A peek leaves the buffer on the
   list and someone else may run off with it. You must hold
   the appropriate locks or have a private queue to do this.
   </para><para>

   Returns <constant>NULL</constant> for an empty list or a pointer to the tail element.
   The reference count is not incremented and the reference is therefore
   volatile. Use with caution.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-queue-len">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_queue_len</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_queue_len</refname>
 <refpurpose>
     get queue length
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>__u32 <function>skb_queue_len </function></funcdef>
   <paramdef>const struct sk_buff_head * <parameter>list_</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list_</parameter></term>
   <listitem>
    <para>
     list to measure
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return the length of an <structname>sk_buff</structname> queue.
</para>
</refsect1>
</refentry>

<refentry id="API---skb-queue-after">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__skb_queue_after</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__skb_queue_after</refname>
 <refpurpose>
     queue a buffer at the list head
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>__skb_queue_after </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>prev</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to use
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>prev</parameter></term>
   <listitem>
    <para>
     place after this buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>newsk</parameter></term>
   <listitem>
    <para>
     buffer to queue
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Queue a buffer int the middle of a list. This function takes no locks
   and you must therefore hold required locks before calling it.
   </para><para>

   A buffer cannot be placed on two lists at the same time.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-put">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_put</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_put</refname>
 <refpurpose>
     add data to a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned char * <function>skb_put </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to use
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     amount of data to add
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function extends the used data area of the buffer. If this would
   exceed the total buffer size the kernel will panic. A pointer to the
   first byte of the extra data is returned.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-push">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_push</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_push</refname>
 <refpurpose>
     add data to the start of a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned char * <function>skb_push </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to use
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     amount of data to add
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function extends the used data area of the buffer at the buffer
   start. If this would exceed the total buffer headroom the kernel will
   panic. A pointer to the first byte of the extra data is returned.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-pull">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_pull</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_pull</refname>
 <refpurpose>
     remove data from the start of a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned char * <function>skb_pull </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to use
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     amount of data to remove
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function removes data from the start of a buffer, returning
   the memory to the headroom. A pointer to the next data in the buffer
   is returned. Once the data has been pulled future pushes will overwrite
   the old data.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-headroom">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_headroom</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_headroom</refname>
 <refpurpose>
     bytes at buffer head
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned int <function>skb_headroom </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return the number of bytes of free space at the head of an <structname>sk_buff</structname>.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-tailroom">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_tailroom</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_tailroom</refname>
 <refpurpose>
     bytes at buffer end
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_tailroom </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return the number of bytes of free space at the tail of an sk_buff
</para>
</refsect1>
</refentry>

<refentry id="API-skb-reserve">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_reserve</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_reserve</refname>
 <refpurpose>
     adjust headroom
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_reserve </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to alter
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     bytes to move
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Increase the headroom of an empty <structname>sk_buff</structname> by reducing the tail
   room. This is only allowed for an empty buffer.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-trim">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_trim</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_trim</refname>
 <refpurpose>
     remove end from a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_trim </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to alter
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     new length
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Cut the length of a buffer down by removing data from the tail. If
   the buffer is already under the length specified it is not modified.
   The skb must be linear.
</para>
</refsect1>
</refentry>

<refentry id="API-pskb-trim-unique">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>pskb_trim_unique</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>pskb_trim_unique</refname>
 <refpurpose>
     remove end from a paged unique (not cloned) buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>pskb_trim_unique </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to alter
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     new length
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This is identical to pskb_trim except that the caller knows that
   the skb is not cloned so we should never get an error due to out-
   of-memory.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-orphan">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_orphan</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_orphan</refname>
 <refpurpose>
     orphan a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_orphan </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to orphan
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If a buffer currently has an owner then we call the owner's
   destructor function and make the <parameter>skb</parameter> unowned. The buffer continues
   to exist but is no longer charged to its former owner.
</para>
</refsect1>
</refentry>

<refentry id="API---dev-alloc-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__dev_alloc_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__dev_alloc_skb</refname>
 <refpurpose>
     allocate an skbuff for receiving
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>__dev_alloc_skb </function></funcdef>
   <paramdef>unsigned int <parameter>length</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>length</parameter></term>
   <listitem>
    <para>
     length to allocate
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     get_free_pages mask, passed to alloc_skb
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allocate a new <structname>sk_buff</structname> and assign it a usage count of one. The
   buffer has unspecified headroom built in. Users should allocate
   the headroom they think they need without accounting for the
   built in space. The built in space is used for optimisations.
   </para><para>

   <constant>NULL</constant> is returned if there is no free memory.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-alloc-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_alloc_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_alloc_skb</refname>
 <refpurpose>
     allocate an skbuff for receiving
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>dev_alloc_skb </function></funcdef>
   <paramdef>unsigned int <parameter>length</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>length</parameter></term>
   <listitem>
    <para>
     length to allocate
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allocate a new <structname>sk_buff</structname> and assign it a usage count of one. The
   buffer has unspecified headroom built in. Users should allocate
   the headroom they think they need without accounting for the
   built in space. The built in space is used for optimisations.
   </para><para>

   <constant>NULL</constant> is returned if there is no free memory. Although this function
   allocates memory it can be called from an interrupt.
</para>
</refsect1>
</refentry>

<refentry id="API-netdev-alloc-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netdev_alloc_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netdev_alloc_skb</refname>
 <refpurpose>
     allocate an skbuff for rx on a specific device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>netdev_alloc_skb </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>unsigned int <parameter>length</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device to receive on
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>length</parameter></term>
   <listitem>
    <para>
     length to allocate
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allocate a new <structname>sk_buff</structname> and assign it a usage count of one. The
   buffer has unspecified headroom built in. Users should allocate
   the headroom they think they need without accounting for the
   built in space. The built in space is used for optimisations.
   </para><para>

   <constant>NULL</constant> is returned if there is no free memory. Although this function
   allocates memory it can be called from an interrupt.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-clone-writable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_clone_writable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_clone_writable</refname>
 <refpurpose>
     is the header of a clone writable
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_clone_writable </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to check
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     length up to which to write
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns true if modifying the header part of the cloned buffer
   does not requires the data to be copied.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-cow">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_cow</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_cow</refname>
 <refpurpose>
     copy header of skb when it is required
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_cow </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>headroom</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to cow
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>headroom</parameter></term>
   <listitem>
    <para>
     needed headroom
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If the skb passed lacks sufficient headroom or its data part
   is shared, data is reallocated. If reallocation fails, an error
   is returned and original skb is not changed.
   </para><para>

   The result is skb with writable area skb-&gt;head...skb-&gt;tail
   and at least <parameter>headroom</parameter> of space at head.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-cow-head">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_cow_head</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_cow_head</refname>
 <refpurpose>
     skb_cow but only making the head writable
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_cow_head </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>headroom</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to cow
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>headroom</parameter></term>
   <listitem>
    <para>
     needed headroom
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function is identical to skb_cow except that we replace the
   skb_cloned check by skb_header_cloned.  It should be used when
   you only need to push on some header and do not need to modify
   the data.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-padto">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_padto</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_padto</refname>
 <refpurpose>
     pad an skbuff up to a minimal size
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_padto </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to pad
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     minimal length
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Pads up a buffer to ensure the trailing bytes exist and are
   blanked. If the buffer already contains sufficient data it
   is untouched. Otherwise it is extended. Returns zero on
   success. The skb is freed on error.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-linearize">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_linearize</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_linearize</refname>
 <refpurpose>
     convert paged skb to linear one
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_linearize </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to linarize
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If there is no free memory -ENOMEM is returned, otherwise zero
   is returned and the old skb data released.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-linearize-cow">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_linearize_cow</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_linearize_cow</refname>
 <refpurpose>
     make sure skb is linear and writable
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_linearize_cow </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to process
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If there is no free memory -ENOMEM is returned, otherwise zero
   is returned and the old skb data released.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-postpull-rcsum">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_postpull_rcsum</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_postpull_rcsum</refname>
 <refpurpose>
     update checksum for received skb after pull
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_postpull_rcsum </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>const void * <parameter>start</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to update
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>start</parameter></term>
   <listitem>
    <para>
     start of data before pull
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     length of data pulled
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   After doing a pull on a received packet, you need to call this to
   update the CHECKSUM_COMPLETE checksum, or set ip_summed to
   CHECKSUM_NONE so that it can be recomputed from scratch.
</para>
</refsect1>
</refentry>

<refentry id="API-pskb-trim-rcsum">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>pskb_trim_rcsum</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>pskb_trim_rcsum</refname>
 <refpurpose>
     trim received skb and update checksum
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>pskb_trim_rcsum </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to trim
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     new length
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This is exactly the same as pskb_trim except that it ensures the
   checksum of received packets are still valid after the operation.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-get-timestamp">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_get_timestamp</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_get_timestamp</refname>
 <refpurpose>
     get timestamp from a skb
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_get_timestamp </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>struct timeval * <parameter>stamp</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     skb to get stamp from
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>stamp</parameter></term>
   <listitem>
    <para>
     pointer to struct timeval to store stamp in
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Timestamps are stored in the skb as offsets to a base timestamp.
   This function converts the offset back to a struct timeval and stores
   it in stamp.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-checksum-complete">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_checksum_complete</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_checksum_complete</refname>
 <refpurpose>
     Calculate checksum of an entire packet
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>__sum16 <function>skb_checksum_complete </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     packet to process
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function calculates the checksum over the entire packet plus
   the value of skb-&gt;csum.  The latter can be used to supply the
   checksum of a pseudo header as used by TCP/UDP.  It returns the
   checksum.
   </para><para>

   For protocols that contain complete checksums such as ICMP/TCP/UDP,
   this function can be used to verify that checksum on received
   packets.  In that case the function should return zero if the
   checksum is correct.  In particular, this function will return zero
   if skb-&gt;ip_summed is CHECKSUM_UNNECESSARY which indicates that the
   hardware has already verified the correctness of the checksum.
</para>
</refsect1>
</refentry>

<!-- include/net/sock.h -->
<refentry id="API-struct-sock-common">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct sock_common</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct sock_common</refname>
 <refpurpose>
  minimal network layer representation of sockets
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct sock_common {
  unsigned short skc_family;
  volatile unsigned char skc_state;
  unsigned char skc_reuse;
  int skc_bound_dev_if;
  struct hlist_node skc_node;
  struct hlist_node skc_bind_node;
  atomic_t skc_refcnt;
  unsigned int skc_hash;
  struct proto * skc_prot;
  struct net * skc_net;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>skc_family</term>
      <listitem><para>
network address family
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_state</term>
      <listitem><para>
Connection state
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_reuse</term>
      <listitem><para>
<constant>SO_REUSEADDR</constant> setting
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_bound_dev_if</term>
      <listitem><para>
bound device index if != 0
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_node</term>
      <listitem><para>
main hash linkage for various protocol lookup tables
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_bind_node</term>
      <listitem><para>
bind hash linkage for various protocol lookup tables
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_refcnt</term>
      <listitem><para>
reference count
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_hash</term>
      <listitem><para>
hash value used with various protocol lookup tables
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_prot</term>
      <listitem><para>
protocol handlers inside a network family
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>skc_net</term>
      <listitem><para>
reference to the network namespace of this socket
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   This is the minimal network layer representation of sockets, the header
   for struct sock and struct inet_timewait_sock.
</para>
</refsect1>
</refentry>

<refentry id="API-struct-sock">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct sock</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct sock</refname>
 <refpurpose>
     network layer representation of sockets
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct sock {
  struct sock_common __sk_common;
#define sk_family		__sk_common.skc_family
#define sk_state		__sk_common.skc_state
#define sk_reuse		__sk_common.skc_reuse
#define sk_bound_dev_if		__sk_common.skc_bound_dev_if
#define sk_node			__sk_common.skc_node
#define sk_bind_node		__sk_common.skc_bind_node
#define sk_refcnt		__sk_common.skc_refcnt
#define sk_hash			__sk_common.skc_hash
#define sk_prot			__sk_common.skc_prot
#define sk_net			__sk_common.skc_net
  unsigned char sk_shutdown:2;
  unsigned char sk_no_check:2;
  unsigned char sk_userlocks:4;
  unsigned char sk_protocol;
  unsigned short sk_type;
  int sk_rcvbuf;
  socket_lock_t sk_lock;
  struct sk_backlog;
  wait_queue_head_t * sk_sleep;
  struct dst_entry * sk_dst_cache;
  struct xfrm_policy * sk_policy[2];
  rwlock_t sk_dst_lock;
  atomic_t sk_rmem_alloc;
  atomic_t sk_wmem_alloc;
  atomic_t sk_omem_alloc;
  int sk_sndbuf;
  struct sk_buff_head sk_receive_queue;
  struct sk_buff_head sk_write_queue;
  struct sk_buff_head sk_async_wait_queue;
  int sk_wmem_queued;
  int sk_forward_alloc;
  gfp_t sk_allocation;
  int sk_route_caps;
  int sk_gso_type;
  int sk_rcvlowat;
  unsigned long sk_flags;
  unsigned long sk_lingertime;
  struct sk_buff_head sk_error_queue;
  struct proto * sk_prot_creator;
  rwlock_t sk_callback_lock;
  int sk_err;
  int sk_err_soft;
  atomic_t sk_drops;
  unsigned short sk_ack_backlog;
  unsigned short sk_max_ack_backlog;
  __u32 sk_priority;
  struct ucred sk_peercred;
  long sk_rcvtimeo;
  long sk_sndtimeo;
  struct sk_filter * sk_filter;
  void * sk_protinfo;
  struct timer_list sk_timer;
  ktime_t sk_stamp;
  struct socket * sk_socket;
  void * sk_user_data;
  struct page * sk_sndmsg_page;
  struct sk_buff * sk_send_head;
  __u32 sk_sndmsg_off;
  int sk_write_pending;
  void * sk_security;
  void (* sk_state_change) (struct sock *sk);
  void (* sk_data_ready) (struct sock *sk, int bytes);
  void (* sk_write_space) (struct sock *sk);
  void (* sk_error_report) (struct sock *sk);
  int (* sk_backlog_rcv) (struct sock *sk,struct sk_buff *skb);
  void (* sk_destruct) (struct sock *sk);
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>__sk_common</term>
      <listitem><para>
   shared layout with inet_timewait_sock
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_shutdown</term>
      <listitem><para>
   mask of <constant>SEND_SHUTDOWN</constant> and/or <constant>RCV_SHUTDOWN</constant>
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_no_check</term>
      <listitem><para>
   <constant>SO_NO_CHECK</constant> setting, wether or not checkup packets
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_userlocks</term>
      <listitem><para>
   <constant>SO_SNDBUF</constant> and <constant>SO_RCVBUF</constant> settings
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_protocol</term>
      <listitem><para>
   which protocol this socket belongs in this network family
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_type</term>
      <listitem><para>
   socket type (<constant>SOCK_STREAM</constant>, etc)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_rcvbuf</term>
      <listitem><para>
   size of receive buffer in bytes
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_lock</term>
      <listitem><para>
   synchronizer
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_backlog</term>
      <listitem><para>
   always used with the per-socket spinlock held
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_sleep</term>
      <listitem><para>
   sock wait queue
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_dst_cache</term>
      <listitem><para>
   destination cache
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_policy[2]</term>
      <listitem><para>
   flow policy
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_dst_lock</term>
      <listitem><para>
   destination cache lock
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_rmem_alloc</term>
      <listitem><para>
   receive queue bytes committed
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_wmem_alloc</term>
      <listitem><para>
   transmit queue bytes committed
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_omem_alloc</term>
      <listitem><para>
   "o<quote> is </quote>option<quote> or </quote>other"
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_sndbuf</term>
      <listitem><para>
   size of send buffer in bytes
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_receive_queue</term>
      <listitem><para>
   incoming packets
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_write_queue</term>
      <listitem><para>
   Packet sending queue
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_async_wait_queue</term>
      <listitem><para>
   DMA copied packets
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_wmem_queued</term>
      <listitem><para>
   persistent queue size
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_forward_alloc</term>
      <listitem><para>
   space allocated forward
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_allocation</term>
      <listitem><para>
   allocation mode
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_route_caps</term>
      <listitem><para>
   route capabilities (e.g. <constant>NETIF_F_TSO</constant>)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_gso_type</term>
      <listitem><para>
   GSO type (e.g. <constant>SKB_GSO_TCPV4</constant>)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_rcvlowat</term>
      <listitem><para>
   <constant>SO_RCVLOWAT</constant> setting
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_flags</term>
      <listitem><para>
   <constant>SO_LINGER</constant> (l_onoff), <constant>SO_BROADCAST</constant>, <constant>SO_KEEPALIVE</constant>,
   <constant>SO_OOBINLINE</constant> settings
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_lingertime</term>
      <listitem><para>
   <constant>SO_LINGER</constant> l_linger setting
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_error_queue</term>
      <listitem><para>
   rarely used
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_prot_creator</term>
      <listitem><para>
   sk_prot of original sock creator (see ipv6_setsockopt,
   IPV6_ADDRFORM for instance)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_callback_lock</term>
      <listitem><para>
   used with the callbacks in the end of this struct
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_err</term>
      <listitem><para>
   last error
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_err_soft</term>
      <listitem><para>
   errors that don't cause failure but are the cause of a
   persistent failure not just 'timed out'
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_drops</term>
      <listitem><para>
   raw drops counter
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_ack_backlog</term>
      <listitem><para>
   current listen backlog
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_max_ack_backlog</term>
      <listitem><para>
   listen backlog set in <function>listen</function>
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_priority</term>
      <listitem><para>
   <constant>SO_PRIORITY</constant> setting
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_peercred</term>
      <listitem><para>
   <constant>SO_PEERCRED</constant> setting
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_rcvtimeo</term>
      <listitem><para>
   <constant>SO_RCVTIMEO</constant> setting
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_sndtimeo</term>
      <listitem><para>
   <constant>SO_SNDTIMEO</constant> setting
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_filter</term>
      <listitem><para>
   socket filtering instructions
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_protinfo</term>
      <listitem><para>
   private area, net family specific, when not using slab
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_timer</term>
      <listitem><para>
   sock cleanup timer
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_stamp</term>
      <listitem><para>
   time stamp of last packet received
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_socket</term>
      <listitem><para>
   Identd and reporting IO signals
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_user_data</term>
      <listitem><para>
   RPC layer private data
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_sndmsg_page</term>
      <listitem><para>
   cached page for sendmsg
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_send_head</term>
      <listitem><para>
   front of stuff to transmit
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_sndmsg_off</term>
      <listitem><para>
   cached offset for sendmsg
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_write_pending</term>
      <listitem><para>
   a write to stream socket waits to start
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_security</term>
      <listitem><para>
   used by security modules
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_state_change</term>
      <listitem><para>
   callback to indicate change in the state of the sock
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_data_ready</term>
      <listitem><para>
   callback to indicate there is data to be processed
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_write_space</term>
      <listitem><para>
   callback to indicate there is bf sending space available
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_error_report</term>
      <listitem><para>
   callback to indicate errors (e.g. <constant>MSG_ERRQUEUE</constant>)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_backlog_rcv</term>
      <listitem><para>
   callback to process the backlog
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>sk_destruct</term>
      <listitem><para>
   called at sock freeing time, i.e. when all refcnt == 0
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
</refentry>

<refentry id="API-sk-filter">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_filter</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_filter</refname>
 <refpurpose>
     run a packet through a socket filter
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sk_filter </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     sock associated with <structname>sk_buff</structname>
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to filter
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Run the filter code and then cut skb-&gt;data to correct size returned by
   sk_run_filter. If pkt_len is 0 we toss packet. If skb-&gt;len is smaller
   than pkt_len we keep whole skb-&gt;data. This is the socket level
   wrapper to sk_run_filter. It returns 0 if the packet should
   be accepted or -EPERM if the packet should be tossed.
</para>
</refsect1>
</refentry>

<refentry id="API-sk-filter-release">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_filter_release</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_filter_release</refname>
 <refpurpose>
   </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sk_filter_release </function></funcdef>
   <paramdef>struct sk_filter * <parameter>fp</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>fp</parameter></term>
   <listitem>
    <para>
     filter to remove
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove a filter from a socket and release its resources.
</para>
</refsect1>
</refentry>

<refentry id="API-sk-eat-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_eat_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_eat_skb</refname>
 <refpurpose>
     Release a skb if it is no longer needed
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sk_eat_skb </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>copied_early</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     socket to eat this skb from
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     socket buffer to eat
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>copied_early</parameter></term>
   <listitem>
    <para>
     flag indicating whether DMA operations copied this data early
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This routine must be called with interrupts disabled or with the socket
   locked so that the sk_buff queue operation is ok.
</para>
</refsect1>
</refentry>

<!-- net/socket.c -->
<refentry id="API-move-addr-to-kernel">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>move_addr_to_kernel</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>move_addr_to_kernel</refname>
 <refpurpose>
  copy a socket address into kernel space
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>move_addr_to_kernel </function></funcdef>
   <paramdef>void __user * <parameter>uaddr</parameter></paramdef>
   <paramdef>int <parameter>ulen</parameter></paramdef>
   <paramdef>void * <parameter>kaddr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>uaddr</parameter></term>
   <listitem>
    <para>
     Address in user space
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ulen</parameter></term>
   <listitem>
    <para>
     Length in user space
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>kaddr</parameter></term>
   <listitem>
    <para>
     Address in kernel space
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The address is copied into kernel space. If the provided address is
   too long an error code of -EINVAL is returned. If the copy gives
   invalid addresses -EFAULT is returned. On a success 0 is returned.
</para>
</refsect1>
</refentry>

<refentry id="API-move-addr-to-user">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>move_addr_to_user</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>move_addr_to_user</refname>
 <refpurpose>
     copy an address to user space
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>move_addr_to_user </function></funcdef>
   <paramdef>void * <parameter>kaddr</parameter></paramdef>
   <paramdef>int <parameter>klen</parameter></paramdef>
   <paramdef>void __user * <parameter>uaddr</parameter></paramdef>
   <paramdef>int __user * <parameter>ulen</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>kaddr</parameter></term>
   <listitem>
    <para>
     kernel space address
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>klen</parameter></term>
   <listitem>
    <para>
     length of address in kernel
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>uaddr</parameter></term>
   <listitem>
    <para>
     user space address
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ulen</parameter></term>
   <listitem>
    <para>
     pointer to user length field
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The value pointed to by ulen on entry is the buffer length available.
   This is overwritten with the buffer space used. -EINVAL is returned
   if an overlong buffer is specified or a negative buffer size. -EFAULT
   is returned if either the buffer or the length field are not
   accessible.
   After copying the data up to the limit the user specifies, the true
   length of the data is written over the length limit the user
   specified. Zero is returned for a success.
</para>
</refsect1>
</refentry>

<refentry id="API-sockfd-lookup">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sockfd_lookup</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sockfd_lookup</refname>
 <refpurpose>
     Go from a file number to its socket slot
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct socket * <function>sockfd_lookup </function></funcdef>
   <paramdef>int <parameter>fd</parameter></paramdef>
   <paramdef>int * <parameter>err</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>fd</parameter></term>
   <listitem>
    <para>
     file handle
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>err</parameter></term>
   <listitem>
    <para>
     pointer to an error code return
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The file handle passed in is locked and the socket it is bound
   too is returned. If an error occurs the err pointer is overwritten
   with a negative errno code and NULL is returned. The function checks
   for both invalid handles and passing a handle which is not a socket.
   </para><para>

   On a success the socket object pointer is returned.
</para>
</refsect1>
</refentry>

<refentry id="API-sock-release">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sock_release</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sock_release</refname>
 <refpurpose>
     close a socket
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sock_release </function></funcdef>
   <paramdef>struct socket * <parameter>sock</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sock</parameter></term>
   <listitem>
    <para>
     socket to close
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The socket is released from the protocol stack if it has a release
   callback, and the inode is then released if the socket is bound to
   an inode not a file.
</para>
</refsect1>
</refentry>

<refentry id="API-sock-register">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sock_register</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sock_register</refname>
 <refpurpose>
     add a socket protocol handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sock_register </function></funcdef>
   <paramdef>const struct net_proto_family * <parameter>ops</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>ops</parameter></term>
   <listitem>
    <para>
     description of protocol
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function is called by a protocol handler that wants to
   advertise its address family, and have it linked into the
   socket interface. The value ops-&gt;family coresponds to the
   socket system call protocol family.
</para>
</refsect1>
</refentry>

<refentry id="API-sock-unregister">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sock_unregister</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sock_unregister</refname>
 <refpurpose>
     remove a protocol handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sock_unregister </function></funcdef>
   <paramdef>int <parameter>family</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>family</parameter></term>
   <listitem>
    <para>
     protocol family to remove
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function is called by a protocol handler that wants to
   remove its address family, and have it unlinked from the
   new socket creation.
   </para><para>

   If protocol handler is a module, then it can use module reference
   counts to protect against new references. If protocol handler is not
   a module then it needs to provide its own protection in
   the ops-&gt;create routine.
</para>
</refsect1>
</refentry>

<!-- net/core/skbuff.c -->
<refentry id="API-skb-over-panic">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_over_panic</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_over_panic</refname>
 <refpurpose>
  private function
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_over_panic </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>sz</parameter></paramdef>
   <paramdef>void * <parameter>here</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>sz</parameter></term>
   <listitem>
    <para>
     size
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>here</parameter></term>
   <listitem>
    <para>
     address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Out of line support code for <function>skb_put</function>. Not user callable.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-under-panic">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_under_panic</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_under_panic</refname>
 <refpurpose>
     private function
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_under_panic </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>sz</parameter></paramdef>
   <paramdef>void * <parameter>here</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>sz</parameter></term>
   <listitem>
    <para>
     size
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>here</parameter></term>
   <listitem>
    <para>
     address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Out of line support code for <function>skb_push</function>. Not user callable.
</para>
</refsect1>
</refentry>

<refentry id="API---alloc-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__alloc_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__alloc_skb</refname>
 <refpurpose>
     allocate a network buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>__alloc_skb </function></funcdef>
   <paramdef>unsigned int <parameter>size</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
   <paramdef>int <parameter>fclone</parameter></paramdef>
   <paramdef>int <parameter>node</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>size</parameter></term>
   <listitem>
    <para>
     size to allocate
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     allocation mask
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>fclone</parameter></term>
   <listitem>
    <para>
     allocate from fclone cache instead of head cache
     and allocate a cloned (child) skb
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>node</parameter></term>
   <listitem>
    <para>
     numa node to allocate memory on
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allocate a new <structname>sk_buff</structname>. The returned buffer has no headroom and a
   tail room of size bytes. The object has a reference count of one.
   The return is the buffer. On a failure the return is <constant>NULL</constant>.
   </para><para>

   Buffers may only be allocated from interrupts using a <parameter>gfp_mask</parameter> of
   <constant>GFP_ATOMIC</constant>.
</para>
</refsect1>
</refentry>

<refentry id="API---netdev-alloc-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__netdev_alloc_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__netdev_alloc_skb</refname>
 <refpurpose>
     allocate an skbuff for rx on a specific device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>__netdev_alloc_skb </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>unsigned int <parameter>length</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device to receive on
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>length</parameter></term>
   <listitem>
    <para>
     length to allocate
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     get_free_pages mask, passed to alloc_skb
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allocate a new <structname>sk_buff</structname> and assign it a usage count of one. The
   buffer has unspecified headroom built in. Users should allocate
   the headroom they think they need without accounting for the
   built in space. The built in space is used for optimisations.
   </para><para>

   <constant>NULL</constant> is returned if there is no free memory.
</para>
</refsect1>
</refentry>

<refentry id="API---kfree-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__kfree_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__kfree_skb</refname>
 <refpurpose>
     private function
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>__kfree_skb </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Free an sk_buff. Release anything attached to the buffer.
   Clean the state. This is an internal helper function. Users should
   always call kfree_skb
</para>
</refsect1>
</refentry>

<refentry id="API-kfree-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>kfree_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>kfree_skb</refname>
 <refpurpose>
     free an sk_buff
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>kfree_skb </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to free
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Drop a reference to the buffer and free it if the usage count has
   hit zero.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-morph">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_morph</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_morph</refname>
 <refpurpose>
     morph one skb into another
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_morph </function></funcdef>
   <paramdef>struct sk_buff * <parameter>dst</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>src</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dst</parameter></term>
   <listitem>
    <para>
     the skb to receive the contents
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>src</parameter></term>
   <listitem>
    <para>
     the skb to supply the contents
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This is identical to skb_clone except that the target skb is
   supplied by the user.
   </para><para>

   The target skb is returned upon exit.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-clone">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_clone</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_clone</refname>
 <refpurpose>
     duplicate an sk_buff
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_clone </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to clone
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     allocation priority
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Duplicate an <structname>sk_buff</structname>. The new one is not owned by a socket. Both
   copies share the same packet data but not structure. The new
   buffer has a reference count of 1. If the allocation fails the
   function returns <constant>NULL</constant> otherwise the new buffer is returned.
   </para><para>

   If this function is called from an interrupt <function>gfp_mask</function> must be
   <constant>GFP_ATOMIC</constant>.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-copy">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_copy</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_copy</refname>
 <refpurpose>
     create private copy of an sk_buff
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_copy </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to copy
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     allocation priority
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Make a copy of both an <structname>sk_buff</structname> and its data. This is used when the
   caller wishes to modify the data and needs a private copy of the
   data to alter. Returns <constant>NULL</constant> on failure or the pointer to the buffer
   on success. The returned buffer has a reference count of 1.
   </para><para>

   As by-product this function converts non-linear <structname>sk_buff</structname> to linear
   one, so that <structname>sk_buff</structname> becomes completely private and caller is allowed
   to modify all the data of returned buffer. This means that this
   function is not recommended for use in circumstances when only
   header is going to be modified. Use <function>pskb_copy</function> instead.
</para>
</refsect1>
</refentry>

<refentry id="API-pskb-copy">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>pskb_copy</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>pskb_copy</refname>
 <refpurpose>
     create copy of an sk_buff with private head.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>pskb_copy </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to copy
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     allocation priority
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Make a copy of both an <structname>sk_buff</structname> and part of its data, located
   in header. Fragmented data remain shared. This is used when
   the caller wishes to modify only header of <structname>sk_buff</structname> and needs
   private copy of the header to alter. Returns <constant>NULL</constant> on failure
   or the pointer to the buffer on success.
   The returned buffer has a reference count of 1.
</para>
</refsect1>
</refentry>

<refentry id="API-pskb-expand-head">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>pskb_expand_head</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>pskb_expand_head</refname>
 <refpurpose>
     reallocate header of <structname>sk_buff</structname>
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>pskb_expand_head </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>nhead</parameter></paramdef>
   <paramdef>int <parameter>ntail</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to reallocate
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>nhead</parameter></term>
   <listitem>
    <para>
     room to add at head
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ntail</parameter></term>
   <listitem>
    <para>
     room to add at tail
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     allocation priority
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Expands (or creates identical copy, if <structname>nhead</structname> and <structname>ntail</structname> are zero)
   header of skb. <structname>sk_buff</structname> itself is not changed. <structname>sk_buff</structname> MUST have
   reference count of 1. Returns zero in the case of success or error,
   if expansion failed. In the last case, <structname>sk_buff</structname> is not changed.
   </para><para>

   All the pointers pointing into skb header may change and must be
   reloaded after call to this function.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-copy-expand">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_copy_expand</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_copy_expand</refname>
 <refpurpose>
     copy and expand sk_buff
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_copy_expand </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>newheadroom</parameter></paramdef>
   <paramdef>int <parameter>newtailroom</parameter></paramdef>
   <paramdef>gfp_t <parameter>gfp_mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to copy
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>newheadroom</parameter></term>
   <listitem>
    <para>
     new free bytes at head
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>newtailroom</parameter></term>
   <listitem>
    <para>
     new free bytes at tail
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gfp_mask</parameter></term>
   <listitem>
    <para>
     allocation priority
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Make a copy of both an <structname>sk_buff</structname> and its data and while doing so
   allocate additional space.
   </para><para>

   This is used when the caller wishes to modify the data and needs a
   private copy of the data to alter as well as more space for new fields.
   Returns <constant>NULL</constant> on failure or the pointer to the buffer
   on success. The returned buffer has a reference count of 1.
   </para><para>

   You must pass <constant>GFP_ATOMIC</constant> as the allocation priority if this function
   is called from an interrupt.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-pad">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_pad</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_pad</refname>
 <refpurpose>
     zero pad the tail of an skb
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_pad </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>pad</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to pad
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>pad</parameter></term>
   <listitem>
    <para>
     space to pad
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Ensure that a buffer is followed by a padding area that is zero
   filled. Used by network drivers which may DMA or transfer data
   beyond the buffer end onto the wire.
   </para><para>

   May return error in out of memory cases. The skb is freed on error.
</para>
</refsect1>
</refentry>

<refentry id="API---pskb-pull-tail">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__pskb_pull_tail</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__pskb_pull_tail</refname>
 <refpurpose>
     advance tail of skb header
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned char * <function>__pskb_pull_tail </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>delta</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to reallocate
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>delta</parameter></term>
   <listitem>
    <para>
     number of bytes to advance tail
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The function makes a sense only on a fragmented <structname>sk_buff</structname>,
   it expands header moving its tail forward and copying necessary
   data from fragmented part.
   </para><para>

   <structname>sk_buff</structname> MUST have reference count of 1.
   </para><para>

   Returns <constant>NULL</constant> (and <structname>sk_buff</structname> does not change) if pull failed
   or value of new tail of skb in the case of success.
   </para><para>

   All the pointers pointing into skb header may change and must be
   reloaded after call to this function.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-store-bits">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_store_bits</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_store_bits</refname>
 <refpurpose>
     store bits from kernel buffer to skb
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_store_bits </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>offset</parameter></paramdef>
   <paramdef>const void * <parameter>from</parameter></paramdef>
   <paramdef>int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     destination buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>offset</parameter></term>
   <listitem>
    <para>
     offset in destination
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>from</parameter></term>
   <listitem>
    <para>
     source buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     number of bytes to copy
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Copy the specified number of bytes from the source buffer to the
   destination skb.  This function handles all the messy bits of
   traversing fragment lists and such.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-dequeue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_dequeue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_dequeue</refname>
 <refpurpose>
     remove from the head of the queue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_dequeue </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to dequeue from
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove the head of the list. The list lock is taken so the function
   may be used safely with other locking list functions. The head item is
   returned or <constant>NULL</constant> if the list is empty.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-dequeue-tail">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_dequeue_tail</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_dequeue_tail</refname>
 <refpurpose>
     remove from the tail of the queue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_dequeue_tail </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to dequeue from
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove the tail of the list. The list lock is taken so the function
   may be used safely with other locking list functions. The tail item is
   returned or <constant>NULL</constant> if the list is empty.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-queue-purge">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_queue_purge</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_queue_purge</refname>
 <refpurpose>
     empty a list
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_queue_purge </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to empty
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Delete all buffers on an <structname>sk_buff</structname> list. Each buffer is removed from
   the list and one reference dropped. This function takes the list
   lock and is atomic with respect to other list locking functions.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-queue-head">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_queue_head</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_queue_head</refname>
 <refpurpose>
     queue a buffer at the list head
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_queue_head </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to use
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>newsk</parameter></term>
   <listitem>
    <para>
     buffer to queue
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Queue a buffer at the start of the list. This function takes the
   list lock and can be used safely with other locking <structname>sk_buff</structname> functions
   safely.
   </para><para>

   A buffer cannot be placed on two lists at the same time.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-queue-tail">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_queue_tail</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_queue_tail</refname>
 <refpurpose>
     queue a buffer at the list tail
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_queue_tail </function></funcdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to use
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>newsk</parameter></term>
   <listitem>
    <para>
     buffer to queue
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Queue a buffer at the tail of the list. This function takes the
   list lock and can be used safely with other locking <structname>sk_buff</structname> functions
   safely.
   </para><para>

   A buffer cannot be placed on two lists at the same time.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-unlink">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_unlink</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_unlink</refname>
 <refpurpose>
     remove a buffer from a list
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_unlink </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to remove
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to use
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove a packet from a list. The list locks are taken and this
   function is atomic with respect to other list locked calls
   </para><para>

   You must know what list the SKB is on.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-append">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_append</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_append</refname>
 <refpurpose>
     append a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_append </function></funcdef>
   <paramdef>struct sk_buff * <parameter>old</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>old</parameter></term>
   <listitem>
    <para>
     buffer to insert after
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>newsk</parameter></term>
   <listitem>
    <para>
     buffer to insert
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to use
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Place a packet after a given packet in a list. The list locks are taken
   and this function is atomic with respect to other list locked calls.
   A buffer cannot be placed on two lists at the same time.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-insert">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_insert</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_insert</refname>
 <refpurpose>
     insert a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_insert </function></funcdef>
   <paramdef>struct sk_buff * <parameter>old</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>newsk</parameter></paramdef>
   <paramdef>struct sk_buff_head * <parameter>list</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>old</parameter></term>
   <listitem>
    <para>
     buffer to insert before
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>newsk</parameter></term>
   <listitem>
    <para>
     buffer to insert
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>list</parameter></term>
   <listitem>
    <para>
     list to use
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Place a packet before a given packet in a list. The list locks are
   taken and this function is atomic with respect to other list locked
   calls.
   </para><para>

   A buffer cannot be placed on two lists at the same time.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-split">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_split</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_split</refname>
 <refpurpose>
     Split fragmented skb to two parts at length len.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_split </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>skb1</parameter></paramdef>
   <paramdef>const u32 <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     the buffer to split
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>skb1</parameter></term>
   <listitem>
    <para>
     the buffer to receive the second part
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     new length for skb
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-skb-prepare-seq-read">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_prepare_seq_read</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_prepare_seq_read</refname>
 <refpurpose>
     Prepare a sequential read of skb data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_prepare_seq_read </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>from</parameter></paramdef>
   <paramdef>unsigned int <parameter>to</parameter></paramdef>
   <paramdef>struct skb_seq_state * <parameter>st</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     the buffer to read
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>from</parameter></term>
   <listitem>
    <para>
     lower offset of data to be read
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>to</parameter></term>
   <listitem>
    <para>
     upper offset of data to be read
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>st</parameter></term>
   <listitem>
    <para>
     state variable
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Initializes the specified state variable. Must be called before
   invoking <function>skb_seq_read</function> for the first time.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-seq-read">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_seq_read</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_seq_read</refname>
 <refpurpose>
     Sequentially read skb data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned int <function>skb_seq_read </function></funcdef>
   <paramdef>unsigned int <parameter>consumed</parameter></paramdef>
   <paramdef>const u8 ** <parameter>data</parameter></paramdef>
   <paramdef>struct skb_seq_state * <parameter>st</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>consumed</parameter></term>
   <listitem>
    <para>
     number of bytes consumed by the caller so far
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>data</parameter></term>
   <listitem>
    <para>
     destination pointer for data to be returned
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>st</parameter></term>
   <listitem>
    <para>
     state variable
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Reads a block of skb data at <structname>consumed</structname> relative to the
   lower offset specified to <function>skb_prepare_seq_read</function>. Assigns
   the head of the data block to <structname>data</structname> and returns the length
   of the block or 0 if the end of the skb data or the upper
   offset has been reached.
   </para><para>

   The caller is not required to consume all of the data
   returned, i.e. <structname>consumed</structname> is typically set to the number
   of bytes already consumed and the next call to
   <function>skb_seq_read</function> will return the remaining part of the block.
</para>
</refsect1>
<refsect1>
<title>Note 1</title>
<para>
   The size of each block of data returned can be arbitary,
   this limitation is the cost for zerocopy seqeuental
   reads of potentially non linear data.
</para>
</refsect1>
<refsect1>
<title>Note 2</title>
<para>
   Fragment lists within fragments are not implemented
   at the moment, state-&gt;root_skb could be replaced with
   a stack for this purpose.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-abort-seq-read">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_abort_seq_read</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_abort_seq_read</refname>
 <refpurpose>
     Abort a sequential read of skb data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>skb_abort_seq_read </function></funcdef>
   <paramdef>struct skb_seq_state * <parameter>st</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>st</parameter></term>
   <listitem>
    <para>
     state variable
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Must be called if <function>skb_seq_read</function> was not called until it
   returned 0.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-find-text">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_find_text</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_find_text</refname>
 <refpurpose>
     Find a text pattern in skb data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned int <function>skb_find_text </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>from</parameter></paramdef>
   <paramdef>unsigned int <parameter>to</parameter></paramdef>
   <paramdef>struct ts_config * <parameter>config</parameter></paramdef>
   <paramdef>struct ts_state * <parameter>state</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     the buffer to look in
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>from</parameter></term>
   <listitem>
    <para>
     search offset
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>to</parameter></term>
   <listitem>
    <para>
     search limit
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>config</parameter></term>
   <listitem>
    <para>
     textsearch configuration
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>state</parameter></term>
   <listitem>
    <para>
     uninitialized textsearch state variable
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Finds a pattern in the skb data according to the specified
   textsearch configuration. Use <function>textsearch_next</function> to retrieve
   subsequent occurrences of the pattern. Returns the offset
   to the first occurrence or UINT_MAX if no match was found.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-append-datato-frags">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_append_datato_frags</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_append_datato_frags</refname>
 <refpurpose>
     append the user data to a skb
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_append_datato_frags </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int (*<parameter>getfrag</parameter>)
     <funcparams>void *from, char *to, int offset, 					int len, int odd, struct sk_buff *skb</funcparams></paramdef>
   <paramdef>void * <parameter>from</parameter></paramdef>
   <paramdef>int <parameter>length</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     sock  structure
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     skb structure to be appened with user data.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>getfrag</parameter></term>
   <listitem>
    <para>
     call back function to be used for getting the user data
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>from</parameter></term>
   <listitem>
    <para>
     pointer to user message iov
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>length</parameter></term>
   <listitem>
    <para>
     length of the iov message
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This procedure append the user data in the fragment part
   of the skb if any page alloc fails user this procedure returns  -ENOMEM
</para>
</refsect1>
</refentry>

<refentry id="API-skb-pull-rcsum">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_pull_rcsum</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_pull_rcsum</refname>
 <refpurpose>
     pull skb and update receive checksum
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned char * <function>skb_pull_rcsum </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to update
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     length of data pulled
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function performs an skb_pull on the packet and updates
   the CHECKSUM_COMPLETE checksum.  It should be used on
   receive path processing instead of skb_pull unless you know
   that the checksum difference is zero (e.g., a valid IP header)
   or you are setting ip_summed to CHECKSUM_NONE.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-segment">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_segment</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_segment</refname>
 <refpurpose>
     Perform protocol segmentation on skb.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_segment </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>features</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to segment
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>features</parameter></term>
   <listitem>
    <para>
     features for the output path (see dev-&gt;features)
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function performs segmentation on the given skb.  It returns
   the segment at the given position.  It returns NULL if there are
   no more segments to generate, or when an error is encountered.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-cow-data">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_cow_data</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_cow_data</refname>
 <refpurpose>
     Check that a socket buffer's data buffers are writable
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_cow_data </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>tailbits</parameter></paramdef>
   <paramdef>struct sk_buff ** <parameter>trailer</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     The socket buffer to check.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>tailbits</parameter></term>
   <listitem>
    <para>
     Amount of trailing space to be added
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>trailer</parameter></term>
   <listitem>
    <para>
     Returned pointer to the skb where the <parameter>tailbits</parameter> space begins
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Make sure that the data buffers attached to a socket buffer are
   writable. If they are not, private copies are made of the data buffers
   and the socket buffer is set to use these instead.
   </para><para>

   If <parameter>tailbits</parameter> is given, make sure that there is space to write <parameter>tailbits</parameter>
   bytes of data beyond current end of socket buffer.  <parameter>trailer</parameter> will be
   set to point to the skb in which this space begins.
   </para><para>

   The number of scatterlist elements required to completely map the
   COW'd and extended socket buffer will be returned.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-partial-csum-set">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_partial_csum_set</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_partial_csum_set</refname>
 <refpurpose>
     set up and verify partial csum values for packet
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>bool <function>skb_partial_csum_set </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>u16 <parameter>start</parameter></paramdef>
   <paramdef>u16 <parameter>off</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     the skb to set
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>start</parameter></term>
   <listitem>
    <para>
     the number of bytes after skb-&gt;data to start checksumming.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>off</parameter></term>
   <listitem>
    <para>
     the offset from start to place the checksum.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   For untrusted partially-checksummed packets, we need to make sure the values
   for skb-&gt;csum_start and skb-&gt;csum_offset are valid so we don't oops.
   </para><para>

   This function checks and sets those values and skb-&gt;ip_summed: if this
   returns false you should drop the packet.
</para>
</refsect1>
</refentry>

<!-- net/core/sock.c -->
<refentry id="API-sk-alloc">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_alloc</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_alloc</refname>
 <refpurpose>
  All socket objects are allocated here
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sock * <function>sk_alloc </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>int <parameter>family</parameter></paramdef>
   <paramdef>gfp_t <parameter>priority</parameter></paramdef>
   <paramdef>struct proto * <parameter>prot</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>family</parameter></term>
   <listitem>
    <para>
     protocol family
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>priority</parameter></term>
   <listitem>
    <para>
     for allocation (<constant>GFP_KERNEL</constant>, <constant>GFP_ATOMIC</constant>, etc)
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>prot</parameter></term>
   <listitem>
    <para>
     struct proto associated with this new sock instance
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-sk-wait-data">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_wait_data</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_wait_data</refname>
 <refpurpose>
     wait for data to arrive at sk_receive_queue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sk_wait_data </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>long * <parameter>timeo</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     sock to wait on
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>timeo</parameter></term>
   <listitem>
    <para>
     for how long
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Now socket state including sk-&gt;sk_err is changed only under lock,
   hence we may omit checks after joining wait queue.
   We check receive queue before <function>schedule</function> only as optimization;
   it is very likely that <function>release_sock</function> added new data.
</para>
</refsect1>
</refentry>

<refentry id="API---sk-mem-schedule">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__sk_mem_schedule</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__sk_mem_schedule</refname>
 <refpurpose>
     increase sk_forward_alloc and memory_allocated
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>__sk_mem_schedule </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>int <parameter>size</parameter></paramdef>
   <paramdef>int <parameter>kind</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     socket
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>size</parameter></term>
   <listitem>
    <para>
     memory size to allocate
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>kind</parameter></term>
   <listitem>
    <para>
     allocation type
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If kind is SK_MEM_SEND, it means wmem allocation. Otherwise it means
   rmem allocation. This function assumes that protocols which have
   memory_pressure use sk_wmem_queued as write buffer accounting.
</para>
</refsect1>
</refentry>

<refentry id="API---sk-mem-reclaim">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__sk_mem_reclaim</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__sk_mem_reclaim</refname>
 <refpurpose>
     reclaim memory_allocated
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>__sk_mem_reclaim </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     socket
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<!-- net/core/datagram.c -->
<refentry id="API---skb-recv-datagram">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__skb_recv_datagram</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__skb_recv_datagram</refname>
 <refpurpose>
  Receive a datagram skbuff
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>__skb_recv_datagram </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>unsigned <parameter>flags</parameter></paramdef>
   <paramdef>int * <parameter>peeked</parameter></paramdef>
   <paramdef>int * <parameter>err</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     socket
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flags</parameter></term>
   <listitem>
    <para>
     MSG_ flags
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>peeked</parameter></term>
   <listitem>
    <para>
     returns non-zero if this packet has been seen before
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>err</parameter></term>
   <listitem>
    <para>
     error code returned
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Get a datagram skbuff, understands the peeking, nonblocking wakeups
   and possible races. This replaces identical code in packet, raw and
   udp, as well as the IPX AX.25 and Appletalk. It also finally fixes
   the long standing peek and read race for datagram sockets. If you
   alter this routine remember it must be re-entrant.
   </para><para>

   This function will lock the socket if a skb is returned, so the caller
   needs to unlock the socket in that case (usually by calling
   skb_free_datagram)
   </para><para>

   * It does not lock socket since today. This function is
   * free of race conditions. This measure should/can improve
   * significantly datagram socket latencies at high loads,
   * when data copying to user space takes lots of time.
   * (BTW I've just killed the last <function>cli</function> in IP/IPv6/core/netlink/packet
   *  8) Great win.)
   *			                    --ANK (980729)
   </para><para>

   The order of the tests when we find no data waiting are specified
   quite explicitly by POSIX 1003.1g, don't change them without having
   the standard around please.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-kill-datagram">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_kill_datagram</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_kill_datagram</refname>
 <refpurpose>
     Free a datagram skbuff forcibly
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_kill_datagram </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned int <parameter>flags</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     socket
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     datagram skbuff
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flags</parameter></term>
   <listitem>
    <para>
     MSG_ flags
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function frees a datagram skbuff that was received by
   skb_recv_datagram.  The flags argument must match the one
   used for skb_recv_datagram.
   </para><para>

   If the MSG_PEEK flag is set, and the packet is still on the
   receive queue of the socket, it will be taken off the queue
   before it is freed.
   </para><para>

   This function currently only disables BH when acquiring the
   sk_receive_queue lock.  Therefore it must not be used in a
   context where that lock is acquired in an IRQ context.
   </para><para>

   It returns 0 if the packet was removed by us.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-copy-datagram-iovec">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_copy_datagram_iovec</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_copy_datagram_iovec</refname>
 <refpurpose>
     Copy a datagram to an iovec.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_copy_datagram_iovec </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>offset</parameter></paramdef>
   <paramdef>struct iovec * <parameter>to</parameter></paramdef>
   <paramdef>int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to copy
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>offset</parameter></term>
   <listitem>
    <para>
     offset in the buffer to start copying from
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>to</parameter></term>
   <listitem>
    <para>
     io vector to copy to
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     amount of data to copy from buffer to iovec
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Note</title>
<para>
   the iovec is modified during the copy.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-copy-and-csum-datagram-iovec">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_copy_and_csum_datagram_iovec</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_copy_and_csum_datagram_iovec</refname>
 <refpurpose>
     Copy and checkum skb to user iovec.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>skb_copy_and_csum_datagram_iovec </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>hlen</parameter></paramdef>
   <paramdef>struct iovec * <parameter>iov</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     skbuff
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>hlen</parameter></term>
   <listitem>
    <para>
     hardware length
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>iov</parameter></term>
   <listitem>
    <para>
     io vector
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Caller _must_ check that skb will fit to this iovec.
</para>
</refsect1>
<refsect1>
<title>Returns</title>
<para>
   0       - success.
   -EINVAL - checksum failure.
   -EFAULT - fault during copy. Beware, in this case iovec
   can be modified!
</para>
</refsect1>
</refentry>

<refentry id="API-datagram-poll">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>datagram_poll</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>datagram_poll</refname>
 <refpurpose>
     generic datagram poll
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned int <function>datagram_poll </function></funcdef>
   <paramdef>struct file * <parameter>file</parameter></paramdef>
   <paramdef>struct socket * <parameter>sock</parameter></paramdef>
   <paramdef>poll_table * <parameter>wait</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>file</parameter></term>
   <listitem>
    <para>
     file struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>sock</parameter></term>
   <listitem>
    <para>
     socket
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>wait</parameter></term>
   <listitem>
    <para>
     poll table
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Datagram poll</title>
<para>
   Again totally generic. This also handles
   sequenced packet sockets providing the socket receive queue
   is only ever holding data ready to receive.
</para>
</refsect1>
<refsect1>
<title>Note</title>
<para>
   when you _don't_ use this routine for this protocol,
   and you use a different write policy from <function>sock_writeable</function>
   then please supply your own write_space callback.
</para>
</refsect1>
</refentry>

<!-- net/core/stream.c -->
<refentry id="API-sk-stream-write-space">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_stream_write_space</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_stream_write_space</refname>
 <refpurpose>
  stream socket write_space callback.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sk_stream_write_space </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     socket
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>FIXME</title>
<para>
   write proper description
</para>
</refsect1>
</refentry>

<refentry id="API-sk-stream-wait-connect">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_stream_wait_connect</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_stream_wait_connect</refname>
 <refpurpose>
     Wait for a socket to get into the connected state
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sk_stream_wait_connect </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>long * <parameter>timeo_p</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     sock to wait on
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>timeo_p</parameter></term>
   <listitem>
    <para>
     for how long to wait
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Must be called with the socket locked.
</para>
</refsect1>
</refentry>

<refentry id="API-sk-stream-wait-memory">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_stream_wait_memory</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_stream_wait_memory</refname>
 <refpurpose>
     Wait for more memory for a socket
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sk_stream_wait_memory </function></funcdef>
   <paramdef>struct sock * <parameter>sk</parameter></paramdef>
   <paramdef>long * <parameter>timeo_p</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sk</parameter></term>
   <listitem>
    <para>
     socket to wait for memory
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>timeo_p</parameter></term>
   <listitem>
    <para>
     for how long
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

     </sect1>
     <sect1><title>Socket Filter</title>
<!-- net/core/filter.c -->
<refentry id="API-sk-run-filter">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_run_filter</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_run_filter</refname>
 <refpurpose>
  run a filter on a socket
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned int <function>sk_run_filter </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>struct sock_filter * <parameter>filter</parameter></paramdef>
   <paramdef>int <parameter>flen</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to run the filter on
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>filter</parameter></term>
   <listitem>
    <para>
     filter to apply
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flen</parameter></term>
   <listitem>
    <para>
     length of filter
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Decode and apply filter instructions to the skb-&gt;data.
   Return length to keep, 0 for none. skb is the data we are
   filtering, filter is the array of filter instructions, and
   len is the number of filter blocks in the array.
</para>
</refsect1>
</refentry>

<refentry id="API-sk-chk-filter">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sk_chk_filter</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sk_chk_filter</refname>
 <refpurpose>
     verify socket filter code
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sk_chk_filter </function></funcdef>
   <paramdef>struct sock_filter * <parameter>filter</parameter></paramdef>
   <paramdef>int <parameter>flen</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>filter</parameter></term>
   <listitem>
    <para>
     filter to verify
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flen</parameter></term>
   <listitem>
    <para>
     length of filter
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check the user's filter code. If we let some ugly
   filter code slip through kaboom! The filter must contain
   no references or jumps that are out of range, no illegal
   instructions, and must end with a RET instruction.
   </para><para>

   All jumps are forward as they are not signed.
   </para><para>

   Returns 0 if the rule set is legal or -EINVAL if not.
</para>
</refsect1>
</refentry>

     </sect1>
     <sect1><title>Generic Network Statistics</title>
<!-- include/linux/gen_stats.h -->
<refentry id="API-struct-gnet-stats-basic">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct gnet_stats_basic</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct gnet_stats_basic</refname>
 <refpurpose>
  byte/packet throughput statistics
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct gnet_stats_basic {
  __u64 bytes;
  __u32 packets;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>bytes</term>
      <listitem><para>
number of seen bytes
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>packets</term>
      <listitem><para>
number of seen packets
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
</refentry>

<refentry id="API-struct-gnet-stats-rate-est">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct gnet_stats_rate_est</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct gnet_stats_rate_est</refname>
 <refpurpose>
     rate estimator
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct gnet_stats_rate_est {
  __u32 bps;
  __u32 pps;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>bps</term>
      <listitem><para>
   current byte rate
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>pps</term>
      <listitem><para>
   current packet rate
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
</refentry>

<refentry id="API-struct-gnet-stats-queue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct gnet_stats_queue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct gnet_stats_queue</refname>
 <refpurpose>
     queuing statistics
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct gnet_stats_queue {
  __u32 qlen;
  __u32 backlog;
  __u32 drops;
  __u32 requeues;
  __u32 overlimits;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>qlen</term>
      <listitem><para>
   queue length
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>backlog</term>
      <listitem><para>
   backlog size of queue
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>drops</term>
      <listitem><para>
   number of dropped packets
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>requeues</term>
      <listitem><para>
   number of requeues
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>overlimits</term>
      <listitem><para>
   number of enqueues over the limit
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
</refentry>

<refentry id="API-struct-gnet-estimator">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct gnet_estimator</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct gnet_estimator</refname>
 <refpurpose>
     rate estimator configuration
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct gnet_estimator {
  signed char interval;
  unsigned char ewma_log;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>interval</term>
      <listitem><para>
   sampling period
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>ewma_log</term>
      <listitem><para>
   the log of measurement window weight
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
</refentry>

<!-- net/core/gen_stats.c -->
<refentry id="API-gnet-stats-start-copy-compat">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gnet_stats_start_copy_compat</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gnet_stats_start_copy_compat</refname>
 <refpurpose>
  start dumping procedure in compatibility mode
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gnet_stats_start_copy_compat </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>type</parameter></paramdef>
   <paramdef>int <parameter>tc_stats_type</parameter></paramdef>
   <paramdef>int <parameter>xstats_type</parameter></paramdef>
   <paramdef>spinlock_t * <parameter>lock</parameter></paramdef>
   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     socket buffer to put statistics TLVs into
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>type</parameter></term>
   <listitem>
    <para>
     TLV type for top level statistic TLV
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>tc_stats_type</parameter></term>
   <listitem>
    <para>
     TLV type for backward compatibility struct tc_stats TLV
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>xstats_type</parameter></term>
   <listitem>
    <para>
     TLV type for backward compatibility xstats TLV
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>lock</parameter></term>
   <listitem>
    <para>
     statistics lock
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>d</parameter></term>
   <listitem>
    <para>
     dumping handle
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Initializes the dumping handle, grabs the statistic lock and appends
   an empty TLV header to the socket buffer for use a container for all
   other statistic TLVS.
   </para><para>

   The dumping handle is marked to be in backward compatibility mode telling
   all <function>gnet_stats_copy_XXX</function> functions to fill a local copy of struct tc_stats.
   </para><para>

   Returns 0 on success or -1 if the room in the socket buffer was not sufficient.
</para>
</refsect1>
</refentry>

<refentry id="API-gnet-stats-start-copy">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gnet_stats_start_copy</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gnet_stats_start_copy</refname>
 <refpurpose>
     start dumping procedure in compatibility mode
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gnet_stats_start_copy </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>type</parameter></paramdef>
   <paramdef>spinlock_t * <parameter>lock</parameter></paramdef>
   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     socket buffer to put statistics TLVs into
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>type</parameter></term>
   <listitem>
    <para>
     TLV type for top level statistic TLV
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>lock</parameter></term>
   <listitem>
    <para>
     statistics lock
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>d</parameter></term>
   <listitem>
    <para>
     dumping handle
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Initializes the dumping handle, grabs the statistic lock and appends
   an empty TLV header to the socket buffer for use a container for all
   other statistic TLVS.
   </para><para>

   Returns 0 on success or -1 if the room in the socket buffer was not sufficient.
</para>
</refsect1>
</refentry>

<refentry id="API-gnet-stats-copy-basic">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gnet_stats_copy_basic</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gnet_stats_copy_basic</refname>
 <refpurpose>
     copy basic statistics into statistic TLV
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gnet_stats_copy_basic </function></funcdef>
   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
   <paramdef>struct gnet_stats_basic * <parameter>b</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>d</parameter></term>
   <listitem>
    <para>
     dumping handle
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>b</parameter></term>
   <listitem>
    <para>
     basic statistics
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Appends the basic statistics to the top level TLV created by
   <function>gnet_stats_start_copy</function>.
   </para><para>

   Returns 0 on success or -1 with the statistic lock released
   if the room in the socket buffer was not sufficient.
</para>
</refsect1>
</refentry>

<refentry id="API-gnet-stats-copy-rate-est">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gnet_stats_copy_rate_est</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gnet_stats_copy_rate_est</refname>
 <refpurpose>
     copy rate estimator statistics into statistics TLV
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gnet_stats_copy_rate_est </function></funcdef>
   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
   <paramdef>struct gnet_stats_rate_est * <parameter>r</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>d</parameter></term>
   <listitem>
    <para>
     dumping handle
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>r</parameter></term>
   <listitem>
    <para>
     rate estimator statistics
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Appends the rate estimator statistics to the top level TLV created by
   <function>gnet_stats_start_copy</function>.
   </para><para>

   Returns 0 on success or -1 with the statistic lock released
   if the room in the socket buffer was not sufficient.
</para>
</refsect1>
</refentry>

<refentry id="API-gnet-stats-copy-queue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gnet_stats_copy_queue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gnet_stats_copy_queue</refname>
 <refpurpose>
     copy queue statistics into statistics TLV
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gnet_stats_copy_queue </function></funcdef>
   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
   <paramdef>struct gnet_stats_queue * <parameter>q</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>d</parameter></term>
   <listitem>
    <para>
     dumping handle
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>q</parameter></term>
   <listitem>
    <para>
     queue statistics
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Appends the queue statistics to the top level TLV created by
   <function>gnet_stats_start_copy</function>.
   </para><para>

   Returns 0 on success or -1 with the statistic lock released
   if the room in the socket buffer was not sufficient.
</para>
</refsect1>
</refentry>

<refentry id="API-gnet-stats-copy-app">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gnet_stats_copy_app</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gnet_stats_copy_app</refname>
 <refpurpose>
     copy application specific statistics into statistics TLV
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gnet_stats_copy_app </function></funcdef>
   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
   <paramdef>void * <parameter>st</parameter></paramdef>
   <paramdef>int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>d</parameter></term>
   <listitem>
    <para>
     dumping handle
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>st</parameter></term>
   <listitem>
    <para>
     application specific statistics data
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     length of data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Appends the application sepecific statistics to the top level TLV created by
   <function>gnet_stats_start_copy</function> and remembers the data for XSTATS if the dumping
   handle is in backward compatibility mode.
   </para><para>

   Returns 0 on success or -1 with the statistic lock released
   if the room in the socket buffer was not sufficient.
</para>
</refsect1>
</refentry>

<refentry id="API-gnet-stats-finish-copy">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gnet_stats_finish_copy</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gnet_stats_finish_copy</refname>
 <refpurpose>
     finish dumping procedure
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gnet_stats_finish_copy </function></funcdef>
   <paramdef>struct gnet_dump * <parameter>d</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>d</parameter></term>
   <listitem>
    <para>
     dumping handle
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Corrects the length of the top level TLV to include all TLVs added
   by <function>gnet_stats_copy_XXX</function> calls. Adds the backward compatibility TLVs
   if <function>gnet_stats_start_copy_compat</function> was used and releases the statistics
   lock.
   </para><para>

   Returns 0 on success or -1 with the statistic lock released
   if the room in the socket buffer was not sufficient.
</para>
</refsect1>
</refentry>

<!-- net/core/gen_estimator.c -->
<refentry id="API-gen-new-estimator">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gen_new_estimator</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gen_new_estimator</refname>
 <refpurpose>
  create a new rate estimator
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gen_new_estimator </function></funcdef>
   <paramdef>struct gnet_stats_basic * <parameter>bstats</parameter></paramdef>
   <paramdef>struct gnet_stats_rate_est * <parameter>rate_est</parameter></paramdef>
   <paramdef>spinlock_t * <parameter>stats_lock</parameter></paramdef>
   <paramdef>struct nlattr * <parameter>opt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>bstats</parameter></term>
   <listitem>
    <para>
     basic statistics
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>rate_est</parameter></term>
   <listitem>
    <para>
     rate estimator statistics
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>stats_lock</parameter></term>
   <listitem>
    <para>
     statistics lock
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>opt</parameter></term>
   <listitem>
    <para>
     rate estimator configuration TLV
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Creates a new rate estimator with <structname>bstats</structname> as source and <structname>rate_est</structname>
   as destination. A new timer with the interval specified in the
   configuration TLV is created. Upon each interval, the latest statistics
   will be read from <structname>bstats</structname> and the estimated rate will be stored in
   <structname>rate_est</structname> with the statistics lock grabed during this period.
   </para><para>

   Returns 0 on success or a negative error code.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   Called under rtnl_mutex
</para>
</refsect1>
</refentry>

<refentry id="API-gen-kill-estimator">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gen_kill_estimator</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gen_kill_estimator</refname>
 <refpurpose>
     remove a rate estimator
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>gen_kill_estimator </function></funcdef>
   <paramdef>struct gnet_stats_basic * <parameter>bstats</parameter></paramdef>
   <paramdef>struct gnet_stats_rate_est * <parameter>rate_est</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>bstats</parameter></term>
   <listitem>
    <para>
     basic statistics
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>rate_est</parameter></term>
   <listitem>
    <para>
     rate estimator statistics
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Removes the rate estimator specified by <structname>bstats</structname> and <structname>rate_est</structname>
   and deletes the timer.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   Called under rtnl_mutex
</para>
</refsect1>
</refentry>

<refentry id="API-gen-replace-estimator">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>gen_replace_estimator</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>gen_replace_estimator</refname>
 <refpurpose>
     replace rate estimator configuration
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>gen_replace_estimator </function></funcdef>
   <paramdef>struct gnet_stats_basic * <parameter>bstats</parameter></paramdef>
   <paramdef>struct gnet_stats_rate_est * <parameter>rate_est</parameter></paramdef>
   <paramdef>spinlock_t * <parameter>stats_lock</parameter></paramdef>
   <paramdef>struct nlattr * <parameter>opt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>bstats</parameter></term>
   <listitem>
    <para>
     basic statistics
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>rate_est</parameter></term>
   <listitem>
    <para>
     rate estimator statistics
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>stats_lock</parameter></term>
   <listitem>
    <para>
     statistics lock
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>opt</parameter></term>
   <listitem>
    <para>
     rate estimator configuration TLV
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Replaces the configuration of a rate estimator by calling
   <function>gen_kill_estimator</function> and <function>gen_new_estimator</function>.
   </para><para>

   Returns 0 on success or a negative error code.
</para>
</refsect1>
</refentry>

     </sect1>
     <sect1><title>SUN RPC subsystem</title>
<!-- The !D functionality is not perfect, garbage has to be protected by comments
net/sunrpc/sunrpc_syms.c-->
<!-- net/sunrpc/xdr.c -->
<refentry id="API-xdr-encode-opaque-fixed">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_encode_opaque_fixed</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_encode_opaque_fixed</refname>
 <refpurpose>
  Encode fixed length opaque data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>__be32 * <function>xdr_encode_opaque_fixed </function></funcdef>
   <paramdef>__be32 * <parameter>p</parameter></paramdef>
   <paramdef>const void * <parameter>ptr</parameter></paramdef>
   <paramdef>unsigned int <parameter>nbytes</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>p</parameter></term>
   <listitem>
    <para>
     pointer to current position in XDR buffer.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ptr</parameter></term>
   <listitem>
    <para>
     pointer to data to encode (or NULL)
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>nbytes</parameter></term>
   <listitem>
    <para>
     size of data.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Copy the array of data of length nbytes at ptr to the XDR buffer
   at position p, then align to the next 32-bit boundary by padding
   with zero bytes (see RFC1832).
</para>
</refsect1>
<refsect1>
<title>Note</title>
<para>
   if ptr is NULL, only the padding is performed.
   </para><para>

   Returns the updated current XDR buffer position
</para>
</refsect1>
</refentry>

<refentry id="API-xdr-encode-opaque">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_encode_opaque</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_encode_opaque</refname>
 <refpurpose>
     Encode variable length opaque data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>__be32 * <function>xdr_encode_opaque </function></funcdef>
   <paramdef>__be32 * <parameter>p</parameter></paramdef>
   <paramdef>const void * <parameter>ptr</parameter></paramdef>
   <paramdef>unsigned int <parameter>nbytes</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>p</parameter></term>
   <listitem>
    <para>
     pointer to current position in XDR buffer.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ptr</parameter></term>
   <listitem>
    <para>
     pointer to data to encode (or NULL)
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>nbytes</parameter></term>
   <listitem>
    <para>
     size of data.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns the updated current XDR buffer position
</para>
</refsect1>
</refentry>

<refentry id="API-xdr-init-encode">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_init_encode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_init_encode</refname>
 <refpurpose>
     Initialize a struct xdr_stream for sending data.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xdr_init_encode </function></funcdef>
   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
   <paramdef>__be32 * <parameter>p</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     pointer to xdr_stream struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>buf</parameter></term>
   <listitem>
    <para>
     pointer to XDR buffer in which to encode data
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>p</parameter></term>
   <listitem>
    <para>
     current pointer inside XDR buffer
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Note</title>
<para>
   at the moment the RPC client only passes the length of our
   scratch buffer in the xdr_buf's header kvec. Previously this
   meant we needed to call <function>xdr_adjust_iovec</function> after encoding the
   data. With the new scheme, the xdr_stream manages the details
   of the buffer length, and takes care of adjusting the kvec
   length for us.
</para>
</refsect1>
</refentry>

<refentry id="API-xdr-reserve-space">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_reserve_space</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_reserve_space</refname>
 <refpurpose>
     Reserve buffer space for sending
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>__be32 * <function>xdr_reserve_space </function></funcdef>
   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
   <paramdef>size_t <parameter>nbytes</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     pointer to xdr_stream
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>nbytes</parameter></term>
   <listitem>
    <para>
     number of bytes to reserve
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Checks that we have enough buffer space to encode 'nbytes' more
   bytes of data. If so, update the total xdr_buf length, and
   adjust the length of the current kvec.
</para>
</refsect1>
</refentry>

<refentry id="API-xdr-write-pages">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_write_pages</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_write_pages</refname>
 <refpurpose>
     Insert a list of pages into an XDR buffer for sending
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xdr_write_pages </function></funcdef>
   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
   <paramdef>struct page ** <parameter>pages</parameter></paramdef>
   <paramdef>unsigned int <parameter>base</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     pointer to xdr_stream
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>pages</parameter></term>
   <listitem>
    <para>
     list of pages
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>base</parameter></term>
   <listitem>
    <para>
     offset of first byte
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     length of data in bytes
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xdr-init-decode">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_init_decode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_init_decode</refname>
 <refpurpose>
     Initialize an xdr_stream for decoding data.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xdr_init_decode </function></funcdef>
   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
   <paramdef>struct xdr_buf * <parameter>buf</parameter></paramdef>
   <paramdef>__be32 * <parameter>p</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     pointer to xdr_stream struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>buf</parameter></term>
   <listitem>
    <para>
     pointer to XDR buffer from which to decode data
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>p</parameter></term>
   <listitem>
    <para>
     current pointer inside XDR buffer
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xdr-inline-decode">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_inline_decode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_inline_decode</refname>
 <refpurpose>
     Retrieve non-page XDR data to decode
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>__be32 * <function>xdr_inline_decode </function></funcdef>
   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
   <paramdef>size_t <parameter>nbytes</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     pointer to xdr_stream struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>nbytes</parameter></term>
   <listitem>
    <para>
     number of bytes of data to decode
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check if the input buffer is long enough to enable us to decode
   'nbytes' more bytes of data starting at the current position.
   If so return the current pointer, then update the current
   pointer position.
</para>
</refsect1>
</refentry>

<refentry id="API-xdr-read-pages">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_read_pages</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_read_pages</refname>
 <refpurpose>
     Ensure page-based XDR data to decode is aligned at current pointer position
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xdr_read_pages </function></funcdef>
   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     pointer to xdr_stream struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     number of bytes of page data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Moves data beyond the current pointer position from the XDR head[] buffer
   into the page list. Any data that lies beyond current position + <quote>len</quote>
   bytes is moved into the XDR tail[].
</para>
</refsect1>
</refentry>

<refentry id="API-xdr-enter-page">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_enter_page</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_enter_page</refname>
 <refpurpose>
     decode data from the XDR page
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xdr_enter_page </function></funcdef>
   <paramdef>struct xdr_stream * <parameter>xdr</parameter></paramdef>
   <paramdef>unsigned int <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     pointer to xdr_stream struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     number of bytes of page data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Moves data beyond the current pointer position from the XDR head[] buffer
   into the page list. Any data that lies beyond current position + <quote>len</quote>
   bytes is moved into the XDR tail[]. The current pointer is then
   repositioned at the beginning of the first XDR page.
</para>
</refsect1>
</refentry>

<!-- net/sunrpc/svc_xprt.c -->
<refentry id="API-svc-print-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>svc_print_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>svc_print_addr</refname>
 <refpurpose>
  Format rq_addr field for printing
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>char * <function>svc_print_addr </function></funcdef>
   <paramdef>struct svc_rqst * <parameter>rqstp</parameter></paramdef>
   <paramdef>char * <parameter>buf</parameter></paramdef>
   <paramdef>size_t <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>rqstp</parameter></term>
   <listitem>
    <para>
     svc_rqst struct containing address to print
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>buf</parameter></term>
   <listitem>
    <para>
     target buffer for formatted address
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     length of target buffer
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-svc-reserve">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>svc_reserve</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>svc_reserve</refname>
 <refpurpose>
     change the space reserved for the reply to a request.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>svc_reserve </function></funcdef>
   <paramdef>struct svc_rqst * <parameter>rqstp</parameter></paramdef>
   <paramdef>int <parameter>space</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>rqstp</parameter></term>
   <listitem>
    <para>
     The request in question
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>space</parameter></term>
   <listitem>
    <para>
     new max space to reserve
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Each request reserves some space on the output queue of the transport
   to make sure the reply fits.  This function reduces that reserved
   space to be the amount of space used already, plus <parameter>space</parameter>.
</para>
</refsect1>
</refentry>

<!-- net/sunrpc/xprt.c -->
<refentry id="API-xprt-register-transport">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_register_transport</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_register_transport</refname>
 <refpurpose>
  register a transport implementation
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>xprt_register_transport </function></funcdef>
   <paramdef>struct xprt_class * <parameter>transport</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>transport</parameter></term>
   <listitem>
    <para>
     transport to register
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If a transport implementation is loaded as a kernel module, it can
   call this interface to make itself known to the RPC client.
</para>
</refsect1>
<refsect1>
<title>0</title>
<para>
   transport successfully registered
   -EEXIST:	transport already registered
   -EINVAL:	transport module being unloaded
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-unregister-transport">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_unregister_transport</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_unregister_transport</refname>
 <refpurpose>
     unregister a transport implementation
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>xprt_unregister_transport </function></funcdef>
   <paramdef>struct xprt_class * <parameter>transport</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>transport</parameter></term>
   <listitem>
    <para>
     transport to unregister
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>0</title>
<para>
   transport successfully unregistered
   -ENOENT:	transport never registered
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-reserve-xprt">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_reserve_xprt</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_reserve_xprt</refname>
 <refpurpose>
     serialize write access to transports
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>xprt_reserve_xprt </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     task that is requesting access to the transport
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This prevents mixing the payload of separate requests, and prevents
   transport connects from colliding with writes.  No congestion control
   is provided.
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-release-xprt">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_release_xprt</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_release_xprt</refname>
 <refpurpose>
     allow other requests to use a transport
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_release_xprt </function></funcdef>
   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xprt</parameter></term>
   <listitem>
    <para>
     transport with other tasks potentially waiting
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     task that is releasing access to the transport
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Note that <quote>task</quote> can be NULL.  No congestion control is provided.
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-release-xprt-cong">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_release_xprt_cong</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_release_xprt_cong</refname>
 <refpurpose>
     allow other requests to use a transport
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_release_xprt_cong </function></funcdef>
   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xprt</parameter></term>
   <listitem>
    <para>
     transport with other tasks potentially waiting
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     task that is releasing access to the transport
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Note that <quote>task</quote> can be NULL.  Another task is awoken to use the
   transport if the transport's congestion window allows it.
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-release-rqst-cong">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_release_rqst_cong</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_release_rqst_cong</refname>
 <refpurpose>
     housekeeping when request is complete
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_release_rqst_cong </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     RPC request that recently completed
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Useful for transports that require congestion control.
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-adjust-cwnd">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_adjust_cwnd</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_adjust_cwnd</refname>
 <refpurpose>
     adjust transport congestion window
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_adjust_cwnd </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
   <paramdef>int <parameter>result</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     recently completed RPC request used to adjust window
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>result</parameter></term>
   <listitem>
    <para>
     result code of completed RPC request
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   We use a time-smoothed congestion estimator to avoid heavy oscillation.
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-wake-pending-tasks">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_wake_pending_tasks</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_wake_pending_tasks</refname>
 <refpurpose>
     wake all tasks on a transport's pending queue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_wake_pending_tasks </function></funcdef>
   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
   <paramdef>int <parameter>status</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xprt</parameter></term>
   <listitem>
    <para>
     transport with waiting tasks
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>status</parameter></term>
   <listitem>
    <para>
     result code to plant in each task before waking it
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xprt-wait-for-buffer-space">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_wait_for_buffer_space</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_wait_for_buffer_space</refname>
 <refpurpose>
     wait for transport output buffer to clear
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_wait_for_buffer_space </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     task to be put to sleep
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xprt-write-space">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_write_space</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_write_space</refname>
 <refpurpose>
     wake the task waiting for transport output buffer space
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_write_space </function></funcdef>
   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xprt</parameter></term>
   <listitem>
    <para>
     transport with waiting tasks
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Can be called in a soft IRQ context, so xprt_write_space never sleeps.
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-set-retrans-timeout-def">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_set_retrans_timeout_def</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_set_retrans_timeout_def</refname>
 <refpurpose>
     set a request's retransmit timeout
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_set_retrans_timeout_def </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     task whose timeout is to be set
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set a request's retransmit timeout based on the transport's
   default timeout parameters.  Used by transports that don't adjust
   the retransmit timeout based on round-trip time estimation.
</para>
</refsect1>
</refentry>

<refentry id="API-xprt-disconnect-done">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_disconnect_done</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_disconnect_done</refname>
 <refpurpose>
     mark a transport as disconnected
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_disconnect_done </function></funcdef>
   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xprt</parameter></term>
   <listitem>
    <para>
     transport to flag for disconnect
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xprt-force-disconnect">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_force_disconnect</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_force_disconnect</refname>
 <refpurpose>
     force a transport to disconnect
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_force_disconnect </function></funcdef>
   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xprt</parameter></term>
   <listitem>
    <para>
     transport to disconnect
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xprt-lookup-rqst">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_lookup_rqst</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_lookup_rqst</refname>
 <refpurpose>
     find an RPC request corresponding to an XID
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct rpc_rqst * <function>xprt_lookup_rqst </function></funcdef>
   <paramdef>struct rpc_xprt * <parameter>xprt</parameter></paramdef>
   <paramdef>__be32 <parameter>xid</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xprt</parameter></term>
   <listitem>
    <para>
     transport on which the original request was transmitted
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>xid</parameter></term>
   <listitem>
    <para>
     RPC XID of incoming reply
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xprt-update-rtt">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_update_rtt</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_update_rtt</refname>
 <refpurpose>
     update an RPC client's RTT state after receiving a reply
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_update_rtt </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     RPC request that recently completed
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-xprt-complete-rqst">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xprt_complete_rqst</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xprt_complete_rqst</refname>
 <refpurpose>
     called when reply processing is complete
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>xprt_complete_rqst </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
   <paramdef>int <parameter>copied</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     RPC request that recently completed
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>copied</parameter></term>
   <listitem>
    <para>
     actual number of bytes received from the transport
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Caller holds transport lock.
</para>
</refsect1>
</refentry>

<!-- net/sunrpc/sched.c -->
<refentry id="API-rpc-wake-up">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_wake_up</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_wake_up</refname>
 <refpurpose>
  wake up all rpc_tasks
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>rpc_wake_up </function></funcdef>
   <paramdef>struct rpc_wait_queue * <parameter>queue</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>queue</parameter></term>
   <listitem>
    <para>
     rpc_wait_queue on which the tasks are sleeping
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Grabs queue-&gt;lock
</para>
</refsect1>
</refentry>

<refentry id="API-rpc-wake-up-status">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_wake_up_status</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_wake_up_status</refname>
 <refpurpose>
     wake up all rpc_tasks and set their status value.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>rpc_wake_up_status </function></funcdef>
   <paramdef>struct rpc_wait_queue * <parameter>queue</parameter></paramdef>
   <paramdef>int <parameter>status</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>queue</parameter></term>
   <listitem>
    <para>
     rpc_wait_queue on which the tasks are sleeping
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>status</parameter></term>
   <listitem>
    <para>
     status value to set
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Grabs queue-&gt;lock
</para>
</refsect1>
</refentry>

<refentry id="API-rpc-malloc">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_malloc</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_malloc</refname>
 <refpurpose>
     allocate an RPC buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void * <function>rpc_malloc </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
   <paramdef>size_t <parameter>size</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     RPC task that will use this buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>size</parameter></term>
   <listitem>
    <para>
     requested byte size
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   To prevent rpciod from hanging, this allocator never sleeps,
   returning NULL if the request cannot be serviced immediately.
   The caller can arrange to sleep in a way that is safe for rpciod.
   </para><para>

   Most requests are 'small' (under 2KiB) and can be serviced from a
   mempool, ensuring that NFS reads and writes can always proceed,
   and that there is good locality of reference for these buffers.
   </para><para>

   In order to avoid memory starvation triggering more writebacks of
   NFS requests, we avoid using GFP_KERNEL.
</para>
</refsect1>
</refentry>

<refentry id="API-rpc-free">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_free</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_free</refname>
 <refpurpose>
     free buffer allocated via rpc_malloc
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>rpc_free </function></funcdef>
   <paramdef>void * <parameter>buffer</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>buffer</parameter></term>
   <listitem>
    <para>
     buffer to free
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<!-- net/sunrpc/socklib.c -->
<refentry id="API-xdr-skb-read-bits">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_skb_read_bits</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_skb_read_bits</refname>
 <refpurpose>
  copy some data bits from skb to internal buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>size_t <function>xdr_skb_read_bits </function></funcdef>
   <paramdef>struct xdr_skb_reader * <parameter>desc</parameter></paramdef>
   <paramdef>void * <parameter>to</parameter></paramdef>
   <paramdef>size_t <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     sk_buff copy helper
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>to</parameter></term>
   <listitem>
    <para>
     copy destination
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     number of bytes to copy
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Possibly called several times to iterate over an sk_buff and copy
   data out of it.
</para>
</refsect1>
</refentry>

<refentry id="API-xdr-partial-copy-from-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>xdr_partial_copy_from_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>xdr_partial_copy_from_skb</refname>
 <refpurpose>
     copy data out of an skb
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>ssize_t <function>xdr_partial_copy_from_skb </function></funcdef>
   <paramdef>struct xdr_buf * <parameter>xdr</parameter></paramdef>
   <paramdef>unsigned int <parameter>base</parameter></paramdef>
   <paramdef>struct xdr_skb_reader * <parameter>desc</parameter></paramdef>
   <paramdef>xdr_skb_read_actor <parameter>copy_actor</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     target XDR buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>base</parameter></term>
   <listitem>
    <para>
     starting offset
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>desc</parameter></term>
   <listitem>
    <para>
     sk_buff copy helper
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>copy_actor</parameter></term>
   <listitem>
    <para>
     virtual method for copying data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-csum-partial-copy-to-xdr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>csum_partial_copy_to_xdr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>csum_partial_copy_to_xdr</refname>
 <refpurpose>
     checksum and copy data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>csum_partial_copy_to_xdr </function></funcdef>
   <paramdef>struct xdr_buf * <parameter>xdr</parameter></paramdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>xdr</parameter></term>
   <listitem>
    <para>
     target XDR buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     source skb
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   We have set things up such that we perform the checksum of the UDP
   packet in parallel with the copies into the RPC client iovec.  -DaveM
</para>
</refsect1>
</refentry>

<!-- net/sunrpc/stats.c -->
<refentry id="API-rpc-alloc-iostats">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_alloc_iostats</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_alloc_iostats</refname>
 <refpurpose>
  allocate an rpc_iostats structure
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct rpc_iostats * <function>rpc_alloc_iostats </function></funcdef>
   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>clnt</parameter></term>
   <listitem>
    <para>
     RPC program, version, and xprt
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-rpc-free-iostats">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_free_iostats</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_free_iostats</refname>
 <refpurpose>
     release an rpc_iostats structure
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>rpc_free_iostats </function></funcdef>
   <paramdef>struct rpc_iostats * <parameter>stats</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>stats</parameter></term>
   <listitem>
    <para>
     doomed rpc_iostats structure
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<!-- net/sunrpc/rpc_pipe.c -->
<refentry id="API-rpc-queue-upcall">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_queue_upcall</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_queue_upcall</refname>
 <refpurpose>
   </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>rpc_queue_upcall </function></funcdef>
   <paramdef>struct inode * <parameter>inode</parameter></paramdef>
   <paramdef>struct rpc_pipe_msg * <parameter>msg</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>inode</parameter></term>
   <listitem>
    <para>
     inode of upcall pipe on which to queue given message
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>msg</parameter></term>
   <listitem>
    <para>
     message to queue
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Call with an <parameter>inode</parameter> created by <function>rpc_mkpipe</function> to queue an upcall.
   A userspace process may then later read the upcall by performing a
   read on an open file for this inode.  It is up to the caller to
   initialize the fields of <parameter>msg</parameter> (other than <parameter>msg</parameter>-&gt;list) appropriately.
</para>
</refsect1>
</refentry>

<refentry id="API-rpc-mkpipe">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_mkpipe</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_mkpipe</refname>
 <refpurpose>
     make an rpc_pipefs file for kernel&lt;-&gt;userspace communication
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct dentry * <function>rpc_mkpipe </function></funcdef>
   <paramdef>struct dentry * <parameter>parent</parameter></paramdef>
   <paramdef>const char * <parameter>name</parameter></paramdef>
   <paramdef>void * <parameter>private</parameter></paramdef>
   <paramdef>struct rpc_pipe_ops * <parameter>ops</parameter></paramdef>
   <paramdef>int <parameter>flags</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>parent</parameter></term>
   <listitem>
    <para>
     dentry of directory to create new <quote>pipe</quote> in
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>name</parameter></term>
   <listitem>
    <para>
     name of pipe
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>private</parameter></term>
   <listitem>
    <para>
     private data to associate with the pipe, for the caller's use
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ops</parameter></term>
   <listitem>
    <para>
     operations defining the behavior of the pipe: upcall, downcall,
     release_pipe, and destroy_msg.
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flags</parameter></term>
   <listitem>
    <para>
     rpc_inode flags
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Data is made available for userspace to read by calls to
   <function>rpc_queue_upcall</function>.  The actual reads will result in calls to
   <parameter>ops</parameter>-&gt;upcall, which will be called with the file pointer,
   message, and userspace buffer to copy to.
   </para><para>

   Writes can come at any time, and do not necessarily have to be
   responses to upcalls.  They will result in calls to <parameter>msg</parameter>-&gt;downcall.
   </para><para>

   The <parameter>private</parameter> argument passed here will be available to all these methods
   from the file pointer, via RPC_I(file-&gt;f_dentry-&gt;d_inode)-&gt;private.
</para>
</refsect1>
</refentry>

<refentry id="API-rpc-unlink">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_unlink</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_unlink</refname>
 <refpurpose>
     remove a pipe
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>rpc_unlink </function></funcdef>
   <paramdef>struct dentry * <parameter>dentry</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dentry</parameter></term>
   <listitem>
    <para>
     dentry for the pipe, as returned from rpc_mkpipe
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   After this call, lookups will no longer find the pipe, and any
   attempts to read or write using preexisting opens of the pipe will
   return -EPIPE.
</para>
</refsect1>
</refentry>

<!-- net/sunrpc/rpcb_clnt.c -->
<refentry id="API-rpcb-getport-sync">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpcb_getport_sync</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpcb_getport_sync</refname>
 <refpurpose>
  obtain the port for an RPC service on a given host
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>rpcb_getport_sync </function></funcdef>
   <paramdef>struct sockaddr_in * <parameter>sin</parameter></paramdef>
   <paramdef>u32 <parameter>prog</parameter></paramdef>
   <paramdef>u32 <parameter>vers</parameter></paramdef>
   <paramdef>int <parameter>prot</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sin</parameter></term>
   <listitem>
    <para>
     address of remote peer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>prog</parameter></term>
   <listitem>
    <para>
     RPC program number to bind
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>vers</parameter></term>
   <listitem>
    <para>
     RPC version number to bind
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>prot</parameter></term>
   <listitem>
    <para>
     transport protocol to use to make this request
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return value is the requested advertised port number,
   or a negative errno value.
   </para><para>

   Called from outside the RPC client in a synchronous task context.
   Uses default timeout parameters specified by underlying transport.
</para>
</refsect1>
<refsect1>
<title>XXX</title>
<para>
   Needs to support IPv6
</para>
</refsect1>
</refentry>

<refentry id="API-rpcb-getport-async">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpcb_getport_async</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpcb_getport_async</refname>
 <refpurpose>
     obtain the port for a given RPC service on a given host
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>rpcb_getport_async </function></funcdef>
   <paramdef>struct rpc_task * <parameter>task</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task</parameter></term>
   <listitem>
    <para>
     task that is waiting for portmapper request
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This one can be called for an ongoing RPC request, and can be used in
   an async (rpciod) context.
</para>
</refsect1>
</refentry>

<!-- net/sunrpc/clnt.c -->
<refentry id="API-rpc-bind-new-program">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_bind_new_program</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_bind_new_program</refname>
 <refpurpose>
  bind a new RPC program to an existing client
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct rpc_clnt * <function>rpc_bind_new_program </function></funcdef>
   <paramdef>struct rpc_clnt * <parameter>old</parameter></paramdef>
   <paramdef>struct rpc_program * <parameter>program</parameter></paramdef>
   <paramdef>u32 <parameter>vers</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>old</parameter></term>
   <listitem>
    <para>
     old rpc_client
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>program</parameter></term>
   <listitem>
    <para>
     rpc program to set
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>vers</parameter></term>
   <listitem>
    <para>
     rpc program version
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Clones the rpc client and sets up a new RPC program. This is mainly
   of use for enabling different RPC programs to share the same transport.
   The Sun NFSv2/v3 ACL protocol can do this.
</para>
</refsect1>
</refentry>

<refentry id="API-rpc-run-task">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_run_task</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_run_task</refname>
 <refpurpose>
     Allocate a new RPC task, then run rpc_execute against it
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct rpc_task * <function>rpc_run_task </function></funcdef>
   <paramdef>const struct rpc_task_setup * <parameter>task_setup_data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>task_setup_data</parameter></term>
   <listitem>
    <para>
     pointer to task initialisation data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-rpc-call-sync">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_call_sync</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_call_sync</refname>
 <refpurpose>
     Perform a synchronous RPC call
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>rpc_call_sync </function></funcdef>
   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
   <paramdef>struct rpc_message * <parameter>msg</parameter></paramdef>
   <paramdef>int <parameter>flags</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>clnt</parameter></term>
   <listitem>
    <para>
     pointer to RPC client
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>msg</parameter></term>
   <listitem>
    <para>
     RPC call parameters
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flags</parameter></term>
   <listitem>
    <para>
     RPC call flags
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-rpc-call-async">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_call_async</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_call_async</refname>
 <refpurpose>
     Perform an asynchronous RPC call
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>rpc_call_async </function></funcdef>
   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
   <paramdef>struct rpc_message * <parameter>msg</parameter></paramdef>
   <paramdef>int <parameter>flags</parameter></paramdef>
   <paramdef>const struct rpc_call_ops * <parameter>tk_ops</parameter></paramdef>
   <paramdef>void * <parameter>data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>clnt</parameter></term>
   <listitem>
    <para>
     pointer to RPC client
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>msg</parameter></term>
   <listitem>
    <para>
     RPC call parameters
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flags</parameter></term>
   <listitem>
    <para>
     RPC call flags
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>tk_ops</parameter></term>
   <listitem>
    <para>
     RPC call ops
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>data</parameter></term>
   <listitem>
    <para>
     user call data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-rpc-peeraddr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_peeraddr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_peeraddr</refname>
 <refpurpose>
     extract remote peer address from clnt's xprt
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>size_t <function>rpc_peeraddr </function></funcdef>
   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
   <paramdef>struct sockaddr * <parameter>buf</parameter></paramdef>
   <paramdef>size_t <parameter>bufsize</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>clnt</parameter></term>
   <listitem>
    <para>
     RPC client structure
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>buf</parameter></term>
   <listitem>
    <para>
     target buffer
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>bufsize</parameter></term>
   <listitem>
    <para>
     length of target buffer
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns the number of bytes that are actually in the stored address.
</para>
</refsect1>
</refentry>

<refentry id="API-rpc-peeraddr2str">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_peeraddr2str</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_peeraddr2str</refname>
 <refpurpose>
     return remote peer address in printable format
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>const char * <function>rpc_peeraddr2str </function></funcdef>
   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
   <paramdef>enum rpc_display_format_t <parameter>format</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>clnt</parameter></term>
   <listitem>
    <para>
     RPC client structure
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>format</parameter></term>
   <listitem>
    <para>
     address format
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-rpc-force-rebind">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rpc_force_rebind</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rpc_force_rebind</refname>
 <refpurpose>
     force transport to check that remote port is unchanged
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>rpc_force_rebind </function></funcdef>
   <paramdef>struct rpc_clnt * <parameter>clnt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>clnt</parameter></term>
   <listitem>
    <para>
     client to rebind
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

     </sect1>
  </chapter>

  <chapter id="netdev">
     <title>Network device support</title>
     <sect1><title>Driver Support</title>
<!-- net/core/dev.c -->
<refentry id="API-dev-add-pack">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_add_pack</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_add_pack</refname>
 <refpurpose>
  add packet handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_add_pack </function></funcdef>
   <paramdef>struct packet_type * <parameter>pt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pt</parameter></term>
   <listitem>
    <para>
     packet type declaration
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Add a protocol handler to the networking stack. The passed <structname>packet_type</structname>
   is linked into kernel lists and may not be freed until it has been
   removed from the kernel lists.
   </para><para>

   This call does not sleep therefore it can not
   guarantee all CPU's that are in middle of receiving packets
   will see the new packet type (until the next received packet).
</para>
</refsect1>
</refentry>

<refentry id="API---dev-remove-pack">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__dev_remove_pack</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__dev_remove_pack</refname>
 <refpurpose>
     remove packet handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>__dev_remove_pack </function></funcdef>
   <paramdef>struct packet_type * <parameter>pt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pt</parameter></term>
   <listitem>
    <para>
     packet type declaration
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove a protocol handler that was previously added to the kernel
   protocol handlers by <function>dev_add_pack</function>. The passed <structname>packet_type</structname> is removed
   from the kernel lists and can be freed or reused once this function
   returns.
   </para><para>

   The packet type might still be in use by receivers
   and must not be freed until after all the CPU's have gone
   through a quiescent state.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-remove-pack">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_remove_pack</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_remove_pack</refname>
 <refpurpose>
     remove packet handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_remove_pack </function></funcdef>
   <paramdef>struct packet_type * <parameter>pt</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pt</parameter></term>
   <listitem>
    <para>
     packet type declaration
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove a protocol handler that was previously added to the kernel
   protocol handlers by <function>dev_add_pack</function>. The passed <structname>packet_type</structname> is removed
   from the kernel lists and can be freed or reused once this function
   returns.
   </para><para>

   This call sleeps to guarantee that no CPU is looking at the packet
   type after return.
</para>
</refsect1>
</refentry>

<refentry id="API-netdev-boot-setup-check">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netdev_boot_setup_check</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netdev_boot_setup_check</refname>
 <refpurpose>
     check boot time settings
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netdev_boot_setup_check </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     the netdevice
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check boot time settings for the device.
   The found settings are set for the device to be used
   later in the device probing.
   Returns 0 if no settings found, 1 if they are.
</para>
</refsect1>
</refentry>

<refentry id="API---dev-get-by-name">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__dev_get_by_name</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__dev_get_by_name</refname>
 <refpurpose>
     find a device by its name
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>__dev_get_by_name </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>const char * <parameter>name</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>name</parameter></term>
   <listitem>
    <para>
     name to find
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Find an interface by name. Must be called under RTNL semaphore
   or <parameter>dev_base_lock</parameter>. If the name is found a pointer to the device
   is returned. If the name is not found then <constant>NULL</constant> is returned. The
   reference counters are not incremented so the caller must be
   careful with locks.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-get-by-name">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_get_by_name</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_get_by_name</refname>
 <refpurpose>
     find a device by its name
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>dev_get_by_name </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>const char * <parameter>name</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>name</parameter></term>
   <listitem>
    <para>
     name to find
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Find an interface by name. This can be called from any
   context and does its own locking. The returned handle has
   the usage count incremented and the caller must use <function>dev_put</function> to
   release it when it is no longer needed. <constant>NULL</constant> is returned if no
   matching device is found.
</para>
</refsect1>
</refentry>

<refentry id="API---dev-get-by-index">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__dev_get_by_index</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__dev_get_by_index</refname>
 <refpurpose>
     find a device by its ifindex
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>__dev_get_by_index </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>int <parameter>ifindex</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ifindex</parameter></term>
   <listitem>
    <para>
     index of device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Search for an interface by index. Returns <constant>NULL</constant> if the device
   is not found or a pointer to the device. The device has not
   had its reference counter increased so the caller must be careful
   about locking. The caller must hold either the RTNL semaphore
   or <parameter>dev_base_lock</parameter>.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-get-by-index">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_get_by_index</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_get_by_index</refname>
 <refpurpose>
     find a device by its ifindex
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>dev_get_by_index </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>int <parameter>ifindex</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ifindex</parameter></term>
   <listitem>
    <para>
     index of device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Search for an interface by index. Returns NULL if the device
   is not found or a pointer to the device. The device returned has
   had a reference added and the pointer is safe until the user calls
   dev_put to indicate they have finished with it.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-getbyhwaddr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_getbyhwaddr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_getbyhwaddr</refname>
 <refpurpose>
     find a device by its hardware address
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>dev_getbyhwaddr </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>unsigned short <parameter>type</parameter></paramdef>
   <paramdef>char * <parameter>ha</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>type</parameter></term>
   <listitem>
    <para>
     media type of device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ha</parameter></term>
   <listitem>
    <para>
     hardware address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Search for an interface by MAC address. Returns NULL if the device
   is not found or a pointer to the device. The caller must hold the
   rtnl semaphore. The returned device has not had its ref count increased
   and the caller must therefore be careful about locking
</para>
</refsect1>
<refsect1>
<title>BUGS</title>
<para>
   If the API was consistent this would be __dev_get_by_hwaddr
</para>
</refsect1>
</refentry>

<refentry id="API-dev-get-by-flags">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_get_by_flags</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_get_by_flags</refname>
 <refpurpose>
     find any device with given flags
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>dev_get_by_flags </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>unsigned short <parameter>if_flags</parameter></paramdef>
   <paramdef>unsigned short <parameter>mask</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>if_flags</parameter></term>
   <listitem>
    <para>
     IFF_* values
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>mask</parameter></term>
   <listitem>
    <para>
     bitmask of bits in if_flags to check
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Search for any interface with the given flags. Returns NULL if a device
   is not found or a pointer to the device. The device returned has
   had a reference added and the pointer is safe until the user calls
   dev_put to indicate they have finished with it.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-valid-name">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_valid_name</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_valid_name</refname>
 <refpurpose>
     check if name is okay for network device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_valid_name </function></funcdef>
   <paramdef>const char * <parameter>name</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>name</parameter></term>
   <listitem>
    <para>
     name string
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Network device names need to be valid file names to
   to allow sysfs to work.  We also disallow any kind of
   whitespace.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-alloc-name">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_alloc_name</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_alloc_name</refname>
 <refpurpose>
     allocate a name for a device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_alloc_name </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>const char * <parameter>name</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>name</parameter></term>
   <listitem>
    <para>
     name format string
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Passed a format string - eg <quote>lt<constant>d</constant></quote> it will try and find a suitable
   id. It scans list of devices to build up a free map, then chooses
   the first empty slot. The caller must hold the dev_base or rtnl lock
   while allocating the name and adding the device in order to avoid
   duplicates.
   Limited to bits_per_byte * page size devices (ie 32K on most platforms).
   Returns the number of the unit assigned or a negative errno code.
</para>
</refsect1>
</refentry>

<refentry id="API-netdev-features-change">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netdev_features_change</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netdev_features_change</refname>
 <refpurpose>
     device changes features
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netdev_features_change </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device to cause notification
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called to indicate a device has changed features.
</para>
</refsect1>
</refentry>

<refentry id="API-netdev-state-change">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netdev_state_change</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netdev_state_change</refname>
 <refpurpose>
     device changes state
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netdev_state_change </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device to cause notification
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called to indicate a device has changed state. This function calls
   the notifier chains for netdev_chain and sends a NEWLINK message
   to the routing socket.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-load">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_load</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_load</refname>
 <refpurpose>
     load a network module
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_load </function></funcdef>
   <paramdef>struct net * <parameter>net</parameter></paramdef>
   <paramdef>const char * <parameter>name</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>net</parameter></term>
   <listitem>
    <para>
     the applicable net namespace
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>name</parameter></term>
   <listitem>
    <para>
     name of interface
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If a network interface is not present and the process has suitable
   privileges this function loads the module. If module loading is not
   available in this kernel then it becomes a nop.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-open">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_open</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_open</refname>
 <refpurpose>
     prepare an interface for use.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_open </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device to open
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Takes a device from down to up state. The device's private open
   function is invoked and then the multicast lists are loaded. Finally
   the device is moved into the up state and a <constant>NETDEV_UP</constant> message is
   sent to the netdev notifier chain.
   </para><para>

   Calling this function on an active interface is a nop. On a failure
   a negative errno code is returned.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-close">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_close</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_close</refname>
 <refpurpose>
     shutdown an interface.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_close </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device to shutdown
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function moves an active device into down state. A
   <constant>NETDEV_GOING_DOWN</constant> is sent to the netdev notifier chain. The device
   is then deactivated and finally a <constant>NETDEV_DOWN</constant> is sent to the notifier
   chain.
</para>
</refsect1>
</refentry>

<refentry id="API-register-netdevice-notifier">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>register_netdevice_notifier</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>register_netdevice_notifier</refname>
 <refpurpose>
     register a network notifier block
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>register_netdevice_notifier </function></funcdef>
   <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>nb</parameter></term>
   <listitem>
    <para>
     notifier
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Register a notifier to be called when network device events occur.
   The notifier passed is linked into the kernel structures and must
   not be reused until it has been unregistered. A negative errno code
   is returned on a failure.
   </para><para>

   When registered all registration and up events are replayed
   to the new notifier to allow device to have a race free
   view of the network device list.
</para>
</refsect1>
</refentry>

<refentry id="API-unregister-netdevice-notifier">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>unregister_netdevice_notifier</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>unregister_netdevice_notifier</refname>
 <refpurpose>
     unregister a network notifier block
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>unregister_netdevice_notifier </function></funcdef>
   <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>nb</parameter></term>
   <listitem>
    <para>
     notifier
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Unregister a notifier previously registered by
   <function>register_netdevice_notifier</function>. The notifier is unlinked into the
   kernel structures and may then be reused. A negative errno code
   is returned on a failure.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-device-detach">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_device_detach</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_device_detach</refname>
 <refpurpose>
     mark device as removed
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_device_detach </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Mark device as removed from system and therefore no longer available.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-device-attach">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_device_attach</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_device_attach</refname>
 <refpurpose>
     mark device as attached
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_device_attach </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Mark device as attached from system and restart if needed.
</para>
</refsect1>
</refentry>

<refentry id="API-skb-gso-segment">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>skb_gso_segment</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>skb_gso_segment</refname>
 <refpurpose>
     Perform segmentation on skb.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct sk_buff * <function>skb_gso_segment </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>int <parameter>features</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to segment
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>features</parameter></term>
   <listitem>
    <para>
     features for the output path (see dev-&gt;features)
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function segments the given skb and returns a list of segments.
   </para><para>

   It may return NULL if the skb requires no segmentation.  This is
   only possible when GSO is used for verifying header integrity.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-queue-xmit">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_queue_xmit</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_queue_xmit</refname>
 <refpurpose>
     transmit a buffer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_queue_xmit </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to transmit
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Queue a buffer for transmission to a network device. The caller must
   have set the device and priority and built the buffer before calling
   this function. The function can be called from an interrupt.
   </para><para>

   A negative errno code is returned on a failure. A success does not
   guarantee the frame will be transmitted as it may be dropped due
   to congestion or traffic shaping.
   </para><para>

   -----------------------------------------------------------------------------------
   I notice this method can also return errors from the queue disciplines,
   including NET_XMIT_DROP, which is a positive value.  So, errors can also
   be positive.
   </para><para>

   Regardless of the return value, the skb is consumed, so it is currently
   difficult to retry a send to this method.  (You can bump the ref count
   before sending to hold a reference for retry if you are careful.)
   </para><para>

   When calling this method, interrupts MUST be enabled.  This is because
   the BH enable code must have IRQs enabled so that it will not deadlock.
   --BLG
</para>
</refsect1>
</refentry>

<refentry id="API-netif-rx">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_rx</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_rx</refname>
 <refpurpose>
     post buffer to the network code
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_rx </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to post
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function receives a packet from a device driver and queues it for
   the upper (protocol) levels to process.  It always succeeds. The buffer
   may be dropped during processing for congestion control or by the
   protocol layers.
</para>
</refsect1>
<refsect1>
<title>return values</title>
<para>
   NET_RX_SUCCESS	(no congestion)
   NET_RX_DROP     (packet was dropped)
</para>
</refsect1>
</refentry>

<refentry id="API-netif-receive-skb">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_receive_skb</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_receive_skb</refname>
 <refpurpose>
     process receive buffer from network
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_receive_skb </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to process
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   <function>netif_receive_skb</function> is the main receive data processing function.
   It always succeeds. The buffer may be dropped during processing
   for congestion control or by the protocol layers.
   </para><para>

   This function may only be called from softirq context and interrupts
   should be enabled.
   </para><para>

   Return values (usually ignored):
</para>
</refsect1>
<refsect1>
<title>NET_RX_SUCCESS</title>
<para>
   no congestion
</para>
</refsect1>
<refsect1>
<title>NET_RX_DROP</title>
<para>
   packet was dropped
</para>
</refsect1>
</refentry>

<refentry id="API---napi-schedule">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__napi_schedule</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__napi_schedule</refname>
 <refpurpose>
     schedule for receive
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>__napi_schedule </function></funcdef>
   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>n</parameter></term>
   <listitem>
    <para>
     entry to schedule
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The entry's receive function will be scheduled to run
</para>
</refsect1>
</refentry>

<refentry id="API-register-gifconf">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>register_gifconf</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>register_gifconf</refname>
 <refpurpose>
     register a SIOCGIF handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>register_gifconf </function></funcdef>
   <paramdef>unsigned int <parameter>family</parameter></paramdef>
   <paramdef>gifconf_func_t * <parameter>gifconf</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>family</parameter></term>
   <listitem>
    <para>
     Address family
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>gifconf</parameter></term>
   <listitem>
    <para>
     Function handler
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Register protocol dependent address dumping routines. The handler
   that is passed must not be freed or reused until it has been replaced
   by another handler.
</para>
</refsect1>
</refentry>

<refentry id="API-netdev-set-master">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netdev_set_master</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netdev_set_master</refname>
 <refpurpose>
     set up master/slave pair
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netdev_set_master </function></funcdef>
   <paramdef>struct net_device * <parameter>slave</parameter></paramdef>
   <paramdef>struct net_device * <parameter>master</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>slave</parameter></term>
   <listitem>
    <para>
     slave device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>master</parameter></term>
   <listitem>
    <para>
     new master device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Changes the master device of the slave. Pass <constant>NULL</constant> to break the
   bonding. The caller must hold the RTNL semaphore. On a failure
   a negative errno code is returned. On success the reference counts
   are adjusted, <constant>RTM_NEWLINK</constant> is sent to the routing socket and the
   function returns zero.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-set-promiscuity">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_set_promiscuity</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_set_promiscuity</refname>
 <refpurpose>
     update promiscuity count on a device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_set_promiscuity </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>int <parameter>inc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>inc</parameter></term>
   <listitem>
    <para>
     modifier
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Add or remove promiscuity from a device. While the count in the device
   remains above zero the interface remains promiscuous. Once it hits zero
   the device reverts back to normal filtering operation. A negative inc
   value is used to drop promiscuity on the device.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-set-allmulti">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_set_allmulti</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_set_allmulti</refname>
 <refpurpose>
     update allmulti count on a device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_set_allmulti </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>int <parameter>inc</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>inc</parameter></term>
   <listitem>
    <para>
     modifier
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Add or remove reception of all multicast frames to a device. While the
   count in the device remains above zero the interface remains listening
   to all interfaces. Once it hits zero the device reverts back to normal
   filtering operation. A negative <parameter>inc</parameter> value is used to drop the counter
   when releasing a resource needing all multicasts.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-unicast-delete">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_unicast_delete</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_unicast_delete</refname>
 <refpurpose>
     Release secondary unicast address.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_unicast_delete </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>void * <parameter>addr</parameter></paramdef>
   <paramdef>int <parameter>alen</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     address to delete
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>alen</parameter></term>
   <listitem>
    <para>
     length of <parameter>addr</parameter>
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Release reference to a secondary unicast address and remove it
   from the device if the reference count drops to zero.
   </para><para>

   The caller must hold the rtnl_mutex.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-unicast-add">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_unicast_add</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_unicast_add</refname>
 <refpurpose>
     add a secondary unicast address
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_unicast_add </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>void * <parameter>addr</parameter></paramdef>
   <paramdef>int <parameter>alen</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     address to delete
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>alen</parameter></term>
   <listitem>
    <para>
     length of <parameter>addr</parameter>
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Add a secondary unicast address to the device or increase
   the reference count if it already exists.
   </para><para>

   The caller must hold the rtnl_mutex.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-unicast-sync">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_unicast_sync</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_unicast_sync</refname>
 <refpurpose>
     Synchronize device's unicast list to another device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>dev_unicast_sync </function></funcdef>
   <paramdef>struct net_device * <parameter>to</parameter></paramdef>
   <paramdef>struct net_device * <parameter>from</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>to</parameter></term>
   <listitem>
    <para>
     destination device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>from</parameter></term>
   <listitem>
    <para>
     source device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Add newly added addresses to the destination device and release
   addresses that have no users left. The source device must be
   locked by netif_tx_lock_bh.
   </para><para>

   This function is intended to be called from the dev-&gt;set_rx_mode
   function of layered software devices.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-unicast-unsync">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_unicast_unsync</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_unicast_unsync</refname>
 <refpurpose>
     Remove synchronized addresses from the destination device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_unicast_unsync </function></funcdef>
   <paramdef>struct net_device * <parameter>to</parameter></paramdef>
   <paramdef>struct net_device * <parameter>from</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>to</parameter></term>
   <listitem>
    <para>
     destination device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>from</parameter></term>
   <listitem>
    <para>
     source device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Remove all addresses that were added to the destination device by
   <function>dev_unicast_sync</function>. This function is intended to be called from the
   dev-&gt;stop function of layered software devices.
</para>
</refsect1>
</refentry>

<refentry id="API-register-netdevice">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>register_netdevice</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>register_netdevice</refname>
 <refpurpose>
     register a network device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>register_netdevice </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device to register
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Take a completed network device structure and add it to the kernel
   interfaces. A <constant>NETDEV_REGISTER</constant> message is sent to the netdev notifier
   chain. 0 is returned on success. A negative errno code is returned
   on a failure to set up the device, or if the name is a duplicate.
   </para><para>

   Callers must hold the rtnl semaphore. You may want
   <function>register_netdev</function> instead of this.
</para>
</refsect1>
<refsect1>
<title>BUGS</title>
<para>
   The locking appears insufficient to guarantee two parallel registers
   will not get the same name.
</para>
</refsect1>
</refentry>

<refentry id="API-register-netdev">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>register_netdev</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>register_netdev</refname>
 <refpurpose>
     register a network device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>register_netdev </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device to register
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Take a completed network device structure and add it to the kernel
   interfaces. A <constant>NETDEV_REGISTER</constant> message is sent to the netdev notifier
   chain. 0 is returned on success. A negative errno code is returned
   on a failure to set up the device, or if the name is a duplicate.
   </para><para>

   This is a wrapper around register_netdevice that takes the rtnl semaphore
   and expands the device name if you passed a format string to
   alloc_netdev.
</para>
</refsect1>
</refentry>

<refentry id="API-alloc-netdev-mq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>alloc_netdev_mq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>alloc_netdev_mq</refname>
 <refpurpose>
     allocate network device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>alloc_netdev_mq </function></funcdef>
   <paramdef>int <parameter>sizeof_priv</parameter></paramdef>
   <paramdef>const char * <parameter>name</parameter></paramdef>
   <paramdef>void (*<parameter>setup</parameter>)
     <funcparams>struct net_device *</funcparams></paramdef>
   <paramdef>unsigned int <parameter>queue_count</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sizeof_priv</parameter></term>
   <listitem>
    <para>
     size of private data to allocate space for
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>name</parameter></term>
   <listitem>
    <para>
     device name format string
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>setup</parameter></term>
   <listitem>
    <para>
     callback to initialize device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>queue_count</parameter></term>
   <listitem>
    <para>
     the number of subqueues to allocate
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allocates a struct net_device with private data area for driver use
   and performs basic initialization.  Also allocates subquue structs
   for each queue on the device at the end of the netdevice.
</para>
</refsect1>
</refentry>

<refentry id="API-free-netdev">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>free_netdev</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>free_netdev</refname>
 <refpurpose>
     free network device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>free_netdev </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function does the last stage of destroying an allocated device
   interface. The reference to the device object is released.
   If this is the last reference then it will be freed.
</para>
</refsect1>
</refentry>

<refentry id="API-unregister-netdevice">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>unregister_netdevice</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>unregister_netdevice</refname>
 <refpurpose>
     remove device from the kernel
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>unregister_netdevice </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function shuts down a device interface and removes it
   from the kernel tables.
   </para><para>

   Callers must hold the rtnl semaphore.  You may want
   <function>unregister_netdev</function> instead of this.
</para>
</refsect1>
</refentry>

<refentry id="API-unregister-netdev">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>unregister_netdev</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>unregister_netdev</refname>
 <refpurpose>
     remove device from the kernel
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>unregister_netdev </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function shuts down a device interface and removes it
   from the kernel tables.
   </para><para>

   This is just a wrapper for unregister_netdevice that takes
   the rtnl semaphore.  In general you want to use this and not
   unregister_netdevice.
</para>
</refsect1>
</refentry>

<refentry id="API-netdev-compute-features">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netdev_compute_features</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netdev_compute_features</refname>
 <refpurpose>
     compute conjunction of two feature sets
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netdev_compute_features </function></funcdef>
   <paramdef>unsigned long <parameter>all</parameter></paramdef>
   <paramdef>unsigned long <parameter>one</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>all</parameter></term>
   <listitem>
    <para>
     first feature set
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>one</parameter></term>
   <listitem>
    <para>
     second feature set
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Computes a new feature set after adding a device with feature set
   <parameter>one</parameter> to the master device with current feature set <parameter>all</parameter>.  Returns
   the new feature set.
</para>
</refsect1>
</refentry>

<!-- net/ethernet/eth.c -->
<refentry id="API-eth-header">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>eth_header</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>eth_header</refname>
 <refpurpose>
  create the Ethernet header
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>eth_header </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>unsigned short <parameter>type</parameter></paramdef>
   <paramdef>const void * <parameter>daddr</parameter></paramdef>
   <paramdef>const void * <parameter>saddr</parameter></paramdef>
   <paramdef>unsigned <parameter>len</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     buffer to alter
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     source device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>type</parameter></term>
   <listitem>
    <para>
     Ethernet type field
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>daddr</parameter></term>
   <listitem>
    <para>
     destination address (NULL leave destination address)
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>saddr</parameter></term>
   <listitem>
    <para>
     source address (NULL use device source address)
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>len</parameter></term>
   <listitem>
    <para>
     packet length (&lt;= skb-&gt;len)
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   </para><para>

   Set the protocol type. For a packet of type ETH_P_802_3 we put the length
   in here instead. It is up to the 802.2 layer to carry protocol information.
</para>
</refsect1>
</refentry>

<refentry id="API-eth-rebuild-header">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>eth_rebuild_header</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>eth_rebuild_header</refname>
 <refpurpose>
     rebuild the Ethernet MAC header.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>eth_rebuild_header </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     socket buffer to update
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This is called after an ARP or IPV6 ndisc it's resolution on this
   sk_buff. We now let protocol (ARP) fill in the other fields.
   </para><para>

   This routine CANNOT use cached dst-&gt;neigh!
   Really, it is used only when dst-&gt;neigh is wrong.
</para>
</refsect1>
</refentry>

<refentry id="API-eth-type-trans">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>eth_type_trans</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>eth_type_trans</refname>
 <refpurpose>
     determine the packet's protocol ID.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>__be16 <function>eth_type_trans </function></funcdef>
   <paramdef>struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     received socket data
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     receiving network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The rule here is that we
   assume 802.3 if the type field is short enough to be a length.
   This is normal practice and works for any 'now in use' protocol.
</para>
</refsect1>
</refentry>

<refentry id="API-eth-header-parse">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>eth_header_parse</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>eth_header_parse</refname>
 <refpurpose>
     extract hardware address from packet
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>eth_header_parse </function></funcdef>
   <paramdef>const struct sk_buff * <parameter>skb</parameter></paramdef>
   <paramdef>unsigned char * <parameter>haddr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>skb</parameter></term>
   <listitem>
    <para>
     packet to extract header from
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>haddr</parameter></term>
   <listitem>
    <para>
     destination buffer
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-eth-header-cache">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>eth_header_cache</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>eth_header_cache</refname>
 <refpurpose>
     fill cache entry from neighbour
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>eth_header_cache </function></funcdef>
   <paramdef>const struct neighbour * <parameter>neigh</parameter></paramdef>
   <paramdef>struct hh_cache * <parameter>hh</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>neigh</parameter></term>
   <listitem>
    <para>
     source neighbour
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>hh</parameter></term>
   <listitem>
    <para>
     destination cache entry
     Create an Ethernet header template from the neighbour.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-eth-header-cache-update">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>eth_header_cache_update</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>eth_header_cache_update</refname>
 <refpurpose>
     update cache entry
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>eth_header_cache_update </function></funcdef>
   <paramdef>struct hh_cache * <parameter>hh</parameter></paramdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>const unsigned char * <parameter>haddr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>hh</parameter></term>
   <listitem>
    <para>
     destination cache entry
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>haddr</parameter></term>
   <listitem>
    <para>
     new hardware address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called by Address Resolution module to notify changes in address.
</para>
</refsect1>
</refentry>

<refentry id="API-ether-setup">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>ether_setup</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>ether_setup</refname>
 <refpurpose>
     setup Ethernet network device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>ether_setup </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
     Fill in the fields of the device structure with Ethernet-generic values.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-alloc-etherdev-mq">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>alloc_etherdev_mq</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>alloc_etherdev_mq</refname>
 <refpurpose>
     Allocates and sets up an Ethernet device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct net_device * <function>alloc_etherdev_mq </function></funcdef>
   <paramdef>int <parameter>sizeof_priv</parameter></paramdef>
   <paramdef>unsigned int <parameter>queue_count</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>sizeof_priv</parameter></term>
   <listitem>
    <para>
     Size of additional driver-private structure to be allocated
     for this Ethernet device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>queue_count</parameter></term>
   <listitem>
    <para>
     The number of queues this device has.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Fill in the fields of the device structure with Ethernet-generic
   values. Basically does everything except registering the device.
   </para><para>

   Constructs a new net device, complete with a private data area of
   size (sizeof_priv).  A 32-byte (not bit) alignment is enforced for
   this private data area.
</para>
</refsect1>
</refentry>

<!-- net/sched/sch_generic.c -->
<refentry id="API-netif-carrier-on">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_carrier_on</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_carrier_on</refname>
 <refpurpose>
  set carrier
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_carrier_on </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Device has detected that carrier.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-carrier-off">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_carrier_off</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_carrier_off</refname>
 <refpurpose>
     clear carrier
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_carrier_off </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Device has detected loss of carrier.
</para>
</refsect1>
</refentry>

<!-- include/linux/etherdevice.h -->
<refentry id="API-is-zero-ether-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>is_zero_ether_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>is_zero_ether_addr</refname>
 <refpurpose>
  Determine if give Ethernet address is all zeros.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>is_zero_ether_addr </function></funcdef>
   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     Pointer to a six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return true if the address is all zeroes.
</para>
</refsect1>
</refentry>

<refentry id="API-is-multicast-ether-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>is_multicast_ether_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>is_multicast_ether_addr</refname>
 <refpurpose>
     Determine if the Ethernet address is a multicast.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>is_multicast_ether_addr </function></funcdef>
   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     Pointer to a six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return true if the address is a multicast address.
   By definition the broadcast address is also a multicast address.
</para>
</refsect1>
</refentry>

<refentry id="API-is-local-ether-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>is_local_ether_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>is_local_ether_addr</refname>
 <refpurpose>
     Determine if the Ethernet address is locally-assigned one (IEEE 802).
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>is_local_ether_addr </function></funcdef>
   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     Pointer to a six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return true if the address is a local address.
</para>
</refsect1>
</refentry>

<refentry id="API-is-broadcast-ether-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>is_broadcast_ether_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>is_broadcast_ether_addr</refname>
 <refpurpose>
     Determine if the Ethernet address is broadcast
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>is_broadcast_ether_addr </function></funcdef>
   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     Pointer to a six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Return true if the address is the broadcast address.
</para>
</refsect1>
</refentry>

<refentry id="API-is-valid-ether-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>is_valid_ether_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>is_valid_ether_addr</refname>
 <refpurpose>
     Determine if the given Ethernet address is valid
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>is_valid_ether_addr </function></funcdef>
   <paramdef>const u8 * <parameter>addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     Pointer to a six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
   a multicast address, and is not FF:FF:FF:FF:FF:FF.
   </para><para>

   Return true if the address is valid.
</para>
</refsect1>
</refentry>

<refentry id="API-random-ether-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>random_ether_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>random_ether_addr</refname>
 <refpurpose>
     Generate software assigned random Ethernet address
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>random_ether_addr </function></funcdef>
   <paramdef>u8 * <parameter>addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     Pointer to a six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Generate a random Ethernet address (MAC) that is not multicast
   and has the local assigned bit set.
</para>
</refsect1>
</refentry>

<refentry id="API-compare-ether-addr">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>compare_ether_addr</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>compare_ether_addr</refname>
 <refpurpose>
     Compare two Ethernet addresses
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned <function>compare_ether_addr </function></funcdef>
   <paramdef>const u8 * <parameter>addr1</parameter></paramdef>
   <paramdef>const u8 * <parameter>addr2</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>addr1</parameter></term>
   <listitem>
    <para>
     Pointer to a six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>addr2</parameter></term>
   <listitem>
    <para>
     Pointer other six-byte array containing the Ethernet address
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Compare two ethernet addresses, returns 0 if equal
</para>
</refsect1>
</refentry>

<!-- include/linux/netdevice.h -->
<refentry id="API-napi-schedule-prep">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>napi_schedule_prep</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>napi_schedule_prep</refname>
 <refpurpose>
  check if napi can be scheduled
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>napi_schedule_prep </function></funcdef>
   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>n</parameter></term>
   <listitem>
    <para>
     napi context
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Test if NAPI routine is already running, and if not mark
   it as running.  This is used as a condition variable
   insure only one NAPI poll instance runs.  We also make
   sure there is no pending NAPI disable.
</para>
</refsect1>
</refentry>

<refentry id="API-napi-schedule">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>napi_schedule</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>napi_schedule</refname>
 <refpurpose>
     schedule NAPI poll
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>napi_schedule </function></funcdef>
   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>n</parameter></term>
   <listitem>
    <para>
     napi context
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Schedule NAPI poll routine to be called if it is not already
   running.
</para>
</refsect1>
</refentry>

<refentry id="API---napi-complete">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__napi_complete</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__napi_complete</refname>
 <refpurpose>
     NAPI processing complete
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>__napi_complete </function></funcdef>
   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>n</parameter></term>
   <listitem>
    <para>
     napi context
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Mark NAPI processing as complete.
</para>
</refsect1>
</refentry>

<refentry id="API-napi-disable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>napi_disable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>napi_disable</refname>
 <refpurpose>
     prevent NAPI from scheduling
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>napi_disable </function></funcdef>
   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>n</parameter></term>
   <listitem>
    <para>
     napi context
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Stop NAPI from being scheduled on this context.
   Waits till any outstanding processing completes.
</para>
</refsect1>
</refentry>

<refentry id="API-napi-enable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>napi_enable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>napi_enable</refname>
 <refpurpose>
     enable NAPI scheduling
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>napi_enable </function></funcdef>
   <paramdef>struct napi_struct * <parameter>n</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>n</parameter></term>
   <listitem>
    <para>
     napi context
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Resume NAPI from being scheduled on this context.
   Must be paired with napi_disable.
</para>
</refsect1>
</refentry>

<refentry id="API-napi-synchronize">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>napi_synchronize</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>napi_synchronize</refname>
 <refpurpose>
     wait until NAPI is not running
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>napi_synchronize </function></funcdef>
   <paramdef>const struct napi_struct * <parameter>n</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>n</parameter></term>
   <listitem>
    <para>
     napi context
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Wait until NAPI is done being scheduled on this context.
   Waits till any outstanding processing completes but
   does not disable future activations.
</para>
</refsect1>
</refentry>

<refentry id="API-netdev-priv">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netdev_priv</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netdev_priv</refname>
 <refpurpose>
     access network device private data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void * <function>netdev_priv </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Get network device private data
</para>
</refsect1>
</refentry>

<refentry id="API-netif-napi-add">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_napi_add</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_napi_add</refname>
 <refpurpose>
     initialize a napi context
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_napi_add </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>struct napi_struct * <parameter>napi</parameter></paramdef>
   <paramdef>int (*<parameter>poll</parameter>)
     <funcparams>struct napi_struct *, int</funcparams></paramdef>
   <paramdef>int <parameter>weight</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>napi</parameter></term>
   <listitem>
    <para>
     napi context
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>poll</parameter></term>
   <listitem>
    <para>
     polling function
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>weight</parameter></term>
   <listitem>
    <para>
     default weight
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   <function>netif_napi_add</function> must be used to initialize a napi context prior to calling
   *any* of the other napi related functions.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-start-queue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_start_queue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_start_queue</refname>
 <refpurpose>
     allow transmit
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_start_queue </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allow upper layers to call the device hard_start_xmit routine.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-wake-queue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_wake_queue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_wake_queue</refname>
 <refpurpose>
     restart transmit
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_wake_queue </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Allow upper layers to call the device hard_start_xmit routine.
   Used for flow control when transmit resources are available.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-stop-queue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_stop_queue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_stop_queue</refname>
 <refpurpose>
     stop transmitted packets
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_stop_queue </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Stop upper layers calling the device hard_start_xmit routine.
   Used for flow control when transmit resources are unavailable.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-queue-stopped">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_queue_stopped</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_queue_stopped</refname>
 <refpurpose>
     test if transmit queue is flowblocked
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_queue_stopped </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Test if transmit queue on device is currently unable to send.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-running">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_running</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_running</refname>
 <refpurpose>
     test if up
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_running </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Test if the device has been brought up.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-start-subqueue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_start_subqueue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_start_subqueue</refname>
 <refpurpose>
     allow sending packets on subqueue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_start_subqueue </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>queue_index</parameter></term>
   <listitem>
    <para>
     sub queue index
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Start individual transmit queue of a device with multiple transmit queues.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-stop-subqueue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_stop_subqueue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_stop_subqueue</refname>
 <refpurpose>
     stop sending packets on subqueue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_stop_subqueue </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>queue_index</parameter></term>
   <listitem>
    <para>
     sub queue index
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Stop individual transmit queue of a device with multiple transmit queues.
</para>
</refsect1>
</refentry>

<refentry id="API---netif-subqueue-stopped">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__netif_subqueue_stopped</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__netif_subqueue_stopped</refname>
 <refpurpose>
     test status of subqueue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>__netif_subqueue_stopped </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>queue_index</parameter></term>
   <listitem>
    <para>
     sub queue index
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check individual transmit queue of a device with multiple transmit queues.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-wake-subqueue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_wake_subqueue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_wake_subqueue</refname>
 <refpurpose>
     allow sending packets on subqueue
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_wake_subqueue </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>u16 <parameter>queue_index</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>queue_index</parameter></term>
   <listitem>
    <para>
     sub queue index
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Resume individual transmit queue of a device with multiple transmit queues.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-is-multiqueue">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_is_multiqueue</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_is_multiqueue</refname>
 <refpurpose>
     test if device has multiple transmit queues
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_is_multiqueue </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check if device has multiple transmit queues
   Always falls if NETDEVICE_MULTIQUEUE is not configured
</para>
</refsect1>
</refentry>

<refentry id="API-dev-put">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_put</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_put</refname>
 <refpurpose>
     release reference to device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_put </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Release reference to device to allow it to be freed.
</para>
</refsect1>
</refentry>

<refentry id="API-dev-hold">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>dev_hold</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>dev_hold</refname>
 <refpurpose>
     get reference to device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>dev_hold </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Hold reference to device to keep it from being freed.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-carrier-ok">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_carrier_ok</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_carrier_ok</refname>
 <refpurpose>
     test if carrier present
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_carrier_ok </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check if carrier is present on device
</para>
</refsect1>
</refentry>

<refentry id="API-netif-dormant-on">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_dormant_on</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_dormant_on</refname>
 <refpurpose>
     mark device as dormant.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_dormant_on </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Mark device as dormant (as per RFC2863).
   </para><para>

   The dormant state indicates that the relevant interface is not
   actually in a condition to pass packets (i.e., it is not 'up') but is
   in a <quote>pending</quote> state, waiting for some external event.  For <quote>on-
   demand</quote> interfaces, this new state identifies the situation where the
   interface is waiting for events to place it in the up state.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-dormant-off">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_dormant_off</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_dormant_off</refname>
 <refpurpose>
     set device as not dormant.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>netif_dormant_off </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Device is not in dormant state.
</para>
</refsect1>
</refentry>

<refentry id="API-netif-dormant">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_dormant</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_dormant</refname>
 <refpurpose>
     test if carrier present
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_dormant </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check if carrier is present on device
</para>
</refsect1>
</refentry>

<refentry id="API-netif-oper-up">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_oper_up</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_oper_up</refname>
 <refpurpose>
     test if device is operational
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_oper_up </function></funcdef>
   <paramdef>const struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check if carrier is operational
</para>
</refsect1>
</refentry>

<refentry id="API-netif-device-present">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>netif_device_present</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>netif_device_present</refname>
 <refpurpose>
     is device available or removed
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>netif_device_present </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check if device has not been removed from system.
</para>
</refsect1>
</refentry>

<refentry id="API---netif-tx-lock">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>__netif_tx_lock</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>__netif_tx_lock</refname>
 <refpurpose>
     grab network device transmit lock
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>__netif_tx_lock </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>int <parameter>cpu</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>cpu</parameter></term>
   <listitem>
    <para>
     cpu number of lock owner
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Get network device transmit lock
</para>
</refsect1>
</refentry>

     </sect1>
     <sect1><title>PHY Support</title>
<!-- drivers/net/phy/phy.c -->
<refentry id="API-phy-print-status">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_print_status</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_print_status</refname>
 <refpurpose>
  Convenience function to print out the current phy status
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_print_status </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-read">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_read</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_read</refname>
 <refpurpose>
     Convenience function for reading a given PHY register
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_read </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
   <paramdef>u16 <parameter>regnum</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>regnum</parameter></term>
   <listitem>
    <para>
     register number to read
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   MUST NOT be called from interrupt context,
   because the bus read/write functions may wait for an interrupt
   to conclude the operation.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-write">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_write</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_write</refname>
 <refpurpose>
     Convenience function for writing a given PHY register
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_write </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
   <paramdef>u16 <parameter>regnum</parameter></paramdef>
   <paramdef>u16 <parameter>val</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>regnum</parameter></term>
   <listitem>
    <para>
     register number to write
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>val</parameter></term>
   <listitem>
    <para>
     value to write to <parameter>regnum</parameter>
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   MUST NOT be called from interrupt context,
   because the bus read/write functions may wait for an interrupt
   to conclude the operation.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-sanitize-settings">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_sanitize_settings</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_sanitize_settings</refname>
 <refpurpose>
     make sure the PHY is set to supported speed and duplex
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_sanitize_settings </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Make sure the PHY is set to supported speeds and
   duplexes.  Drop down by one in this order:  1000/FULL,
   1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-ethtool-sset">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_ethtool_sset</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_ethtool_sset</refname>
 <refpurpose>
     generic ethtool sset function, handles all the details
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_ethtool_sset </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
   <paramdef>struct ethtool_cmd * <parameter>cmd</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>cmd</parameter></term>
   <listitem>
    <para>
     ethtool_cmd
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>A few notes about parameter checking</title>
<para>
   - We don't set port or transceiver, so we don't care what they
   were set to.
   - <function>phy_start_aneg</function> will make sure forced settings are sane, and
   choose the next best ones from the ones selected, so we don't
   care if ethtool tries to give us bad values.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-mii-ioctl">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_mii_ioctl</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_mii_ioctl</refname>
 <refpurpose>
     generic PHY MII ioctl interface
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_mii_ioctl </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
   <paramdef>struct mii_ioctl_data * <parameter>mii_data</parameter></paramdef>
   <paramdef>int <parameter>cmd</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>mii_data</parameter></term>
   <listitem>
    <para>
     MII ioctl data
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>cmd</parameter></term>
   <listitem>
    <para>
     ioctl cmd to execute
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Note that this function is currently incompatible with the
   PHYCONTROL layer.  It changes registers without regard to
   current state.  Use at own risk.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-start-aneg">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_start_aneg</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_start_aneg</refname>
 <refpurpose>
     start auto-negotiation for this PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_start_aneg </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Sanitizes the settings (if we're not autonegotiating
   them), and then calls the driver's config_aneg function.
   If the PHYCONTROL Layer is operating, we change the state to
   reflect the beginning of Auto-negotiation or forcing.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-enable-interrupts">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_enable_interrupts</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_enable_interrupts</refname>
 <refpurpose>
     Enable the interrupts from the PHY side
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_enable_interrupts </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-disable-interrupts">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_disable_interrupts</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_disable_interrupts</refname>
 <refpurpose>
     Disable the PHY interrupts from the PHY side
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_disable_interrupts </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-start-interrupts">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_start_interrupts</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_start_interrupts</refname>
 <refpurpose>
     request and enable interrupts for a PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_start_interrupts </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Request the interrupt for the given PHY.
   If this fails, then we set irq to PHY_POLL.
   Otherwise, we enable the interrupts in the PHY.
   This should only be called with a valid IRQ number.
   Returns 0 on success or &lt; 0 on error.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-stop-interrupts">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_stop_interrupts</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_stop_interrupts</refname>
 <refpurpose>
     disable interrupts from a PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_stop_interrupts </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-stop">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_stop</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_stop</refname>
 <refpurpose>
     Bring down the PHY link, and stop checking the status
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_stop </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-start">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_start</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_start</refname>
 <refpurpose>
     start or restart a PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_start </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Indicates the attached device's readiness to
   handle PHY-related work.  Used during startup to start the
   PHY, and after a call to <function>phy_stop</function> to resume operation.
   Also used to indicate the MDIO bus has cleared an error
   condition.
</para>
</refsect1>
</refentry>

<!-- drivers/net/phy/phy.c -->
<refentry id="API-phy-clear-interrupt">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_clear_interrupt</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_clear_interrupt</refname>
 <refpurpose>
  Ack the phy device's interrupt
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_clear_interrupt </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If the <parameter>phydev</parameter> driver has an ack_interrupt function, call it to
   ack and clear the phy device's interrupt.
   </para><para>

   Returns 0 on success on &lt; 0 on error.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-config-interrupt">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_config_interrupt</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_config_interrupt</refname>
 <refpurpose>
     configure the PHY device for the requested interrupts
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_config_interrupt </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
   <paramdef>u32 <parameter>interrupts</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>interrupts</parameter></term>
   <listitem>
    <para>
     interrupt flags to configure for this <parameter>phydev</parameter>
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns 0 on success on &lt; 0 on error.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-aneg-done">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_aneg_done</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_aneg_done</refname>
 <refpurpose>
     return auto-negotiation status
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_aneg_done </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Reads the status register and returns 0 either if
   auto-negotiation is incomplete, or if there was an error.
   Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-find-setting">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_find_setting</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_find_setting</refname>
 <refpurpose>
     find a PHY settings array entry that matches speed &amp; duplex
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_find_setting </function></funcdef>
   <paramdef>int <parameter>speed</parameter></paramdef>
   <paramdef>int <parameter>duplex</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>speed</parameter></term>
   <listitem>
    <para>
     speed to match
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>duplex</parameter></term>
   <listitem>
    <para>
     duplex to match
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Searches the settings array for the setting which
   matches the desired speed and duplex, and returns the index
   of that setting.  Returns the index of the last setting if
   none of the others match.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-find-valid">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_find_valid</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_find_valid</refname>
 <refpurpose>
     find a PHY setting that matches the requested features mask
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_find_valid </function></funcdef>
   <paramdef>int <parameter>idx</parameter></paramdef>
   <paramdef>u32 <parameter>features</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>idx</parameter></term>
   <listitem>
    <para>
     The first index in settings[] to search
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>features</parameter></term>
   <listitem>
    <para>
     A mask of the valid settings
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns the index of the first valid setting less
   than or equal to the one pointed to by idx, as determined by
   the mask in features.  Returns the index of the last setting
   if nothing else matches.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-start-machine">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_start_machine</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_start_machine</refname>
 <refpurpose>
     start PHY state machine tracking
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_start_machine </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
   <paramdef>void (*<parameter>handler</parameter>)
     <funcparams>struct net_device *</funcparams></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     the phy_device struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>handler</parameter></term>
   <listitem>
    <para>
     callback function for state change notifications
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   The PHY infrastructure can run a state machine
   which tracks whether the PHY is starting up, negotiating,
   etc.  This function starts the timer which tracks the state
   of the PHY.  If you want to be notified when the state changes,
   pass in the callback <parameter>handler</parameter>, otherwise, pass NULL.  If you
   want to maintain your own state machine, do not call this
   function.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-stop-machine">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_stop_machine</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_stop_machine</refname>
 <refpurpose>
     stop the PHY state machine tracking
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_stop_machine </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Stops the state machine timer, sets the state to UP
   (unless it wasn't up yet). This function must be called BEFORE
   phy_detach.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-force-reduction">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_force_reduction</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_force_reduction</refname>
 <refpurpose>
     reduce PHY speed/duplex settings by one step
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_force_reduction </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Reduces the speed/duplex settings by one notch,
   in this order--
   1000/FULL, 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF.
   The function bottoms out at 10/HALF.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-error">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_error</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_error</refname>
 <refpurpose>
     enter HALTED state for this PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_error </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Moves the PHY to the HALTED state in response to a read
   or write error, and tells the controller the link is down.
   Must not be called from interrupt context, or while the
   phydev-&gt;lock is held.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-interrupt">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_interrupt</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_interrupt</refname>
 <refpurpose>
     PHY interrupt handler
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>irqreturn_t <function>phy_interrupt </function></funcdef>
   <paramdef>int <parameter>irq</parameter></paramdef>
   <paramdef>void * <parameter>phy_dat</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>irq</parameter></term>
   <listitem>
    <para>
     interrupt line
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy_dat</parameter></term>
   <listitem>
    <para>
     phy_device pointer
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   When a PHY interrupt occurs, the handler disables
   interrupts, and schedules a work task to clear the interrupt.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-change">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_change</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_change</refname>
 <refpurpose>
     Scheduled by the phy_interrupt/timer to handle PHY changes
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_change </function></funcdef>
   <paramdef>struct work_struct * <parameter>work</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>work</parameter></term>
   <listitem>
    <para>
     work_struct that describes the work to be done
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-state-machine">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_state_machine</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_state_machine</refname>
 <refpurpose>
     Handle the state machine
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_state_machine </function></funcdef>
   <paramdef>struct work_struct * <parameter>work</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>work</parameter></term>
   <listitem>
    <para>
     work_struct that describes the work to be done
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Scheduled by the state_queue workqueue each time
   phy_timer is triggered.
</para>
</refsect1>
</refentry>

<!-- drivers/net/phy/phy_device.c -->
<refentry id="API-phy-connect">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_connect</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_connect</refname>
 <refpurpose>
  connect an ethernet device to a PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct phy_device * <function>phy_connect </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>const char * <parameter>phy_id</parameter></paramdef>
   <paramdef>void (*<parameter>handler</parameter>)
     <funcparams>struct net_device *</funcparams></paramdef>
   <paramdef>u32 <parameter>flags</parameter></paramdef>
   <paramdef>phy_interface_t <parameter>interface</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     the network device to connect
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy_id</parameter></term>
   <listitem>
    <para>
     the PHY device to connect
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>handler</parameter></term>
   <listitem>
    <para>
     callback function for state change notifications
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flags</parameter></term>
   <listitem>
    <para>
     PHY device's dev_flags
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>interface</parameter></term>
   <listitem>
    <para>
     PHY device's interface
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Convenience function for connecting ethernet
   devices to PHY devices.  The default behavior is for
   the PHY infrastructure to handle everything, and only notify
   the connected driver when the link status changes.  If you
   don't want, or can't use the provided functionality, you may
   choose to call only the subset of functions which provide
   the desired functionality.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-disconnect">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_disconnect</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_disconnect</refname>
 <refpurpose>
     disable interrupts, stop state machine, and detach a PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_disconnect </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-attach">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_attach</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_attach</refname>
 <refpurpose>
     attach a network device to a particular PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct phy_device * <function>phy_attach </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>const char * <parameter>phy_id</parameter></paramdef>
   <paramdef>u32 <parameter>flags</parameter></paramdef>
   <paramdef>phy_interface_t <parameter>interface</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     network device to attach
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>phy_id</parameter></term>
   <listitem>
    <para>
     PHY device to attach
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>flags</parameter></term>
   <listitem>
    <para>
     PHY device's dev_flags
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>interface</parameter></term>
   <listitem>
    <para>
     PHY device's interface
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called by drivers to attach to a particular PHY
   device. The phy_device is found, and properly hooked up
   to the phy_driver.  If no driver is attached, then the
   genphy_driver is used.  The phy_device is given a ptr to
   the attaching device, and given a callback for link status
   change.  The phy_device is returned to the attaching driver.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-detach">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_detach</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_detach</refname>
 <refpurpose>
     detach a PHY device from its network device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_detach </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-genphy-config-advert">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>genphy_config_advert</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>genphy_config_advert</refname>
 <refpurpose>
     sanitize and advertise auto-negotation parameters
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>genphy_config_advert </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Writes MII_ADVERTISE with the appropriate values,
   after sanitizing the values to make sure we only advertise
   what is supported.
</para>
</refsect1>
</refentry>

<refentry id="API-genphy-config-aneg">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>genphy_config_aneg</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>genphy_config_aneg</refname>
 <refpurpose>
     restart auto-negotiation or write BMCR
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>genphy_config_aneg </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   If auto-negotiation is enabled, we configure the
   advertising, and then restart auto-negotiation.  If it is not
   enabled, then we write the BMCR.
</para>
</refsect1>
</refentry>

<refentry id="API-genphy-update-link">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>genphy_update_link</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>genphy_update_link</refname>
 <refpurpose>
     update link status in <parameter>phydev</parameter>
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>genphy_update_link </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Update the value in phydev-&gt;link to reflect the
   current link value.  In order to do this, we need to read
   the status register twice, keeping the second value.
</para>
</refsect1>
</refentry>

<refentry id="API-genphy-read-status">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>genphy_read_status</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>genphy_read_status</refname>
 <refpurpose>
     check the link status and update current link state
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>genphy_read_status </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Check the link, then figure out the current state
   by comparing what we advertise with what the link partner
   advertises.  Start by checking the gigabit possibilities,
   then move on to 10/100.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-driver-register">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_driver_register</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_driver_register</refname>
 <refpurpose>
     register a phy_driver with the PHY layer
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_driver_register </function></funcdef>
   <paramdef>struct phy_driver * <parameter>new_driver</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>new_driver</parameter></term>
   <listitem>
    <para>
     new phy_driver to register
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<!-- drivers/net/phy/phy_device.c -->
<refentry id="API-get-phy-device">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>get_phy_device</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>get_phy_device</refname>
 <refpurpose>
  reads the specified PHY device and returns its <parameter>phy_device</parameter> struct
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct phy_device * <function>get_phy_device </function></funcdef>
   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
   <paramdef>int <parameter>addr</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>bus</parameter></term>
   <listitem>
    <para>
     the target MII bus
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>addr</parameter></term>
   <listitem>
    <para>
     PHY address on the MII bus
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Reads the ID registers of the PHY at <parameter>addr</parameter> on the
   <parameter>bus</parameter>, then allocates and returns the phy_device to represent it.
</para>
</refsect1>
</refentry>

<refentry id="API-phy-prepare-link">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_prepare_link</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_prepare_link</refname>
 <refpurpose>
     prepares the PHY layer to monitor link status
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>phy_prepare_link </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
   <paramdef>void (*<parameter>handler</parameter>)
     <funcparams>struct net_device *</funcparams></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>handler</parameter></term>
   <listitem>
    <para>
     callback function for link status change notifications
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Tells the PHY infrastructure to handle the
   gory details on monitoring link status (whether through
   polling or an interrupt), and to call back to the
   connected device driver when the link status changes.
   If you want to monitor your own link state, don't call
   this function.
</para>
</refsect1>
</refentry>

<refentry id="API-genphy-setup-forced">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>genphy_setup_forced</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>genphy_setup_forced</refname>
 <refpurpose>
     configures/forces speed/duplex from <parameter>phydev</parameter>
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>genphy_setup_forced </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Configures MII_BMCR to force speed/duplex
   to the values in phydev. Assumes that the values are valid.
   Please see <function>phy_sanitize_settings</function>.
</para>
</refsect1>
</refentry>

<refentry id="API-genphy-restart-aneg">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>genphy_restart_aneg</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>genphy_restart_aneg</refname>
 <refpurpose>
     Enable and Restart Autonegotiation
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>genphy_restart_aneg </function></funcdef>
   <paramdef>struct phy_device * <parameter>phydev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>phydev</parameter></term>
   <listitem>
    <para>
     target phy_device struct
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-phy-probe">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>phy_probe</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>phy_probe</refname>
 <refpurpose>
     probe and init a PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>phy_probe </function></funcdef>
   <paramdef>struct device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device to probe and init
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Take care of setting up the phy_device structure,
   set the state to READY (the driver's init function should
   set it to STARTING if needed).
</para>
</refsect1>
</refentry>

<!-- drivers/net/phy/mdio_bus.c -->
<refentry id="API-mdiobus-register">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>mdiobus_register</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>mdiobus_register</refname>
 <refpurpose>
  bring up all the PHYs on a given bus and attach them to bus
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>mdiobus_register </function></funcdef>
   <paramdef>struct mii_bus * <parameter>bus</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>bus</parameter></term>
   <listitem>
    <para>
     target mii_bus
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called by a bus driver to bring up all the PHYs
   on a given bus, and attach them to the bus.
   </para><para>

   Returns 0 on success or &lt; 0 on error.
</para>
</refsect1>
</refentry>

<!-- drivers/net/phy/mdio_bus.c -->
<refentry id="API-mdio-bus-match">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>mdio_bus_match</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>mdio_bus_match</refname>
 <refpurpose>
  determine if given PHY driver supports the given PHY device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>mdio_bus_match </function></funcdef>
   <paramdef>struct device * <parameter>dev</parameter></paramdef>
   <paramdef>struct device_driver * <parameter>drv</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     target PHY device
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>drv</parameter></term>
   <listitem>
    <para>
     given PHY driver
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Given a PHY device, and a PHY driver, return 1 if
   the driver supports the device.  Otherwise, return 0.
</para>
</refsect1>
</refentry>

     </sect1>
<!-- FIXME: Removed for now since no structured comments in source
     <sect1><title>Wireless</title>
X!Enet/core/wireless.c
     </sect1>
-->
     <sect1><title>Synchronous PPP</title>
<!-- drivers/net/wan/syncppp.c -->
<refentry id="API-sppp-close">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sppp_close</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sppp_close</refname>
 <refpurpose>
  close down a synchronous PPP or Cisco HDLC link
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sppp_close </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     The network device to drop the link of
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This drops the logical interface to the channel. It is not
   done politely as we assume we will also be dropping DTR. Any
   timeouts are killed.
</para>
</refsect1>
</refentry>

<refentry id="API-sppp-open">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sppp_open</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sppp_open</refname>
 <refpurpose>
     open a synchronous PPP or Cisco HDLC link
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sppp_open </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     Network device to activate
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Close down any existing synchronous session and commence
   from scratch. In the PPP case this means negotiating LCP/IPCP
   and friends, while for Cisco HDLC we simply need to start sending
   keepalives
</para>
</refsect1>
</refentry>

<refentry id="API-sppp-reopen">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sppp_reopen</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sppp_reopen</refname>
 <refpurpose>
     notify of physical link loss
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sppp_reopen </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     Device that lost the link
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function informs the synchronous protocol code that
   the underlying link died (for example a carrier drop on X.21)
   </para><para>

   We increment the magic numbers to ensure that if the other end
   failed to notice we will correctly start a new session. It happens
   do to the nature of telco circuits is that you can lose carrier on
   one endonly.
   </para><para>

   Having done this we go back to negotiating. This function may
   be called from an interrupt context.
</para>
</refsect1>
</refentry>

<refentry id="API-sppp-do-ioctl">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sppp_do_ioctl</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sppp_do_ioctl</refname>
 <refpurpose>
     Ioctl handler for ppp/hdlc
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>sppp_do_ioctl </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
   <paramdef>struct ifreq * <parameter>ifr</parameter></paramdef>
   <paramdef>int <parameter>cmd</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     Device subject to ioctl
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>ifr</parameter></term>
   <listitem>
    <para>
     Interface request block from the user
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>cmd</parameter></term>
   <listitem>
    <para>
     Command that is being issued
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This function handles the ioctls that may be issued by the user
   to control the settings of a PPP/HDLC link. It does both busy
   and security checks. This function is intended to be wrapped by
   callers who wish to add additional ioctl calls of their own.
</para>
</refsect1>
</refentry>

<refentry id="API-sppp-attach">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sppp_attach</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sppp_attach</refname>
 <refpurpose>
     attach synchronous PPP/HDLC to a device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sppp_attach </function></funcdef>
   <paramdef>struct ppp_device * <parameter>pd</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>pd</parameter></term>
   <listitem>
    <para>
     PPP device to initialise
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This initialises the PPP/HDLC support on an interface. At the
   time of calling the dev element must point to the network device
   that this interface is attached to. The interface should not yet
   be registered. 
</para>
</refsect1>
</refentry>

<refentry id="API-sppp-detach">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>February 2008</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>sppp_detach</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.25-rc2</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>sppp_detach</refname>
 <refpurpose>
     release PPP resources from a device
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>sppp_detach </function></funcdef>
   <paramdef>struct net_device * <parameter>dev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     Network device to release
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Stop and free up any PPP/HDLC resources used by this
   interface. This must be called before the device is
   freed.
</para>
</refsect1>
</refentry>

     </sect1>
  </chapter>

</book>
