Merge tag 'topic/drm-fixes-2015-07-16' of git://anongit.freedesktop.org/drm-intel...
[firefly-linux-kernel-4.4.55.git] / drivers / hv / hyperv_vmbus.h
index 887287ad411f767dd3b7329e8494cd3a8a6d37aa..cddc0c9f6bf9965a8e59bde34011896a762e07ba 100644 (file)
@@ -647,6 +647,7 @@ struct vmbus_connection {
 
        atomic_t next_gpadl_handle;
 
+       struct completion  unload_event;
        /*
         * Represents channel interrupts. Each bit position represents a
         * channel.  When a channel sends an interrupt via VMBUS, it finds its
@@ -730,9 +731,39 @@ int vmbus_set_event(struct vmbus_channel *channel);
 
 void vmbus_on_event(unsigned long data);
 
+int hv_kvp_init(struct hv_util_service *);
+void hv_kvp_deinit(void);
+void hv_kvp_onchannelcallback(void *);
+
+int hv_vss_init(struct hv_util_service *);
+void hv_vss_deinit(void);
+void hv_vss_onchannelcallback(void *);
+
 int hv_fcopy_init(struct hv_util_service *);
 void hv_fcopy_deinit(void);
 void hv_fcopy_onchannelcallback(void *);
+void vmbus_initiate_unload(void);
+
+static inline void hv_poll_channel(struct vmbus_channel *channel,
+                                  void (*cb)(void *))
+{
+       if (!channel)
+               return;
+
+       if (channel->target_cpu != smp_processor_id())
+               smp_call_function_single(channel->target_cpu,
+                                        cb, channel, true);
+       else
+               cb(channel);
+}
 
+enum hvutil_device_state {
+       HVUTIL_DEVICE_INIT = 0,  /* driver is loaded, waiting for userspace */
+       HVUTIL_READY,            /* userspace is registered */
+       HVUTIL_HOSTMSG_RECEIVED, /* message from the host was received */
+       HVUTIL_USERSPACE_REQ,    /* request to userspace was sent */
+       HVUTIL_USERSPACE_RECV,   /* reply from userspace was received */
+       HVUTIL_DEVICE_DYING,     /* driver unload is in progress */
+};
 
 #endif /* _HYPERV_VMBUS_H */