From: Vitaly Kuznetsov Date: Sun, 12 Apr 2015 01:07:46 +0000 (-0700) Subject: Drivers: hv: util: introduce state machine for util drivers X-Git-Tag: v4.1.12-92~196^2~26 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3e5978f42f0aaea5fe715552b0f313892c7967cc;p=users%2Fjedix%2Flinux-maple.git Drivers: hv: util: introduce state machine for util drivers KVP/VSS/FCOPY drivers work in fully serialized mode: we wait till userspace daemon registers, wait for a message from the host, send this message to the daemon, get the reply, send it back to host, wait for another message. Introduce enum hvutil_device_state to represend this state in all 3 drivers. Signed-off-by: Vitaly Kuznetsov Tested-by: Alex Ng Signed-off-by: K. Y. Srinivasan Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 636c88da6df3bb2f978b48d3a7ed55423da84d19) Orabug: 21886720 Signed-off-by: Jason Luo --- diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 4f32f6ab78ec6..3d70e36c918ef 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -771,4 +771,13 @@ static inline void hv_poll_channel(struct vmbus_channel *channel, 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 */