Merge remote-tracking branch 'staging/staging-next'
[deliverable/linux.git] / drivers / staging / unisys / visorbus / visorbus_private.h
CommitLineData
7339cb09 1/* visorbus_private.h
12e364b9 2 *
6f14cc18 3 * Copyright (C) 2010 - 2015 UNISYS CORPORATION
12e364b9
KC
4 * All rights reserved.
5 *
6f14cc18
BR
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
12e364b9
KC
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
13 * NON INFRINGEMENT. See the GNU General Public License for more
14 * details.
15 */
16
7339cb09
DB
17#ifndef __VISORBUS_PRIVATE_H__
18#define __VISORBUS_PRIVATE_H__
12e364b9 19
90addb02
BR
20#include <linux/uuid.h>
21
12e364b9 22#include "controlvmchannel.h"
b6d0fa15 23#include "vbuschannel.h"
43c0ab0e
BT
24
25/* TARGET_HOSTNAME specified as -DTARGET_HOSTNAME=\"thename\" on the
26 * command line
27 */
28
29#define TARGET_HOSTNAME "linuxguest"
30
31static inline void bus_device_info_init(
32 struct ultra_vbus_deviceinfo *bus_device_info_ptr,
33 const char *dev_type, const char *drv_name,
34 const char *ver, const char *ver_tag)
35{
36 memset(bus_device_info_ptr, 0, sizeof(struct ultra_vbus_deviceinfo));
37 snprintf(bus_device_info_ptr->devtype,
38 sizeof(bus_device_info_ptr->devtype),
39 "%s", (dev_type) ? dev_type : "unknownType");
40 snprintf(bus_device_info_ptr->drvname,
41 sizeof(bus_device_info_ptr->drvname),
42 "%s", (drv_name) ? drv_name : "unknownDriver");
43 snprintf(bus_device_info_ptr->infostrs,
44 sizeof(bus_device_info_ptr->infostrs), "%s\t%s\t%s",
45 (ver) ? ver : "unknownVer",
46 (ver_tag) ? ver_tag : "unknownVerTag",
47 TARGET_HOSTNAME);
48}
12e364b9 49
87241ab8
DB
50void chipset_bus_create(struct visor_device *bus_info);
51void chipset_bus_destroy(struct visor_device *bus_info);
52void chipset_device_create(struct visor_device *dev_info);
53void chipset_device_destroy(struct visor_device *dev_info);
54void chipset_device_pause(struct visor_device *dev_info);
55void chipset_device_resume(struct visor_device *dev_info);
56
57void bus_create_response(struct visor_device *p, int response);
58void bus_destroy_response(struct visor_device *p, int response);
59void device_create_response(struct visor_device *p, int response);
60void device_destroy_response(struct visor_device *p, int response);
61void device_resume_response(struct visor_device *p, int response);
ea3a5aaf 62void device_pause_response(struct visor_device *p, int response);
12e364b9 63
55c67dca 64int visorbus_init(void);
c79b28f7 65void visorbus_exit(void);
e9b18f3b 66
90bb5c1f 67/* visorchannel access functions */
e9b18f3b 68
e9b18f3b
DB
69struct visorchannel *visorchannel_create(u64 physaddr,
70 unsigned long channel_bytes,
71 gfp_t gfp, uuid_le guid);
72struct visorchannel *visorchannel_create_with_lock(u64 physaddr,
73 unsigned long channel_bytes,
74 gfp_t gfp, uuid_le guid);
75void visorchannel_destroy(struct visorchannel *channel);
76int visorchannel_read(struct visorchannel *channel, ulong offset,
77 void *local, ulong nbytes);
78int visorchannel_write(struct visorchannel *channel, ulong offset,
79 void *local, ulong nbytes);
80u64 visorchannel_get_physaddr(struct visorchannel *channel);
81ulong visorchannel_get_nbytes(struct visorchannel *channel);
82char *visorchannel_id(struct visorchannel *channel, char *s);
83char *visorchannel_zoneid(struct visorchannel *channel, char *s);
84u64 visorchannel_get_clientpartition(struct visorchannel *channel);
85int visorchannel_set_clientpartition(struct visorchannel *channel,
86 u64 partition_handle);
87char *visorchannel_uuid_id(uuid_le *guid, char *s);
88void __iomem *visorchannel_get_header(struct visorchannel *channel);
12e364b9 89#endif
This page took 0.354149 seconds and 5 git commands to generate.