blob: 6956de6058278a6eba69a7cf885e0e26479b1e20 [file] [log] [blame]
Nishad Kamdaraf831142020-04-19 19:30:21 +05301/* SPDX-License-Identifier: GPL-2.0 */
Mark Forestaeb30ed52017-08-22 13:26:56 -04002/*
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.
Ken Cox12e364b2014-03-04 07:58:07 -06005 */
6
David Binder7339cb02016-09-02 16:41:32 -04007#ifndef __VISORBUS_PRIVATE_H__
8#define __VISORBUS_PRIVATE_H__
Ken Cox12e364b2014-03-04 07:58:07 -06009
Benjamin Romer90addb02014-05-06 09:58:23 -040010#include <linux/uuid.h>
Jon Frische82ed632016-09-26 11:03:41 -040011#include <linux/utsname.h>
David Kershner93d3ad92017-12-07 12:11:07 -050012#include <linux/visorbus.h>
Benjamin Romer90addb02014-05-06 09:58:23 -040013
Ken Cox12e364b2014-03-04 07:58:07 -060014#include "controlvmchannel.h"
David Kershnerb6d0fa12016-09-02 16:41:39 -040015#include "vbuschannel.h"
Bryan Thompson43c0ab02016-09-02 16:41:31 -040016
David Kershner69a4d1e72017-09-27 13:14:36 -040017struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
18 struct visor_device *from);
David Kershnerfdf5b9a2017-08-22 13:27:24 -040019int visorbus_create_instance(struct visor_device *dev);
Sameer Wadgaonkara7093ba2017-08-22 13:27:33 -040020void visorbus_remove_instance(struct visor_device *bus_info);
Sameer Wadgaonkar51c0f812017-08-22 13:27:34 -040021int create_visor_device(struct visor_device *dev_info);
Sameer Wadgaonkarb74856b2017-08-22 13:27:35 -040022void remove_visor_device(struct visor_device *dev_info);
Sameer Wadgaonkarc0b44132017-05-19 16:17:41 -040023int visorchipset_device_pause(struct visor_device *dev_info);
24int visorchipset_device_resume(struct visor_device *dev_info);
Sameer Wadgaonkar76956aa2017-08-22 13:27:03 -040025void visorbus_response(struct visor_device *p, int response, int controlvm_id);
Sameer Wadgaonkar722e73d2017-08-22 13:27:04 -040026void visorbus_device_changestate_response(struct visor_device *p, int response,
27 struct visor_segment_state state);
Prarit Bhargava55c67dc2015-05-05 18:37:02 -040028int visorbus_init(void);
Prarit Bhargavac79b28f2015-05-05 18:36:15 -040029void visorbus_exit(void);
David Bindere9b18f32016-06-10 21:48:19 -040030
Tim Sell90bb5c12016-06-10 21:48:23 -040031/* visorchannel access functions */
David Kershnerd7f15892017-08-30 13:36:31 -040032struct visorchannel *visorchannel_create(u64 physaddr, gfp_t gfp,
Sameer Wadgaonkar90476672017-09-27 13:14:44 -040033 const guid_t *guid, bool needs_lock);
David Bindere9b18f32016-06-10 21:48:19 -040034void visorchannel_destroy(struct visorchannel *channel);
35int visorchannel_read(struct visorchannel *channel, ulong offset,
Erik Arfvidson9ed146c2016-11-21 12:15:43 -050036 void *dest, ulong nbytes);
David Bindere9b18f32016-06-10 21:48:19 -040037int visorchannel_write(struct visorchannel *channel, ulong offset,
Erik Arfvidson9ed146c2016-11-21 12:15:43 -050038 void *dest, ulong nbytes);
David Bindere9b18f32016-06-10 21:48:19 -040039u64 visorchannel_get_physaddr(struct visorchannel *channel);
40ulong visorchannel_get_nbytes(struct visorchannel *channel);
41char *visorchannel_id(struct visorchannel *channel, char *s);
42char *visorchannel_zoneid(struct visorchannel *channel, char *s);
43u64 visorchannel_get_clientpartition(struct visorchannel *channel);
44int visorchannel_set_clientpartition(struct visorchannel *channel,
45 u64 partition_handle);
Andy Shevchenkob32c5cb2017-08-22 13:26:54 -040046char *visorchannel_guid_id(const guid_t *guid, char *s);
David Binder5da77f32017-03-17 11:27:11 -040047void *visorchannel_get_header(struct visorchannel *channel);
Ken Cox12e364b2014-03-04 07:58:07 -060048#endif