]> git.openfabrics.org - ~emulex/for-vlad/old/compat.git/commitdiff
Backport netdev_alloc_skb_ip_align
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Sat, 12 Dec 2009 05:33:41 +0000 (21:33 -0800)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Sat, 12 Dec 2009 05:33:41 +0000 (21:33 -0800)
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
include/linux/compat-2.6.33.h

index 8ac44e59b1e98e2cc25e776315c652ad47eabc08..0942baf19504491b8e9ae07a7fcd00ac2c48fd33 100644 (file)
@@ -7,6 +7,8 @@
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33))
 
+#include <linux/skbuff.h>
+
 #define IFF_DONT_BRIDGE 0x800          /* disallow bridging this ether dev */
 /* source: include/linux/if.h */
 
 /* this will never happen on older kernels */
 #define NETDEV_POST_INIT 0xffff
 
+static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
+                unsigned int length)
+{
+       struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN);
+
+       if (NET_IP_ALIGN && skb)
+               skb_reserve(skb, NET_IP_ALIGN);
+       return skb;
+}
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
 
 #endif /* LINUX_26_33_COMPAT_H */