diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 43 |
1 files changed, 32 insertions, 11 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 083b5989cecb..8b266390b9e2 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -63,27 +63,48 @@ struct wireless_dev; | |||
63 | #define HAVE_FREE_NETDEV /* free_netdev() */ | 63 | #define HAVE_FREE_NETDEV /* free_netdev() */ |
64 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ | 64 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ |
65 | 65 | ||
66 | #define NET_XMIT_SUCCESS 0 | 66 | /* |
67 | #define NET_XMIT_DROP 1 /* skb dropped */ | 67 | * Transmit return codes: transmit return codes originate from three different |
68 | #define NET_XMIT_CN 2 /* congestion notification */ | 68 | * namespaces: |
69 | #define NET_XMIT_POLICED 3 /* skb is shot by police */ | 69 | * |
70 | #define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */ | 70 | * - qdisc return codes |
71 | * - driver transmit return codes | ||
72 | * - errno values | ||
73 | * | ||
74 | * Drivers are allowed to return any one of those in their hard_start_xmit() | ||
75 | * function. Real network devices commonly used with qdiscs should only return | ||
76 | * the driver transmit return codes though - when qdiscs are used, the actual | ||
77 | * transmission happens asynchronously, so the value is not propagated to | ||
78 | * higher layers. Virtual network devices transmit synchronously, in this case | ||
79 | * the driver transmit return codes are consumed by dev_queue_xmit(), all | ||
80 | * others are propagated to higher layers. | ||
81 | */ | ||
82 | |||
83 | /* qdisc ->enqueue() return codes. */ | ||
84 | #define NET_XMIT_SUCCESS 0x00 | ||
85 | #define NET_XMIT_DROP 0x10 /* skb dropped */ | ||
86 | #define NET_XMIT_CN 0x20 /* congestion notification */ | ||
87 | #define NET_XMIT_POLICED 0x30 /* skb is shot by police */ | ||
88 | #define NET_XMIT_MASK 0xf0 /* qdisc flags in net/sch_generic.h */ | ||
71 | 89 | ||
72 | /* Backlog congestion levels */ | 90 | /* Backlog congestion levels */ |
73 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 91 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
74 | #define NET_RX_DROP 1 /* packet dropped */ | 92 | #define NET_RX_DROP 1 /* packet dropped */ |
75 | 93 | ||
76 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It | 94 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It |
77 | * indicates that the device will soon be dropping packets, or already drops | 95 | * indicates that the device will soon be dropping packets, or already drops |
78 | * some packets of the same priority; prompting us to send less aggressively. */ | 96 | * some packets of the same priority; prompting us to send less aggressively. */ |
79 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) | 97 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN ? 0 : (e)) |
80 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) | 98 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
81 | 99 | ||
82 | /* Driver transmit return codes */ | 100 | /* Driver transmit return codes */ |
101 | #define NETDEV_TX_MASK 0xf | ||
102 | |||
83 | enum netdev_tx { | 103 | enum netdev_tx { |
84 | NETDEV_TX_OK = 0, /* driver took care of packet */ | 104 | __NETDEV_TX_MIN = INT_MIN, /* make sure enum is signed */ |
85 | NETDEV_TX_BUSY, /* driver tx path was busy*/ | 105 | NETDEV_TX_OK = 0, /* driver took care of packet */ |
86 | NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */ | 106 | NETDEV_TX_BUSY = 1, /* driver tx path was busy*/ |
107 | NETDEV_TX_LOCKED = 2, /* driver tx lock was already taken */ | ||
87 | }; | 108 | }; |
88 | typedef enum netdev_tx netdev_tx_t; | 109 | typedef enum netdev_tx netdev_tx_t; |
89 | 110 | ||