#include <linux/device.h>
#include <linux/module.h>
+#include <linux/poll.h>
#include <linux/kernel.h>
#include <linux/uuid.h>
struct visor_driver;
struct visor_device;
+extern struct bus_type visorbus_type;
typedef void (*visorbus_state_complete_func) (struct visor_device *dev,
- int status);
+ int status, void *dev_info);
+struct visorchipset_state {
+ u32 created:1;
+ u32 attached:1;
+ u32 configured:1;
+ u32 running:1;
+ /* Add new fields above. */
+ /* Remaining bits in this 32-bit word are unused. */
+};
/** This struct describes a specific Supervisor channel, by providing its
* GUID, name, and sizes.
* fails or completes successfully.
*/
int (*pause)(struct visor_device *dev,
- visorbus_state_complete_func complete_func);
+ visorbus_state_complete_func complete_func,
+ void *dev_info);
int (*resume)(struct visor_device *dev,
- visorbus_state_complete_func complete_func);
+ visorbus_state_complete_func complete_func,
+ void *dev_info);
/** These fields are for private use by the bus driver only. */
struct device_driver driver;
struct periodic_work *periodic_work;
bool being_removed;
bool responded_to_device_create;
- struct kobject kobjchannel; /* visorbus<x>/dev<y>/channel/ */
struct kobject kobjdevmajorminor; /* visorbus<x>/dev<y>/devmajorminor/*/
struct {
int major, minor;
struct semaphore visordriver_callback_lock;
bool pausing;
bool resuming;
- unsigned long chipset_bus_no;
- unsigned long chipset_dev_no;
+ u32 chipset_bus_no;
+ u32 chipset_dev_no;
+ struct visorchipset_state state;
+ uuid_le type;
+ uuid_le inst;
+ u8 *name;
+ u8 *description;
+ struct controlvm_message_header *pending_msg_hdr;
+ void *vbus_hdr_info;
+ u32 switch_no;
+ u32 internal_port_no;
+ uuid_le partition_uuid;
};
#define to_visor_device(x) container_of(x, struct visor_device, device)
* In this case, the values can simply be read from the channel header.
*/
struct visorchannel *visorchannel_create(u64 physaddr,
- ulong channel_bytes, uuid_le guid);
+ unsigned long channel_bytes,
+ gfp_t gfp, uuid_le guid);
struct visorchannel *visorchannel_create_with_lock(u64 physaddr,
- ulong channel_bytes,
- uuid_le guid);
+ unsigned long channel_bytes,
+ gfp_t gfp, uuid_le guid);
void visorchannel_destroy(struct visorchannel *channel);
int visorchannel_read(struct visorchannel *channel, ulong offset,
void *local, ulong nbytes);
char *visorchannel_id(struct visorchannel *channel, char *s);
char *visorchannel_zoneid(struct visorchannel *channel, char *s);
u64 visorchannel_get_clientpartition(struct visorchannel *channel);
+int visorchannel_set_clientpartition(struct visorchannel *channel,
+ u64 partition_handle);
uuid_le visorchannel_get_uuid(struct visorchannel *channel);
char *visorchannel_uuid_id(uuid_le *guid, char *s);
void visorchannel_debug(struct visorchannel *channel, int num_queues,
struct seq_file *seq, u32 off);
void __iomem *visorchannel_get_header(struct visorchannel *channel);
+#define BUS_ROOT_DEVICE UINT_MAX
+struct visor_device *visorbus_get_device_by_id(u32 bus_no, u32 dev_no,
+ struct visor_device *from);
#endif