aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-11-01 05:21:47 -0400
committerDavid S. Miller <davem@davemloft.net>2007-11-01 05:21:47 -0400
commit3b582cc14c50f71eabf1c3cada05acb8dc9f457c (patch)
treebad13e4e0a36f019f8ea62d1401a9248073a7392
parentd57a9212e00779181d8d820887dcab3e9d529194 (diff)
[NET]: docbook fixes for netif_ functions
Documentation updates for network interfaces. 1. Add doc for netif_napi_add 2. Remove doc for unused returns from netif_rx 3. Add doc for netif_receive_skb [ Incorporated minor mods from Randy Dunlap -DaveM ] Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netdevice.h10
-rw-r--r--net/core/dev.c18
2 files changed, 25 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9b0c8f12373e..1e6af4f174b6 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -739,6 +739,16 @@ static inline void *netdev_priv(const struct net_device *dev)
739 */ 739 */
740#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) 740#define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev))
741 741
742/**
743 * netif_napi_add - initialize a napi context
744 * @dev: network device
745 * @napi: napi context
746 * @poll: polling function
747 * @weight: default weight
748 *
749 * netif_napi_add() must be used to initialize a napi context prior to calling
750 * *any* of the other napi related functions.
751 */
742static inline void netif_napi_add(struct net_device *dev, 752static inline void netif_napi_add(struct net_device *dev,
743 struct napi_struct *napi, 753 struct napi_struct *napi,
744 int (*poll)(struct napi_struct *, int), 754 int (*poll)(struct napi_struct *, int),
diff --git a/net/core/dev.c b/net/core/dev.c
index 91ece48e127e..be6cedab5aa8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1751,9 +1751,6 @@ DEFINE_PER_CPU(struct netif_rx_stats, netdev_rx_stat) = { 0, };
1751 * 1751 *
1752 * return values: 1752 * return values:
1753 * NET_RX_SUCCESS (no congestion) 1753 * NET_RX_SUCCESS (no congestion)
1754 * NET_RX_CN_LOW (low congestion)
1755 * NET_RX_CN_MOD (moderate congestion)
1756 * NET_RX_CN_HIGH (high congestion)
1757 * NET_RX_DROP (packet was dropped) 1754 * NET_RX_DROP (packet was dropped)
1758 * 1755 *
1759 */ 1756 */
@@ -2001,6 +1998,21 @@ out:
2001} 1998}
2002#endif 1999#endif
2003 2000
2001/**
2002 * netif_receive_skb - process receive buffer from network
2003 * @skb: buffer to process
2004 *
2005 * netif_receive_skb() is the main receive data processing function.
2006 * It always succeeds. The buffer may be dropped during processing
2007 * for congestion control or by the protocol layers.
2008 *
2009 * This function may only be called from softirq context and interrupts
2010 * should be enabled.
2011 *
2012 * Return values (usually ignored):
2013 * NET_RX_SUCCESS: no congestion
2014 * NET_RX_DROP: packet was dropped
2015 */
2004int netif_receive_skb(struct sk_buff *skb) 2016int netif_receive_skb(struct sk_buff *skb)
2005{ 2017{
2006 struct packet_type *ptype, *pt_prev; 2018 struct packet_type *ptype, *pt_prev;