diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index cebe677e153b..5e8e2d50429a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -36,6 +36,7 @@ | |||
36 | 36 | ||
37 | #include <linux/device.h> | 37 | #include <linux/device.h> |
38 | #include <linux/percpu.h> | 38 | #include <linux/percpu.h> |
39 | #include <linux/dmaengine.h> | ||
39 | 40 | ||
40 | struct divert_blk; | 41 | struct divert_blk; |
41 | struct vlan_group; | 42 | struct vlan_group; |
@@ -310,6 +311,9 @@ struct net_device | |||
310 | #define NETIF_F_LLTX 4096 /* LockLess TX */ | 311 | #define NETIF_F_LLTX 4096 /* LockLess TX */ |
311 | #define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ | 312 | #define NETIF_F_UFO 8192 /* Can offload UDP Large Send*/ |
312 | 313 | ||
314 | #define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) | ||
315 | #define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) | ||
316 | |||
313 | struct net_device *next_sched; | 317 | struct net_device *next_sched; |
314 | 318 | ||
315 | /* Interface index. Unique device identifier */ | 319 | /* Interface index. Unique device identifier */ |
@@ -405,7 +409,7 @@ struct net_device | |||
405 | * One part is mostly used on xmit path (device) | 409 | * One part is mostly used on xmit path (device) |
406 | */ | 410 | */ |
407 | /* hard_start_xmit synchronizer */ | 411 | /* hard_start_xmit synchronizer */ |
408 | spinlock_t xmit_lock ____cacheline_aligned_in_smp; | 412 | spinlock_t _xmit_lock ____cacheline_aligned_in_smp; |
409 | /* cpu id of processor entered to hard_start_xmit or -1, | 413 | /* cpu id of processor entered to hard_start_xmit or -1, |
410 | if nobody entered there. | 414 | if nobody entered there. |
411 | */ | 415 | */ |
@@ -592,6 +596,9 @@ struct softnet_data | |||
592 | struct sk_buff *completion_queue; | 596 | struct sk_buff *completion_queue; |
593 | 597 | ||
594 | struct net_device backlog_dev; /* Sorry. 8) */ | 598 | struct net_device backlog_dev; /* Sorry. 8) */ |
599 | #ifdef CONFIG_NET_DMA | ||
600 | struct dma_chan *net_dma; | ||
601 | #endif | ||
595 | }; | 602 | }; |
596 | 603 | ||
597 | DECLARE_PER_CPU(struct softnet_data,softnet_data); | 604 | DECLARE_PER_CPU(struct softnet_data,softnet_data); |
@@ -888,11 +895,43 @@ static inline void __netif_rx_complete(struct net_device *dev) | |||
888 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); | 895 | clear_bit(__LINK_STATE_RX_SCHED, &dev->state); |
889 | } | 896 | } |
890 | 897 | ||
898 | static inline void netif_tx_lock(struct net_device *dev) | ||
899 | { | ||
900 | spin_lock(&dev->_xmit_lock); | ||
901 | dev->xmit_lock_owner = smp_processor_id(); | ||
902 | } | ||
903 | |||
904 | static inline void netif_tx_lock_bh(struct net_device *dev) | ||
905 | { | ||
906 | spin_lock_bh(&dev->_xmit_lock); | ||
907 | dev->xmit_lock_owner = smp_processor_id(); | ||
908 | } | ||
909 | |||
910 | static inline int netif_tx_trylock(struct net_device *dev) | ||
911 | { | ||
912 | int err = spin_trylock(&dev->_xmit_lock); | ||
913 | if (!err) | ||
914 | dev->xmit_lock_owner = smp_processor_id(); | ||
915 | return err; | ||
916 | } | ||
917 | |||
918 | static inline void netif_tx_unlock(struct net_device *dev) | ||
919 | { | ||
920 | dev->xmit_lock_owner = -1; | ||
921 | spin_unlock(&dev->_xmit_lock); | ||
922 | } | ||
923 | |||
924 | static inline void netif_tx_unlock_bh(struct net_device *dev) | ||
925 | { | ||
926 | dev->xmit_lock_owner = -1; | ||
927 | spin_unlock_bh(&dev->_xmit_lock); | ||
928 | } | ||
929 | |||
891 | static inline void netif_tx_disable(struct net_device *dev) | 930 | static inline void netif_tx_disable(struct net_device *dev) |
892 | { | 931 | { |
893 | spin_lock_bh(&dev->xmit_lock); | 932 | netif_tx_lock_bh(dev); |
894 | netif_stop_queue(dev); | 933 | netif_stop_queue(dev); |
895 | spin_unlock_bh(&dev->xmit_lock); | 934 | netif_tx_unlock_bh(dev); |
896 | } | 935 | } |
897 | 936 | ||
898 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ | 937 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ |