p@2552: /**
p@2552: Network Driver for Beckhoff CCAT communication controller
p@2552: Copyright (C) 2014 Beckhoff Automation GmbH
p@2552: Author: Patrick Bruenn
p@2552:
p@2552: This program is free software; you can redistribute it and/or modify
p@2552: it under the terms of the GNU General Public License as published by
p@2552: the Free Software Foundation; either version 2 of the License, or
p@2552: (at your option) any later version.
p@2552:
p@2552: This program is distributed in the hope that it will be useful,
p@2552: but WITHOUT ANY WARRANTY; without even the implied warranty of
p@2552: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
p@2552: GNU General Public License for more details.
p@2552:
p@2552: You should have received a copy of the GNU General Public License along
p@2552: with this program; if not, write to the Free Software Foundation, Inc.,
p@2552: 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
p@2552: */
p@2552:
p@2552: #ifndef _CCAT_COMPAT_H_
p@2552: #define _CCAT_COMPAT_H_
p@2552: #include
p@2552: #include
p@2552: #include
p@2552:
p@2552: #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 32)
p@2552: #define pr_warn pr_info
p@2552:
p@2552: #define netdev_info(DEV, ...) pr_info(__VA_ARGS__)
p@2552: #define netdev_err netdev_info
p@2552:
p@2552: static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
p@2552: dma_addr_t * dma_handle, gfp_t flag)
p@2552: {
p@2552: void *result =
p@2552: dma_alloc_coherent(dev, size, dma_handle, flag | __GFP_ZERO);
p@2552: if (result)
p@2552: memset(result, 0, size);
p@2552: return result;
p@2552: }
p@2552:
p@2552: static inline void usleep_range(unsigned long min, unsigned long max)
p@2552: {
p@2552: msleep(min / 1000);
p@2552: }
p@2552: #endif
p@2552: #endif /* #ifndef _CCAT_COMPAT_H_ */