|
@@ -129,7 +129,7 @@ static struct vmbus_driver_context g_vmbus_drv = {
|
|
|
.bus.dev_attrs = vmbus_device_attrs,
|
|
|
};
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_show_device_attr - Show the device attribute in sysfs.
|
|
|
*
|
|
|
* This is invoked when user does a
|
|
@@ -233,7 +233,7 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_bus_init -Main vmbus driver initialization routine.
|
|
|
*
|
|
|
* Here, we
|
|
@@ -362,7 +362,7 @@ cleanup:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_bus_exit - Terminate the vmbus driver.
|
|
|
*
|
|
|
* This routine is opposite of vmbus_bus_init()
|
|
@@ -398,8 +398,18 @@ static void vmbus_bus_exit(void)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * vmbus_child_driver_register - Register a vmbus's child driver
|
|
|
+ * vmbus_child_driver_register() - Register a vmbus's child driver
|
|
|
+ * @driver_ctx: Pointer to driver structure you want to register
|
|
|
+ *
|
|
|
+ * @driver_ctx is of type &struct driver_context
|
|
|
+ *
|
|
|
+ * Registers the given driver with Linux through the 'driver_register()' call
|
|
|
+ * And sets up the hyper-v vmbus handling for this driver.
|
|
|
+ * It will return the state of the 'driver_register()' call.
|
|
|
+ *
|
|
|
+ * Mainly used by Hyper-V drivers.
|
|
|
*/
|
|
|
int vmbus_child_driver_register(struct driver_context *driver_ctx)
|
|
|
{
|
|
@@ -425,7 +435,15 @@ int vmbus_child_driver_register(struct driver_context *driver_ctx)
|
|
|
EXPORT_SYMBOL(vmbus_child_driver_register);
|
|
|
|
|
|
/**
|
|
|
- * vmbus_child_driver_unregister Unregister a vmbus's child driver
|
|
|
+ * vmbus_child_driver_unregister() - Unregister a vmbus's child driver
|
|
|
+ * @driver_ctx: Pointer to driver structure you want to un-register
|
|
|
+ *
|
|
|
+ * @driver_ctx is of type &struct driver_context
|
|
|
+ *
|
|
|
+ * Un-register the given driver with Linux through the 'driver_unregister()'
|
|
|
+ * call. And ungegisters the driver from the Hyper-V vmbus handler.
|
|
|
+ *
|
|
|
+ * Mainly used by Hyper-V drivers.
|
|
|
*/
|
|
|
void vmbus_child_driver_unregister(struct driver_context *driver_ctx)
|
|
|
{
|
|
@@ -443,9 +461,15 @@ void vmbus_child_driver_unregister(struct driver_context *driver_ctx)
|
|
|
EXPORT_SYMBOL(vmbus_child_driver_unregister);
|
|
|
|
|
|
/**
|
|
|
- * vmbus_get_interface - Get the vmbus channel interface.
|
|
|
+ * vmbus_get_interface() - Get the vmbus channel interface.
|
|
|
+ * @interface: Pointer to channel interface structure
|
|
|
+ *
|
|
|
+ * Get the Hyper-V channel used for the driver.
|
|
|
+ *
|
|
|
+ * @interface is of type &struct vmbus_channel_interface
|
|
|
+ * This is invoked by child/client driver that sits above vmbus.
|
|
|
*
|
|
|
- * This is invoked by child/client driver that sits above vmbus
|
|
|
+ * Mainly used by Hyper-V drivers.
|
|
|
*/
|
|
|
void vmbus_get_interface(struct vmbus_channel_interface *interface)
|
|
|
{
|
|
@@ -455,7 +479,7 @@ void vmbus_get_interface(struct vmbus_channel_interface *interface)
|
|
|
}
|
|
|
EXPORT_SYMBOL(vmbus_get_interface);
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_child_device_get_info - Get the vmbus child device info.
|
|
|
*
|
|
|
* This is invoked to display various device attributes in sysfs.
|
|
@@ -468,8 +492,9 @@ static void vmbus_child_device_get_info(struct hv_device *device_obj,
|
|
|
vmbus_drv_obj->GetChannelInfo(device_obj, device_info);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * vmbus_child_device_create - Creates and registers a new child device on the vmbus.
|
|
|
+/*
|
|
|
+ * vmbus_child_device_create - Creates and registers a new child device
|
|
|
+ * on the vmbus.
|
|
|
*/
|
|
|
static struct hv_device *vmbus_child_device_create(struct hv_guid *type,
|
|
|
struct hv_guid *instance,
|
|
@@ -523,7 +548,7 @@ static struct hv_device *vmbus_child_device_create(struct hv_guid *type,
|
|
|
return child_device_obj;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_child_device_register - Register the child device on the specified bus
|
|
|
*/
|
|
|
static int vmbus_child_device_register(struct hv_device *root_device_obj,
|
|
@@ -571,8 +596,9 @@ static int vmbus_child_device_register(struct hv_device *root_device_obj,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * vmbus_child_device_unregister - Remove the specified child device from the vmbus.
|
|
|
+/*
|
|
|
+ * vmbus_child_device_unregister - Remove the specified child device
|
|
|
+ * from the vmbus.
|
|
|
*/
|
|
|
static void vmbus_child_device_unregister(struct hv_device *device_obj)
|
|
|
{
|
|
@@ -595,7 +621,7 @@ static void vmbus_child_device_unregister(struct hv_device *device_obj)
|
|
|
DPRINT_EXIT(VMBUS_DRV);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_child_device_destroy - Destroy the specified child device on the vmbus.
|
|
|
*/
|
|
|
static void vmbus_child_device_destroy(struct hv_device *device_obj)
|
|
@@ -605,7 +631,7 @@ static void vmbus_child_device_destroy(struct hv_device *device_obj)
|
|
|
DPRINT_EXIT(VMBUS_DRV);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_uevent - add uevent for our device
|
|
|
*
|
|
|
* This routine is invoked when a device is added or removed on the vmbus to
|
|
@@ -684,7 +710,7 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_match - Attempt to match the specified device to the specified driver
|
|
|
*/
|
|
|
static int vmbus_match(struct device *device, struct device_driver *driver)
|
|
@@ -719,7 +745,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
|
|
|
return match;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_probe_failed_cb - Callback when a driver probe failed in vmbus_probe()
|
|
|
*
|
|
|
* We need a callback because we cannot invoked device_unregister() inside
|
|
@@ -742,7 +768,7 @@ static void vmbus_probe_failed_cb(struct work_struct *context)
|
|
|
DPRINT_EXIT(VMBUS_DRV);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_probe - Add the new vmbus's child device
|
|
|
*/
|
|
|
static int vmbus_probe(struct device *child_device)
|
|
@@ -778,7 +804,7 @@ static int vmbus_probe(struct device *child_device)
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_remove - Remove a vmbus device
|
|
|
*/
|
|
|
static int vmbus_remove(struct device *child_device)
|
|
@@ -820,7 +846,7 @@ static int vmbus_remove(struct device *child_device)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_shutdown - Shutdown a vmbus device
|
|
|
*/
|
|
|
static void vmbus_shutdown(struct device *child_device)
|
|
@@ -856,7 +882,7 @@ static void vmbus_shutdown(struct device *child_device)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_bus_release - Final callback release of the vmbus root device
|
|
|
*/
|
|
|
static void vmbus_bus_release(struct device *device)
|
|
@@ -870,7 +896,7 @@ static void vmbus_bus_release(struct device *device)
|
|
|
DPRINT_EXIT(VMBUS_DRV);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_device_release - Final callback release of the vmbus child device
|
|
|
*/
|
|
|
static void vmbus_device_release(struct device *device)
|
|
@@ -888,7 +914,7 @@ static void vmbus_device_release(struct device *device)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_msg_dpc - Tasklet routine to handle hypervisor messages
|
|
|
*/
|
|
|
static void vmbus_msg_dpc(unsigned long data)
|
|
@@ -905,7 +931,7 @@ static void vmbus_msg_dpc(unsigned long data)
|
|
|
DPRINT_EXIT(VMBUS_DRV);
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
+/*
|
|
|
* vmbus_msg_dpc - Tasklet routine to handle hypervisor events
|
|
|
*/
|
|
|
static void vmbus_event_dpc(unsigned long data)
|