1 /****************************************************************************
2 * Driver for Solarflare network controllers -
3 * resource management for Xen backend, OpenOnload, etc
4 * (including support for SFE4001 10GBT NIC)
6 * This file provides version-independent Linux kernel API for header files
7 * with hardware-related definitions (in ci/driver/efab/hardware*).
8 * Only kernels >=2.6.9 are supported.
10 * Copyright 2005-2007: Solarflare Communications Inc,
11 * 9501 Jeronimo Road, Suite 250,
12 * Irvine, CA 92618, USA
14 * Developed and maintained by Solarflare Communications:
15 * <linux-xen-drivers@solarflare.com>
16 * <onload-dev@solarflare.com>
18 * Certain parts of the driver were implemented by
19 * Alexandra Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
20 * OKTET Labs Ltd, Russia,
21 * http://oktetlabs.ru, <info@oktetlabs.ru>
22 * by request of Solarflare Communications
25 * This program is free software; you can redistribute it and/or modify it
26 * under the terms of the GNU General Public License version 2 as published
27 * by the Free Software Foundation, incorporated herein by reference.
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * You should have received a copy of the GNU General Public License
35 * along with this program; if not, write to the Free Software
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
37 ****************************************************************************
40 #ifndef __CI_EFHW_HARDWARE_LINUX_H__
41 #define __CI_EFHW_HARDWARE_LINUX_H__
45 #if defined(__LITTLE_ENDIAN)
46 #define EFHW_IS_LITTLE_ENDIAN
47 #elif defined(__BIG_ENDIAN)
48 #define EFHW_IS_BIG_ENDIAN
50 #error Unknown endianness
54 static inline uint64_t __readq(volatile void __iomem *addr)
56 return *(volatile uint64_t *)addr;
58 #define readq(x) __readq(x)
62 static inline void __writeq(uint64_t v, volatile void __iomem *addr)
64 *(volatile uint64_t *)addr = v;
66 #define writeq(val, addr) __writeq((val), (addr))
69 #endif /* __CI_EFHW_HARDWARE_LINUX_H__ */