blob: 39edd20184531f89b4174f3abaaa12807e6dbb35 [file] [log] [blame]
Ken Cox12e364b2014-03-04 07:58:07 -06001/* visorchipset.h
2 *
Benjamin Romer6f14cc12015-07-16 12:40:48 -04003 * Copyright (C) 2010 - 2015 UNISYS CORPORATION
Ken Cox12e364b2014-03-04 07:58:07 -06004 * All rights reserved.
5 *
Benjamin Romer6f14cc12015-07-16 12:40:48 -04006 * 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.
Ken Cox12e364b2014-03-04 07:58:07 -06009 *
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
17#ifndef __VISORCHIPSET_H__
18#define __VISORCHIPSET_H__
19
Benjamin Romer90addb02014-05-06 09:58:23 -040020#include <linux/uuid.h>
21
Ken Cox12e364b2014-03-04 07:58:07 -060022#include "controlvmchannel.h"
Ken Cox12e364b2014-03-04 07:58:07 -060023#include "vbusdeviceinfo.h"
24#include "vbushelper.h"
25
Ken Cox12e364b2014-03-04 07:58:07 -060026/* These functions will be called from within visorchipset when certain
27 * events happen. (The implementation of these functions is outside of
28 * visorchipset.)
29 */
Benjamin Romerfe90d892014-10-31 09:57:32 -040030struct visorchipset_busdev_notifiers {
Don Zickusd32517e2015-06-04 09:22:41 -040031 void (*bus_create)(struct visor_device *bus_info);
32 void (*bus_destroy)(struct visor_device *bus_info);
Don Zickusa298bc02015-06-04 09:22:42 -040033 void (*device_create)(struct visor_device *bus_info);
34 void (*device_destroy)(struct visor_device *bus_info);
35 void (*device_pause)(struct visor_device *bus_info);
36 void (*device_resume)(struct visor_device *bus_info);
Benjamin Romerfe90d892014-10-31 09:57:32 -040037};
Ken Cox12e364b2014-03-04 07:58:07 -060038
39/* These functions live inside visorchipset, and will be called to indicate
40 * responses to specific events (by code outside of visorchipset).
41 * For now, the value for each response is simply either:
42 * 0 = it worked
43 * -1 = it failed
44 */
Benjamin Romer929aa8a2014-10-31 09:57:33 -040045struct visorchipset_busdev_responders {
Don Zickusd32517e2015-06-04 09:22:41 -040046 void (*bus_create)(struct visor_device *p, int response);
47 void (*bus_destroy)(struct visor_device *p, int response);
Don Zickusa298bc02015-06-04 09:22:42 -040048 void (*device_create)(struct visor_device *p, int response);
49 void (*device_destroy)(struct visor_device *p, int response);
50 void (*device_pause)(struct visor_device *p, int response);
51 void (*device_resume)(struct visor_device *p, int response);
Benjamin Romer929aa8a2014-10-31 09:57:33 -040052};
Ken Cox12e364b2014-03-04 07:58:07 -060053
54/** Register functions (in the bus driver) to get called by visorchipset
David Kershner4da33362015-05-05 18:36:39 -040055 * whenever a bus or device appears for which this guest is to be the
56 * client for. visorchipset will fill in <responders>, to indicate
57 * functions the bus driver should call to indicate message responses.
Ken Cox12e364b2014-03-04 07:58:07 -060058 */
59void
David Kershner4da33362015-05-05 18:36:39 -040060visorchipset_register_busdev(
Benjamin Romerfe90d892014-10-31 09:57:32 -040061 struct visorchipset_busdev_notifiers *notifiers,
Benjamin Romer929aa8a2014-10-31 09:57:33 -040062 struct visorchipset_busdev_responders *responders,
Benjamin Romer1e7a59c2014-10-31 09:57:35 -040063 struct ultra_vbus_deviceinfo *driver_info);
Ken Cox12e364b2014-03-04 07:58:07 -060064
Prarit Bhargavac79b28f2015-05-05 18:36:15 -040065/* visorbus init and exit functions */
Prarit Bhargava55c67dc2015-05-05 18:37:02 -040066int visorbus_init(void);
Prarit Bhargavac79b28f2015-05-05 18:36:15 -040067void visorbus_exit(void);
Ken Cox12e364b2014-03-04 07:58:07 -060068#endif