3 * Copyright (C) 2010 - 2013 UNISYS CORPORATION
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.
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
18 #ifndef __VISORCHANNEL_H__
19 #define __VISORCHANNEL_H__
21 #include <linux/uuid.h>
23 #include "memregion.h"
26 #define HOSTADDRESS u64
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.
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,
44 struct visorchannel *visorchannel_create_overlapped_with_lock(
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,
55 BOOL visorchannel_signalremove(struct visorchannel *channel, u32 queue,
57 BOOL visorchannel_signalinsert(struct visorchannel *channel, u32 queue,
59 int visorchannel_signalqueue_slots_avail(struct visorchannel *channel,
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);