1 /* visorchipset.h 2 * 3 * Copyright (C) 2010 - 2015 UNISYS CORPORATION 4 * All rights reserved. 5 * 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. 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 17 #ifndef __VISORCHIPSET_H__ 18 #define __VISORCHIPSET_H__ 19 20 #include <linux/uuid.h> 21 22 #include "controlvmchannel.h" 23 #include "vbusdeviceinfo.h" 24 #include "vbushelper.h" 25 26 /* These functions will be called from within visorchipset when certain 27 * events happen. (The implementation of these functions is outside of 28 * visorchipset.) 29 */ 30 struct visorchipset_busdev_notifiers { 31 void (*bus_create)(struct visor_device *bus_info); 32 void (*bus_destroy)(struct visor_device *bus_info); 33 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); 37 }; 38 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 */ 45 struct visorchipset_busdev_responders { 46 void (*bus_create)(struct visor_device *p, int response); 47 void (*bus_destroy)(struct visor_device *p, int response); 48 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); 52 }; 53 54 /** Register functions (in the bus driver) to get called by visorchipset 55 * 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. 58 */ 59 void 60 visorchipset_register_busdev( 61 struct visorchipset_busdev_notifiers *notifiers, 62 struct visorchipset_busdev_responders *responders, 63 struct ultra_vbus_deviceinfo *driver_info); 64 65 /* visorbus init and exit functions */ 66 int visorbus_init(void); 67 void visorbus_exit(void); 68 #endif 69