diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2014-12-20 23:10:52 +0100 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2014-12-21 17:08:27 +0100 |
commit | 3fb8e0f663e32a6042abed9b0c6cf0aaf13b7d37 (patch) | |
tree | 9276f3ba08c160380c3763abaa270980512c7af3 | |
parent | 43cf7675ef4665eaa43fb4ac109ff09c506dabc1 (diff) |
header: add eth_skb_pad()
eth_skb_pad() is used by the igb driver.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r-- | backport/backport-include/linux/etherdevice.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/backport/backport-include/linux/etherdevice.h b/backport/backport-include/linux/etherdevice.h index 70decd29..34dbf651 100644 --- a/backport/backport-include/linux/etherdevice.h +++ b/backport/backport-include/linux/etherdevice.h @@ -178,4 +178,19 @@ static inline void ether_addr_copy(u8 *dst, const u8 *src) int eth_get_headlen(unsigned char *data, unsigned int max_len); #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#define eth_skb_pad LINUX_BACKPORT(eth_skb_pad) +/** + * eth_skb_pad - Pad buffer to mininum number of octets for Ethernet frame + * @skb: Buffer to pad + * + * An Ethernet frame should have a minimum size of 60 bytes. This function + * takes short frames and pads them with zeros up to the 60 byte limit. + */ +static inline int eth_skb_pad(struct sk_buff *skb) +{ + return skb_put_padto(skb, ETH_ZLEN); +} +#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) */ + #endif /* _BACKPORT_LINUX_ETHERDEVICE_H */ |