Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 1 | /* visorchipset.h |
| 2 | * |
Benjamin Romer | 6f14cc1 | 2015-07-16 12:40:48 -0400 | [diff] [blame] | 3 | * Copyright (C) 2010 - 2015 UNISYS CORPORATION |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 4 | * All rights reserved. |
| 5 | * |
Benjamin Romer | 6f14cc1 | 2015-07-16 12:40:48 -0400 | [diff] [blame] | 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. |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 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 | |
Benjamin Romer | 90addb0 | 2014-05-06 09:58:23 -0400 | [diff] [blame] | 20 | #include <linux/uuid.h> |
| 21 | |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 22 | #include "controlvmchannel.h" |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 23 | #include "vbusdeviceinfo.h" |
| 24 | #include "vbushelper.h" |
| 25 | |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 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 | */ |
Benjamin Romer | fe90d89 | 2014-10-31 09:57:32 -0400 | [diff] [blame] | 30 | struct visorchipset_busdev_notifiers { |
Don Zickus | d32517e | 2015-06-04 09:22:41 -0400 | [diff] [blame] | 31 | void (*bus_create)(struct visor_device *bus_info); |
| 32 | void (*bus_destroy)(struct visor_device *bus_info); |
Don Zickus | a298bc0 | 2015-06-04 09:22:42 -0400 | [diff] [blame] | 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); |
Benjamin Romer | fe90d89 | 2014-10-31 09:57:32 -0400 | [diff] [blame] | 37 | }; |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 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 | */ |
Benjamin Romer | 929aa8a | 2014-10-31 09:57:33 -0400 | [diff] [blame] | 45 | struct visorchipset_busdev_responders { |
Don Zickus | d32517e | 2015-06-04 09:22:41 -0400 | [diff] [blame] | 46 | void (*bus_create)(struct visor_device *p, int response); |
| 47 | void (*bus_destroy)(struct visor_device *p, int response); |
Don Zickus | a298bc0 | 2015-06-04 09:22:42 -0400 | [diff] [blame] | 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); |
Benjamin Romer | 929aa8a | 2014-10-31 09:57:33 -0400 | [diff] [blame] | 52 | }; |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 53 | |
| 54 | /** Register functions (in the bus driver) to get called by visorchipset |
David Kershner | 4da3336 | 2015-05-05 18:36:39 -0400 | [diff] [blame] | 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. |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 58 | */ |
| 59 | void |
David Kershner | 4da3336 | 2015-05-05 18:36:39 -0400 | [diff] [blame] | 60 | visorchipset_register_busdev( |
Benjamin Romer | fe90d89 | 2014-10-31 09:57:32 -0400 | [diff] [blame] | 61 | struct visorchipset_busdev_notifiers *notifiers, |
Benjamin Romer | 929aa8a | 2014-10-31 09:57:33 -0400 | [diff] [blame] | 62 | struct visorchipset_busdev_responders *responders, |
Benjamin Romer | 1e7a59c | 2014-10-31 09:57:35 -0400 | [diff] [blame] | 63 | struct ultra_vbus_deviceinfo *driver_info); |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 64 | |
Prarit Bhargava | c79b28f | 2015-05-05 18:36:15 -0400 | [diff] [blame] | 65 | /* visorbus init and exit functions */ |
Prarit Bhargava | 55c67dc | 2015-05-05 18:37:02 -0400 | [diff] [blame] | 66 | int visorbus_init(void); |
Prarit Bhargava | c79b28f | 2015-05-05 18:36:15 -0400 | [diff] [blame] | 67 | void visorbus_exit(void); |
Ken Cox | 12e364b | 2014-03-04 07:58:07 -0600 | [diff] [blame] | 68 | #endif |