1161304Snetchild/*-
2161304Snetchild * Copyright (c) 2010 Isilon Systems, Inc.
3161304Snetchild * Copyright (c) 2010 iX Systems, Inc.
4161304Snetchild * Copyright (c) 2010 Panasas, Inc.
5161304Snetchild * All rights reserved.
6161304Snetchild *
7161304Snetchild * Redistribution and use in source and binary forms, with or without
8161304Snetchild * modification, are permitted provided that the following conditions
9161304Snetchild * are met:
10161304Snetchild * 1. Redistributions of source code must retain the above copyright
11161304Snetchild *    notice unmodified, this list of conditions, and the following
12161304Snetchild *    disclaimer.
13161304Snetchild * 2. Redistributions in binary form must reproduce the above copyright
14161304Snetchild *    notice, this list of conditions and the following disclaimer in the
15161304Snetchild *    documentation and/or other materials provided with the distribution.
16161304Snetchild *
17161304Snetchild * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18161304Snetchild * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19161304Snetchild * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20161304Snetchild * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21161304Snetchild * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22161304Snetchild * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23161304Snetchild * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24161304Snetchild * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25161304Snetchild * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26161304Snetchild * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27161304Snetchild */
28161304Snetchild
29161304Snetchild#ifndef	_LINUX_IO_MAPPING_H_
30161304Snetchild#define	_LINUX_IO_MAPPING_H_
31161304Snetchild
32161304Snetchild#include <linux/types.h>
33161304Snetchild#include <linux/io.h>
34161304Snetchild
35161304Snetchildstruct io_mapping;
36161304Snetchild
37166420Skibstatic inline struct io_mapping *
38161304Snetchildio_mapping_create_wc(resource_size_t base, unsigned long size)
39161304Snetchild{
40161304Snetchild
41161304Snetchild	return ioremap_wc(base, size);
42161304Snetchild}
43161304Snetchild
44161304Snetchildstatic inline void
45161304Snetchildio_mapping_free(struct io_mapping *mapping)
46161304Snetchild{
47161304Snetchild
48161304Snetchild	iounmap(mapping);
49161304Snetchild}
50161304Snetchild
51161304Snetchildstatic inline void *
52161304Snetchildio_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset)
53161304Snetchild{
54161304Snetchild
55178976Srdivacky	return (((char *)mapping) + offset);
56178976Srdivacky}
57178976Srdivacky
58168275Sjkimstatic inline void
59168275Sjkimio_mapping_unmap_atomic(void *vaddr)
60161304Snetchild{
61161304Snetchild
62161304Snetchild}
63161304Snetchild
64161304Snetchildstatic inline void *
65161304Snetchildio_mapping_map_wc(struct io_mapping *mapping, unsigned long offset)
66161304Snetchild{
67165867Snetchild
68165688Snetchild	return (((char *) mapping) + offset);
69161304Snetchild}
70165688Snetchild
71161304Snetchildstatic inline void
72165867Snetchildio_mapping_unmap(void *vaddr)
73165688Snetchild{
74161304Snetchild
75161304Snetchild}
76161304Snetchild
77161304Snetchild#endif	/* _LINUX_IO_MAPPING_H_ */
78161304Snetchild