- patches.rt/0001-sched-count-of-queued-RT-tasks.patch: Delete.
[linux-flexiantxendom0-3.2.10.git] / drivers / xen / sfc_netback / ci / efhw / sysdep.h
1 /****************************************************************************
2  * Driver for Solarflare network controllers -
3  *          resource management for Xen backend, OpenOnload, etc
4  *           (including support for SFE4001 10GBT NIC)
5  *
6  * This file provides version-independent Linux kernel API for efhw library.
7  * Only kernels >=2.6.9 are supported.
8  *
9  * Copyright 2005-2007: Solarflare Communications Inc,
10  *                      9501 Jeronimo Road, Suite 250,
11  *                      Irvine, CA 92618, USA
12  *
13  * Developed and maintained by Solarflare Communications:
14  *                      <linux-xen-drivers@solarflare.com>
15  *                      <onload-dev@solarflare.com>
16  *
17  * Certain parts of the driver were implemented by
18  *          Alexandra Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
19  *          OKTET Labs Ltd, Russia,
20  *          http://oktetlabs.ru, <info@oktetlabs.ru>
21  *          by request of Solarflare Communications
22  *
23  *
24  * This program is free software; you can redistribute it and/or modify it
25  * under the terms of the GNU General Public License version 2 as published
26  * by the Free Software Foundation, incorporated herein by reference.
27  *
28  * This program is distributed in the hope that it will be useful,
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31  * GNU General Public License for more details.
32  *
33  * You should have received a copy of the GNU General Public License
34  * along with this program; if not, write to the Free Software
35  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
36  ****************************************************************************
37  */
38
39 #ifndef __CI_EFHW_SYSDEP_LINUX_H__
40 #define __CI_EFHW_SYSDEP_LINUX_H__
41
42 #include <linux/version.h>
43 #include <linux/module.h>
44 #include <linux/spinlock.h>
45 #include <linux/delay.h>
46 #include <linux/if_ether.h>
47
48 #include <linux/netdevice.h> /* necessary for etherdevice.h on some kernels */
49 #include <linux/etherdevice.h>
50
51 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
52 static inline int is_local_ether_addr(const u8 *addr)
53 {
54         return (0x02 & addr[0]);
55 }
56 #endif
57
58 typedef unsigned long irq_flags_t;
59
60 #define spin_lock_destroy(l_)  do {} while (0)
61
62 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
63 #define HAS_NET_NAMESPACE
64 #endif
65
66 /* Funny, but linux has round_up for x86 only, defined in
67  * x86-specific header */
68 #ifndef round_up
69 #define round_up(x, y) (((x) + (y) - 1) & ~((y)-1))
70 #endif
71
72 #endif /* __CI_EFHW_SYSDEP_LINUX_H__ */