/* * Compatibility code for older Linux kernels * * Copyright (c) 2007 Pavel Roskin * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. */ #include #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) #define skb_mac_header(_skb) ((_skb)->mac.raw) #define skb_reset_mac_header(_skb) \ do { (_skb)->mac.raw = (_skb)->data; } while(0) #define skb_set_mac_header(_skb, _offset) \ do { (_skb)->mac.raw = (_skb)->data + (_offset); } while(0) #define skb_end_pointer(_skb) ((_skb)->end) #define skb_tail_pointer(_skb) ((_skb)->tail) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) #undef INIT_WORK #define INIT_WORK(_work, _func) \ do { \ INIT_LIST_HEAD(&(_work)->entry); \ (_work)->pending = 0; \ PREPARE_WORK((_work), (void (*)(void *))(_func), \ (void *)(_work)); \ init_timer(&(_work)->timer); \ } while (0) #endif