Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / drivers / staging / unisys / visorchannel / visorchannel.h
1 /* visorchannel.h
2  *
3  * Copyright (C) 2010 - 2013 UNISYS CORPORATION
4  * All rights reserved.
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or (at
9  * your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14  * NON INFRINGEMENT.  See the GNU General Public License for more
15  * details.
16  */
17
18 #ifndef __VISORCHANNEL_H__
19 #define __VISORCHANNEL_H__
20
21 #include <linux/uuid.h>
22
23 #include "memregion.h"
24 #include "channel.h"
25 #ifndef HOSTADDRESS
26 #define HOSTADDRESS u64
27 #endif
28 #ifndef BOOL
29 #define BOOL int
30 #endif
31
32 /* Note that for visorchannel_create() and visorchannel_create_overlapped(),
33  * <channel_bytes> and <guid> arguments may be 0 if we are a channel CLIENT.
34  * In this case, the values can simply be read from the channel header.
35  */
36 struct visorchannel *visorchannel_create(HOSTADDRESS physaddr,
37                                          ulong channel_bytes, uuid_le guid);
38 struct visorchannel *visorchannel_create_overlapped(ulong channel_bytes,
39                                                     struct visorchannel *parent,
40                                                     ulong off, uuid_le guid);
41 struct visorchannel *visorchannel_create_with_lock(HOSTADDRESS physaddr,
42                                                    ulong channel_bytes,
43                                                    uuid_le guid);
44 struct visorchannel *visorchannel_create_overlapped_with_lock(
45                                 ulong channel_bytes,
46                                 struct visorchannel *parent,
47                                 ulong off, uuid_le guid);
48 void visorchannel_destroy(struct visorchannel *channel);
49 int visorchannel_read(struct visorchannel *channel, ulong offset,
50                       void *local, ulong nbytes);
51 int visorchannel_write(struct visorchannel *channel, ulong offset,
52                        void *local, ulong nbytes);
53 int visorchannel_clear(struct visorchannel *channel, ulong offset,
54                        u8 ch, ulong nbytes);
55 BOOL visorchannel_signalremove(struct visorchannel *channel, u32 queue,
56                                void *msg);
57 BOOL visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
58                                void *msg);
59 int visorchannel_signalqueue_slots_avail(struct visorchannel *channel,
60                                          u32 queue);
61 int visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue);
62 HOSTADDRESS visorchannel_get_physaddr(struct visorchannel *channel);
63 ulong visorchannel_get_nbytes(struct visorchannel *channel);
64 char *visorchannel_id(struct visorchannel *channel, char *s);
65 char *visorchannel_zoneid(struct visorchannel *channel, char *s);
66 u64 visorchannel_get_clientpartition(struct visorchannel *channel);
67 uuid_le visorchannel_get_uuid(struct visorchannel *channel);
68 struct memregion *visorchannel_get_memregion(struct visorchannel *channel);
69 char *visorchannel_uuid_id(uuid_le *guid, char *s);
70 void visorchannel_debug(struct visorchannel *channel, int num_queues,
71                         struct seq_file *seq, u32 off);
72 void visorchannel_dump_section(struct visorchannel *chan, char *s,
73                                int off, int len, struct seq_file *seq);
74 void __iomem *visorchannel_get_header(struct visorchannel *channel);
75
76 #endif