summaryrefslogtreecommitdiff
path: root/drivers/staging/hv/vmbus_drv.c
AgeCommit message (Collapse)Author
2011-04-04staging: hv: use sync_bitops when interacting with the hypervisorOlaf Hering
Locking is required when tweaking bits located in a shared page, use the sync_ version of bitops. Without this change vmbus_on_event() will miss events and as a result, vmbus_isr() will not schedule the receive tasklet. Signed-off-by: Olaf Hering <olaf@aepfle.de> Cc: stable <stable@kernel.org> Acked-by: Haiyang Zhang <haiyangz@microsoft.com> Acked-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Get rid of vmbus_child_dev_add()K. Y. Srinivasan
The function vmbus_child_dev_add() is a wrapper that can be eliminated; get rid of it. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Change the signature for vmbus_child_device_register()K. Y. Srinivasan
In preparation for getting rid of the vmbus_child_dev_add() function, modify the signature of vmbus_child_device_register(). Note that the root device is a global variable. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Get rid of vmbus_cleanup() functionK. Y. Srinivasan
Get rid of the vmbus_cleanup() function by inlining the necessary code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Get rid of vmbus_dev_rm() functionK. Y. Srinivasan
Get rid of the vmbus_dev_rm() function by inlining the necessary code. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Change the signature for vmbus_on_isr()K. Y. Srinivasan
As part of getting getting rid of the hv_driver object from vmbus_driver_context, change the signature for vmbus_on_isr. Note that the argument to vmbus_on_isr() is not used. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Eliminate vmbus_event_dpc()K. Y. Srinivasan
vmbus_event_dpc() was a wrapper function not adding any value; get rid of it. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Get rid of the function vmbus_msg_dpc()K. Y. Srinivasan
vmbus_msg_dpc() was a wrapper adding no additional value; get rid of this function. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Change the signature for vmbus_cleanup()K. Y. Srinivasan
As part of geting rid of hv_driver object from vmbus_driver_context, change the signature of vmbus_cleanup() function. Note that while vmbus_cleanup() was passed a pointer to hv_driver, this argument was unused. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14Staging: hv: Simplify root device managementK. Y. Srinivasan
As part of simplifying root device management, get rid of the hv_driver object from vmbus_driver_context. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Mike Sterling <mike.sterling@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Remove the vm_device structureK. Y. Srinivasan
Consolidate all device related state in struct hv_device by moving the device field from struct vm_device to struct hv_device. As part of this, also get rid of struct vm_device since the consolidation is complete. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Eliminate device_id from vm_deviceK. Y. Srinivasan
Both device abstractions: vm_device and hv_device maintain state to reperesent the device instance (and they refer to them by different names - device_id in vm_device and dev_instance in hv_device). In preparation for consolidating all device state in struct hv_device; eliminate device_id from struct vm_device. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Get rid of class_id from vm_deviceK. Y. Srinivasan
Both device abstractions: vm_device and hv_device maintain state to reperesent the device type (and they refer to them by different names - class_id in vm_device and dev_type in hv_device). In preparation for consolidating all device state in struct hv_device; eliminate class_id from struct vm_device. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Remove probe_error from vm_deviceK. Y. Srinivasan
In preparation for consolidating all device related state into struct hv_device, move probe_error from vm_device to hv_device. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Move probe_failed_work_item from vm_deviceK. Y. Srinivasan
In preparation for consolidating all device related state into struct hv_device, move probe_failed_work_item from vm_device to hv_device. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Eliminate driver_context structureK. Y. Srinivasan
We need to move the following elements from struct driver_context: class_id and driver in one step. As part of this operation get rid of the struct driver_context. With this patch we will have consolidated all driver state into one data structure: struct hv_driver. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Change the signature for vmbus_child_driver_unregisterK. Y. Srinivasan
In preperation for moving the element driver from the struct driver_context to struct hv_driver, change the signature for the function vmbus_child_driver_unregister() to take a pointer to struct device_driver. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Change the signature for vmbus_child_driver_registerK. Y. Srinivasan
In preparation for moving the element driver from the struct driver_context to struct hv_driver, change the signature for the function vmbus_child_driver_register() to take a pointer to struct device_driver. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Use generic device_driver shutdown functionK. Y. Srinivasan
In preparation for moving all the state from struct driver_context to struct hv_driver, eliminate the shutdown() function from struct driver_context and use generic device_driver shutdown() function. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Use generic device_driver remove functionK. Y. Srinivasan
In preparation for moving all the state from struct driver_context to struct hv_driver, eliminate the remove() function from struct driver_context and use generic device_driver remove() function. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07Staging: hv: Use generic device_driver probe functionK. Y. Srinivasan
In preparation for moving all the state from struct driver_context to struct hv_driver, eliminate the probe() function from struct driver_context and use generic device_driver probe function. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Abhishek Kane <v-abkane@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-18Staging: hv: Remove osd layerK. Y. Srinivasan
The OSD layer was a wrapper around native interfaces adding little value and was infact buggy - refer to the osd_wait.patch for details. This patch gets rid of the OSD abstraction. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31staging: hv: Convert camel cased struct fields in vmbus_private.h to lower casesHaiyang Zhang
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31staging: hv: Convert camel cased struct fields in vmbus_api.h to lower casesHaiyang Zhang
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31staging: hv: Convert camel cased functions in vmbus_drv.c to lower casesHaiyang Zhang
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31staging: hv: Convert camel cased variables in vmbus_drv.c to lower casesHaiyang Zhang
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31staging: hv: Convert camel cased functions in connection.c to lower casesHaiyang Zhang
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-31staging: hv: Convert camel cased variables in connection.c to lower casesHaiyang Zhang
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-16staging: hv: convert vmbus_on_msg_dpc to not call osd_schedule_callbackTimo Teräs
The additional abstraction is unneeded. This also fixes a sleeping while atomic issue as osd_schedule_callback can sleep which is not allowed for vmbus_on_msg_dpc running in a tasklet. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=16701 Reviewed-By: Hank Janssen <hjanssen@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Timo Teräs <timo.teras@iki.fi> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove vmbus_on_event_dpc()Greg Kroah-Hartman
Just call VmbusOnEvents() as that's all the function did, so we can remove it. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: make some vmbus_drv functions staticGreg Kroah-Hartman
Now that vmbus_drv.c is merged with vmbus.c, some of the newly global functions can now be marked static. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: merge VmbusInitialize into vmbus_bus_initGreg Kroah-Hartman
No need to have two functions for this. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove gDriver variableGreg Kroah-Hartman
It's only set and never used anymore, so remove it. Gotta love static variables with a "global" hungarian notatation on the name... Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: call VmbusInitialize directly from vmbus_bus_init()Greg Kroah-Hartman
No need to pass a function pointer to a function in the same file. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove vmbus.cGreg Kroah-Hartman
Merge the functions into vmbus_drv.c as there's no need to have them separate anymore. It will also make unwinding some of the function and pointer mess easier, as well as making functions static in the future. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove struct vmbus_driverGreg Kroah-Hartman
It's only a wrapper for the struct hv_driver structure, so just use that instead, as there are no other fields left in it at the moment. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove OnChildDeviceAdd vmbus_driver callbackGreg Kroah-Hartman
It's only ever set to one function, so just call that function instead. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove GetChannelOffers vmbus_driver callbackGreg Kroah-Hartman
It's only ever set to one function, so just call that function instead. Actually, that wrapper function only ever called vmbus_request_offers() so just call that function instead, no need for a do-nothing intermediate step here. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove OnEventDpc vmbus_driver callbackGreg Kroah-Hartman
It's only ever set to one function, so just call that function instead. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove OnMsgDpc vmbus_driver callbackGreg Kroah-Hartman
It's only ever set to one function, so just call that function instead. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove OnIsr vmbus_driver callbackGreg Kroah-Hartman
It's only ever set to one function, so just call that function instead. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove OnChildDeviceRemove vmbus_driver callbackGreg Kroah-Hartman
It's only ever set to one function, so just call that function instead. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove OnChildDeviceDestroy vmbus_driver callbackGreg Kroah-Hartman
No one ever calls it so get rid of it, it's pointless. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-02Staging: hv: remove OnChildDeviceCreate vmbus_driver callbackGreg Kroah-Hartman
It's only ever set to one function, so just call that function instead. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09staging: hv: Convert camel cased struct fields in ring_buffer.h to lower casesHaiyang Zhang
staging: hv: Convert camel cased struct fields in ring_buffer.h to lower cases Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09staging: hv: Convert camel cased struct fields in channel_mgmt.h to lower casesHaiyang Zhang
staging: hv: Convert camel cased struct fields in channel_mgmt.h to lower cases Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-21Staging: hv: remove struct vmbus_channel_interfaceGreg Kroah-Hartman
Now that no one uses this structure, remove it, and channel_interface.c (which is now empty) and the function, vmbus_get_interface() which is not needed anymore either. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-21Staging: hv: rename context to channel in struct hv_deviceGreg Kroah-Hartman
As it really is a channel, not a "context" name it so. This also entailed making a few more functions typesafe as they were sending a struct vmbus_channel pointer as a void pointer. There are still a few more that need to be converted (the osd callbacks are one), but this is good for now. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-20Staging: hv: make get_channel_info staticGreg Kroah-Hartman
This is done by moving it to the only .c file it is used in. This also allowed us to delete the channel_interface.h file, as it's no longer needed. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-20Staging: hv: vmbus_drv: remove vmbus_child_device_get_infoGreg Kroah-Hartman
Just make the call to get_channel_info() directly. Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>