28
28
#include <linux/device.h>
29
29
#include "vmbus_api.h"
31
struct driver_context {
32
struct hv_guid class_id;
34
struct device_driver driver;
37
* Use these methods instead of the struct device_driver so 2.6 kernel
41
int (*probe)(struct device *);
42
int (*remove)(struct device *);
43
void (*shutdown)(struct device *);
47
struct work_struct probe_failed_work_item;
48
struct hv_guid class_id;
49
struct hv_guid device_id;
51
struct hv_device device_obj;
55
static inline struct vm_device *to_vm_device(struct hv_device *d)
57
return container_of(d, struct vm_device, device_obj);
60
static inline struct vm_device *device_to_vm_device(struct device *d)
62
return container_of(d, struct vm_device, device);
65
static inline struct driver_context *driver_to_driver_context(struct device_driver *d)
67
return container_of(d, struct driver_context, driver);
34
static inline struct hv_device *device_to_hv_device(struct device *d)
36
return container_of(d, struct hv_device, device);
39
static inline struct hv_driver *drv_to_hv_drv(struct device_driver *d)
41
return container_of(d, struct hv_driver, driver);
71
45
/* Vmbus interface */
72
int vmbus_child_driver_register(struct driver_context *driver_ctx);
73
void vmbus_child_driver_unregister(struct driver_context *driver_ctx);
46
int vmbus_child_driver_register(struct device_driver *drv);
47
void vmbus_child_driver_unregister(struct device_driver *drv);
75
49
extern struct completion hv_channel_ready;