Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2011-09-01 18:47:37 +0200
committerOlaf Hering <ohering@suse.de>2011-09-01 18:47:37 +0200
commitd77df1b9e2a08eb1b39e575a2db42f3c3b39382b (patch)
tree399eea4c87fe972d6d42546ee302aded0ede7ba4
parentbd9ecd247a13f8d6a3d114429125768ad047df1d (diff)
- ata_piix: ignore disks in a hyper-v guest.
- Staging: hv: vmbus: Don't wait indefinitely for IRQ resouces. - Staging: hv: tools: Fix a checkpatch warning in hv_kvp_daemon.c. - Staging: hv: vmbus: Fix checkpatch warnings. - Staging: hv: util: kvp: Fix the reported OSVersion string. - Staging: hv: util: kvp: Cleanup kvp_get_domain_name(). - Staging: hv: Fix macros, tab errors and warning in drivers/staging/hv/hv_mouse.c. - Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature. - Staging: hv: Replace struct hv_guid with the uuid type already defined in Linux. - Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver. - Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver. - Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver. - Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver. - Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver. - Staging: hv: util: Make hv_utils a vmbus device driver. - Staging: hv: create VMBUS_DEVICE macro and use it. - Staging: hv: vmbus: Cleanup vmbus_match(). - Staging: hv: vmbus: Cleanup vmbus_uevent() code. - Staging: hv: vmbus: Support the notion of id tables in vmbus_match(). - Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c. - Staging: hv: storvsc: Get rid of the DMI signature. - Staging: hv: netvsc: Get rid of the PCI signature. - Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c. - Staging: hv: util: Get rid of the DMI signature in hv_util.c. - Staging: hv: util: Get rid of the PCI signature in hv_util.c. - Staging: hv: fix up driver registering mess. - Staging: hv: vmbus: Get rid of some unnecessary comments. - Staging: hv: vmbus: Cleanup unnecessary comments in hv.c. - Staging: hv: vmbus: Cleanup error handling in hv_init(). - Staging: hv: vmbus: Get rid of unnecessay comments in connection.c. - Staging: hv: vmbus: Get rid of the function dump_gpadl_body(). - Staging: hv: vmbus: Get rid of the function dump_gpadl_header(). - Staging: hv: vmbus: Rename openMsg to open_msg in channel.c. - Staging: hv: vmbus: Get rid of unnecessary comments in channel.c. - Staging: hv: vmbus: Change the variable name openInfo to open_info in channel.c. - Staging: hv: vmbus: Cleanup error values in ringbuffer.c. - Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw(). - Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe(). - Staging: hv: vmbus: Retry vmbus_post_msg() before giving up. - Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add(). - Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init(). - Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp(). - Staging: hv: storvsc: Cleanup error handling in storvsc_do_io(). - Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c. - Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c. - Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset(). - Staging: hv: storvsc: Cleanup error code returned in storvsc_probe(). - Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init(). - Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe(). - Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf(). - Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf(). - Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp(). - Staging: hv: netvsc: Cleanup error return values in netvsc_send(). - Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add(). - Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive(). - Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device(). - Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter(). - Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device(). - Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add(). - Staging: hv: mouse: Change the jump label Cleanup to cleanup. - Staging: hv: netvsc: Change the jump label Cleanup to cleanup. - Staging: hv: netvsc: Change the jump label Exit to exit. - Staging: hv: mouse: Get rid of the unused PCI signature. - Staging: hv: hv_mouse: remove deviceinfo_callback function. - Staging: hv: hv_mouse: remove inputreport_callback function. - Staging: hv: hv_mouse: remove a forward declaration. - Staging: hv: hv_mouse: fix up remove() function. - Staging: hv: Add struct hv_vmbus_device_id to mod_devicetable.h. - Staging: hv: add driver_data to hv_vmbus_device_id. - Staging: hv: Add code to parse struct hv_vmbus_device_id table. - Staging: hv: file2alias: fix up alias creation logic for hv_vmbus_device_id. - Staging: hv: storvsc: Inline free_stor_device(). - Staging: hv: storvsc: Do not aquire an unnecessary reference on stor_device. - Staging: hv: storvsc: Rename must_get_stor_device(). - Staging: hv: storvsc: Rename get_stor_device(). - Staging: hv: storvsc: Cleanup alloc_stor_device(). - Staging: hv: storvsc: Introduce state to manage the lifecycle of stor device. - Staging: hv: storvsc: Prevent outgoing traffic when stor dev is being destroyed. - Staging: hv: storvsc: Get rid of release_stor_device() by inlining the code. - Staging: hv: storvsc: Get rid of final_release_stor_device() by inlining code. - Staging: hv: storvsc: Get rid of the reference counting in struct storvsc_device. - Staging: hv: netvsc: Inline the code for free_net_device(). - Staging: hv: netvsc: Cleanup alloc_net_device(). - Staging: hv: netvsc: Introduce state to manage the lifecycle of net device. - Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed. - Staging: hv: netvsc: Get rid of release_outbound_net_device() by inlining the code. - Staging: hv: netvsc: Get rid of release_inbound_net_device() by inlining the code. - Staging: hv: netvsc: Get rid of the refcnt field in struct netvsc_device. - Staging: hv: storvsc: Add code to handle IDE devices using the storvsc driver. - Staging: hv: storvsc: Handle IDE devices using the storvsc driver. - Staging: hv: blkvsc: Get rid of blkvsc_drv.c as this code is not used. - Staging: hv: storvsc: Optimize bounce buffer handling for the "write" case. - Staging: hv: storvsc: Optimize the bounce buffer handling in the "read" case. - Staging: hv: storvsc: Include storvsc.c in storvsc_drv.c. - Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c. - Staging: hv: storvsc: Add the contents of hyperv_storage.h to storvsc_drv.c. - Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of hyperv_storage.h. - Staging: hv: storvsc: Fixup srb and scsi status for INQUIRY and MODE_SENSE. - Staging: hv: storvsc: Fix a typo. - Staging: hv: storvsc: In case of scsi errors offline the device. - Staging: hv: storvsc: No need to copy from bounce buffer in case of a failure. - Staging: hv: util: Forcefully shutdown when shutdown is requested. - Staging: hv: util: Adjust guest time in a process context. - Staging: hv: vmbus: Check before invoking the channel callback. - Staging: hv: vmbus: Properly deal with de-registering channel callback. - Staging: hv: Fix a bug in vmbus_match(). - Staging: hv: vmbus: Get rid of vmbus_on_isr() by inlining the code. - Staging: hv: vmbus: Do not enable auto eoi. - Staging: hv: vmbus: Fixup indentation in vmbus_acpi_add(). - Staging: hv: vmbus: Get rid of some dated/redundant comments. - Staging: hv: vmbus: Get rid of an unnecessary check in vmbus_connect(). - Staging: hv: vmbus: Fix a checkpatch warning in ring_buffer.c. - Staging: hv: vmbus: Fix checkpatch warnings in connection.c. - Staging: hv: mousevsc: Fix checkpatch errors and warnings. - Staging: hv: netvsc: return negative error codes. - Delete patches.suse/staging-hv-vmbus-init-on-dmi-match.patch.
-rw-r--r--patches.suse/staging-hv-pata_piix-ignore-disks.patch110
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0001-Staging-hv-vmbus-Don-t-wait-indefinitely-for-IRQ.patch65
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0002-Staging-hv-tools-Fix-a-checkpatch-warning-in-hv_k.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0003-Staging-hv-vmbus-Fix-checkpatch-warnings.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0004-Staging-hv-util-kvp-Fix-the-reported-OSVersion-s.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0005-Staging-hv-util-kvp-Cleanup-kvp_get_domain_name.patch51
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0006-Staging-hv-Fix-macros-tab-errors-and-warning-in-d.patch90
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0007-Staging-hv-vmbus-VMBUS-is-an-ACPI-enumerated-devi.patch49
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0008-Staging-hv-Replace-struct-hv_guid-with-the-uuid-ty.patch639
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0009-Staging-hv-vmbus-Introduce-vmbus-ID-space-in-stru.patch39
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0010-Staging-hv-blkvsc-Use-the-newly-introduced-vmbus.patch71
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0011-Staging-hv-storvsc-Use-the-newly-introduced-vmbus.patch77
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0012-Staging-hv-netvsc-Use-the-newly-introduced-vmbus.patch77
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0013-Staging-hv-mousevsc-Use-the-newly-introduced-vmbu.patch74
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0014-Staging-hv-util-Make-hv_utils-a-vmbus-device-driv.patch115
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0015-Staging-hv-create-VMBUS_DEVICE-macro-and-use-it.patch203
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0016-Staging-hv-vmbus-Cleanup-vmbus_match.patch32
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0017-Staging-hv-vmbus-Cleanup-vmbus_uevent-code.patch95
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0018-Staging-hv-vmbus-Support-the-notion-of-id-tables.patch61
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0019-Staging-hv-vmbus-Get-rid-of-an-unnecessary-includ.patch30
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0020-Staging-hv-storvsc-Get-rid-of-the-DMI-signature.patch59
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0021-Staging-hv-netvsc-Get-rid-of-the-PCI-signature.patch45
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0022-Staging-hv-netvsc-Get-rid-of-the-DMI-signature-in.patch63
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0023-Staging-hv-util-Get-rid-of-the-DMI-signature-in-h.patch64
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0024-Staging-hv-util-Get-rid-of-the-PCI-signature-in-h.patch45
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0025-Staging-hv-fix-up-driver-registering-mess.patch420
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0026-Staging-hv-vmbus-Get-rid-of-some-unnecessary-comm.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0027-Staging-hv-vmbus-Cleanup-unnecessary-comments-in.patch45
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0028-Staging-hv-vmbus-Cleanup-error-handling-in-hv_ini.patch50
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0029-Staging-hv-vmbus-Get-rid-of-unnecessay-comments-i.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0030-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch57
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0031-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch64
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0032-Staging-hv-vmbus-Rename-openMsg-to-open_msg-in-ch.patch70
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0033-Staging-hv-vmbus-Get-rid-of-unnecessary-comments.patch47
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0034-Staging-hv-vmbus-Change-the-variable-name-openInf.patch99
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0035-Staging-hv-vmbus-Cleanup-error-values-in-ringbuff.patch92
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0036-Staging-hv-vmbus-Cleanup-the-error-return-value-i.patch59
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0037-Staging-hv-netvsc-Get-rid-of-an-unnecessary-print.patch33
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0038-Staging-hv-vmbus-Retry-vmbus_post_msg-before-gi.patch70
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0039-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch53
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0040-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0041-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0042-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0043-Storage-hv-storvsc-Get-rid-of-some-unnecessary-DP.patch89
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0044-Staging-hv-storvsc-Fix-cleanup-some-dated-comment.patch58
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0045-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0046-Staging-hv-storvsc-Cleanup-error-code-returned-in.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0047-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0048-Staging-hv-netvsc-Cleanup-the-returned-error-code.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0049-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0050-Staging-hv-netvsc-Cleanup-error-return-values-in.patch67
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0051-Staging-hv-netvsc-Cleanup-error-returns-in-netvsc.patch59
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0052-Staging-hv-netvsc-Cleanup-error-return-values-in.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0053-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch47
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0054-Staging-hv-netvsc-Cleanup-error-codes-in-rndis_fi.patch39
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0055-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0056-Staging-hv-netvsc-Cleanup-error-return-values-in.patch48
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0057-Staging-hv-netvsc-Cleanup-error-returns-in-rndis_.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0058-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0059-Staging-hv-mouse-Change-the-jump-label-Cleanup-to.patch121
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0060-Staging-hv-netvsc-Change-the-jump-label-Cleanup-t.patch145
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0061-Staging-hv-netvsc-Change-the-jump-label-Exit-to-e.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0062-Staging-hv-mouse-Get-rid-of-the-unused-PCI-signat.patch58
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0063-Staging-hv-hv_mouse-remove-deviceinfo_callback-fu.patch86
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0064-Staging-hv-hv_mouse-remove-inputreport_callback-f.patch74
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0065-Staging-hv-hv_mouse-remove-a-forward-declaration.patch177
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0066-Staging-hv-hv_mouse-fix-up-remove-function.patch52
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0562-Staging-hv-Add-struct-hv_vmbus_device_id-to-mod_de.patch37
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0563-Staging-hv-add-driver_data-to-hv_vmbus_device_id.patch33
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0568-Staging-hv-Add-code-to-parse-struct-hv_vmbus_devic.patch61
-rw-r--r--patches.suse/staging-hv-staging-next-20110825-0570-Staging-hv-file2alias-fix-up-alias-creation-logic.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0303-Staging-hv-storvsc-Inline-free_stor_device.patch51
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0304-Staging-hv-storvsc-Do-not-aquire-an-unnecessary-r.patch42
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0305-Staging-hv-storvsc-Rename-must_get_stor_device.patch50
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0306-Staging-hv-storvsc-Rename-get_stor_device.patch88
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0307-Staging-hv-storvsc-Cleanup-alloc_stor_device.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0308-Staging-hv-storvsc-Introduce-state-to-manage-the.patch62
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0309-Staging-hv-storvsc-Prevent-outgoing-traffic-when.patch32
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0310-Staging-hv-storvsc-Get-rid-of-release_stor_device.patch55
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0311-Staging-hv-storvsc-Get-rid-of-final_release_stor_.patch59
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0312-Staging-hv-storvsc-Get-rid-of-the-reference-count.patch182
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0313-Staging-hv-netvsc-Inline-the-code-for-free_net_de.patch55
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0314-Staging-hv-netvsc-Cleanup-alloc_net_device.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0315-Staging-hv-netvsc-Introduce-state-to-manage-the-l.patch62
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0316-Staging-hv-netvsc-Prevent-outgoing-traffic-when-n.patch32
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0317-Staging-hv-netvsc-Get-rid-of-release_outbound_net.patch88
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0318-Staging-hv-netvsc-Get-rid-of-release_inbound_net_.patch67
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0319-Staging-hv-netvsc-Get-rid-of-the-refcnt-field-in.patch229
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0320-Staging-hv-storvsc-Add-code-to-handle-IDE-devices.patch122
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0321-Staging-hv-storvsc-Handle-IDE-devices-using-the-s.patch106
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0322-Staging-hv-blkvsc-Get-rid-of-blkvsc_drv.c-as-this.patch1039
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0323-Staging-hv-storvsc-Optimize-bounce-buffer-handlin.patch46
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0324-Staging-hv-storvsc-Optimize-the-bounce-buffer-han.patch39
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0325-Staging-hv-storvsc-Include-storvsc.c-in-storvsc_d.patch1109
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0326-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch196
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0327-Staging-hv-storvsc-Add-the-contents-of-hyperv_sto.patch644
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0328-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch140
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0329-Staging-hv-storvsc-Fixup-srb-and-scsi-status-for.patch48
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0330-Staging-hv-storvsc-Fix-a-typo.patch43
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0331-Staging-hv-storvsc-In-case-of-scsi-errors-offline.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0332-Staging-hv-storvsc-No-need-to-copy-from-bounce-bu.patch43
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0333-Staging-hv-util-Forcefully-shutdown-when-shutdown.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0334-Staging-hv-util-Adjust-guest-time-in-a-process-co.patch79
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0335-Staging-hv-vmbus-Check-before-invoking-the-channe.patch32
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0336-Staging-hv-vmbus-Properly-deal-with-de-registerin.patch186
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0337-Staging-hv-Fix-a-bug-in-vmbus_match.patch32
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0338-Staging-hv-vmbus-Get-rid-of-vmbus_on_isr-by-inl.patch88
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0339-Staging-hv-vmbus-Do-not-enable-auto-eoi.patch31
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0340-Staging-hv-vmbus-Fixup-indentation-in-vmbus_acpi_.patch34
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0341-Staging-hv-vmbus-Get-rid-of-some-dated-redundant.patch71
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0342-Staging-hv-vmbus-Get-rid-of-an-unnecessary-check.patch33
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0343-Staging-hv-vmbus-Fix-a-checkpatch-warning-in-ring.patch32
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0344-Staging-hv-vmbus-Fix-checkpatch-warnings-in-conne.patch58
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0345-Staging-hv-mousevsc-Fix-checkpatch-errors-and-war.patch51
-rw-r--r--patches.suse/staging-hv-staging-next-20110829-0346-Staging-hv-netvsc-return-negative-error-codes.patch31
-rw-r--r--patches.suse/staging-hv-vmbus-init-on-dmi-match.patch47
-rw-r--r--series.conf120
117 files changed, 10964 insertions, 48 deletions
diff --git a/patches.suse/staging-hv-pata_piix-ignore-disks.patch b/patches.suse/staging-hv-pata_piix-ignore-disks.patch
new file mode 100644
index 0000000000..207a7f9b72
--- /dev/null
+++ b/patches.suse/staging-hv-pata_piix-ignore-disks.patch
@@ -0,0 +1,110 @@
+Subject: ata_piix: ignore disks in a hyper-v guest
+From: <ohering@suse.de>
+Patch-mainline: 3.42 ?
+
+See comments inline.
+
+Signed-off-by: Olaf Hering <olaf@aepfle.de>
+
+---
+ drivers/ata/ata_piix.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 54 insertions(+)
+
+--- a/drivers/ata/ata_piix.c
++++ b/drivers/ata/ata_piix.c
+@@ -98,6 +98,10 @@
+ #define DRV_NAME "ata_piix"
+ #define DRV_VERSION "2.13"
+
++#if defined(CONFIG_HYPERV_STORAGE) || defined(CONFIG_HYPERV_STORAGE_MODULE)
++#define PIIX_IGNORE_ATA_ON_HYPERV 1
++#endif
++
+ enum {
+ PIIX_IOCFG = 0x54, /* IDE I/O configuration register */
+ ICH5_PMR = 0x90, /* port mapping register */
+@@ -164,6 +168,7 @@ struct piix_host_priv {
+ static int piix_init_one(struct pci_dev *pdev,
+ const struct pci_device_id *ent);
+ static void piix_remove_one(struct pci_dev *pdev);
++static unsigned int piix_pata_read_id(struct ata_device *adev, struct ata_taskfile *tf, u16 *id);
+ static int piix_pata_prereset(struct ata_link *link, unsigned long deadline);
+ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev);
+ static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev);
+@@ -346,6 +351,7 @@ static struct ata_port_operations piix_p
+ .set_piomode = piix_set_piomode,
+ .set_dmamode = piix_set_dmamode,
+ .prereset = piix_pata_prereset,
++ .read_id = piix_pata_read_id,
+ };
+
+ static struct ata_port_operations piix_vmw_ops = {
+@@ -619,6 +625,24 @@ MODULE_LICENSE("GPL");
+ MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
+ MODULE_VERSION(DRV_VERSION);
+
++#if defined(PIIX_IGNORE_ATA_ON_HYPERV)
++static int piix_msft_hyperv(void)
++{
++ static const struct dmi_system_id hv_dmi_ident[] = {
++ {
++ .ident = "Hyper-V",
++ .matches = {
++ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
++ DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
++ DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
++ },
++ },
++ { } /* terminate list */
++ };
++ return !!dmi_check_system(hv_dmi_ident);
++}
++#endif
++
+ struct ich_laptop {
+ u16 device;
+ u16 subvendor;
+@@ -702,6 +726,29 @@ static int piix_pata_prereset(struct ata
+ return ata_sff_prereset(link, deadline);
+ }
+
++/**
++ *
++ */
++static unsigned int piix_pata_read_id(struct ata_device *adev, struct ata_taskfile *tf, u16 *id)
++{
++ unsigned int err_mask = ata_do_dev_read_id(adev, tf, id);
++#if defined(PIIX_IGNORE_ATA_ON_HYPERV)
++ /*
++ * Ignore disks in a hyper-v guest.
++ * There is no unplug protocol like it is done with xen_emul_unplug= option.
++ * Emulate the unplug by ignoring disks when the hv_storvsc driver is enabled.
++ * If the disks are not ignored, they will appear twice: once through piix and once through hv_storvsc.
++ * Because hv_storvsc does not handle ATAPI devices, the piix driver is still required.
++ * Once hv_storvsc handles all devices, this function can be removed and the whole driver should be disabled in a hyper-v guest.
++ */
++ if (ata_id_is_ata(id) && piix_msft_hyperv()) {
++ ata_dev_printk(adev, KERN_WARNING, "ATA device ignored in Hyper-V guest\n");
++ id[ATA_ID_CONFIG] |= (1 << 15);
++ }
++#endif
++ return err_mask;
++}
++
+ static DEFINE_SPINLOCK(piix_lock);
+
+ /**
+@@ -1679,6 +1726,13 @@ static int __init piix_init(void)
+ {
+ int rc;
+
++#if defined(PIIX_IGNORE_ATA_ON_HYPERV)
++ /* disabled until hv_storvsc drives also cdrom devices */
++ if (0 && piix_msft_hyperv()) {
++ printk(KERN_DEBUG "%s: hv_storvsc will bind to storage\n", __func__);
++ return -ENODEV;
++ }
++#endif
+ DPRINTK("pci_register_driver\n");
+ rc = pci_register_driver(&piix_pci_driver);
+ if (rc)
diff --git a/patches.suse/staging-hv-staging-next-20110825-0001-Staging-hv-vmbus-Don-t-wait-indefinitely-for-IRQ.patch b/patches.suse/staging-hv-staging-next-20110825-0001-Staging-hv-vmbus-Don-t-wait-indefinitely-for-IRQ.patch
new file mode 100644
index 0000000000..319a44bd3a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0001-Staging-hv-vmbus-Don-t-wait-indefinitely-for-IRQ.patch
@@ -0,0 +1,65 @@
+From 2dda95f80b2afa4bf85c6419f40e11b545cda422 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Fri, 15 Jul 2011 13:38:56 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Don't wait indefinitely for IRQ resouces
+
+If an attempt is made to load the vmbus driver on a non-Hyper-V platform,
+the load operation will hang since we currently wait indefinitely to
+retrieve the IRQ information. This is done in the context of an acpi callback
+context (which will obviously not happen when this driver is
+loaded on a non-Hyper-V platform). This patch fixes the problem.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 19 ++++++++++++++-----
+ 1 files changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 1c949f5..67a4f33 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -768,7 +768,7 @@ MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
+
+ static int __init hv_acpi_init(void)
+ {
+- int ret;
++ int ret, t;
+
+ init_completion(&probe_event);
+
+@@ -781,16 +781,25 @@ static int __init hv_acpi_init(void)
+ if (ret)
+ return ret;
+
+- wait_for_completion(&probe_event);
++ t = wait_for_completion_timeout(&probe_event, 5*HZ);
++ if (t == 0) {
++ ret = -ETIMEDOUT;
++ goto cleanup;
++ }
+
+ if (irq <= 0) {
+- acpi_bus_unregister_driver(&vmbus_acpi_driver);
+- return -ENODEV;
++ ret = -ENODEV;
++ goto cleanup;
+ }
+
+ ret = vmbus_bus_init(irq);
+ if (ret)
+- acpi_bus_unregister_driver(&vmbus_acpi_driver);
++ goto cleanup;
++
++ return 0;
++
++cleanup:
++ acpi_bus_unregister_driver(&vmbus_acpi_driver);
+ return ret;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0002-Staging-hv-tools-Fix-a-checkpatch-warning-in-hv_k.patch b/patches.suse/staging-hv-staging-next-20110825-0002-Staging-hv-tools-Fix-a-checkpatch-warning-in-hv_k.patch
new file mode 100644
index 0000000000..3f91ea47cc
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0002-Staging-hv-tools-Fix-a-checkpatch-warning-in-hv_k.patch
@@ -0,0 +1,31 @@
+From 064931d0bb088c56e80d427e91a812ee7dd8c7dc Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 19 Jul 2011 11:44:20 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: tools: Fix a checkpatch warning in hv_kvp_daemon.c
+
+Fix a checkpatch warning in hv_kvp_daemon.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/tools/hv_kvp_daemon.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/tools/hv_kvp_daemon.c b/drivers/staging/hv/tools/hv_kvp_daemon.c
+index a4a407f..8fd0f2b 100644
+--- a/drivers/staging/hv/tools/hv_kvp_daemon.c
++++ b/drivers/staging/hv/tools/hv_kvp_daemon.c
+@@ -116,7 +116,7 @@ void kvp_get_os_info(void)
+
+ uname(&uts_buf);
+ os_build = uts_buf.release;
+- processor_arch= uts_buf.machine;
++ processor_arch = uts_buf.machine;
+
+ file = fopen("/etc/SuSE-release", "r");
+ if (file != NULL)
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0003-Staging-hv-vmbus-Fix-checkpatch-warnings.patch b/patches.suse/staging-hv-staging-next-20110825-0003-Staging-hv-vmbus-Fix-checkpatch-warnings.patch
new file mode 100644
index 0000000000..0d26da5323
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0003-Staging-hv-vmbus-Fix-checkpatch-warnings.patch
@@ -0,0 +1,40 @@
+From dec317fd6accfdba4daff13aa4d9f5abde02b347 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 19 Jul 2011 11:44:21 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Fix checkpatch warnings
+
+Fix checkpatch warnings in hv.c
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
+index 824f816..2192d78 100644
+--- a/drivers/staging/hv/hv.c
++++ b/drivers/staging/hv/hv.c
+@@ -111,7 +111,7 @@ static u64 do_hypercall(u64 control, void *input, void *output)
+ u64 hv_status = 0;
+ u64 input_address = (input) ? virt_to_phys(input) : 0;
+ u64 output_address = (output) ? virt_to_phys(output) : 0;
+- volatile void *hypercall_page = hv_context.hypercall_page;
++ void *hypercall_page = hv_context.hypercall_page;
+
+ __asm__ __volatile__("mov %0, %%r8" : : "r" (output_address) : "r8");
+ __asm__ __volatile__("call *%3" : "=a" (hv_status) :
+@@ -132,7 +132,7 @@ static u64 do_hypercall(u64 control, void *input, void *output)
+ u64 output_address = (output) ? virt_to_phys(output) : 0;
+ u32 output_address_hi = output_address >> 32;
+ u32 output_address_lo = output_address & 0xFFFFFFFF;
+- volatile void *hypercall_page = hv_context.hypercall_page;
++ void *hypercall_page = hv_context.hypercall_page;
+
+ __asm__ __volatile__ ("call *%8" : "=d"(hv_status_hi),
+ "=a"(hv_status_lo) : "d" (control_hi),
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0004-Staging-hv-util-kvp-Fix-the-reported-OSVersion-s.patch b/patches.suse/staging-hv-staging-next-20110825-0004-Staging-hv-util-kvp-Fix-the-reported-OSVersion-s.patch
new file mode 100644
index 0000000000..b520fa21db
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0004-Staging-hv-util-kvp-Fix-the-reported-OSVersion-s.patch
@@ -0,0 +1,40 @@
+From e54bbc6471d7f788d829e5f3b5922960048fbff7 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Fri, 22 Jul 2011 10:14:31 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: util: kvp: Fix the reported OSVersion string
+
+The current win7 host does not like it when we return the
+complete kernel release information. Conform to what the host
+expects.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/tools/hv_kvp_daemon.c | 9 +++++++++
+ 1 files changed, 9 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/staging/hv/tools/hv_kvp_daemon.c b/drivers/staging/hv/tools/hv_kvp_daemon.c
+index 8fd0f2b..c4cf988 100644
+--- a/drivers/staging/hv/tools/hv_kvp_daemon.c
++++ b/drivers/staging/hv/tools/hv_kvp_daemon.c
+@@ -118,6 +118,15 @@ void kvp_get_os_info(void)
+ os_build = uts_buf.release;
+ processor_arch = uts_buf.machine;
+
++ /*
++ * The current windows host (win7) expects the build
++ * string to be of the form: x.y.z
++ * Strip additional information we may have.
++ */
++ p = strchr(os_build, '-');
++ if (p)
++ *p = '\0';
++
+ file = fopen("/etc/SuSE-release", "r");
+ if (file != NULL)
+ goto kvp_osinfo_found;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0005-Staging-hv-util-kvp-Cleanup-kvp_get_domain_name.patch b/patches.suse/staging-hv-staging-next-20110825-0005-Staging-hv-util-kvp-Cleanup-kvp_get_domain_name.patch
new file mode 100644
index 0000000000..8c1e8419a4
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0005-Staging-hv-util-kvp-Cleanup-kvp_get_domain_name.patch
@@ -0,0 +1,51 @@
+From 5be528c2130a1281ba858296924dd619068bb0e3 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 26 Jul 2011 11:03:10 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: util: kvp: Cleanup kvp_get_domain_name()
+
+Cleanup kvp_get_domain_name(). If getaddrinfo() fails, deal with it properly
+(this can happen if no IP address has been assigned). Also, don't specify
+a specific service in the call to getaddrinfo() to make this code as generic
+as possible. Lastly, move the call to gethostname() after the local variables.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/tools/hv_kvp_daemon.c | 8 +++-----
+ 1 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/staging/hv/tools/hv_kvp_daemon.c b/drivers/staging/hv/tools/hv_kvp_daemon.c
+index c4cf988..11224ed 100644
+--- a/drivers/staging/hv/tools/hv_kvp_daemon.c
++++ b/drivers/staging/hv/tools/hv_kvp_daemon.c
+@@ -273,22 +273,20 @@ static int
+ kvp_get_domain_name(char *buffer, int length)
+ {
+ struct addrinfo hints, *info ;
+- gethostname(buffer, length);
+ int error = 0;
+
++ gethostname(buffer, length);
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_INET; /*Get only ipv4 addrinfo. */
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_CANONNAME;
+
+- error = getaddrinfo(buffer, "http", &hints, &info);
++ error = getaddrinfo(buffer, NULL, &hints, &info);
+ if (error != 0) {
+ strcpy(buffer, "getaddrinfo failed\n");
+- error = 1;
+- goto get_domain_done;
++ return error;
+ }
+ strcpy(buffer, info->ai_canonname);
+-get_domain_done:
+ freeaddrinfo(info);
+ return error;
+ }
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0006-Staging-hv-Fix-macros-tab-errors-and-warning-in-d.patch b/patches.suse/staging-hv-staging-next-20110825-0006-Staging-hv-Fix-macros-tab-errors-and-warning-in-d.patch
new file mode 100644
index 0000000000..abfa520d89
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0006-Staging-hv-Fix-macros-tab-errors-and-warning-in-d.patch
@@ -0,0 +1,90 @@
+From dbbb24947e1bea5e6034ae2edfbf1be5b8f2b062 Mon Sep 17 00:00:00 2001
+From: Ruslan Pisarev <ruslan@rpisarev.org.ua>
+Date: Fri, 22 Jul 2011 15:12:47 +0300
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: Fix macros, tab errors and warning in drivers/staging/hv/hv_mouse.c
+
+This is a patch to the hv_mouse.c file that fixed up macros, tab
+errors and warning found by the checkpatch.pl tools.
+
+Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 40 ++++++++++++++++++++--------------------
+ 1 files changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index d957fc2..9f3fbee 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -54,7 +54,7 @@ struct hv_input_dev_info {
+ (SYNTHHID_INPUT_VERSION_MAJOR << 16))
+
+
+-#pragma pack(push,1)
++#pragma pack(push, 1)
+ /*
+ * Message types in the synthetic input protocol
+ */
+@@ -120,8 +120,8 @@ struct synthhid_input_report {
+
+ #pragma pack(pop)
+
+-#define INPUTVSC_SEND_RING_BUFFER_SIZE 10*PAGE_SIZE
+-#define INPUTVSC_RECV_RING_BUFFER_SIZE 10*PAGE_SIZE
++#define INPUTVSC_SEND_RING_BUFFER_SIZE (10*PAGE_SIZE)
++#define INPUTVSC_RECV_RING_BUFFER_SIZE (10*PAGE_SIZE)
+
+ #define NBITS(x) (((x)/BITS_PER_LONG)+1)
+
+@@ -509,22 +509,22 @@ static void mousevsc_on_channel_callback(void *context)
+ desc = (struct vmpacket_descriptor *)buffer;
+
+ switch (desc->type) {
+- case VM_PKT_COMP:
+- mousevsc_on_send_completion(
+- device, desc);
+- break;
+-
+- case VM_PKT_DATA_INBAND:
+- mousevsc_on_receive(
+- device, desc);
+- break;
+-
+- default:
+- pr_err("unhandled packet type %d, tid %llx len %d\n",
+- desc->type,
+- req_id,
+- bytes_recvd);
+- break;
++ case VM_PKT_COMP:
++ mousevsc_on_send_completion(
++ device, desc);
++ break;
++
++ case VM_PKT_DATA_INBAND:
++ mousevsc_on_receive(
++ device, desc);
++ break;
++
++ default:
++ pr_err("unhandled packet type %d, tid %llx len %d\n",
++ desc->type,
++ req_id,
++ bytes_recvd);
++ break;
+ }
+
+ /* reset */
+@@ -960,7 +960,7 @@ static void __exit mousevsc_exit(void)
+ * installed and/or configured. We don't do anything else with the table, but
+ * it needs to be present.
+ */
+-const static struct pci_device_id microsoft_hv_pci_table[] = {
++static const struct pci_device_id microsoft_hv_pci_table[] = {
+ { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
+ { 0 }
+ };
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0007-Staging-hv-vmbus-VMBUS-is-an-ACPI-enumerated-devi.patch b/patches.suse/staging-hv-staging-next-20110825-0007-Staging-hv-vmbus-VMBUS-is-an-ACPI-enumerated-devi.patch
new file mode 100644
index 0000000000..efe42b7346
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0007-Staging-hv-vmbus-VMBUS-is-an-ACPI-enumerated-devi.patch
@@ -0,0 +1,49 @@
+From 32a753ffb2c5aea6c32d34393a8e0da3ecfd78bb Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:27 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature
+
+VMBUS is an ACPI enumerated device, get rid of the PCI signature.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 13 -------------
+ 1 files changed, 0 insertions(+), 13 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 67a4f33..8f1d6eb 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -28,7 +28,6 @@
+ #include <linux/irq.h>
+ #include <linux/interrupt.h>
+ #include <linux/sysctl.h>
+-#include <linux/pci.h>
+ #include <linux/dmi.h>
+ #include <linux/slab.h>
+ #include <linux/acpi.h>
+@@ -754,18 +753,6 @@ static struct acpi_driver vmbus_acpi_driver = {
+ },
+ };
+
+-/*
+- * We use a PCI table to determine if we should autoload this driver This is
+- * needed by distro tools to determine if the hyperv drivers should be
+- * installed and/or configured. We don't do anything else with the table, but
+- * it needs to be present.
+- */
+-static const struct pci_device_id microsoft_hv_pci_table[] = {
+- { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
+- { 0 }
+-};
+-MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
+-
+ static int __init hv_acpi_init(void)
+ {
+ int ret, t;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0008-Staging-hv-Replace-struct-hv_guid-with-the-uuid-ty.patch b/patches.suse/staging-hv-staging-next-20110825-0008-Staging-hv-Replace-struct-hv_guid-with-the-uuid-ty.patch
new file mode 100644
index 0000000000..3e6adb4cf4
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0008-Staging-hv-Replace-struct-hv_guid-with-the-uuid-ty.patch
@@ -0,0 +1,639 @@
+From 358d2ee2e8f5c25f1661e94c206102c88fdee370 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:28 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: Replace struct hv_guid with the uuid type already defined in Linux
+
+Replace struct hv_guid with the uuid type already defined in Linux.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/blkvsc_drv.c | 18 +++---
+ drivers/staging/hv/channel.c | 4 +-
+ drivers/staging/hv/channel_mgmt.c | 50 ++++++-------
+ drivers/staging/hv/hv_mouse.c | 6 +-
+ drivers/staging/hv/hyperv.h | 24 +++----
+ drivers/staging/hv/hyperv_vmbus.h | 8 +-
+ drivers/staging/hv/netvsc.c | 6 +-
+ drivers/staging/hv/storvsc_drv.c | 6 +-
+ drivers/staging/hv/vmbus_drv.c | 142 ++++++++++++++++++------------------
+ 9 files changed, 129 insertions(+), 135 deletions(-)
+
+diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
+index d286b22..018b293 100644
+--- a/drivers/staging/hv/blkvsc_drv.c
++++ b/drivers/staging/hv/blkvsc_drv.c
+@@ -112,8 +112,8 @@ struct block_device_context {
+ static const char *drv_name = "blkvsc";
+
+ /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
+-static const struct hv_guid dev_type = {
+- .data = {
++static const uuid_le dev_type = {
++ .b = {
+ 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
+ }
+@@ -155,13 +155,13 @@ static int blkvsc_device_add(struct hv_device *device,
+ * id. For IDE devices, the device instance id is formatted as
+ * <bus id> * - <device id> - 8899 - 000000000000.
+ */
+- device_info->path_id = device->dev_instance.data[3] << 24 |
+- device->dev_instance.data[2] << 16 |
+- device->dev_instance.data[1] << 8 |
+- device->dev_instance.data[0];
++ device_info->path_id = device->dev_instance.b[3] << 24 |
++ device->dev_instance.b[2] << 16 |
++ device->dev_instance.b[1] << 8 |
++ device->dev_instance.b[0];
+
+- device_info->target_id = device->dev_instance.data[5] << 8 |
+- device->dev_instance.data[4];
++ device_info->target_id = device->dev_instance.b[5] << 8 |
++ device->dev_instance.b[4];
+
+ return ret;
+ }
+@@ -829,7 +829,7 @@ static int blkvsc_drv_init(void)
+
+ BUILD_BUG_ON(sizeof(sector_t) != 8);
+
+- memcpy(&drv->dev_type, &dev_type, sizeof(struct hv_guid));
++ memcpy(&drv->dev_type, &dev_type, sizeof(uuid_le));
+ drv->driver.name = drv_name;
+
+ /* The driver belongs to vmbus */
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index 455f47a..222adcc 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -81,10 +81,10 @@ void vmbus_get_debug_info(struct vmbus_channel *channel,
+ debuginfo->relid = channel->offermsg.child_relid;
+ debuginfo->state = channel->state;
+ memcpy(&debuginfo->interfacetype,
+- &channel->offermsg.offer.if_type, sizeof(struct hv_guid));
++ &channel->offermsg.offer.if_type, sizeof(uuid_le));
+ memcpy(&debuginfo->interface_instance,
+ &channel->offermsg.offer.if_instance,
+- sizeof(struct hv_guid));
++ sizeof(uuid_le));
+
+ monitorpage = (struct hv_monitor_page *)vmbus_connection.monitor_pages;
+
+diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
+index bf011f3..11beb41 100644
+--- a/drivers/staging/hv/channel_mgmt.c
++++ b/drivers/staging/hv/channel_mgmt.c
+@@ -40,12 +40,12 @@ struct vmbus_channel_message_table_entry {
+ #define MAX_MSG_TYPES 4
+ #define MAX_NUM_DEVICE_CLASSES_SUPPORTED 8
+
+-static const struct hv_guid
++static const uuid_le
+ supported_device_classes[MAX_NUM_DEVICE_CLASSES_SUPPORTED] = {
+ /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
+ /* Storage - SCSI */
+ {
+- .data = {
++ .b = {
+ 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
+ }
+@@ -54,7 +54,7 @@ static const struct hv_guid
+ /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
+ /* Network */
+ {
+- .data = {
++ .b = {
+ 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
+ }
+@@ -63,7 +63,7 @@ static const struct hv_guid
+ /* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
+ /* Input */
+ {
+- .data = {
++ .b = {
+ 0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
+ 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A
+ }
+@@ -72,7 +72,7 @@ static const struct hv_guid
+ /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
+ /* IDE */
+ {
+- .data = {
++ .b = {
+ 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
+ }
+@@ -80,7 +80,7 @@ static const struct hv_guid
+ /* 0E0B6031-5213-4934-818B-38D90CED39DB */
+ /* Shutdown */
+ {
+- .data = {
++ .b = {
+ 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
+ 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
+ }
+@@ -88,7 +88,7 @@ static const struct hv_guid
+ /* {9527E630-D0AE-497b-ADCE-E80AB0175CAF} */
+ /* TimeSync */
+ {
+- .data = {
++ .b = {
+ 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
+ 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
+ }
+@@ -96,7 +96,7 @@ static const struct hv_guid
+ /* {57164f39-9115-4e78-ab55-382f3bd5422d} */
+ /* Heartbeat */
+ {
+- .data = {
++ .b = {
+ 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
+ 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
+ }
+@@ -104,7 +104,7 @@ static const struct hv_guid
+ /* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */
+ /* KVP */
+ {
+- .data = {
++ .b = {
+ 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
+ 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
+ }
+@@ -231,7 +231,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
+ /* Shutdown */
+ {
+ .msg_type = HV_SHUTDOWN_MSG,
+- .data = {
++ .data.b = {
+ 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
+ 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
+ },
+@@ -242,7 +242,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
+ /* TimeSync */
+ {
+ .msg_type = HV_TIMESYNC_MSG,
+- .data = {
++ .data.b = {
+ 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
+ 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
+ },
+@@ -252,7 +252,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
+ /* Heartbeat */
+ {
+ .msg_type = HV_HEARTBEAT_MSG,
+- .data = {
++ .data.b = {
+ 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
+ 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
+ },
+@@ -261,7 +261,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
+ /* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */
+ /* KVP */
+ {
+- .data = {
++ .data.b = {
+ 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
+ 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
+ },
+@@ -358,12 +358,10 @@ static void vmbus_process_offer(struct work_struct *work)
+ spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
+
+ list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
+- if (!memcmp(&channel->offermsg.offer.if_type,
+- &newchannel->offermsg.offer.if_type,
+- sizeof(struct hv_guid)) &&
+- !memcmp(&channel->offermsg.offer.if_instance,
+- &newchannel->offermsg.offer.if_instance,
+- sizeof(struct hv_guid))) {
++ if (!uuid_le_cmp(channel->offermsg.offer.if_type,
++ newchannel->offermsg.offer.if_type) &&
++ !uuid_le_cmp(channel->offermsg.offer.if_instance,
++ newchannel->offermsg.offer.if_instance)) {
+ fnew = false;
+ break;
+ }
+@@ -416,9 +414,8 @@ static void vmbus_process_offer(struct work_struct *work)
+
+ /* Open IC channels */
+ for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) {
+- if (memcmp(&newchannel->offermsg.offer.if_type,
+- &hv_cb_utils[cnt].data,
+- sizeof(struct hv_guid)) == 0 &&
++ if (!uuid_le_cmp(newchannel->offermsg.offer.if_type,
++ hv_cb_utils[cnt].data) &&
+ vmbus_open(newchannel, 2 * PAGE_SIZE,
+ 2 * PAGE_SIZE, NULL, 0,
+ chn_cb_negotiate,
+@@ -444,16 +441,15 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
+ {
+ struct vmbus_channel_offer_channel *offer;
+ struct vmbus_channel *newchannel;
+- struct hv_guid *guidtype;
+- struct hv_guid *guidinstance;
++ uuid_le *guidtype;
++ uuid_le *guidinstance;
+ int i;
+ int fsupported = 0;
+
+ offer = (struct vmbus_channel_offer_channel *)hdr;
+ for (i = 0; i < MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) {
+- if (memcmp(&offer->offer.if_type,
+- &supported_device_classes[i],
+- sizeof(struct hv_guid)) == 0) {
++ if (!uuid_le_cmp(offer->offer.if_type,
++ supported_device_classes[i])) {
+ fsupported = 1;
+ break;
+ }
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 9f3fbee..950f4b4 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -179,8 +179,8 @@ struct mousevsc_dev {
+ static const char *driver_name = "mousevsc";
+
+ /* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
+-static const struct hv_guid mouse_guid = {
+- .data = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
++static const uuid_le mouse_guid = {
++ .b = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
+ 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A}
+ };
+
+@@ -932,7 +932,7 @@ static int __init mousevsc_init(void)
+ DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing.");
+
+ memcpy(&drv->dev_type, &mouse_guid,
+- sizeof(struct hv_guid));
++ sizeof(uuid_le));
+
+ drv->driver.name = driver_name;
+
+diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
+index 1747a24..399d9fe 100644
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -27,6 +27,7 @@
+
+ #include <linux/scatterlist.h>
+ #include <linux/list.h>
++#include <linux/uuid.h>
+ #include <linux/timer.h>
+ #include <linux/workqueue.h>
+ #include <linux/completion.h>
+@@ -35,9 +36,6 @@
+
+ #include <asm/hyperv.h>
+
+-struct hv_guid {
+- unsigned char data[16];
+-};
+
+ #define MAX_PAGE_BUFFER_COUNT 16
+ #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
+@@ -156,8 +154,8 @@ struct hv_ring_buffer_debug_info {
+ * struct contains the fundamental information about an offer.
+ */
+ struct vmbus_channel_offer {
+- struct hv_guid if_type;
+- struct hv_guid if_instance;
++ uuid_le if_type;
++ uuid_le if_instance;
+ u64 int_latency; /* in 100ns units */
+ u32 if_revision;
+ u32 server_ctx_size; /* in bytes */
+@@ -526,8 +524,8 @@ enum vmbus_channel_state {
+ struct vmbus_channel_debug_info {
+ u32 relid;
+ enum vmbus_channel_state state;
+- struct hv_guid interfacetype;
+- struct hv_guid interface_instance;
++ uuid_le interfacetype;
++ uuid_le interface_instance;
+ u32 monitorid;
+ u32 servermonitor_pending;
+ u32 servermonitor_latency;
+@@ -786,8 +784,8 @@ struct hv_dev_port_info {
+ struct hv_device_info {
+ u32 chn_id;
+ u32 chn_state;
+- struct hv_guid chn_type;
+- struct hv_guid chn_instance;
++ uuid_le chn_type;
++ uuid_le chn_instance;
+
+ u32 monitor_id;
+ u32 server_monitor_pending;
+@@ -806,7 +804,7 @@ struct hv_driver {
+ const char *name;
+
+ /* the device type supported by this driver */
+- struct hv_guid dev_type;
++ uuid_le dev_type;
+
+ struct device_driver driver;
+
+@@ -819,10 +817,10 @@ struct hv_driver {
+ /* Base device object */
+ struct hv_device {
+ /* the device type id of this device */
+- struct hv_guid dev_type;
++ uuid_le dev_type;
+
+ /* the device instance id of this device */
+- struct hv_guid dev_instance;
++ uuid_le dev_instance;
+
+ struct device device;
+
+@@ -935,7 +933,7 @@ struct ictimesync_data {
+ struct hyperv_service_callback {
+ u8 msg_type;
+ char *log_msg;
+- unsigned char data[16];
++ uuid_le data;
+ struct vmbus_channel *channel;
+ void (*callback) (void *context);
+ };
+diff --git a/drivers/staging/hv/hyperv_vmbus.h b/drivers/staging/hv/hyperv_vmbus.h
+index 349ad80..16ca90d 100644
+--- a/drivers/staging/hv/hyperv_vmbus.h
++++ b/drivers/staging/hv/hyperv_vmbus.h
+@@ -451,8 +451,8 @@ enum {
+ /* #define VMBUS_PORT_ID 11 */
+
+ /* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */
+-static const struct hv_guid VMBUS_SERVICE_ID = {
+- .data = {
++static const uuid_le VMBUS_SERVICE_ID = {
++ .b = {
+ 0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c,
+ 0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4
+ },
+@@ -601,8 +601,8 @@ extern struct vmbus_connection vmbus_connection;
+
+ /* General vmbus interface */
+
+-struct hv_device *vmbus_child_device_create(struct hv_guid *type,
+- struct hv_guid *instance,
++struct hv_device *vmbus_child_device_create(uuid_le *type,
++ uuid_le *instance,
+ struct vmbus_channel *channel);
+
+ int vmbus_child_device_register(struct hv_device *child_device_obj);
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index dc5e5c4..1506b53 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -36,8 +36,8 @@
+ static const char *driver_name = "netvsc";
+
+ /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
+-static const struct hv_guid netvsc_device_type = {
+- .data = {
++static const uuid_le netvsc_device_type = {
++ .b = {
+ 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
+ }
+@@ -1009,7 +1009,7 @@ int netvsc_initialize(struct hv_driver *drv)
+ {
+
+ drv->name = driver_name;
+- memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid));
++ memcpy(&drv->dev_type, &netvsc_device_type, sizeof(uuid_le));
+
+ return 0;
+ }
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 7effaf3..e4cdbc5 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -45,8 +45,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
+ static const char *driver_name = "storvsc";
+
+ /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
+-static const struct hv_guid stor_vsci_device_type = {
+- .data = {
++static const uuid_le stor_vsci_device_type = {
++ .b = {
+ 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
+ }
+@@ -765,7 +765,7 @@ static int __init storvsc_drv_init(void)
+ sizeof(u64)));
+
+ memcpy(&drv->dev_type, &stor_vsci_device_type,
+- sizeof(struct hv_guid));
++ sizeof(uuid_le));
+
+ if (max_outstanding_req_per_channel <
+ STORVSC_MAX_IO_REQUESTS)
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 8f1d6eb..c88a183 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -64,9 +64,9 @@ static void get_channel_info(struct hv_device *device,
+ info->chn_id = debug_info.relid;
+ info->chn_state = debug_info.state;
+ memcpy(&info->chn_type, &debug_info.interfacetype,
+- sizeof(struct hv_guid));
++ sizeof(uuid_le));
+ memcpy(&info->chn_instance, &debug_info.interface_instance,
+- sizeof(struct hv_guid));
++ sizeof(uuid_le));
+
+ info->monitor_id = debug_info.monitorid;
+
+@@ -116,41 +116,41 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
+ if (!strcmp(dev_attr->attr.name, "class_id")) {
+ return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
+- device_info.chn_type.data[3],
+- device_info.chn_type.data[2],
+- device_info.chn_type.data[1],
+- device_info.chn_type.data[0],
+- device_info.chn_type.data[5],
+- device_info.chn_type.data[4],
+- device_info.chn_type.data[7],
+- device_info.chn_type.data[6],
+- device_info.chn_type.data[8],
+- device_info.chn_type.data[9],
+- device_info.chn_type.data[10],
+- device_info.chn_type.data[11],
+- device_info.chn_type.data[12],
+- device_info.chn_type.data[13],
+- device_info.chn_type.data[14],
+- device_info.chn_type.data[15]);
++ device_info.chn_type.b[3],
++ device_info.chn_type.b[2],
++ device_info.chn_type.b[1],
++ device_info.chn_type.b[0],
++ device_info.chn_type.b[5],
++ device_info.chn_type.b[4],
++ device_info.chn_type.b[7],
++ device_info.chn_type.b[6],
++ device_info.chn_type.b[8],
++ device_info.chn_type.b[9],
++ device_info.chn_type.b[10],
++ device_info.chn_type.b[11],
++ device_info.chn_type.b[12],
++ device_info.chn_type.b[13],
++ device_info.chn_type.b[14],
++ device_info.chn_type.b[15]);
+ } else if (!strcmp(dev_attr->attr.name, "device_id")) {
+ return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
+- device_info.chn_instance.data[3],
+- device_info.chn_instance.data[2],
+- device_info.chn_instance.data[1],
+- device_info.chn_instance.data[0],
+- device_info.chn_instance.data[5],
+- device_info.chn_instance.data[4],
+- device_info.chn_instance.data[7],
+- device_info.chn_instance.data[6],
+- device_info.chn_instance.data[8],
+- device_info.chn_instance.data[9],
+- device_info.chn_instance.data[10],
+- device_info.chn_instance.data[11],
+- device_info.chn_instance.data[12],
+- device_info.chn_instance.data[13],
+- device_info.chn_instance.data[14],
+- device_info.chn_instance.data[15]);
++ device_info.chn_instance.b[3],
++ device_info.chn_instance.b[2],
++ device_info.chn_instance.b[1],
++ device_info.chn_instance.b[0],
++ device_info.chn_instance.b[5],
++ device_info.chn_instance.b[4],
++ device_info.chn_instance.b[7],
++ device_info.chn_instance.b[6],
++ device_info.chn_instance.b[8],
++ device_info.chn_instance.b[9],
++ device_info.chn_instance.b[10],
++ device_info.chn_instance.b[11],
++ device_info.chn_instance.b[12],
++ device_info.chn_instance.b[13],
++ device_info.chn_instance.b[14],
++ device_info.chn_instance.b[15]);
+ } else if (!strcmp(dev_attr->attr.name, "state")) {
+ return sprintf(buf, "%d\n", device_info.chn_state);
+ } else if (!strcmp(dev_attr->attr.name, "id")) {
+@@ -246,22 +246,22 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
+ ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={"
+ "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x%02x%02x}",
+- dev->dev_type.data[3],
+- dev->dev_type.data[2],
+- dev->dev_type.data[1],
+- dev->dev_type.data[0],
+- dev->dev_type.data[5],
+- dev->dev_type.data[4],
+- dev->dev_type.data[7],
+- dev->dev_type.data[6],
+- dev->dev_type.data[8],
+- dev->dev_type.data[9],
+- dev->dev_type.data[10],
+- dev->dev_type.data[11],
+- dev->dev_type.data[12],
+- dev->dev_type.data[13],
+- dev->dev_type.data[14],
+- dev->dev_type.data[15]);
++ dev->dev_type.b[3],
++ dev->dev_type.b[2],
++ dev->dev_type.b[1],
++ dev->dev_type.b[0],
++ dev->dev_type.b[5],
++ dev->dev_type.b[4],
++ dev->dev_type.b[7],
++ dev->dev_type.b[6],
++ dev->dev_type.b[8],
++ dev->dev_type.b[9],
++ dev->dev_type.b[10],
++ dev->dev_type.b[11],
++ dev->dev_type.b[12],
++ dev->dev_type.b[13],
++ dev->dev_type.b[14],
++ dev->dev_type.b[15]);
+
+ if (ret)
+ return ret;
+@@ -269,22 +269,22 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
+ ret = add_uevent_var(env, "VMBUS_DEVICE_DEVICE_GUID={"
+ "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x%02x%02x}",
+- dev->dev_instance.data[3],
+- dev->dev_instance.data[2],
+- dev->dev_instance.data[1],
+- dev->dev_instance.data[0],
+- dev->dev_instance.data[5],
+- dev->dev_instance.data[4],
+- dev->dev_instance.data[7],
+- dev->dev_instance.data[6],
+- dev->dev_instance.data[8],
+- dev->dev_instance.data[9],
+- dev->dev_instance.data[10],
+- dev->dev_instance.data[11],
+- dev->dev_instance.data[12],
+- dev->dev_instance.data[13],
+- dev->dev_instance.data[14],
+- dev->dev_instance.data[15]);
++ dev->dev_instance.b[3],
++ dev->dev_instance.b[2],
++ dev->dev_instance.b[1],
++ dev->dev_instance.b[0],
++ dev->dev_instance.b[5],
++ dev->dev_instance.b[4],
++ dev->dev_instance.b[7],
++ dev->dev_instance.b[6],
++ dev->dev_instance.b[8],
++ dev->dev_instance.b[9],
++ dev->dev_instance.b[10],
++ dev->dev_instance.b[11],
++ dev->dev_instance.b[12],
++ dev->dev_instance.b[13],
++ dev->dev_instance.b[14],
++ dev->dev_instance.b[15]);
+ if (ret)
+ return ret;
+
+@@ -303,7 +303,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
+
+ /* We found our driver ? */
+ if (memcmp(&hv_dev->dev_type, &drv->dev_type,
+- sizeof(struct hv_guid)) == 0)
++ sizeof(uuid_le)) == 0)
+ match = 1;
+
+ return match;
+@@ -630,8 +630,8 @@ EXPORT_SYMBOL(vmbus_child_driver_unregister);
+ * vmbus_child_device_create - Creates and registers a new child device
+ * on the vmbus.
+ */
+-struct hv_device *vmbus_child_device_create(struct hv_guid *type,
+- struct hv_guid *instance,
++struct hv_device *vmbus_child_device_create(uuid_le *type,
++ uuid_le *instance,
+ struct vmbus_channel *channel)
+ {
+ struct hv_device *child_device_obj;
+@@ -644,9 +644,9 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
+ }
+
+ child_device_obj->channel = channel;
+- memcpy(&child_device_obj->dev_type, type, sizeof(struct hv_guid));
++ memcpy(&child_device_obj->dev_type, type, sizeof(uuid_le));
+ memcpy(&child_device_obj->dev_instance, instance,
+- sizeof(struct hv_guid));
++ sizeof(uuid_le));
+
+
+ return child_device_obj;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0009-Staging-hv-vmbus-Introduce-vmbus-ID-space-in-stru.patch b/patches.suse/staging-hv-staging-next-20110825-0009-Staging-hv-vmbus-Introduce-vmbus-ID-space-in-stru.patch
new file mode 100644
index 0000000000..2976d5bf6f
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0009-Staging-hv-vmbus-Introduce-vmbus-ID-space-in-stru.patch
@@ -0,0 +1,39 @@
+From 2e2c1d17abc3953239bc05ac586eab9f2f14bfda Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:31 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver
+
+In preparation for supporting auto-loading Hyper-V drivers
+using vmbus specific aliases, introduce vmbus ID space in struct hv_driver.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
+index 399d9fe..b8199f4 100644
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -32,6 +32,7 @@
+ #include <linux/workqueue.h>
+ #include <linux/completion.h>
+ #include <linux/device.h>
++#include <linux/mod_devicetable.h>
+
+
+ #include <asm/hyperv.h>
+@@ -805,6 +806,7 @@ struct hv_driver {
+
+ /* the device type supported by this driver */
+ uuid_le dev_type;
++ const struct hv_vmbus_device_id *id_table;
+
+ struct device_driver driver;
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0010-Staging-hv-blkvsc-Use-the-newly-introduced-vmbus.patch b/patches.suse/staging-hv-staging-next-20110825-0010-Staging-hv-blkvsc-Use-the-newly-introduced-vmbus.patch
new file mode 100644
index 0000000000..d7dd0d8769
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0010-Staging-hv-blkvsc-Use-the-newly-introduced-vmbus.patch
@@ -0,0 +1,71 @@
+From eefd7f4555163da346781a2216264ba871aed76b Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:32 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver
+
+Use the newly introduced vmbus ID in the blockvsc driver. Also, do
+the associated cleanup.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/blkvsc_drv.c | 23 ++++++++++++++---------
+ 1 files changed, 14 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
+index 018b293..9b99387 100644
+--- a/drivers/staging/hv/blkvsc_drv.c
++++ b/drivers/staging/hv/blkvsc_drv.c
+@@ -111,14 +111,6 @@ struct block_device_context {
+
+ static const char *drv_name = "blkvsc";
+
+-/* {32412632-86cb-44a2-9b5c-50d1417354f5} */
+-static const uuid_le dev_type = {
+- .b = {
+- 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+- 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
+- }
+-};
+-
+ /*
+ * There is a circular dependency involving blkvsc_request_completion()
+ * and blkvsc_do_request().
+@@ -802,10 +794,24 @@ static void blkvsc_request(struct request_queue *queue)
+ }
+ }
+
++static const struct hv_vmbus_device_id id_table[] = {
++ {
++ /* IDE guid */
++ .guid = {
++ 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
++ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
++ }
++ },
++ {
++ .guid = { }
++ },
++};
+
++MODULE_DEVICE_TABLE(vmbus, id_table);
+
+ /* The one and only one */
+ static struct hv_driver blkvsc_drv = {
++ .id_table = id_table,
+ .probe = blkvsc_probe,
+ .remove = blkvsc_remove,
+ .shutdown = blkvsc_shutdown,
+@@ -829,7 +835,6 @@ static int blkvsc_drv_init(void)
+
+ BUILD_BUG_ON(sizeof(sector_t) != 8);
+
+- memcpy(&drv->dev_type, &dev_type, sizeof(uuid_le));
+ drv->driver.name = drv_name;
+
+ /* The driver belongs to vmbus */
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0011-Staging-hv-storvsc-Use-the-newly-introduced-vmbus.patch b/patches.suse/staging-hv-staging-next-20110825-0011-Staging-hv-storvsc-Use-the-newly-introduced-vmbus.patch
new file mode 100644
index 0000000000..2ce7568056
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0011-Staging-hv-storvsc-Use-the-newly-introduced-vmbus.patch
@@ -0,0 +1,77 @@
+From d847b5fe333d3cc588b26fabb138bb86077f080d Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:33 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver
+
+Use the newly introduced vmbus ID in storvsc driver. Also, do the
+assciated cleanup.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 25 ++++++++++++++-----------
+ 1 files changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index e4cdbc5..ed2140c 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -44,14 +44,6 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
+
+ static const char *driver_name = "storvsc";
+
+-/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
+-static const uuid_le stor_vsci_device_type = {
+- .b = {
+- 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+- 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
+- }
+-};
+-
+ struct hv_host_device {
+ struct hv_device *dev;
+ struct kmem_cache *request_pool;
+@@ -646,7 +638,20 @@ static struct scsi_host_template scsi_driver = {
+ .dma_boundary = PAGE_SIZE-1,
+ };
+
++static const struct hv_vmbus_device_id id_table[] = {
++ {
++ /* SCSI guid */
++ .guid = {
++ 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
++ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
++ }
++ },
++ {
++ .guid = { }
++ },
++};
+
++MODULE_DEVICE_TABLE(vmbus, id_table);
+ /*
+ * storvsc_probe - Add a new device for this driver
+ */
+@@ -720,6 +725,7 @@ static int storvsc_probe(struct hv_device *device)
+ /* The one and only one */
+
+ static struct hv_driver storvsc_drv = {
++ .id_table = id_table,
+ .probe = storvsc_probe,
+ .remove = storvsc_remove,
+ };
+@@ -764,9 +770,6 @@ static int __init storvsc_drv_init(void)
+ sizeof(struct vstor_packet) + sizeof(u64),
+ sizeof(u64)));
+
+- memcpy(&drv->dev_type, &stor_vsci_device_type,
+- sizeof(uuid_le));
+-
+ if (max_outstanding_req_per_channel <
+ STORVSC_MAX_IO_REQUESTS)
+ return -1;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0012-Staging-hv-netvsc-Use-the-newly-introduced-vmbus.patch b/patches.suse/staging-hv-staging-next-20110825-0012-Staging-hv-netvsc-Use-the-newly-introduced-vmbus.patch
new file mode 100644
index 0000000000..59e57391f1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0012-Staging-hv-netvsc-Use-the-newly-introduced-vmbus.patch
@@ -0,0 +1,77 @@
+From 345c4cc3b953a43464776701918e22c7e30cedd0 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:34 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver
+
+Use the newly introduced vmbus ID in netvsc driver. Also, do the associated
+cleanup.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 10 ----------
+ drivers/staging/hv/netvsc_drv.c | 16 ++++++++++++++++
+ 2 files changed, 16 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 1506b53..6f4541b 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -35,15 +35,6 @@
+ /* Globals */
+ static const char *driver_name = "netvsc";
+
+-/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
+-static const uuid_le netvsc_device_type = {
+- .b = {
+- 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+- 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
+- }
+-};
+-
+-
+ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ {
+ struct netvsc_device *net_device;
+@@ -1009,7 +1000,6 @@ int netvsc_initialize(struct hv_driver *drv)
+ {
+
+ drv->name = driver_name;
+- memcpy(&drv->dev_type, &netvsc_device_type, sizeof(uuid_le));
+
+ return 0;
+ }
+diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
+index 61989f0..2e25c95 100644
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -413,8 +413,24 @@ static int netvsc_remove(struct hv_device *dev)
+ return 0;
+ }
+
++static const struct hv_vmbus_device_id id_table[] = {
++ {
++ /* Network guid */
++ .guid = {
++ 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
++ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
++ }
++ },
++ {
++ .guid = { }
++ },
++};
++
++MODULE_DEVICE_TABLE(vmbus, id_table);
++
+ /* The one and only one */
+ static struct hv_driver netvsc_drv = {
++ .id_table = id_table,
+ .probe = netvsc_probe,
+ .remove = netvsc_remove,
+ };
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0013-Staging-hv-mousevsc-Use-the-newly-introduced-vmbu.patch b/patches.suse/staging-hv-staging-next-20110825-0013-Staging-hv-mousevsc-Use-the-newly-introduced-vmbu.patch
new file mode 100644
index 0000000000..5d9b3329ef
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0013-Staging-hv-mousevsc-Use-the-newly-introduced-vmbu.patch
@@ -0,0 +1,74 @@
+From 1ec91ebe4da8fe016a16eec1177e8edb2ea57517 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:35 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver
+
+Use the newly introduced vmbus ID in mouse driver. Also, do the associated
+cleanup. Since the mouse driver is not functional, we disable the
+autoloading of this driver.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 27 ++++++++++++++++++---------
+ 1 files changed, 18 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 950f4b4..dd8a114 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -178,12 +178,6 @@ struct mousevsc_dev {
+
+ static const char *driver_name = "mousevsc";
+
+-/* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
+-static const uuid_le mouse_guid = {
+- .b = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
+- 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A}
+-};
+-
+ static void deviceinfo_callback(struct hv_device *dev, struct hv_input_dev_info *info);
+ static void inputreport_callback(struct hv_device *dev, void *packet, u32 len);
+ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
+@@ -914,8 +908,26 @@ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
+ kfree(hid_dev);
+ }
+
++static const struct hv_vmbus_device_id id_table[] = {
++ {
++ /* Mouse guid */
++ .guid = {
++ 0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
++ 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A
++ }
++ },
++ {
++ .guid = { }
++ },
++};
++
++/*
++ * The mouse driver is not functional; do not auto-load it.
++ */
++/* MODULE_DEVICE_TABLE(vmbus, id_table); */
+
+ static struct hv_driver mousevsc_drv = {
++ .id_table = id_table,
+ .probe = mousevsc_probe,
+ .remove = mousevsc_remove,
+ };
+@@ -931,9 +943,6 @@ static int __init mousevsc_init(void)
+
+ DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing.");
+
+- memcpy(&drv->dev_type, &mouse_guid,
+- sizeof(uuid_le));
+-
+ drv->driver.name = driver_name;
+
+ /* The driver belongs to vmbus */
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0014-Staging-hv-util-Make-hv_utils-a-vmbus-device-driv.patch b/patches.suse/staging-hv-staging-next-20110825-0014-Staging-hv-util-Make-hv_utils-a-vmbus-device-driv.patch
new file mode 100644
index 0000000000..29fa9bfd36
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0014-Staging-hv-util-Make-hv_utils-a-vmbus-device-driv.patch
@@ -0,0 +1,115 @@
+From 283f21294ea02f7608e0c833b9c982712427fc50 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:36 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: util: Make hv_utils a vmbus device driver
+
+In preperation for supporting auto-loading the util driver, make
+the util driver a vmbus driver.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_util.c | 64 +++++++++++++++++++++++++++++++++++++++++-
+ 1 files changed, 63 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
+index c164b54..a620f4d 100644
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -36,6 +36,8 @@ static u8 *shut_txf_buf;
+ static u8 *time_txf_buf;
+ static u8 *hbeat_txf_buf;
+
++static const char *driver_name = "hv_util";
++
+ static void shutdown_onchannelcallback(void *context)
+ {
+ struct vmbus_channel *channel = context;
+@@ -210,6 +212,63 @@ static void heartbeat_onchannelcallback(void *context)
+ }
+ }
+
++/*
++ * The devices managed by the util driver don't need any additional
++ * setup.
++ */
++static int util_probe(struct hv_device *dev)
++{
++ return 0;
++}
++
++static int util_remove(struct hv_device *dev)
++{
++ return 0;
++}
++
++static const struct hv_vmbus_device_id id_table[] = {
++ {
++ /* Shutdown guid */
++ .guid = {
++ 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
++ 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
++ }
++ },
++ {
++ /* Time synch guid */
++ .guid = {
++ 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
++ 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
++ }
++ },
++ {
++ /* Heartbeat guid */
++ .guid = {
++ 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
++ 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
++ }
++ },
++ {
++ /* KVP guid */
++ .guid = {
++ 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
++ 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
++ }
++ },
++ {
++ .guid = { }
++ },
++};
++
++MODULE_DEVICE_TABLE(vmbus, id_table);
++
++/* The one and only one */
++static struct hv_driver util_drv = {
++ .id_table = id_table,
++ .probe = util_probe,
++ .remove = util_remove,
++};
++
+ static const struct pci_device_id __initconst
+ hv_utils_pci_table[] __maybe_unused = {
+ { PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */
+@@ -264,7 +323,9 @@ static int __init init_hyperv_utils(void)
+
+ hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
+
+- return 0;
++ util_drv.driver.name = driver_name;
++
++ return vmbus_child_driver_register(&util_drv.driver);
+ }
+
+ static void exit_hyperv_utils(void)
+@@ -296,6 +357,7 @@ static void exit_hyperv_utils(void)
+ kfree(shut_txf_buf);
+ kfree(time_txf_buf);
+ kfree(hbeat_txf_buf);
++ vmbus_child_driver_unregister(&util_drv.driver);
+ }
+
+ module_init(init_hyperv_utils);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0015-Staging-hv-create-VMBUS_DEVICE-macro-and-use-it.patch b/patches.suse/staging-hv-staging-next-20110825-0015-Staging-hv-create-VMBUS_DEVICE-macro-and-use-it.patch
new file mode 100644
index 0000000000..8cddb22292
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0015-Staging-hv-create-VMBUS_DEVICE-macro-and-use-it.patch
@@ -0,0 +1,203 @@
+From c45cf2d4976e2fcde68d88898a37af70f2caaf5d Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 11:41:33 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: create VMBUS_DEVICE macro and use it.
+
+This is to be used to be able to write hv_vmbus_device_id tables easier.
+
+This patch also converts all hv drivers to use the macro, saving some
+lines of code and making things easier to read overall.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/blkvsc_drv.c | 14 +++--------
+ drivers/staging/hv/hv_mouse.c | 14 +++--------
+ drivers/staging/hv/hv_util.c | 44 +++++++++++--------------------------
+ drivers/staging/hv/hyperv.h | 11 +++++++++
+ drivers/staging/hv/netvsc_drv.c | 14 +++--------
+ drivers/staging/hv/storvsc_drv.c | 14 +++--------
+ 6 files changed, 40 insertions(+), 71 deletions(-)
+
+diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
+index 9b99387..d170f24 100644
+--- a/drivers/staging/hv/blkvsc_drv.c
++++ b/drivers/staging/hv/blkvsc_drv.c
+@@ -795,16 +795,10 @@ static void blkvsc_request(struct request_queue *queue)
+ }
+
+ static const struct hv_vmbus_device_id id_table[] = {
+- {
+- /* IDE guid */
+- .guid = {
+- 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+- 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
+- }
+- },
+- {
+- .guid = { }
+- },
++ /* IDE guid */
++ { VMBUS_DEVICE(0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
++ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5) },
++ { },
+ };
+
+ MODULE_DEVICE_TABLE(vmbus, id_table);
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index dd8a114..ebd1715 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -909,16 +909,10 @@ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
+ }
+
+ static const struct hv_vmbus_device_id id_table[] = {
+- {
+- /* Mouse guid */
+- .guid = {
+- 0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
+- 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A
+- }
+- },
+- {
+- .guid = { }
+- },
++ /* Mouse guid */
++ { VMBUS_DEVICE(0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
++ 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A) },
++ { },
+ };
+
+ /*
+diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
+index a620f4d..5bd6f00 100644
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -227,37 +227,19 @@ static int util_remove(struct hv_device *dev)
+ }
+
+ static const struct hv_vmbus_device_id id_table[] = {
+- {
+- /* Shutdown guid */
+- .guid = {
+- 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
+- 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
+- }
+- },
+- {
+- /* Time synch guid */
+- .guid = {
+- 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
+- 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
+- }
+- },
+- {
+- /* Heartbeat guid */
+- .guid = {
+- 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
+- 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
+- }
+- },
+- {
+- /* KVP guid */
+- .guid = {
+- 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
+- 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
+- }
+- },
+- {
+- .guid = { }
+- },
++ /* Shutdown guid */
++ { VMBUS_DEVICE(0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
++ 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB) },
++ /* Time synch guid */
++ { VMBUS_DEVICE(0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
++ 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf) },
++ /* Heartbeat guid */
++ { VMBUS_DEVICE(0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
++ 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d) },
++ /* KVP guid */
++ { VMBUS_DEVICE(0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
++ 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6) },
++ { },
+ };
+
+ MODULE_DEVICE_TABLE(vmbus, id_table);
+diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
+index b8199f4..d96de66 100644
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -848,6 +848,17 @@ static inline struct hv_driver *drv_to_hv_drv(struct device_driver *d)
+ int vmbus_child_driver_register(struct device_driver *drv);
+ void vmbus_child_driver_unregister(struct device_driver *drv);
+
++/**
++ * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device
++ *
++ * This macro is used to create a struct hv_vmbus_device_id that matches a
++ * specific device.
++ */
++#define VMBUS_DEVICE(g0, g1, g2, g3, g4, g5, g6, g7, \
++ g8, g9, ga, gb, gc, gd, ge, gf) \
++ .guid = { g0, g1, g2, g3, g4, g5, g6, g7, \
++ g8, g9, ga, gb, gc, gd, ge, gf },
++
+ /*
+ * Common header for Hyper-V ICs
+ */
+diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
+index 2e25c95..c3b7de1 100644
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -414,16 +414,10 @@ static int netvsc_remove(struct hv_device *dev)
+ }
+
+ static const struct hv_vmbus_device_id id_table[] = {
+- {
+- /* Network guid */
+- .guid = {
+- 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+- 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
+- }
+- },
+- {
+- .guid = { }
+- },
++ /* Network guid */
++ { VMBUS_DEVICE(0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
++ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E) },
++ { },
+ };
+
+ MODULE_DEVICE_TABLE(vmbus, id_table);
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index ed2140c..f85f2ea 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -639,16 +639,10 @@ static struct scsi_host_template scsi_driver = {
+ };
+
+ static const struct hv_vmbus_device_id id_table[] = {
+- {
+- /* SCSI guid */
+- .guid = {
+- 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+- 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
+- }
+- },
+- {
+- .guid = { }
+- },
++ /* SCSI guid */
++ { VMBUS_DEVICE(0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
++ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f) },
++ { },
+ };
+
+ MODULE_DEVICE_TABLE(vmbus, id_table);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0016-Staging-hv-vmbus-Cleanup-vmbus_match.patch b/patches.suse/staging-hv-staging-next-20110825-0016-Staging-hv-vmbus-Cleanup-vmbus_match.patch
new file mode 100644
index 0000000000..6d6db03e31
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0016-Staging-hv-vmbus-Cleanup-vmbus_match.patch
@@ -0,0 +1,32 @@
+From 5cee7cb79d210f48c19692a79e0508ec001e439f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:37 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup vmbus_match()
+
+Use the preferred mechanism to compare guids in vmbus_match().
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 3 +--
+ 1 files changed, 1 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index c88a183..b651968 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -302,8 +302,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
+ struct hv_device *hv_dev = device_to_hv_device(device);
+
+ /* We found our driver ? */
+- if (memcmp(&hv_dev->dev_type, &drv->dev_type,
+- sizeof(uuid_le)) == 0)
++ if (!uuid_le_cmp(hv_dev->dev_type, drv->dev_type))
+ match = 1;
+
+ return match;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0017-Staging-hv-vmbus-Cleanup-vmbus_uevent-code.patch b/patches.suse/staging-hv-staging-next-20110825-0017-Staging-hv-vmbus-Cleanup-vmbus_uevent-code.patch
new file mode 100644
index 0000000000..be9ab99a14
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0017-Staging-hv-vmbus-Cleanup-vmbus_uevent-code.patch
@@ -0,0 +1,95 @@
+From 0ddda6603a6eea0b3aff294648ecb30a22e974f1 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:38 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup vmbus_uevent() code
+
+Now generate appropriate uevent based on the modalias string. As part of this,
+cleanup the existing uevent code.
+
+[gregkh - fixed code to handle driver_data portion of struct
+hv_vmbus_device_id]
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 60 ++++++++--------------------------------
+ 1 files changed, 12 insertions(+), 48 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index b651968..afb1670 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -237,58 +237,22 @@ static struct device_attribute vmbus_device_attrs[] = {
+ * This routine is invoked when a device is added or removed on the vmbus to
+ * generate a uevent to udev in the userspace. The udev will then look at its
+ * rule and the uevent generated here to load the appropriate driver
++ *
++ * The alias string will be of the form vmbus:guid where guid is the string
++ * representation of the device guid (each byte of the guid will be
++ * represented with two hex characters.
+ */
+ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
+ {
+ struct hv_device *dev = device_to_hv_device(device);
+- int ret;
+-
+- ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={"
+- "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+- "%02x%02x%02x%02x%02x%02x%02x%02x}",
+- dev->dev_type.b[3],
+- dev->dev_type.b[2],
+- dev->dev_type.b[1],
+- dev->dev_type.b[0],
+- dev->dev_type.b[5],
+- dev->dev_type.b[4],
+- dev->dev_type.b[7],
+- dev->dev_type.b[6],
+- dev->dev_type.b[8],
+- dev->dev_type.b[9],
+- dev->dev_type.b[10],
+- dev->dev_type.b[11],
+- dev->dev_type.b[12],
+- dev->dev_type.b[13],
+- dev->dev_type.b[14],
+- dev->dev_type.b[15]);
+-
+- if (ret)
+- return ret;
++ int i, ret;
++ char alias_name[((sizeof((struct hv_vmbus_device_id *)0)->guid) + 1) * 2];
+
+- ret = add_uevent_var(env, "VMBUS_DEVICE_DEVICE_GUID={"
+- "%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+- "%02x%02x%02x%02x%02x%02x%02x%02x}",
+- dev->dev_instance.b[3],
+- dev->dev_instance.b[2],
+- dev->dev_instance.b[1],
+- dev->dev_instance.b[0],
+- dev->dev_instance.b[5],
+- dev->dev_instance.b[4],
+- dev->dev_instance.b[7],
+- dev->dev_instance.b[6],
+- dev->dev_instance.b[8],
+- dev->dev_instance.b[9],
+- dev->dev_instance.b[10],
+- dev->dev_instance.b[11],
+- dev->dev_instance.b[12],
+- dev->dev_instance.b[13],
+- dev->dev_instance.b[14],
+- dev->dev_instance.b[15]);
+- if (ret)
+- return ret;
++ for (i = 0; i < ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2); i += 2)
++ sprintf(&alias_name[i], "%02x", dev->dev_type.b[i/2]);
+
+- return 0;
++ ret = add_uevent_var(env, "MODALIAS=vmbus:%s", alias_name);
++ return ret;
+ }
+
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0018-Staging-hv-vmbus-Support-the-notion-of-id-tables.patch b/patches.suse/staging-hv-staging-next-20110825-0018-Staging-hv-vmbus-Support-the-notion-of-id-tables.patch
new file mode 100644
index 0000000000..bba2944ab3
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0018-Staging-hv-vmbus-Support-the-notion-of-id-tables.patch
@@ -0,0 +1,61 @@
+From 5841a829594983077f670192b78fee4f7712e2b4 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:39 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Support the notion of id tables in vmbus_match()
+
+Introduce code to handle driver specific id tables to the vmbus core
+(vmbus_match). This would allow us to handle more than one device type
+with a given driver.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 20 +++++++++++++++-----
+ 1 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index afb1670..82769a4 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -255,21 +255,31 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
+ return ret;
+ }
+
++static uuid_le null_guid;
++
++static inline bool is_null_guid(const __u8 *guid)
++{
++ if (memcmp(guid, &null_guid, sizeof(uuid_le)))
++ return false;
++ return true;
++}
++
+
+ /*
+ * vmbus_match - Attempt to match the specified device to the specified driver
+ */
+ static int vmbus_match(struct device *device, struct device_driver *driver)
+ {
+- int match = 0;
+ struct hv_driver *drv = drv_to_hv_drv(driver);
+ struct hv_device *hv_dev = device_to_hv_device(device);
++ const struct hv_vmbus_device_id *id_array = drv->id_table;
+
+- /* We found our driver ? */
+- if (!uuid_le_cmp(hv_dev->dev_type, drv->dev_type))
+- match = 1;
++ for (; !is_null_guid(id_array->guid); id_array++)
++ if (!memcmp(&id_array->guid, &hv_dev->dev_type.b,
++ sizeof(struct hv_vmbus_device_id)))
++ return 1;
+
+- return match;
++ return 0;
+ }
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0019-Staging-hv-vmbus-Get-rid-of-an-unnecessary-includ.patch b/patches.suse/staging-hv-staging-next-20110825-0019-Staging-hv-vmbus-Get-rid-of-an-unnecessary-includ.patch
new file mode 100644
index 0000000000..41aa33431a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0019-Staging-hv-vmbus-Get-rid-of-an-unnecessary-includ.patch
@@ -0,0 +1,30 @@
+From 49ce6757cfb4de5be695a47f2cbcbc5589838af6 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:40 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c
+
+Get rid of an unnecessary include line in vmbus_drv.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 82769a4..0114b04 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -28,7 +28,6 @@
+ #include <linux/irq.h>
+ #include <linux/interrupt.h>
+ #include <linux/sysctl.h>
+-#include <linux/dmi.h>
+ #include <linux/slab.h>
+ #include <linux/acpi.h>
+ #include <acpi/acpi_bus.h>
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0020-Staging-hv-storvsc-Get-rid-of-the-DMI-signature.patch b/patches.suse/staging-hv-staging-next-20110825-0020-Staging-hv-storvsc-Get-rid-of-the-DMI-signature.patch
new file mode 100644
index 0000000000..8a30bed78a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0020-Staging-hv-storvsc-Get-rid-of-the-DMI-signature.patch
@@ -0,0 +1,59 @@
+From 4e80fbfc7ff4e063d96b258aaa3da97e8e4dc6a5 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:41 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Get rid of the DMI signature
+
+Now that we have implemented a vmbus specific mechanism for auto-loading,
+get rid of the DMI signature.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 22 ----------------------
+ 1 files changed, 0 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index f85f2ea..6f67e9b 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -24,7 +24,6 @@
+ #include <linux/module.h>
+ #include <linux/device.h>
+ #include <linux/blkdev.h>
+-#include <linux/dmi.h>
+ #include <scsi/scsi.h>
+ #include <scsi/scsi_cmnd.h>
+ #include <scsi/scsi_host.h>
+@@ -724,27 +723,6 @@ static struct hv_driver storvsc_drv = {
+ .remove = storvsc_remove,
+ };
+
+-/*
+- * We use a DMI table to determine if we should autoload this driver This is
+- * needed by distro tools to determine if the hyperv drivers should be
+- * installed and/or configured. We don't do anything else with the table, but
+- * it needs to be present.
+- */
+-
+-static const struct dmi_system_id __initconst
+-hv_stor_dmi_table[] __maybe_unused = {
+- {
+- .ident = "Hyper-V",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+- DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
+- DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+- },
+- },
+- { },
+-};
+-MODULE_DEVICE_TABLE(dmi, hv_stor_dmi_table);
+-
+ static int __init storvsc_drv_init(void)
+ {
+ int ret;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0021-Staging-hv-netvsc-Get-rid-of-the-PCI-signature.patch b/patches.suse/staging-hv-staging-next-20110825-0021-Staging-hv-netvsc-Get-rid-of-the-PCI-signature.patch
new file mode 100644
index 0000000000..05c88b5c82
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0021-Staging-hv-netvsc-Get-rid-of-the-PCI-signature.patch
@@ -0,0 +1,45 @@
+From d7dc6b9c2e8fec9f9d6ebe518918d028a505ef7b Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:42 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Get rid of the PCI signature
+
+Now that we have implemented a vmbus specific mechanism for auto-loading,
+get rid of the PCI signature.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 8 --------
+ 1 files changed, 0 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
+index c3b7de1..1c3c5fe 100644
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -34,7 +34,6 @@
+ #include <linux/in.h>
+ #include <linux/slab.h>
+ #include <linux/dmi.h>
+-#include <linux/pci.h>
+ #include <net/arp.h>
+ #include <net/route.h>
+ #include <net/sock.h>
+@@ -471,13 +470,6 @@ static int __init netvsc_drv_init(void)
+ return ret;
+ }
+
+-static const struct pci_device_id __initconst
+-hv_netvsc_pci_table[] __maybe_unused = {
+- { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
+- { 0 }
+-};
+-MODULE_DEVICE_TABLE(pci, hv_netvsc_pci_table);
+-
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION(HV_DRV_VERSION);
+ MODULE_DESCRIPTION("Microsoft Hyper-V network driver");
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0022-Staging-hv-netvsc-Get-rid-of-the-DMI-signature-in.patch b/patches.suse/staging-hv-staging-next-20110825-0022-Staging-hv-netvsc-Get-rid-of-the-DMI-signature-in.patch
new file mode 100644
index 0000000000..c131e642ab
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0022-Staging-hv-netvsc-Get-rid-of-the-DMI-signature-in.patch
@@ -0,0 +1,63 @@
+From 2e7a35adbb4fdca2e5f2a02791c83704f4b1797f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:43 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c
+
+Now that we have implemented a vmbus specific mechanism for auto-loading,
+get rid of the DMI signature.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 19 -------------------
+ 1 files changed, 0 insertions(+), 19 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
+index 1c3c5fe..2d2955c 100644
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -33,7 +33,6 @@
+ #include <linux/skbuff.h>
+ #include <linux/in.h>
+ #include <linux/slab.h>
+-#include <linux/dmi.h>
+ #include <net/arp.h>
+ #include <net/route.h>
+ #include <net/sock.h>
+@@ -434,20 +433,6 @@ static void __exit netvsc_drv_exit(void)
+ }
+
+
+-static const struct dmi_system_id __initconst
+-hv_netvsc_dmi_table[] __maybe_unused = {
+- {
+- .ident = "Hyper-V",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+- DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
+- DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+- },
+- },
+- { },
+-};
+-MODULE_DEVICE_TABLE(dmi, hv_netvsc_dmi_table);
+-
+ static int __init netvsc_drv_init(void)
+ {
+ struct hv_driver *drv = &netvsc_drv;
+@@ -455,10 +440,6 @@ static int __init netvsc_drv_init(void)
+
+ pr_info("initializing....");
+
+- if (!dmi_check_system(hv_netvsc_dmi_table))
+- return -ENODEV;
+-
+-
+ /* Callback to client driver to complete the initialization */
+ netvsc_initialize(drv);
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0023-Staging-hv-util-Get-rid-of-the-DMI-signature-in-h.patch b/patches.suse/staging-hv-staging-next-20110825-0023-Staging-hv-util-Get-rid-of-the-DMI-signature-in-h.patch
new file mode 100644
index 0000000000..3eaa5e92f2
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0023-Staging-hv-util-Get-rid-of-the-DMI-signature-in-h.patch
@@ -0,0 +1,64 @@
+From 84385b057fae74eb91a2a163be59543a31291bc6 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:44 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: util: Get rid of the DMI signature in hv_util.c
+
+Now that we have implemented a vmbus specific mechanism for auto-loading,
+get rid of the DMI signature.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_util.c | 20 --------------------
+ 1 files changed, 0 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
+index 5bd6f00..c16a7f1 100644
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -26,7 +26,6 @@
+ #include <linux/slab.h>
+ #include <linux/sysctl.h>
+ #include <linux/reboot.h>
+-#include <linux/dmi.h>
+ #include <linux/pci.h>
+
+ #include "hyperv.h"
+@@ -258,22 +257,6 @@ hv_utils_pci_table[] __maybe_unused = {
+ };
+ MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
+
+-
+-static const struct dmi_system_id __initconst
+-hv_utils_dmi_table[] __maybe_unused = {
+- {
+- .ident = "Hyper-V",
+- .matches = {
+- DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
+- DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
+- DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
+- },
+- },
+- { },
+-};
+-MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table);
+-
+-
+ static int __init init_hyperv_utils(void)
+ {
+ pr_info("Registering HyperV Utility Driver\n");
+@@ -282,9 +265,6 @@ static int __init init_hyperv_utils(void)
+ return -ENODEV;
+
+
+- if (!dmi_check_system(hv_utils_dmi_table))
+- return -ENODEV;
+-
+ shut_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ time_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ hbeat_txf_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0024-Staging-hv-util-Get-rid-of-the-PCI-signature-in-h.patch b/patches.suse/staging-hv-staging-next-20110825-0024-Staging-hv-util-Get-rid-of-the-PCI-signature-in-h.patch
new file mode 100644
index 0000000000..57feb8883b
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0024-Staging-hv-util-Get-rid-of-the-PCI-signature-in-h.patch
@@ -0,0 +1,45 @@
+From c411a5981d6f53ed2502ad06a2ee70d67ed13f12 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:45 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: util: Get rid of the PCI signature in hv_util.c
+
+Now that we have implemented a vmbus specific mechanism for auto-loading,
+get rid of the PCI signature.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_util.c | 8 --------
+ 1 files changed, 0 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
+index c16a7f1..b0d89de 100644
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -26,7 +26,6 @@
+ #include <linux/slab.h>
+ #include <linux/sysctl.h>
+ #include <linux/reboot.h>
+-#include <linux/pci.h>
+
+ #include "hyperv.h"
+ #include "hv_kvp.h"
+@@ -250,13 +249,6 @@ static struct hv_driver util_drv = {
+ .remove = util_remove,
+ };
+
+-static const struct pci_device_id __initconst
+-hv_utils_pci_table[] __maybe_unused = {
+- { PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */
+- { 0 }
+-};
+-MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
+-
+ static int __init init_hyperv_utils(void)
+ {
+ pr_info("Registering HyperV Utility Driver\n");
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0025-Staging-hv-fix-up-driver-registering-mess.patch b/patches.suse/staging-hv-staging-next-20110825-0025-Staging-hv-fix-up-driver-registering-mess.patch
new file mode 100644
index 0000000000..c2b88915ee
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0025-Staging-hv-fix-up-driver-registering-mess.patch
@@ -0,0 +1,420 @@
+From 768fa21919b7f30b77f0b3ba94939f5556d111d5 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 15:07:32 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: fix up driver registering mess
+
+Individual drivers should never be touching the 'struct device' field,
+so if that is a requirement to pass to the vmbus core, you know
+something is wrong.
+
+This patch fixes that all up, and resolves the problem where the module
+reference counting was not happening properly for the individual drivers
+as well. Overall, it reduces the lines of code the individual drivers
+have to have, which tells you that this is the correct thing to do.
+
+Also, somehow the _GPL marking for the functions got removed on an older
+patch. As the name of the function was changing, properly change the
+_GPL marking as well at the same time.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Cc: Hank Janssen <hjanssen@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/blkvsc_drv.c | 17 ++------------
+ drivers/staging/hv/hv_mouse.c | 21 ++---------------
+ drivers/staging/hv/hv_util.c | 9 ++-----
+ drivers/staging/hv/hyperv.h | 8 +++++-
+ drivers/staging/hv/hyperv_net.h | 1 -
+ drivers/staging/hv/netvsc.c | 14 ------------
+ drivers/staging/hv/netvsc_drv.c | 19 ++--------------
+ drivers/staging/hv/storvsc_drv.c | 24 ++++++---------------
+ drivers/staging/hv/vmbus_drv.c | 43 ++++++++++++++++++-------------------
+ 9 files changed, 46 insertions(+), 110 deletions(-)
+
+diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
+index d170f24..07dc9ed 100644
+--- a/drivers/staging/hv/blkvsc_drv.c
++++ b/drivers/staging/hv/blkvsc_drv.c
+@@ -109,7 +109,6 @@ struct block_device_context {
+ int users;
+ };
+
+-static const char *drv_name = "blkvsc";
+
+ /*
+ * There is a circular dependency involving blkvsc_request_completion()
+@@ -805,6 +804,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
+
+ /* The one and only one */
+ static struct hv_driver blkvsc_drv = {
++ .name = "blkvsc",
+ .id_table = id_table,
+ .probe = blkvsc_probe,
+ .remove = blkvsc_remove,
+@@ -824,24 +824,13 @@ static const struct block_device_operations block_ops = {
+ */
+ static int blkvsc_drv_init(void)
+ {
+- struct hv_driver *drv = &blkvsc_drv;
+- int ret;
+-
+ BUILD_BUG_ON(sizeof(sector_t) != 8);
+-
+- drv->driver.name = drv_name;
+-
+- /* The driver belongs to vmbus */
+- ret = vmbus_child_driver_register(&drv->driver);
+-
+- return ret;
++ return vmbus_driver_register(&blkvsc_drv);
+ }
+
+-
+ static void blkvsc_drv_exit(void)
+ {
+-
+- vmbus_child_driver_unregister(&blkvsc_drv.driver);
++ vmbus_driver_unregister(&blkvsc_drv);
+ }
+
+ /*
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index ebd1715..5727173 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -176,8 +176,6 @@ struct mousevsc_dev {
+ };
+
+
+-static const char *driver_name = "mousevsc";
+-
+ static void deviceinfo_callback(struct hv_device *dev, struct hv_input_dev_info *info);
+ static void inputreport_callback(struct hv_device *dev, void *packet, u32 len);
+ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
+@@ -921,33 +919,20 @@ static const struct hv_vmbus_device_id id_table[] = {
+ /* MODULE_DEVICE_TABLE(vmbus, id_table); */
+
+ static struct hv_driver mousevsc_drv = {
++ .name = "mousevsc",
+ .id_table = id_table,
+ .probe = mousevsc_probe,
+ .remove = mousevsc_remove,
+ };
+
+-static void mousevsc_drv_exit(void)
+-{
+- vmbus_child_driver_unregister(&mousevsc_drv.driver);
+-}
+-
+ static int __init mousevsc_init(void)
+ {
+- struct hv_driver *drv = &mousevsc_drv;
+-
+- DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing.");
+-
+- drv->driver.name = driver_name;
+-
+- /* The driver belongs to vmbus */
+- vmbus_child_driver_register(&drv->driver);
+-
+- return 0;
++ return vmbus_driver_register(&mousevsc_drv);
+ }
+
+ static void __exit mousevsc_exit(void)
+ {
+- mousevsc_drv_exit();
++ vmbus_driver_unregister(&mousevsc_drv);
+ }
+
+ /*
+diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
+index b0d89de..f2f456f 100644
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -34,8 +34,6 @@ static u8 *shut_txf_buf;
+ static u8 *time_txf_buf;
+ static u8 *hbeat_txf_buf;
+
+-static const char *driver_name = "hv_util";
+-
+ static void shutdown_onchannelcallback(void *context)
+ {
+ struct vmbus_channel *channel = context;
+@@ -244,6 +242,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
+
+ /* The one and only one */
+ static struct hv_driver util_drv = {
++ .name = "hv_util",
+ .id_table = id_table,
+ .probe = util_probe,
+ .remove = util_remove,
+@@ -277,9 +276,7 @@ static int __init init_hyperv_utils(void)
+
+ hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
+
+- util_drv.driver.name = driver_name;
+-
+- return vmbus_child_driver_register(&util_drv.driver);
++ return vmbus_driver_register(&util_drv);
+ }
+
+ static void exit_hyperv_utils(void)
+@@ -311,7 +308,7 @@ static void exit_hyperv_utils(void)
+ kfree(shut_txf_buf);
+ kfree(time_txf_buf);
+ kfree(hbeat_txf_buf);
+- vmbus_child_driver_unregister(&util_drv.driver);
++ vmbus_driver_unregister(&util_drv);
+ }
+
+ module_init(init_hyperv_utils);
+diff --git a/drivers/staging/hv/hyperv.h b/drivers/staging/hv/hyperv.h
+index d96de66..c249811 100644
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -845,8 +845,12 @@ static inline struct hv_driver *drv_to_hv_drv(struct device_driver *d)
+
+
+ /* Vmbus interface */
+-int vmbus_child_driver_register(struct device_driver *drv);
+-void vmbus_child_driver_unregister(struct device_driver *drv);
++#define vmbus_driver_register(driver) \
++ __vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
++int __must_check __vmbus_driver_register(struct hv_driver *hv_driver,
++ struct module *owner,
++ const char *mod_name);
++void vmbus_driver_unregister(struct hv_driver *hv_driver);
+
+ /**
+ * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device
+diff --git a/drivers/staging/hv/hyperv_net.h b/drivers/staging/hv/hyperv_net.h
+index 27f987b..5782fea 100644
+--- a/drivers/staging/hv/hyperv_net.h
++++ b/drivers/staging/hv/hyperv_net.h
+@@ -96,7 +96,6 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
+ unsigned int status);
+ int netvsc_recv_callback(struct hv_device *device_obj,
+ struct hv_netvsc_packet *packet);
+-int netvsc_initialize(struct hv_driver *drv);
+ int rndis_filter_open(struct hv_device *dev);
+ int rndis_filter_close(struct hv_device *dev);
+ int rndis_filter_device_add(struct hv_device *dev,
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 6f4541b..cb02eed 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -32,9 +32,6 @@
+ #include "hyperv_net.h"
+
+
+-/* Globals */
+-static const char *driver_name = "netvsc";
+-
+ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ {
+ struct netvsc_device *net_device;
+@@ -992,14 +989,3 @@ cleanup:
+
+ return ret;
+ }
+-
+-/*
+- * netvsc_initialize - Main entry point
+- */
+-int netvsc_initialize(struct hv_driver *drv)
+-{
+-
+- drv->name = driver_name;
+-
+- return 0;
+-}
+diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
+index 2d2955c..ad1ef03 100644
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -422,6 +422,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
+
+ /* The one and only one */
+ static struct hv_driver netvsc_drv = {
++ .name = "netvsc",
+ .id_table = id_table,
+ .probe = netvsc_probe,
+ .remove = netvsc_remove,
+@@ -429,26 +430,12 @@ static struct hv_driver netvsc_drv = {
+
+ static void __exit netvsc_drv_exit(void)
+ {
+- vmbus_child_driver_unregister(&netvsc_drv.driver);
++ vmbus_driver_unregister(&netvsc_drv);
+ }
+
+-
+ static int __init netvsc_drv_init(void)
+ {
+- struct hv_driver *drv = &netvsc_drv;
+- int ret;
+-
+- pr_info("initializing....");
+-
+- /* Callback to client driver to complete the initialization */
+- netvsc_initialize(drv);
+-
+- drv->driver.name = drv->name;
+-
+- /* The driver belongs to vmbus */
+- ret = vmbus_child_driver_register(&drv->driver);
+-
+- return ret;
++ return vmbus_driver_register(&netvsc_drv);
+ }
+
+ MODULE_LICENSE("GPL");
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 6f67e9b..0297418 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -41,8 +41,6 @@ static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
+ module_param(storvsc_ringbuffer_size, int, S_IRUGO);
+ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
+
+-static const char *driver_name = "storvsc";
+-
+ struct hv_host_device {
+ struct hv_device *dev;
+ struct kmem_cache *request_pool;
+@@ -718,6 +716,7 @@ static int storvsc_probe(struct hv_device *device)
+ /* The one and only one */
+
+ static struct hv_driver storvsc_drv = {
++ .name = "storvsc",
+ .id_table = id_table,
+ .probe = storvsc_probe,
+ .remove = storvsc_remove,
+@@ -725,8 +724,6 @@ static struct hv_driver storvsc_drv = {
+
+ static int __init storvsc_drv_init(void)
+ {
+- int ret;
+- struct hv_driver *drv = &storvsc_drv;
+ u32 max_outstanding_req_per_channel;
+
+ /*
+@@ -735,29 +732,22 @@ static int __init storvsc_drv_init(void)
+ * the ring buffer indices) by the max request size (which is
+ * vmbus_channel_packet_multipage_buffer + struct vstor_packet + u64)
+ */
+-
+ max_outstanding_req_per_channel =
+- ((storvsc_ringbuffer_size - PAGE_SIZE) /
+- ALIGN(MAX_MULTIPAGE_BUFFER_PACKET +
+- sizeof(struct vstor_packet) + sizeof(u64),
+- sizeof(u64)));
++ ((storvsc_ringbuffer_size - PAGE_SIZE) /
++ ALIGN(MAX_MULTIPAGE_BUFFER_PACKET +
++ sizeof(struct vstor_packet) + sizeof(u64),
++ sizeof(u64)));
+
+ if (max_outstanding_req_per_channel <
+ STORVSC_MAX_IO_REQUESTS)
+ return -1;
+
+- drv->driver.name = driver_name;
+-
+-
+- /* The driver belongs to vmbus */
+- ret = vmbus_child_driver_register(&drv->driver);
+-
+- return ret;
++ return vmbus_driver_register(&storvsc_drv);
+ }
+
+ static void __exit storvsc_drv_exit(void)
+ {
+- vmbus_child_driver_unregister(&storvsc_drv.driver);
++ vmbus_driver_unregister(&storvsc_drv);
+ }
+
+ MODULE_LICENSE("GPL");
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 0114b04..26f4901 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -552,51 +552,50 @@ static int vmbus_bus_init(int irq)
+ }
+
+ /**
+- * vmbus_child_driver_register() - Register a vmbus's child driver
+- * @drv: Pointer to driver structure you want to register
+- *
++ * __vmbus_child_driver_register - Register a vmbus's driver
++ * @drv: Pointer to driver structure you want to register
++ * @owner: owner module of the drv
++ * @mod_name: module name string
+ *
+ * Registers the given driver with Linux through the 'driver_register()' call
+- * And sets up the hyper-v vmbus handling for this driver.
++ * 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 device_driver *drv)
++int __vmbus_driver_register(struct hv_driver *hv_driver, struct module *owner, const char *mod_name)
+ {
+ int ret;
+
+- pr_info("child driver registering - name %s\n", drv->name);
++ pr_info("registering driver %s\n", hv_driver->name);
+
+- /* The child driver on this vmbus */
+- drv->bus = &hv_bus;
++ hv_driver->driver.name = hv_driver->name;
++ hv_driver->driver.owner = owner;
++ hv_driver->driver.mod_name = mod_name;
++ hv_driver->driver.bus = &hv_bus;
+
+- ret = driver_register(drv);
++ ret = driver_register(&hv_driver->driver);
+
+ vmbus_request_offers();
+
+ return ret;
+ }
+-EXPORT_SYMBOL(vmbus_child_driver_register);
++EXPORT_SYMBOL_GPL(__vmbus_driver_register);
+
+ /**
+- * vmbus_child_driver_unregister() - Unregister a vmbus's child driver
+- * @drv: Pointer to driver structure you want to un-register
+- *
+- *
+- * Un-register the given driver with Linux through the 'driver_unregister()'
+- * call. And ungegisters the driver from the Hyper-V vmbus handler.
++ * vmbus_driver_unregister() - Unregister a vmbus's driver
++ * @drv: Pointer to driver structure you want to un-register
+ *
+- * Mainly used by Hyper-V drivers.
++ * Un-register the given driver that was previous registered with a call to
++ * vmbus_driver_register()
+ */
+-void vmbus_child_driver_unregister(struct device_driver *drv)
++void vmbus_driver_unregister(struct hv_driver *hv_driver)
+ {
+- pr_info("child driver unregistering - name %s\n", drv->name);
++ pr_info("unregistering driver %s\n", hv_driver->name);
+
+- driver_unregister(drv);
++ driver_unregister(&hv_driver->driver);
+
+ }
+-EXPORT_SYMBOL(vmbus_child_driver_unregister);
++EXPORT_SYMBOL_GPL(vmbus_driver_unregister);
+
+ /*
+ * vmbus_child_device_create - Creates and registers a new child device
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0026-Staging-hv-vmbus-Get-rid-of-some-unnecessary-comm.patch b/patches.suse/staging-hv-staging-next-20110825-0026-Staging-hv-vmbus-Get-rid-of-some-unnecessary-comm.patch
new file mode 100644
index 0000000000..5b5ea4db84
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0026-Staging-hv-vmbus-Get-rid-of-some-unnecessary-comm.patch
@@ -0,0 +1,31 @@
+From 94a66c9c803a31805d98c92e65593b756ffa05c4 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:49 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of some unnecessary comments
+
+Get rid of some unnecessary comments.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 26f4901..be62b62 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -44,8 +44,6 @@ static struct tasklet_struct event_dpc;
+
+ unsigned int vmbus_loglevel = (ALL_MODULES << 16 | INFO_LVL);
+ EXPORT_SYMBOL(vmbus_loglevel);
+- /* (ALL_MODULES << 16 | DEBUG_LVL_ENTEREXIT); */
+- /* (((VMBUS | VMBUS_DRV)<<16) | DEBUG_LVL_ENTEREXIT); */
+
+ static struct completion probe_event;
+ static int irq;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0027-Staging-hv-vmbus-Cleanup-unnecessary-comments-in.patch b/patches.suse/staging-hv-staging-next-20110825-0027-Staging-hv-vmbus-Cleanup-unnecessary-comments-in.patch
new file mode 100644
index 0000000000..f1dab43b57
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0027-Staging-hv-vmbus-Cleanup-unnecessary-comments-in.patch
@@ -0,0 +1,45 @@
+From ffca7c40b62b182d9de17c7229346f4230df46d6 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:50 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c
+
+Cleanup unnecessary comments in hv.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv.c | 8 --------
+ 1 files changed, 0 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
+index 2192d78..d2b921b 100644
+--- a/drivers/staging/hv/hv.c
++++ b/drivers/staging/hv/hv.c
+@@ -164,11 +164,7 @@ int hv_init(void)
+ goto cleanup;
+
+ max_leaf = query_hypervisor_info();
+- /* HvQueryHypervisorFeatures(maxLeaf); */
+
+- /*
+- * We only support running on top of Hyper-V
+- */
+ rdmsrl(HV_X64_MSR_GUEST_OS_ID, hv_context.guestid);
+
+ if (hv_context.guestid != 0)
+@@ -181,10 +177,6 @@ int hv_init(void)
+ /* See if the hypercall page is already set */
+ rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64);
+
+- /*
+- * Allocate the hypercall page memory
+- * virtaddr = osd_page_alloc(1);
+- */
+ virtaddr = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_EXEC);
+
+ if (!virtaddr)
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0028-Staging-hv-vmbus-Cleanup-error-handling-in-hv_ini.patch b/patches.suse/staging-hv-staging-next-20110825-0028-Staging-hv-vmbus-Cleanup-error-handling-in-hv_ini.patch
new file mode 100644
index 0000000000..6f2544e017
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0028-Staging-hv-vmbus-Cleanup-error-handling-in-hv_ini.patch
@@ -0,0 +1,50 @@
+From 5433e00334d3e20f8bff70845c7f44e00cdf2d14 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:51 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup error handling in hv_init()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv.c | 7 +++----
+ 1 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
+index d2b921b..736794e 100644
+--- a/drivers/staging/hv/hv.c
++++ b/drivers/staging/hv/hv.c
+@@ -151,7 +151,6 @@ static u64 do_hypercall(u64 control, void *input, void *output)
+ */
+ int hv_init(void)
+ {
+- int ret = 0;
+ int max_leaf;
+ union hv_x64_msr_hypercall_contents hypercall_msr;
+ void *virtaddr = NULL;
+@@ -214,7 +213,7 @@ int hv_init(void)
+ hv_context.signal_event_param->flag_number = 0;
+ hv_context.signal_event_param->rsvdz = 0;
+
+- return ret;
++ return 0;
+
+ cleanup:
+ if (virtaddr) {
+@@ -225,8 +224,8 @@ cleanup:
+
+ vfree(virtaddr);
+ }
+- ret = -1;
+- return ret;
++
++ return -ENOTSUPP;
+ }
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0029-Staging-hv-vmbus-Get-rid-of-unnecessay-comments-i.patch b/patches.suse/staging-hv-staging-next-20110825-0029-Staging-hv-vmbus-Get-rid-of-unnecessay-comments-i.patch
new file mode 100644
index 0000000000..a5d23c35e5
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0029-Staging-hv-vmbus-Get-rid-of-unnecessay-comments-i.patch
@@ -0,0 +1,31 @@
+From 7a9462d842197cba9ca16b915284289535c88675 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:52 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c
+
+Get rid of unnecessay comments in connection.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/connection.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
+index e6b4039..0e7efce 100644
+--- a/drivers/staging/hv/connection.c
++++ b/drivers/staging/hv/connection.c
+@@ -215,8 +215,6 @@ static void process_chn_event(u32 relid)
+ {
+ struct vmbus_channel *channel;
+
+- /* ASSERT(relId > 0); */
+-
+ /*
+ * Find the channel based on this relid and invokes the
+ * channel callback to process the event
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0030-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch b/patches.suse/staging-hv-staging-next-20110825-0030-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch
new file mode 100644
index 0000000000..e0398c5ef0
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0030-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch
@@ -0,0 +1,57 @@
+From 1f22b9aae313ae5707358abbe9617ea13c7f80c5 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:53 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of the function dump_gpadl_body()
+
+Get rid of the function dump_gpadl_body() since it adds no value and actually is
+in the data path.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/channel.c | 20 --------------------
+ 1 files changed, 0 insertions(+), 20 deletions(-)
+
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index 222adcc..2d5bfac 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -239,24 +239,6 @@ errorout:
+ }
+ EXPORT_SYMBOL_GPL(vmbus_open);
+
+-/*
+- * dump_gpadl_body - Dump the gpadl body message to the console for
+- * debugging purposes.
+- */
+-static void dump_gpadl_body(struct vmbus_channel_gpadl_body *gpadl, u32 len)
+-{
+- int i;
+- int pfncount;
+-
+- pfncount = (len - sizeof(struct vmbus_channel_gpadl_body)) /
+- sizeof(u64);
+-
+- DPRINT_DBG(VMBUS, "gpadl body - len %d pfn count %d", len, pfncount);
+-
+- for (i = 0; i < pfncount; i++)
+- DPRINT_DBG(VMBUS, "gpadl body - %d) pfn %llu",
+- i, gpadl->pfn[i]);
+-}
+
+ /*
+ * dump_gpadl_header - Dump the gpadl header message to the console for
+@@ -485,8 +467,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
+ CHANNELMSG_GPADL_BODY;
+ gpadl_body->gpadl = next_gpadl_handle;
+
+- dump_gpadl_body(gpadl_body, submsginfo->msgsize -
+- sizeof(*submsginfo));
+ ret = vmbus_post_msg(gpadl_body,
+ submsginfo->msgsize -
+ sizeof(*submsginfo));
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0031-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch b/patches.suse/staging-hv-staging-next-20110825-0031-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch
new file mode 100644
index 0000000000..31c04bf040
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0031-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch
@@ -0,0 +1,64 @@
+From da06da287d9f2697f247024efbb6e18a764411f8 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:54 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of the function dump_gpadl_header()
+
+Get rid of the function dump_gpadl_header() as this adds no value.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/channel.c | 28 ----------------------------
+ 1 files changed, 0 insertions(+), 28 deletions(-)
+
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index 2d5bfac..aa0a150 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -239,33 +239,6 @@ errorout:
+ }
+ EXPORT_SYMBOL_GPL(vmbus_open);
+
+-
+-/*
+- * dump_gpadl_header - Dump the gpadl header message to the console for
+- * debugging purposes.
+- */
+-static void dump_gpadl_header(struct vmbus_channel_gpadl_header *gpadl)
+-{
+- int i, j;
+- int pagecount;
+-
+- DPRINT_DBG(VMBUS,
+- "gpadl header - relid %d, range count %d, range buflen %d",
+- gpadl->child_relid, gpadl->rangecount, gpadl->range_buflen);
+- for (i = 0; i < gpadl->rangecount; i++) {
+- pagecount = gpadl->range[i].byte_count >> PAGE_SHIFT;
+- pagecount = (pagecount > 26) ? 26 : pagecount;
+-
+- DPRINT_DBG(VMBUS, "gpadl range %d - len %d offset %d "
+- "page count %d", i, gpadl->range[i].byte_count,
+- gpadl->range[i].byte_offset, pagecount);
+-
+- for (j = 0; j < pagecount; j++)
+- DPRINT_DBG(VMBUS, "%d) pfn %llu", j,
+- gpadl->range[i].pfn_array[j]);
+- }
+-}
+-
+ /*
+ * create_gpadl_header - Creates a gpadl for the specified buffer
+ */
+@@ -443,7 +416,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
+ gpadlmsg->child_relid = channel->offermsg.child_relid;
+ gpadlmsg->gpadl = next_gpadl_handle;
+
+- dump_gpadl_header(gpadlmsg);
+
+ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
+ list_add_tail(&msginfo->msglistentry,
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0032-Staging-hv-vmbus-Rename-openMsg-to-open_msg-in-ch.patch b/patches.suse/staging-hv-staging-next-20110825-0032-Staging-hv-vmbus-Rename-openMsg-to-open_msg-in-ch.patch
new file mode 100644
index 0000000000..e443db03de
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0032-Staging-hv-vmbus-Rename-openMsg-to-open_msg-in-ch.patch
@@ -0,0 +1,70 @@
+From 0987ff696d55ad4454211d0b72615fb52b05aa77 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:55 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c
+
+Rename openMsg to open_msg in channel.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/channel.c | 20 ++++++++++----------
+ 1 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index aa0a150..ebd7552 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -119,7 +119,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+ u32 recv_ringbuffer_size, void *userdata, u32 userdatalen,
+ void (*onchannelcallback)(void *context), void *context)
+ {
+- struct vmbus_channel_open_channel *openMsg;
++ struct vmbus_channel_open_channel *open_msg;
+ struct vmbus_channel_msginfo *openInfo = NULL;
+ void *in, *out;
+ unsigned long flags;
+@@ -183,14 +183,14 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+
+ init_completion(&openInfo->waitevent);
+
+- openMsg = (struct vmbus_channel_open_channel *)openInfo->msg;
+- openMsg->header.msgtype = CHANNELMSG_OPENCHANNEL;
+- openMsg->openid = newchannel->offermsg.child_relid;
+- openMsg->child_relid = newchannel->offermsg.child_relid;
+- openMsg->ringbuffer_gpadlhandle = newchannel->ringbuffer_gpadlhandle;
+- openMsg->downstream_ringbuffer_pageoffset = send_ringbuffer_size >>
++ open_msg = (struct vmbus_channel_open_channel *)openInfo->msg;
++ open_msg->header.msgtype = CHANNELMSG_OPENCHANNEL;
++ open_msg->openid = newchannel->offermsg.child_relid;
++ open_msg->child_relid = newchannel->offermsg.child_relid;
++ open_msg->ringbuffer_gpadlhandle = newchannel->ringbuffer_gpadlhandle;
++ open_msg->downstream_ringbuffer_pageoffset = send_ringbuffer_size >>
+ PAGE_SHIFT;
+- openMsg->server_contextarea_gpadlhandle = 0;
++ open_msg->server_contextarea_gpadlhandle = 0;
+
+ if (userdatalen > MAX_USER_DEFINED_BYTES) {
+ err = -EINVAL;
+@@ -198,14 +198,14 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+ }
+
+ if (userdatalen)
+- memcpy(openMsg->userdata, userdata, userdatalen);
++ memcpy(open_msg->userdata, userdata, userdatalen);
+
+ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
+ list_add_tail(&openInfo->msglistentry,
+ &vmbus_connection.chn_msg_list);
+ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
+
+- ret = vmbus_post_msg(openMsg,
++ ret = vmbus_post_msg(open_msg,
+ sizeof(struct vmbus_channel_open_channel));
+
+ if (ret != 0)
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0033-Staging-hv-vmbus-Get-rid-of-unnecessary-comments.patch b/patches.suse/staging-hv-staging-next-20110825-0033-Staging-hv-vmbus-Get-rid-of-unnecessary-comments.patch
new file mode 100644
index 0000000000..99dae1a04b
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0033-Staging-hv-vmbus-Get-rid-of-unnecessary-comments.patch
@@ -0,0 +1,47 @@
+From c8a56985faae8e4150779b781de8d53afa4a7da2 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:56 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of unnecessary comments in channel.c
+
+Get rid of unnecessary comments in channel.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/channel.c | 4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index ebd7552..e02060e 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -76,7 +76,6 @@ void vmbus_get_debug_info(struct vmbus_channel *channel,
+ struct hv_monitor_page *monitorpage;
+ u8 monitor_group = (u8)channel->offermsg.monitorid / 32;
+ u8 monitor_offset = (u8)channel->offermsg.monitorid % 32;
+- /* u32 monitorBit = 1 << monitorOffset; */
+
+ debuginfo->relid = channel->offermsg.child_relid;
+ debuginfo->state = channel->state;
+@@ -392,7 +391,6 @@ int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
+ {
+ struct vmbus_channel_gpadl_header *gpadlmsg;
+ struct vmbus_channel_gpadl_body *gpadl_body;
+- /* struct vmbus_channel_gpadl_created *gpadlCreated; */
+ struct vmbus_channel_msginfo *msginfo = NULL;
+ struct vmbus_channel_msginfo *submsginfo;
+ u32 msgcount;
+@@ -474,8 +472,6 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
+ unsigned long flags;
+ int ret, t;
+
+- /* ASSERT(gpadl_handle != 0); */
+-
+ info = kmalloc(sizeof(*info) +
+ sizeof(struct vmbus_channel_gpadl_teardown), GFP_KERNEL);
+ if (!info)
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0034-Staging-hv-vmbus-Change-the-variable-name-openInf.patch b/patches.suse/staging-hv-staging-next-20110825-0034-Staging-hv-vmbus-Change-the-variable-name-openInf.patch
new file mode 100644
index 0000000000..a8218f62a6
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0034-Staging-hv-vmbus-Change-the-variable-name-openInf.patch
@@ -0,0 +1,99 @@
+From 176fb9e3f1c145c502dfcd88b2800039aa5e2a24 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:57 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Change the variable name openInfo to open_info in channel.c
+
+Change the variable name openInfo to open_info in channel.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/channel.c | 24 ++++++++++++------------
+ 1 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index e02060e..9eb8def 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -119,7 +119,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+ void (*onchannelcallback)(void *context), void *context)
+ {
+ struct vmbus_channel_open_channel *open_msg;
+- struct vmbus_channel_msginfo *openInfo = NULL;
++ struct vmbus_channel_msginfo *open_info = NULL;
+ void *in, *out;
+ unsigned long flags;
+ int ret, t, err = 0;
+@@ -172,17 +172,17 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+ }
+
+ /* Create and init the channel open message */
+- openInfo = kmalloc(sizeof(*openInfo) +
++ open_info = kmalloc(sizeof(*open_info) +
+ sizeof(struct vmbus_channel_open_channel),
+ GFP_KERNEL);
+- if (!openInfo) {
++ if (!open_info) {
+ err = -ENOMEM;
+ goto errorout;
+ }
+
+- init_completion(&openInfo->waitevent);
++ init_completion(&open_info->waitevent);
+
+- open_msg = (struct vmbus_channel_open_channel *)openInfo->msg;
++ open_msg = (struct vmbus_channel_open_channel *)open_info->msg;
+ open_msg->header.msgtype = CHANNELMSG_OPENCHANNEL;
+ open_msg->openid = newchannel->offermsg.child_relid;
+ open_msg->child_relid = newchannel->offermsg.child_relid;
+@@ -200,7 +200,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+ memcpy(open_msg->userdata, userdata, userdatalen);
+
+ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
+- list_add_tail(&openInfo->msglistentry,
++ list_add_tail(&open_info->msglistentry,
+ &vmbus_connection.chn_msg_list);
+ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
+
+@@ -210,22 +210,22 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+ if (ret != 0)
+ goto cleanup;
+
+- t = wait_for_completion_timeout(&openInfo->waitevent, 5*HZ);
++ t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ);
+ if (t == 0) {
+ err = -ETIMEDOUT;
+ goto errorout;
+ }
+
+
+- if (openInfo->response.open_result.status)
+- err = openInfo->response.open_result.status;
++ if (open_info->response.open_result.status)
++ err = open_info->response.open_result.status;
+
+ cleanup:
+ spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
+- list_del(&openInfo->msglistentry);
++ list_del(&open_info->msglistentry);
+ spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
+
+- kfree(openInfo);
++ kfree(open_info);
+ return err;
+
+ errorout:
+@@ -233,7 +233,7 @@ errorout:
+ hv_ringbuffer_cleanup(&newchannel->inbound);
+ free_pages((unsigned long)out,
+ get_order(send_ringbuffer_size + recv_ringbuffer_size));
+- kfree(openInfo);
++ kfree(open_info);
+ return err;
+ }
+ EXPORT_SYMBOL_GPL(vmbus_open);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0035-Staging-hv-vmbus-Cleanup-error-values-in-ringbuff.patch b/patches.suse/staging-hv-staging-next-20110825-0035-Staging-hv-vmbus-Cleanup-error-values-in-ringbuff.patch
new file mode 100644
index 0000000000..133a209263
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0035-Staging-hv-vmbus-Cleanup-error-values-in-ringbuff.patch
@@ -0,0 +1,92 @@
+From d2598f017f02bbc3623503c6e08f22f7ea473cdd Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:58 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup error values in ringbuffer.c
+
+Use standard Linux errno values in ringbuffer.c and do the associated
+cleanup in the clients.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/blkvsc_drv.c | 2 +-
+ drivers/staging/hv/netvsc.c | 2 +-
+ drivers/staging/hv/ring_buffer.c | 6 +++---
+ drivers/staging/hv/storvsc_drv.c | 2 +-
+ 4 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
+index 07dc9ed..2b41eb6 100644
+--- a/drivers/staging/hv/blkvsc_drv.c
++++ b/drivers/staging/hv/blkvsc_drv.c
+@@ -725,7 +725,7 @@ static int blkvsc_do_request(struct block_device_context *blkdev,
+ } else {
+ ret = blkvsc_submit_request(blkvsc_req,
+ blkvsc_request_completion);
+- if (ret == -1) {
++ if (ret == -EAGAIN) {
+ pending = 1;
+ list_add_tail(&blkvsc_req->pend_entry,
+ &blkdev->pending_list);
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index cb02eed..d547ff6 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -565,7 +565,7 @@ retry_send_cmplt:
+ if (ret == 0) {
+ /* success */
+ /* no-op */
+- } else if (ret == -1) {
++ } else if (ret == -EAGAIN) {
+ /* no more room...wait a bit and attempt to retry 3 times */
+ retries++;
+ dev_err(&device->device, "unable to send receive completion pkt"
+diff --git a/drivers/staging/hv/ring_buffer.c b/drivers/staging/hv/ring_buffer.c
+index 42f7672..9212699 100644
+--- a/drivers/staging/hv/ring_buffer.c
++++ b/drivers/staging/hv/ring_buffer.c
+@@ -390,7 +390,7 @@ int hv_ringbuffer_write(struct hv_ring_buffer_info *outring_info,
+ /* is empty since the read index == write index */
+ if (bytes_avail_towrite <= totalbytes_towrite) {
+ spin_unlock_irqrestore(&outring_info->ring_lock, flags);
+- return -1;
++ return -EAGAIN;
+ }
+
+ /* Write to the ring buffer */
+@@ -450,7 +450,7 @@ int hv_ringbuffer_peek(struct hv_ring_buffer_info *Inring_info,
+
+ spin_unlock_irqrestore(&Inring_info->ring_lock, flags);
+
+- return -1;
++ return -EAGAIN;
+ }
+
+ /* Convert to byte offset */
+@@ -496,7 +496,7 @@ int hv_ringbuffer_read(struct hv_ring_buffer_info *inring_info, void *buffer,
+ if (bytes_avail_toread < buflen) {
+ spin_unlock_irqrestore(&inring_info->ring_lock, flags);
+
+- return -1;
++ return -EAGAIN;
+ }
+
+ next_read_location =
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 0297418..29ac644 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -578,7 +578,7 @@ retry_request:
+ /* Invokes the vsc to start an IO */
+ ret = storvsc_do_io(dev, &cmd_request->request);
+
+- if (ret == -1) {
++ if (ret == -EAGAIN) {
+ /* no more space */
+
+ if (cmd_request->bounce_sgl_count) {
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0036-Staging-hv-vmbus-Cleanup-the-error-return-value-i.patch b/patches.suse/staging-hv-staging-next-20110825-0036-Staging-hv-vmbus-Cleanup-the-error-return-value-i.patch
new file mode 100644
index 0000000000..7ef96aabb2
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0036-Staging-hv-vmbus-Cleanup-the-error-return-value-i.patch
@@ -0,0 +1,59 @@
+From 3d5cad97c4be2bfc5cb4e52a0972c6e3bf8c278d Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:59 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw()
+
+Use standard Linux errno values.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/channel.c | 2 +-
+ drivers/staging/hv/hv_mouse.c | 2 +-
+ drivers/staging/hv/netvsc.c | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index 9eb8def..ac92c1f 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -811,7 +811,7 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
+ pr_err("Buffer too small - needed %d bytes but "
+ "got space for only %d bytes\n",
+ packetlen, bufferlen);
+- return -2;
++ return -ENOBUFS;
+ }
+
+ *requestid = desc.trans_id;
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 5727173..d7e24bc 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -539,7 +539,7 @@ static void mousevsc_on_channel_callback(void *context)
+ }
+ break;
+ }
+- } else if (ret == -2) {
++ } else if (ret == -ENOBUFS) {
+ /* Handle large packet */
+ bufferlen = bytes_recvd;
+ buffer = kzalloc(bytes_recvd, GFP_KERNEL);
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index d547ff6..b89ac7e 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -884,7 +884,7 @@ static void netvsc_channel_cb(void *context)
+
+ break;
+ }
+- } else if (ret == -2) {
++ } else if (ret == -ENOBUFS) {
+ /* Handle large packet */
+ buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
+ if (buffer == NULL) {
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0037-Staging-hv-netvsc-Get-rid-of-an-unnecessary-print.patch b/patches.suse/staging-hv-staging-next-20110825-0037-Staging-hv-netvsc-Get-rid-of-an-unnecessary-print.patch
new file mode 100644
index 0000000000..51575792fd
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0037-Staging-hv-netvsc-Get-rid-of-an-unnecessary-print.patch
@@ -0,0 +1,33 @@
+From 0293e5cabcd9067f35a64575922470b92d642d0e Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:00 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe()
+
+Get rid of an unnecessary print statement in netvsc_probe(). Furthermore,
+this fixes a bug since netdev_err is being invoked after the device has
+been freed.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 2 --
+ 1 files changed, 0 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
+index ad1ef03..0b8ac1a 100644
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -355,8 +355,6 @@ static int netvsc_probe(struct hv_device *dev)
+ if (ret != 0) {
+ free_netdev(net);
+ dev_set_drvdata(&dev->device, NULL);
+-
+- netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
+ return ret;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0038-Staging-hv-vmbus-Retry-vmbus_post_msg-before-gi.patch b/patches.suse/staging-hv-staging-next-20110825-0038-Staging-hv-vmbus-Retry-vmbus_post_msg-before-gi.patch
new file mode 100644
index 0000000000..0e6104b918
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0038-Staging-hv-vmbus-Retry-vmbus_post_msg-before-gi.patch
@@ -0,0 +1,70 @@
+From 5289d3d160e8d5c63974502696ab5def71891f18 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:01 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up
+
+The function hv_post_msg() can fail because of transient resource
+conditions. It may be useful to retry the operation.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ arch/x86/include/asm/hyperv.h | 1 +
+ drivers/staging/hv/connection.c | 18 +++++++++++++++++-
+ 2 files changed, 18 insertions(+), 1 deletions(-)
+
+diff --git a/arch/x86/include/asm/hyperv.h b/arch/x86/include/asm/hyperv.h
+index 5df477a..b80420b 100644
+--- a/arch/x86/include/asm/hyperv.h
++++ b/arch/x86/include/asm/hyperv.h
+@@ -189,5 +189,6 @@
+ #define HV_STATUS_INVALID_HYPERCALL_CODE 2
+ #define HV_STATUS_INVALID_HYPERCALL_INPUT 3
+ #define HV_STATUS_INVALID_ALIGNMENT 4
++#define HV_STATUS_INSUFFICIENT_BUFFERS 19
+
+ #endif
+diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
+index 0e7efce..a88ad70 100644
+--- a/drivers/staging/hv/connection.c
++++ b/drivers/staging/hv/connection.c
+@@ -25,6 +25,7 @@
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
+ #include <linux/wait.h>
++#include <linux/delay.h>
+ #include <linux/mm.h>
+ #include <linux/slab.h>
+ #include <linux/vmalloc.h>
+@@ -268,10 +269,25 @@ void vmbus_on_event(unsigned long data)
+ int vmbus_post_msg(void *buffer, size_t buflen)
+ {
+ union hv_connection_id conn_id;
++ int ret = 0;
++ int retries = 0;
+
+ conn_id.asu32 = 0;
+ conn_id.u.id = VMBUS_MESSAGE_CONNECTION_ID;
+- return hv_post_message(conn_id, 1, buffer, buflen);
++
++ /*
++ * hv_post_message() can have transient failures because of
++ * insufficient resources. Retry the operation a couple of
++ * times before giving up.
++ */
++ while (retries < 3) {
++ ret = hv_post_message(conn_id, 1, buffer, buflen);
++ if (ret != HV_STATUS_INSUFFICIENT_BUFFERS)
++ return ret;
++ retries++;
++ msleep(100);
++ }
++ return ret;
+ }
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0039-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch b/patches.suse/staging-hv-staging-next-20110825-0039-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
new file mode 100644
index 0000000000..116049d57c
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0039-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
@@ -0,0 +1,53 @@
+From d225d36b13927defee0f5d51ade9987bb617d465 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:02 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add()
+
+Use standard Linux error values and cleanup error handling. I would like
+to acknowledge Andre Bartke (andre.bartke@gmail.com) for highlighting this
+problem.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 3029786..915aeee 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -392,10 +392,8 @@ int storvsc_dev_add(struct hv_device *device,
+
+ device_info = (struct storvsc_device_info *)additional_info;
+ stor_device = alloc_stor_device(device);
+- if (!stor_device) {
+- ret = -1;
+- goto cleanup;
+- }
++ if (!stor_device)
++ return -ENOMEM;
+
+ /* Save the channel properties to our storvsc channel */
+
+@@ -409,11 +407,13 @@ int storvsc_dev_add(struct hv_device *device,
+ stor_device->port_number = device_info->port_number;
+ /* Send it back up */
+ ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
+-
++ if (ret) {
++ free_stor_device(stor_device);
++ return ret;
++ }
+ device_info->path_id = stor_device->path_id;
+ device_info->target_id = stor_device->target_id;
+
+-cleanup:
+ return ret;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0040-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch b/patches.suse/staging-hv-staging-next-20110825-0040-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
new file mode 100644
index 0000000000..d6be6eb1d0
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0040-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
@@ -0,0 +1,31 @@
+From 5260e291ff116ff1db14166a778fcab3f5932bc8 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:03 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 915aeee..22ac6f2 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -111,7 +111,7 @@ static int storvsc_channel_init(struct hv_device *device)
+
+ stor_device = get_stor_device(device);
+ if (!stor_device)
+- return -1;
++ return -ENODEV;
+
+ request = &stor_device->init_request;
+ vstor_packet = &request->vstor_packet;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0041-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch b/patches.suse/staging-hv-staging-next-20110825-0041-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
new file mode 100644
index 0000000000..4932c5574e
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0041-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
@@ -0,0 +1,31 @@
+From cae50a27a0405b7a70a97a2c9c22912955c84d44 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:04 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp()
+
+Cleanup error handling in storvsc_connect_to_vsp().
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 22ac6f2..2b73f72 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -376,7 +376,7 @@ static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size)
+ storvsc_on_channel_callback, device);
+
+ if (ret != 0)
+- return -1;
++ return ret;
+
+ ret = storvsc_channel_init(device);
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0042-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch b/patches.suse/staging-hv-staging-next-20110825-0042-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
new file mode 100644
index 0000000000..7b1ad65a60
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0042-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
@@ -0,0 +1,31 @@
+From 3b54eed7de90d59b2c6fa416513826279acc3bbd Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:05 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 2b73f72..2b914e4 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -454,7 +454,7 @@ int storvsc_do_io(struct hv_device *device,
+ stor_device = get_stor_device(device);
+
+ if (!stor_device)
+- return -2;
++ return -ENODEV;
+
+
+ request->device = device;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0043-Storage-hv-storvsc-Get-rid-of-some-unnecessary-DP.patch b/patches.suse/staging-hv-staging-next-20110825-0043-Storage-hv-storvsc-Get-rid-of-some-unnecessary-DP.patch
new file mode 100644
index 0000000000..e155eeb73d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0043-Storage-hv-storvsc-Get-rid-of-some-unnecessary-DP.patch
@@ -0,0 +1,89 @@
+From e9bda4348b8dc907ffb26dcda53fff568d35a045 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:06 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c
+
+Get rid of some unnecessary DPRINTs from storvsc.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 16 ----------------
+ 1 files changed, 0 insertions(+), 16 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 2b914e4..3730f3f 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -125,8 +125,6 @@ static int storvsc_channel_init(struct hv_device *device)
+ vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION;
+ vstor_packet->flags = REQUEST_COMPLETION_FLAG;
+
+- DPRINT_INFO(STORVSC, "BEGIN_INITIALIZATION_OPERATION...");
+-
+ ret = vmbus_sendpacket(device->channel, vstor_packet,
+ sizeof(struct vstor_packet),
+ (unsigned long)request,
+@@ -145,7 +143,6 @@ static int storvsc_channel_init(struct hv_device *device)
+ vstor_packet->status != 0)
+ goto cleanup;
+
+- DPRINT_INFO(STORVSC, "QUERY_PROTOCOL_VERSION_OPERATION...");
+
+ /* reuse the packet for version range supported */
+ memset(vstor_packet, 0, sizeof(struct vstor_packet));
+@@ -174,8 +171,6 @@ static int storvsc_channel_init(struct hv_device *device)
+ vstor_packet->status != 0)
+ goto cleanup;
+
+- /* Query channel properties */
+- DPRINT_INFO(STORVSC, "QUERY_PROPERTIES_OPERATION...");
+
+ memset(vstor_packet, 0, sizeof(struct vstor_packet));
+ vstor_packet->operation = VSTOR_OPERATION_QUERY_PROPERTIES;
+@@ -207,8 +202,6 @@ static int storvsc_channel_init(struct hv_device *device)
+ stor_device->target_id
+ = vstor_packet->storage_channel_properties.target_id;
+
+- DPRINT_INFO(STORVSC, "END_INITIALIZATION_OPERATION...");
+-
+ memset(vstor_packet, 0, sizeof(struct vstor_packet));
+ vstor_packet->operation = VSTOR_OPERATION_END_INITIALIZATION;
+ vstor_packet->flags = REQUEST_COMPLETION_FLAG;
+@@ -232,7 +225,6 @@ static int storvsc_channel_init(struct hv_device *device)
+ vstor_packet->status != 0)
+ goto cleanup;
+
+- DPRINT_INFO(STORVSC, "**** storage channel up and running!! ****");
+
+ cleanup:
+ put_stor_device(device);
+@@ -305,13 +297,8 @@ static void storvsc_on_receive(struct hv_device *device,
+ storvsc_on_io_completion(device, vstor_packet, request);
+ break;
+ case VSTOR_OPERATION_REMOVE_DEVICE:
+- DPRINT_INFO(STORVSC, "REMOVE_DEVICE_OPERATION");
+- /* TODO: */
+- break;
+
+ default:
+- DPRINT_INFO(STORVSC, "Unknown operation received - %d",
+- vstor_packet->operation);
+ break;
+ }
+ }
+@@ -421,9 +408,6 @@ int storvsc_dev_remove(struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+
+- DPRINT_INFO(STORVSC, "disabling storage device (%p)...",
+- device->ext);
+-
+ stor_device = release_stor_device(device);
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0044-Staging-hv-storvsc-Fix-cleanup-some-dated-comment.patch b/patches.suse/staging-hv-staging-next-20110825-0044-Staging-hv-storvsc-Fix-cleanup-some-dated-comment.patch
new file mode 100644
index 0000000000..f52002aa6d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0044-Staging-hv-storvsc-Fix-cleanup-some-dated-comment.patch
@@ -0,0 +1,58 @@
+From 1920da8801284c954e6edb8156a84fa9ce041128 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:07 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c
+
+Fix/cleanup some dated comments in storvsc.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 8 +++-----
+ 1 files changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 3730f3f..827b6a3 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -166,7 +166,6 @@ static int storvsc_channel_init(struct hv_device *device)
+ goto cleanup;
+ }
+
+- /* TODO: Check returned version */
+ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
+ vstor_packet->status != 0)
+ goto cleanup;
+@@ -193,7 +192,6 @@ static int storvsc_channel_init(struct hv_device *device)
+ goto cleanup;
+ }
+
+- /* TODO: Check returned version */
+ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
+ vstor_packet->status != 0)
+ goto cleanup;
+@@ -384,11 +382,12 @@ int storvsc_dev_add(struct hv_device *device,
+
+ /* Save the channel properties to our storvsc channel */
+
+- /* FIXME: */
+ /*
+ * If we support more than 1 scsi channel, we need to set the
+ * port number here to the scsi channel but how do we get the
+- * scsi channel prior to the bus scan
++ * scsi channel prior to the bus scan.
++ *
++ * The host does not support this.
+ */
+
+ stor_device->port_number = device_info->port_number;
+@@ -545,4 +544,3 @@ int storvsc_get_major_info(struct storvsc_device_info *device_info,
+
+ return -ENODEV;
+ }
+-
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0045-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch b/patches.suse/staging-hv-staging-next-20110825-0045-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch
new file mode 100644
index 0000000000..433f1de8f2
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0045-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch
@@ -0,0 +1,31 @@
+From f3b741658c983a2a7abc5d22a5dc60b503f6cbc3 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:08 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 29ac644..0eb8c71 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -346,7 +346,7 @@ static int storvsc_host_reset(struct hv_device *device)
+
+ stor_device = get_stor_device(device);
+ if (!stor_device)
+- return -1;
++ return -ENODEV;
+
+ request = &stor_device->reset_request;
+ vstor_packet = &request->vstor_packet;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0046-Staging-hv-storvsc-Cleanup-error-code-returned-in.patch b/patches.suse/staging-hv-staging-next-20110825-0046-Staging-hv-storvsc-Cleanup-error-code-returned-in.patch
new file mode 100644
index 0000000000..78830d6638
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0046-Staging-hv-storvsc-Cleanup-error-code-returned-in.patch
@@ -0,0 +1,40 @@
+From 8e854680b57440a8bbfdaae05534b010060f7966 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:09 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 0eb8c71..69a312f 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -685,7 +685,7 @@ static int storvsc_probe(struct hv_device *device)
+ if (ret != 0) {
+ kmem_cache_destroy(host_dev->request_pool);
+ scsi_host_put(host);
+- return -1;
++ return -ENODEV;
+ }
+
+ host_dev->path = device_info.path_id;
+@@ -706,7 +706,7 @@ static int storvsc_probe(struct hv_device *device)
+
+ kmem_cache_destroy(host_dev->request_pool);
+ scsi_host_put(host);
+- return -1;
++ return -ENODEV;
+ }
+
+ scsi_scan_host(host);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0047-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch b/patches.suse/staging-hv-staging-next-20110825-0047-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch
new file mode 100644
index 0000000000..fa9697aac1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0047-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch
@@ -0,0 +1,31 @@
+From b06efc199f9b8cc49e47d441f837a2dbe4971e4e Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:10 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 69a312f..faa8d57 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -740,7 +740,7 @@ static int __init storvsc_drv_init(void)
+
+ if (max_outstanding_req_per_channel <
+ STORVSC_MAX_IO_REQUESTS)
+- return -1;
++ return -EINVAL;
+
+ return vmbus_driver_register(&storvsc_drv);
+ }
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0048-Staging-hv-netvsc-Cleanup-the-returned-error-code.patch b/patches.suse/staging-hv-staging-next-20110825-0048-Staging-hv-netvsc-Cleanup-the-returned-error-code.patch
new file mode 100644
index 0000000000..c8be30ee4b
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0048-Staging-hv-netvsc-Cleanup-the-returned-error-code.patch
@@ -0,0 +1,31 @@
+From 51a805d0ce0f78810fd90d4e9eafd8a0ab4bdb58 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:11 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
+index 0b8ac1a..90a3198 100644
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -338,7 +338,7 @@ static int netvsc_probe(struct hv_device *dev)
+
+ net = alloc_etherdev(sizeof(struct net_device_context));
+ if (!net)
+- return -1;
++ return -ENOMEM;
+
+ /* Set initial state */
+ netif_carrier_off(net);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0049-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch b/patches.suse/staging-hv-staging-next-20110825-0049-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch
new file mode 100644
index 0000000000..6475a4773d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0049-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch
@@ -0,0 +1,40 @@
+From a3e00530469baa39ccc08b1731a4e120bd63012f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:12 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf()
+
+Cleanup error return codes in netvsc_destroy_recv_buf().
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index b89ac7e..baa0c8d 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -160,7 +160,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
+ if (ret != 0) {
+ dev_err(&net_device->dev->device, "unable to send "
+ "revoke receive buffer to netvsp");
+- return -1;
++ return ret;
+ }
+ }
+
+@@ -175,7 +175,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
+ if (ret != 0) {
+ dev_err(&net_device->dev->device,
+ "unable to teardown receive buffer's gpadl");
+- return -1;
++ return -ret;
+ }
+ net_device->recv_buf_gpadl_handle = 0;
+ }
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0050-Staging-hv-netvsc-Cleanup-error-return-values-in.patch b/patches.suse/staging-hv-staging-next-20110825-0050-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
new file mode 100644
index 0000000000..094d416b62
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0050-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
@@ -0,0 +1,67 @@
+From 927bc33c0a239b706635b23c5cc1f3df2a3c8b86 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:13 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 10 +++++-----
+ 1 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index baa0c8d..5703fd7 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -207,7 +207,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
+ if (!net_device) {
+ dev_err(&device->device, "unable to get net device..."
+ "device being destroyed?");
+- return -1;
++ return -ENODEV;
+ }
+
+ net_device->recv_buf =
+@@ -216,7 +216,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
+ if (!net_device->recv_buf) {
+ dev_err(&device->device, "unable to allocate receive "
+ "buffer of size %d", net_device->recv_buf_size);
+- ret = -1;
++ ret = -ENOMEM;
+ goto cleanup;
+ }
+
+@@ -269,7 +269,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
+ "initialzation with NetVsp - status %d",
+ init_packet->msg.v1_msg.
+ send_recv_buf_complete.status);
+- ret = -1;
++ ret = -EINVAL;
+ goto cleanup;
+ }
+
+@@ -281,7 +281,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
+ net_device->recv_section = kmalloc(net_device->recv_section_cnt
+ * sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL);
+ if (net_device->recv_section == NULL) {
+- ret = -1;
++ ret = -EINVAL;
+ goto cleanup;
+ }
+
+@@ -297,7 +297,7 @@ static int netvsc_init_recv_buf(struct hv_device *device)
+ */
+ if (net_device->recv_section_cnt != 1 ||
+ net_device->recv_section->offset != 0) {
+- ret = -1;
++ ret = -EINVAL;
+ goto cleanup;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0051-Staging-hv-netvsc-Cleanup-error-returns-in-netvsc.patch b/patches.suse/staging-hv-staging-next-20110825-0051-Staging-hv-netvsc-Cleanup-error-returns-in-netvsc.patch
new file mode 100644
index 0000000000..de2ab6c1d8
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0051-Staging-hv-netvsc-Cleanup-error-returns-in-netvsc.patch
@@ -0,0 +1,59 @@
+From 0f48c72ca63a6e1da7f226163c36fecd7a923fed Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:14 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 10 ++++------
+ 1 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 5703fd7..9cc126b 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -323,7 +323,7 @@ static int netvsc_connect_vsp(struct hv_device *device)
+ if (!net_device) {
+ dev_err(&device->device, "unable to get net device..."
+ "device being destroyed?");
+- return -1;
++ return -ENODEV;
+ }
+
+ init_packet = &net_device->channel_init_pkt;
+@@ -354,13 +354,13 @@ static int netvsc_connect_vsp(struct hv_device *device)
+
+ if (init_packet->msg.init_msg.init_complete.status !=
+ NVSP_STAT_SUCCESS) {
+- ret = -1;
++ ret = -EINVAL;
+ goto cleanup;
+ }
+
+ if (init_packet->msg.init_msg.init_complete.
+ negotiated_protocol_ver != NVSP_PROTOCOL_VERSION_1) {
+- ret = -1;
++ ret = -EPROTO;
+ goto cleanup;
+ }
+ /* Send the ndis version */
+@@ -381,10 +381,8 @@ static int netvsc_connect_vsp(struct hv_device *device)
+ sizeof(struct nvsp_message),
+ (unsigned long)init_packet,
+ VM_PKT_DATA_INBAND, 0);
+- if (ret != 0) {
+- ret = -1;
++ if (ret != 0)
+ goto cleanup;
+- }
+
+ /* Post the big receive buffer to NetVSP */
+ ret = netvsc_init_recv_buf(device);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0052-Staging-hv-netvsc-Cleanup-error-return-values-in.patch b/patches.suse/staging-hv-staging-next-20110825-0052-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
new file mode 100644
index 0000000000..4a3b20e05d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0052-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
@@ -0,0 +1,40 @@
+From ff2bd69ae3ec164b606114fcbd9b9e4d5f2bcdc7 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:15 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error return values in netvsc_send()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 9cc126b..f7f4957 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -409,7 +409,7 @@ int netvsc_device_remove(struct hv_device *device)
+ net_device = release_outbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "No net device present!!");
+- return -1;
++ return -ENODEV;
+ }
+
+ /* Wait for all send completions */
+@@ -499,7 +499,7 @@ int netvsc_send(struct hv_device *device,
+ if (!net_device) {
+ dev_err(&device->device, "net device (%p) shutting down..."
+ "ignoring outbound packets", net_device);
+- return -2;
++ return -ENODEV;
+ }
+
+ sendMessage.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0053-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch b/patches.suse/staging-hv-staging-next-20110825-0053-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch
new file mode 100644
index 0000000000..39f79a7275
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0053-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch
@@ -0,0 +1,47 @@
+From ace163a85a9a98e7f91db3a23db3f63689038f1e Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:16 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 4 +---
+ 1 files changed, 1 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index f7f4957..b6e1fb9 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -918,7 +918,7 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+
+ net_device = alloc_net_device(device);
+ if (!net_device) {
+- ret = -1;
++ ret = -ENOMEM;
+ goto cleanup;
+ }
+
+@@ -947,7 +947,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+
+ if (ret != 0) {
+ dev_err(&device->device, "unable to open channel: %d", ret);
+- ret = -1;
+ goto cleanup;
+ }
+
+@@ -959,7 +958,6 @@ int netvsc_device_add(struct hv_device *device, void *additional_info)
+ if (ret != 0) {
+ dev_err(&device->device,
+ "unable to connect to NetVSP - %d", ret);
+- ret = -1;
+ goto close;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0054-Staging-hv-netvsc-Cleanup-error-codes-in-rndis_fi.patch b/patches.suse/staging-hv-staging-next-20110825-0054-Staging-hv-netvsc-Cleanup-error-codes-in-rndis_fi.patch
new file mode 100644
index 0000000000..8bd78dc67f
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0054-Staging-hv-netvsc-Cleanup-error-codes-in-rndis_fi.patch
@@ -0,0 +1,39 @@
+From 62c0743ef00cb0ad0b32b05fb96acd4d8e7391dd Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:17 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index dbb5201..8e1ef00 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -358,14 +358,14 @@ int rndis_filter_receive(struct hv_device *dev,
+ if (!net_dev->extension) {
+ dev_err(&dev->device, "got rndis message but no rndis device - "
+ "dropping this message!\n");
+- return -1;
++ return -ENODEV;
+ }
+
+ rndis_dev = (struct rndis_device *)net_dev->extension;
+ if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) {
+ dev_err(&dev->device, "got rndis message but rndis device "
+ "uninitialized...dropping this message!\n");
+- return -1;
++ return -ENODEV;
+ }
+
+ rndis_hdr = (struct rndis_message *)kmap_atomic(
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0055-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch b/patches.suse/staging-hv-staging-next-20110825-0055-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch
new file mode 100644
index 0000000000..c31fd1fe18
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0055-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch
@@ -0,0 +1,31 @@
+From de6e0580d5884942f58a636902e5b0225f38b8cf Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:18 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index 8e1ef00..f26886d 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -437,7 +437,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
+ request = get_rndis_request(dev, REMOTE_NDIS_QUERY_MSG,
+ RNDIS_MESSAGE_SIZE(struct rndis_query_request));
+ if (!request) {
+- ret = -1;
++ ret = -ENOMEM;
+ goto Cleanup;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0056-Staging-hv-netvsc-Cleanup-error-return-values-in.patch b/patches.suse/staging-hv-staging-next-20110825-0056-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
new file mode 100644
index 0000000000..ebeded255a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0056-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
@@ -0,0 +1,48 @@
+From 58ef3977ce8e0edba374dd7645e59cf5afdc6447 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:19 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter()
+
+Use standard Linux error codes and cleanup some error paths.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 5 +----
+ 1 files changed, 1 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index f26886d..f5f3052 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -511,7 +511,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+ RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
+ sizeof(u32));
+ if (!request) {
+- ret = -1;
++ ret = -ENOMEM;
+ goto Cleanup;
+ }
+
+@@ -531,7 +531,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+
+ if (t == 0) {
+- ret = -1;
+ dev_err(&dev->net_dev->dev->device,
+ "timeout before we got a set response...\n");
+ /*
+@@ -540,8 +539,6 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+ */
+ goto Exit;
+ } else {
+- if (ret > 0)
+- ret = 0;
+ set_complete = &request->response_msg.msg.set_complete;
+ status = set_complete->status;
+ }
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0057-Staging-hv-netvsc-Cleanup-error-returns-in-rndis_.patch b/patches.suse/staging-hv-staging-next-20110825-0057-Staging-hv-netvsc-Cleanup-error-returns-in-rndis_.patch
new file mode 100644
index 0000000000..accc7ef0ec
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0057-Staging-hv-netvsc-Cleanup-error-returns-in-rndis_.patch
@@ -0,0 +1,40 @@
+From bc49b92671632d09a0fa6651c4fdf2b9ab0632ee Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:20 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index f5f3052..a71f29d 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -562,7 +562,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
+ request = get_rndis_request(dev, REMOTE_NDIS_INITIALIZE_MSG,
+ RNDIS_MESSAGE_SIZE(struct rndis_initialize_request));
+ if (!request) {
+- ret = -1;
++ ret = -ENOMEM;
+ goto Cleanup;
+ }
+
+@@ -596,7 +596,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
+ ret = 0;
+ } else {
+ dev->state = RNDIS_DEV_UNINITIALIZED;
+- ret = -1;
++ ret = -EINVAL;
+ }
+
+ Cleanup:
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0058-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch b/patches.suse/staging-hv-staging-next-20110825-0058-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch
new file mode 100644
index 0000000000..f41984ccf7
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0058-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch
@@ -0,0 +1,31 @@
+From 327efbae1f96743c9b208e8a4c667eea9b8cf6c0 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:21 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add()
+
+Use standard Linux error codes.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index a71f29d..f0d1362 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -673,7 +673,7 @@ int rndis_filter_device_add(struct hv_device *dev,
+
+ rndisDevice = get_rndis_device();
+ if (!rndisDevice)
+- return -1;
++ return -ENODEV;
+
+ /*
+ * Let the inner driver handle this first to create the netvsc channel
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0059-Staging-hv-mouse-Change-the-jump-label-Cleanup-to.patch b/patches.suse/staging-hv-staging-next-20110825-0059-Staging-hv-mouse-Change-the-jump-label-Cleanup-to.patch
new file mode 100644
index 0000000000..85f820f694
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0059-Staging-hv-mouse-Change-the-jump-label-Cleanup-to.patch
@@ -0,0 +1,121 @@
+From fdb3c32cb7b80d28f23f005543eb4f0d6e88c2a3 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:22 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: mouse: Change the jump label Cleanup to cleanup
+
+Change the jump label "Cleanup" to "cleanup".
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 22 +++++++++++-----------
+ 1 files changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index d7e24bc..07a6584 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -336,7 +336,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+
+ if (!input_device->hid_desc) {
+ pr_err("unable to allocate hid descriptor - size %d", desc->bLength);
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ memcpy(input_device->hid_desc, desc, desc->bLength);
+@@ -349,7 +349,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+ if (!input_device->report_desc) {
+ pr_err("unable to allocate report descriptor - size %d",
+ input_device->report_desc_size);
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ memcpy(input_device->report_desc,
+@@ -376,7 +376,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+ if (ret != 0) {
+ pr_err("unable to send synthhid device info ack - ret %d",
+ ret);
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ input_device->device_wait_condition = 1;
+@@ -384,7 +384,7 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+
+ return;
+
+-Cleanup:
++cleanup:
+ kfree(input_device->hid_desc);
+ input_device->hid_desc = NULL;
+
+@@ -603,7 +603,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
+ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+ if (ret != 0) {
+ pr_err("unable to send synthhid protocol request.");
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ input_dev->protocol_wait_condition = 0;
+@@ -611,7 +611,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
+ input_dev->protocol_wait_condition, msecs_to_jiffies(1000));
+ if (input_dev->protocol_wait_condition == 0) {
+ ret = -ETIMEDOUT;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ response = &input_dev->protocol_resp;
+@@ -620,7 +620,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
+ pr_err("synthhid protocol request failed (version %d)",
+ SYNTHHID_INPUT_VERSION);
+ ret = -1;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ input_dev->device_wait_condition = 0;
+@@ -628,7 +628,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
+ input_dev->device_wait_condition, msecs_to_jiffies(1000));
+ if (input_dev->device_wait_condition == 0) {
+ ret = -ETIMEDOUT;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ /*
+@@ -640,7 +640,7 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
+ else
+ ret = -1;
+
+-Cleanup:
++cleanup:
+ put_input_device(device);
+
+ return ret;
+@@ -658,7 +658,7 @@ static int mousevsc_on_device_add(struct hv_device *device,
+
+ if (!input_dev) {
+ ret = -1;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ input_dev->init_complete = false;
+@@ -711,7 +711,7 @@ static int mousevsc_on_device_add(struct hv_device *device,
+
+ input_dev->init_complete = true;
+
+-Cleanup:
++cleanup:
+ return ret;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0060-Staging-hv-netvsc-Change-the-jump-label-Cleanup-t.patch b/patches.suse/staging-hv-staging-next-20110825-0060-Staging-hv-netvsc-Change-the-jump-label-Cleanup-t.patch
new file mode 100644
index 0000000000..36de915ade
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0060-Staging-hv-netvsc-Change-the-jump-label-Cleanup-t.patch
@@ -0,0 +1,145 @@
+From 1c627870f005149e815a7db00084160cfde1bef8 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:24 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Change the jump label Cleanup to cleanup
+
+Change the jump label "Cleanup" to "cleanup".
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 28 ++++++++++++++--------------
+ 1 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index f0d1362..79dfe78 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -438,7 +438,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
+ RNDIS_MESSAGE_SIZE(struct rndis_query_request));
+ if (!request) {
+ ret = -ENOMEM;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ /* Setup the rndis query */
+@@ -450,12 +450,12 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
+
+ ret = rndis_filter_send_request(dev, request);
+ if (ret != 0)
+- goto Cleanup;
++ goto cleanup;
+
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+ if (t == 0) {
+ ret = -ETIMEDOUT;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ /* Copy the response back */
+@@ -463,7 +463,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
+
+ if (query_complete->info_buflen > inresult_size) {
+ ret = -1;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ memcpy(result,
+@@ -473,7 +473,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid,
+
+ *result_size = query_complete->info_buflen;
+
+-Cleanup:
++cleanup:
+ if (request)
+ put_rndis_request(dev, request);
+
+@@ -512,7 +512,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+ sizeof(u32));
+ if (!request) {
+ ret = -ENOMEM;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ /* Setup the rndis set */
+@@ -526,7 +526,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+
+ ret = rndis_filter_send_request(dev, request);
+ if (ret != 0)
+- goto Cleanup;
++ goto cleanup;
+
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+
+@@ -543,7 +543,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+ status = set_complete->status;
+ }
+
+-Cleanup:
++cleanup:
+ if (request)
+ put_rndis_request(dev, request);
+ Exit:
+@@ -563,7 +563,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
+ RNDIS_MESSAGE_SIZE(struct rndis_initialize_request));
+ if (!request) {
+ ret = -ENOMEM;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ /* Setup the rndis set */
+@@ -578,7 +578,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
+ ret = rndis_filter_send_request(dev, request);
+ if (ret != 0) {
+ dev->state = RNDIS_DEV_UNINITIALIZED;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+
+@@ -586,7 +586,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
+
+ if (t == 0) {
+ ret = -ETIMEDOUT;
+- goto Cleanup;
++ goto cleanup;
+ }
+
+ init_complete = &request->response_msg.msg.init_complete;
+@@ -599,7 +599,7 @@ static int rndis_filter_init_device(struct rndis_device *dev)
+ ret = -EINVAL;
+ }
+
+-Cleanup:
++cleanup:
+ if (request)
+ put_rndis_request(dev, request);
+
+@@ -615,7 +615,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
+ request = get_rndis_request(dev, REMOTE_NDIS_HALT_MSG,
+ RNDIS_MESSAGE_SIZE(struct rndis_halt_request));
+ if (!request)
+- goto Cleanup;
++ goto cleanup;
+
+ /* Setup the rndis set */
+ halt = &request->request_msg.msg.halt_req;
+@@ -626,7 +626,7 @@ static void rndis_filter_halt_device(struct rndis_device *dev)
+
+ dev->state = RNDIS_DEV_UNINITIALIZED;
+
+-Cleanup:
++cleanup:
+ if (request)
+ put_rndis_request(dev, request);
+ return;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0061-Staging-hv-netvsc-Change-the-jump-label-Exit-to-e.patch b/patches.suse/staging-hv-staging-next-20110825-0061-Staging-hv-netvsc-Change-the-jump-label-Exit-to-e.patch
new file mode 100644
index 0000000000..87063d0a53
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0061-Staging-hv-netvsc-Change-the-jump-label-Exit-to-e.patch
@@ -0,0 +1,40 @@
+From 5585d81e0a52f7994b8cdc6a8927b425c068444a Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:25 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: netvsc: Change the jump label Exit to exit
+
+Change the jump lable "Exit" to "exit".
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/rndis_filter.c b/drivers/staging/hv/rndis_filter.c
+index 79dfe78..6db48b9 100644
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -537,7 +537,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+ * We can't deallocate the request since we may still receive a
+ * send completion for it.
+ */
+- goto Exit;
++ goto exit;
+ } else {
+ set_complete = &request->response_msg.msg.set_complete;
+ status = set_complete->status;
+@@ -546,7 +546,7 @@ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+ cleanup:
+ if (request)
+ put_rndis_request(dev, request);
+-Exit:
++exit:
+ return ret;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0062-Staging-hv-mouse-Get-rid-of-the-unused-PCI-signat.patch b/patches.suse/staging-hv-staging-next-20110825-0062-Staging-hv-mouse-Get-rid-of-the-unused-PCI-signat.patch
new file mode 100644
index 0000000000..a4735a4036
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0062-Staging-hv-mouse-Get-rid-of-the-unused-PCI-signat.patch
@@ -0,0 +1,58 @@
+From 18d08aff878c827e8a7a0ea10da597a44ddfe7bc Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:49:23 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: mouse: Get rid of the unused PCI signature
+
+Get rid of the unused PCI signature in the mouse driver.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 22 ----------------------
+ 1 files changed, 0 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 07a6584..dfa8ae8 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -22,8 +22,6 @@
+ #include <linux/input.h>
+ #include <linux/hid.h>
+ #include <linux/hiddev.h>
+-#include <linux/pci.h>
+-#include <linux/dmi.h>
+
+ #include "hyperv.h"
+
+@@ -935,26 +933,6 @@ static void __exit mousevsc_exit(void)
+ vmbus_driver_unregister(&mousevsc_drv);
+ }
+
+-/*
+- * We don't want to automatically load this driver just yet, it's quite
+- * broken. It's safe if you want to load it yourself manually, but
+- * don't inflict it on unsuspecting users, that's just mean.
+- */
+-#if 0
+-
+-/*
+- * We use a PCI table to determine if we should autoload this driver This is
+- * needed by distro tools to determine if the hyperv drivers should be
+- * installed and/or configured. We don't do anything else with the table, but
+- * it needs to be present.
+- */
+-static const struct pci_device_id microsoft_hv_pci_table[] = {
+- { PCI_DEVICE(0x1414, 0x5353) }, /* VGA compatible controller */
+- { 0 }
+-};
+-MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
+-#endif
+-
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION(HV_DRV_VERSION);
+ module_init(mousevsc_init);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0063-Staging-hv-hv_mouse-remove-deviceinfo_callback-fu.patch b/patches.suse/staging-hv-staging-next-20110825-0063-Staging-hv-hv_mouse-remove-deviceinfo_callback-fu.patch
new file mode 100644
index 0000000000..03e4f06532
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0063-Staging-hv-hv_mouse-remove-deviceinfo_callback-fu.patch
@@ -0,0 +1,86 @@
+From 4bc694057bc95049ed8d451c2e142c79bbf97328 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 16:36:52 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: hv_mouse: remove deviceinfo_callback function
+
+It's not needed, so just inline the two lines.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Cc: Hank Janssen <hjanssen@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 34 ++++++++++------------------------
+ 1 files changed, 10 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index dfa8ae8..8c4ae37 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -173,8 +173,13 @@ struct mousevsc_dev {
+ struct hv_input_dev_info hid_dev_info;
+ };
+
++struct input_device_context {
++ struct hv_device *device_ctx;
++ struct hid_device *hid_device;
++ struct hv_input_dev_info device_info;
++ int connected;
++};
+
+-static void deviceinfo_callback(struct hv_device *dev, struct hv_input_dev_info *info);
+ static void inputreport_callback(struct hv_device *dev, void *packet, u32 len);
+ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
+
+@@ -651,6 +656,7 @@ static int mousevsc_on_device_add(struct hv_device *device,
+ struct mousevsc_dev *input_dev;
+ struct hv_driver *input_drv;
+ struct hv_input_dev_info dev_info;
++ struct input_device_context *input_device_ctx;
+
+ input_dev = alloc_input_device(device);
+
+@@ -697,7 +703,9 @@ static int mousevsc_on_device_add(struct hv_device *device,
+ strcpy(dev_info.name, "Microsoft Vmbus HID-compliant Mouse");
+
+ /* Send the device info back up */
+- deviceinfo_callback(device, &dev_info);
++ input_device_ctx = dev_get_drvdata(&device->device);
++ memcpy(&input_device_ctx->device_info, &dev_info,
++ sizeof(struct hv_input_dev_info));
+
+ /* Send the report desc back up */
+ /* workaround SA-167 */
+@@ -752,28 +760,6 @@ static int mousevsc_on_device_remove(struct hv_device *device)
+ }
+
+
+-/*
+- * Data types
+- */
+-struct input_device_context {
+- struct hv_device *device_ctx;
+- struct hid_device *hid_device;
+- struct hv_input_dev_info device_info;
+- int connected;
+-};
+-
+-
+-static void deviceinfo_callback(struct hv_device *dev, struct hv_input_dev_info *info)
+-{
+- struct input_device_context *input_device_ctx =
+- dev_get_drvdata(&dev->device);
+-
+- memcpy(&input_device_ctx->device_info, info,
+- sizeof(struct hv_input_dev_info));
+-
+- DPRINT_INFO(INPUTVSC_DRV, "%s", __func__);
+-}
+-
+ static void inputreport_callback(struct hv_device *dev, void *packet, u32 len)
+ {
+ int ret = 0;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0064-Staging-hv-hv_mouse-remove-inputreport_callback-f.patch b/patches.suse/staging-hv-staging-next-20110825-0064-Staging-hv-hv_mouse-remove-inputreport_callback-f.patch
new file mode 100644
index 0000000000..308364adc1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0064-Staging-hv-hv_mouse-remove-inputreport_callback-f.patch
@@ -0,0 +1,74 @@
+From 3f4636e625204e74986e9f1f845229ebd6235f9e Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 16:41:06 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: hv_mouse: remove inputreport_callback function
+
+It's not needed, so just inline the two lines.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Cc: Hank Janssen <hjanssen@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 23 ++++++-----------------
+ 1 files changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 8c4ae37..257684e 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -180,7 +180,6 @@ struct input_device_context {
+ int connected;
+ };
+
+-static void inputreport_callback(struct hv_device *dev, void *packet, u32 len);
+ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
+
+ static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
+@@ -403,6 +402,7 @@ static void mousevsc_on_receive_input_report(struct mousevsc_dev *input_device,
+ struct synthhid_input_report *input_report)
+ {
+ struct hv_driver *input_drv;
++ struct input_device_context *input_dev_ctx;
+
+ if (!input_device->init_complete) {
+ pr_info("Initialization incomplete...ignoring input_report msg");
+@@ -411,9 +411,11 @@ static void mousevsc_on_receive_input_report(struct mousevsc_dev *input_device,
+
+ input_drv = drv_to_hv_drv(input_device->device->device.driver);
+
+- inputreport_callback(input_device->device,
+- input_report->buffer,
+- input_report->header.size);
++ input_dev_ctx = dev_get_drvdata(&input_device->device->device);
++
++ hid_input_report(input_dev_ctx->hid_device,
++ HID_INPUT_REPORT, input_report->buffer, input_report->header.size, 1);
++
+ }
+
+ static void mousevsc_on_receive(struct hv_device *device,
+@@ -760,19 +762,6 @@ static int mousevsc_on_device_remove(struct hv_device *device)
+ }
+
+
+-static void inputreport_callback(struct hv_device *dev, void *packet, u32 len)
+-{
+- int ret = 0;
+-
+- struct input_device_context *input_dev_ctx =
+- dev_get_drvdata(&dev->device);
+-
+- ret = hid_input_report(input_dev_ctx->hid_device,
+- HID_INPUT_REPORT, packet, len, 1);
+-
+- DPRINT_DBG(INPUTVSC_DRV, "hid_input_report (ret %d)", ret);
+-}
+-
+ static int mousevsc_hid_open(struct hid_device *hid)
+ {
+ return 0;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0065-Staging-hv-hv_mouse-remove-a-forward-declaration.patch b/patches.suse/staging-hv-staging-next-20110825-0065-Staging-hv-hv_mouse-remove-a-forward-declaration.patch
new file mode 100644
index 0000000000..a6b42e66ad
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0065-Staging-hv-hv_mouse-remove-a-forward-declaration.patch
@@ -0,0 +1,177 @@
+From 4ab0871ddd1bfdc514f93472cfd68290ecdb62c0 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 16:47:43 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: hv_mouse: remove a forward declaration
+
+This moves some functions around to remove a forward declaration.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Cc: Hank Janssen <hjanssen@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 126 ++++++++++++++++++++---------------------
+ 1 files changed, 62 insertions(+), 64 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 257684e..083f28f 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -180,8 +180,6 @@ struct input_device_context {
+ int connected;
+ };
+
+-static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
+-
+ static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
+ {
+ struct mousevsc_dev *input_dev;
+@@ -651,6 +649,68 @@ cleanup:
+ return ret;
+ }
+
++static int mousevsc_hid_open(struct hid_device *hid)
++{
++ return 0;
++}
++
++static void mousevsc_hid_close(struct hid_device *hid)
++{
++}
++
++static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
++{
++ struct input_device_context *input_device_ctx =
++ dev_get_drvdata(&dev->device);
++ struct hid_device *hid_dev;
++
++ /* hid_debug = -1; */
++ hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);
++
++ if (hid_parse_report(hid_dev, packet, len)) {
++ DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
++ return;
++ }
++
++ if (hid_dev) {
++ DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
++
++ hid_dev->ll_driver->open = mousevsc_hid_open;
++ hid_dev->ll_driver->close = mousevsc_hid_close;
++
++ hid_dev->bus = BUS_VIRTUAL;
++ hid_dev->vendor = input_device_ctx->device_info.vendor;
++ hid_dev->product = input_device_ctx->device_info.product;
++ hid_dev->version = input_device_ctx->device_info.version;
++ hid_dev->dev = dev->device;
++
++ sprintf(hid_dev->name, "%s",
++ input_device_ctx->device_info.name);
++
++ /*
++ * HJ Do we want to call it with a 0
++ */
++ if (!hidinput_connect(hid_dev, 0)) {
++ hid_dev->claimed |= HID_CLAIMED_INPUT;
++
++ input_device_ctx->connected = 1;
++
++ DPRINT_INFO(INPUTVSC_DRV,
++ "HID device claimed by input\n");
++ }
++
++ if (!hid_dev->claimed) {
++ DPRINT_ERR(INPUTVSC_DRV,
++ "HID device not claimed by "
++ "input or hiddev\n");
++ }
++
++ input_device_ctx->hid_device = hid_dev;
++ }
++
++ kfree(hid_dev);
++}
++
+ static int mousevsc_on_device_add(struct hv_device *device,
+ void *additional_info)
+ {
+@@ -762,15 +822,6 @@ static int mousevsc_on_device_remove(struct hv_device *device)
+ }
+
+
+-static int mousevsc_hid_open(struct hid_device *hid)
+-{
+- return 0;
+-}
+-
+-static void mousevsc_hid_close(struct hid_device *hid)
+-{
+-}
+-
+ static int mousevsc_probe(struct hv_device *dev)
+ {
+ int ret = 0;
+@@ -826,59 +877,6 @@ static int mousevsc_remove(struct hv_device *dev)
+ return ret;
+ }
+
+-static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
+-{
+- struct input_device_context *input_device_ctx =
+- dev_get_drvdata(&dev->device);
+- struct hid_device *hid_dev;
+-
+- /* hid_debug = -1; */
+- hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);
+-
+- if (hid_parse_report(hid_dev, packet, len)) {
+- DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
+- return;
+- }
+-
+- if (hid_dev) {
+- DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
+-
+- hid_dev->ll_driver->open = mousevsc_hid_open;
+- hid_dev->ll_driver->close = mousevsc_hid_close;
+-
+- hid_dev->bus = BUS_VIRTUAL;
+- hid_dev->vendor = input_device_ctx->device_info.vendor;
+- hid_dev->product = input_device_ctx->device_info.product;
+- hid_dev->version = input_device_ctx->device_info.version;
+- hid_dev->dev = dev->device;
+-
+- sprintf(hid_dev->name, "%s",
+- input_device_ctx->device_info.name);
+-
+- /*
+- * HJ Do we want to call it with a 0
+- */
+- if (!hidinput_connect(hid_dev, 0)) {
+- hid_dev->claimed |= HID_CLAIMED_INPUT;
+-
+- input_device_ctx->connected = 1;
+-
+- DPRINT_INFO(INPUTVSC_DRV,
+- "HID device claimed by input\n");
+- }
+-
+- if (!hid_dev->claimed) {
+- DPRINT_ERR(INPUTVSC_DRV,
+- "HID device not claimed by "
+- "input or hiddev\n");
+- }
+-
+- input_device_ctx->hid_device = hid_dev;
+- }
+-
+- kfree(hid_dev);
+-}
+-
+ static const struct hv_vmbus_device_id id_table[] = {
+ /* Mouse guid */
+ { VMBUS_DEVICE(0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0066-Staging-hv-hv_mouse-fix-up-remove-function.patch b/patches.suse/staging-hv-staging-next-20110825-0066-Staging-hv-hv_mouse-fix-up-remove-function.patch
new file mode 100644
index 0000000000..bcd10a45d3
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0066-Staging-hv-hv_mouse-fix-up-remove-function.patch
@@ -0,0 +1,52 @@
+From 6a180978aea7cb231c60b69b078ec339f40e2faa Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 16:51:28 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: hv_mouse: fix up remove() function
+
+This function obviously never worked, it was a cut-and-paste from the
+probe() function. Rewrite it to do what it is supposed to do at least
+in theory. As to if it works yet, well, it's not worse than it was
+before, so this can't hurt.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Cc: Hank Janssen <hjanssen@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 10 ++--------
+ 1 files changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 083f28f..090736a 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -847,15 +847,10 @@ static int mousevsc_probe(struct hv_device *dev)
+
+ static int mousevsc_remove(struct hv_device *dev)
+ {
+- int ret = 0;
+-
+ struct input_device_context *input_dev_ctx;
++ int ret;
+
+- input_dev_ctx = kmalloc(sizeof(struct input_device_context),
+- GFP_KERNEL);
+-
+- dev_set_drvdata(&dev->device, input_dev_ctx);
+-
++ input_dev_ctx = dev_get_drvdata(&dev->device);
+ if (input_dev_ctx->connected) {
+ hidinput_disconnect(input_dev_ctx->hid_device);
+ input_dev_ctx->connected = 0;
+@@ -866,7 +861,6 @@ static int mousevsc_remove(struct hv_device *dev)
+ * is being removed
+ */
+ ret = mousevsc_on_device_remove(dev);
+-
+ if (ret != 0) {
+ DPRINT_ERR(INPUTVSC_DRV,
+ "unable to remove vsc device (ret %d)", ret);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0562-Staging-hv-Add-struct-hv_vmbus_device_id-to-mod_de.patch b/patches.suse/staging-hv-staging-next-20110825-0562-Staging-hv-Add-struct-hv_vmbus_device_id-to-mod_de.patch
new file mode 100644
index 0000000000..5d05001603
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0562-Staging-hv-Add-struct-hv_vmbus_device_id-to-mod_de.patch
@@ -0,0 +1,37 @@
+From 17be18c2b5f5c8acd75e4edf1211abf2cfd60fa5 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:29 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: Add struct hv_vmbus_device_id to mod_devicetable.h
+
+In preparation for implementing vmbus aliases for auto-loading
+Hyper-V drivers, define vmbus specific device ID.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ include/linux/mod_devicetable.h | 7 +++++++
+ 1 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
+index ae28e93..5a12377 100644
+--- a/include/linux/mod_devicetable.h
++++ b/include/linux/mod_devicetable.h
+@@ -405,6 +405,13 @@ struct virtio_device_id {
+ };
+ #define VIRTIO_DEV_ANY_ID 0xffffffff
+
++/*
++ * For Hyper-V devices we use the device guid as the id.
++ */
++struct hv_vmbus_device_id {
++ __u8 guid[16];
++};
++
+ /* i2c */
+
+ #define I2C_NAME_SIZE 20
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0563-Staging-hv-add-driver_data-to-hv_vmbus_device_id.patch b/patches.suse/staging-hv-staging-next-20110825-0563-Staging-hv-add-driver_data-to-hv_vmbus_device_id.patch
new file mode 100644
index 0000000000..5aee1bd6bd
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0563-Staging-hv-add-driver_data-to-hv_vmbus_device_id.patch
@@ -0,0 +1,33 @@
+From a91befc116f424883602fb7b57b63b5fcfe18719 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 10:25:37 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: add driver_data to hv_vmbus_device_id
+
+This is going to be needed by some drivers that handle more than one
+device, like all other bus types do, so prepare for that in advance
+before the user/kernel api is used.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ include/linux/mod_devicetable.h | 2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
+index 5a12377..468819c 100644
+--- a/include/linux/mod_devicetable.h
++++ b/include/linux/mod_devicetable.h
+@@ -410,6 +410,8 @@ struct virtio_device_id {
+ */
+ struct hv_vmbus_device_id {
+ __u8 guid[16];
++ kernel_ulong_t driver_data /* Data private to the driver */
++ __attribute__((aligned(sizeof(kernel_ulong_t))));
+ };
+
+ /* i2c */
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0568-Staging-hv-Add-code-to-parse-struct-hv_vmbus_devic.patch b/patches.suse/staging-hv-staging-next-20110825-0568-Staging-hv-Add-code-to-parse-struct-hv_vmbus_devic.patch
new file mode 100644
index 0000000000..f5baae0113
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0568-Staging-hv-Add-code-to-parse-struct-hv_vmbus_devic.patch
@@ -0,0 +1,61 @@
+From d2ee52aaf30072e4a761e785c752e305ce10152f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 25 Aug 2011 09:48:30 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: Add code to parse struct hv_vmbus_device_id table
+
+Add code to parse struct hv_vmbus_device_id table.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ scripts/mod/file2alias.c | 25 +++++++++++++++++++++++++
+ 1 files changed, 25 insertions(+), 0 deletions(-)
+
+diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
+index e26e2fb..b74d21a 100644
+--- a/scripts/mod/file2alias.c
++++ b/scripts/mod/file2alias.c
+@@ -735,6 +735,27 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id,
+ return 1;
+ }
+
++/*
++ * Looks like: vmbus:guid
++ * Each byte of the guid will be represented by two hex characters
++ * in the name.
++ */
++
++static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
++ char *alias)
++{
++ int i;
++ char guid_name[((sizeof(struct hv_vmbus_device_id) + 1)) * 2];
++
++ for (i = 0; i < (sizeof(struct hv_vmbus_device_id) * 2); i += 2)
++ sprintf(&guid_name[i], "%02x", id->guid[i/2]);
++
++ strcpy(alias, "vmbus:");
++ strcat(alias, guid_name);
++
++ return 1;
++}
++
+ /* Looks like: i2c:S */
+ static int do_i2c_entry(const char *filename, struct i2c_device_id *id,
+ char *alias)
+@@ -994,6 +1015,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
+ do_table(symval, sym->st_size,
+ sizeof(struct virtio_device_id), "virtio",
+ do_virtio_entry, mod);
++ else if (sym_is(symname, "__mod_vmbus_device_table"))
++ do_table(symval, sym->st_size,
++ sizeof(struct hv_vmbus_device_id), "vmbus",
++ do_vmbus_entry, mod);
+ else if (sym_is(symname, "__mod_i2c_device_table"))
+ do_table(symval, sym->st_size,
+ sizeof(struct i2c_device_id), "i2c",
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110825-0570-Staging-hv-file2alias-fix-up-alias-creation-logic.patch b/patches.suse/staging-hv-staging-next-20110825-0570-Staging-hv-file2alias-fix-up-alias-creation-logic.patch
new file mode 100644
index 0000000000..6d1ff68a47
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110825-0570-Staging-hv-file2alias-fix-up-alias-creation-logic.patch
@@ -0,0 +1,40 @@
+From ebf16e38515188b61962ba84b59e898ad64ffff6 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu, 25 Aug 2011 11:28:11 -0700
+Patch-mainline: staging-next-20110825 ?
+Subject: [PATCH] Staging: hv: file2alias: fix up alias creation logic for hv_vmbus_device_id
+
+When I added the driver_data field to hv_vmbus_device_id, I forgot to
+take into the account how the alias was created, so it would append the
+kernel pointer to the end of the alias, which is not correct.
+
+This changes how the hv_vmbus_device_id alias is created to proper
+account for the driver_data field. As no module yet uses this alias, it
+is safe to fix this up at this point in the commit stream.
+
+Cc: K. Y. Srinivasan <kys@microsoft.com>
+Cc: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ scripts/mod/file2alias.c | 4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
+index b74d21a..f936d1f 100644
+--- a/scripts/mod/file2alias.c
++++ b/scripts/mod/file2alias.c
+@@ -745,9 +745,9 @@ static int do_vmbus_entry(const char *filename, struct hv_vmbus_device_id *id,
+ char *alias)
+ {
+ int i;
+- char guid_name[((sizeof(struct hv_vmbus_device_id) + 1)) * 2];
++ char guid_name[((sizeof(id->guid) + 1)) * 2];
+
+- for (i = 0; i < (sizeof(struct hv_vmbus_device_id) * 2); i += 2)
++ for (i = 0; i < (sizeof(id->guid) * 2); i += 2)
+ sprintf(&guid_name[i], "%02x", id->guid[i/2]);
+
+ strcpy(alias, "vmbus:");
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0303-Staging-hv-storvsc-Inline-free_stor_device.patch b/patches.suse/staging-hv-staging-next-20110829-0303-Staging-hv-storvsc-Inline-free_stor_device.patch
new file mode 100644
index 0000000000..ab26b728e1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0303-Staging-hv-storvsc-Inline-free_stor_device.patch
@@ -0,0 +1,51 @@
+From 0fb07a87ec663652bea02a54faa05fb4b3d0c20f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:00 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Inline free_stor_device()
+
+Inline the code for free_stor_device() and get rid of the function.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 8 ++------
+ 1 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 827b6a3..8c62829 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -51,10 +51,6 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ return stor_device;
+ }
+
+-static inline void free_stor_device(struct storvsc_device *device)
+-{
+- kfree(device);
+-}
+
+ /* Get the stordevice object iff exists and its refcount > 0 */
+ static inline struct storvsc_device *must_get_stor_device(
+@@ -394,7 +390,7 @@ int storvsc_dev_add(struct hv_device *device,
+ /* Send it back up */
+ ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
+ if (ret) {
+- free_stor_device(stor_device);
++ kfree(stor_device);
+ return ret;
+ }
+ device_info->path_id = stor_device->path_id;
+@@ -422,7 +418,7 @@ int storvsc_dev_remove(struct hv_device *device)
+ /* Close the channel */
+ vmbus_close(device->channel);
+
+- free_stor_device(stor_device);
++ kfree(stor_device);
+ return 0;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0304-Staging-hv-storvsc-Do-not-aquire-an-unnecessary-r.patch b/patches.suse/staging-hv-staging-next-20110829-0304-Staging-hv-storvsc-Do-not-aquire-an-unnecessary-r.patch
new file mode 100644
index 0000000000..ad545f6a64
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0304-Staging-hv-storvsc-Do-not-aquire-an-unnecessary-r.patch
@@ -0,0 +1,42 @@
+From bdbc49706be445d0f5c16c0add979d52d01a7b2c Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:01 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Do not aquire an unnecessary reference on stor_device
+
+On entry into storvsc_on_io_completion() we have already acquired a reference
+on the stor_device; there is no need to acquire an additional reference here.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 5 +----
+ 1 files changed, 1 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 8c62829..cd38cd6 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -232,9 +232,7 @@ static void storvsc_on_io_completion(struct hv_device *device,
+ struct storvsc_device *stor_device;
+ struct vstor_packet *stor_pkt;
+
+- stor_device = must_get_stor_device(device);
+- if (!stor_device)
+- return;
++ stor_device = (struct storvsc_device *)device->ext;
+
+ stor_pkt = &request->vstor_packet;
+
+@@ -279,7 +277,6 @@ static void storvsc_on_io_completion(struct hv_device *device,
+ wake_up(&stor_device->waiting_to_drain);
+
+
+- put_stor_device(device);
+ }
+
+ static void storvsc_on_receive(struct hv_device *device,
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0305-Staging-hv-storvsc-Rename-must_get_stor_device.patch b/patches.suse/staging-hv-staging-next-20110829-0305-Staging-hv-storvsc-Rename-must_get_stor_device.patch
new file mode 100644
index 0000000000..e5d77f7a24
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0305-Staging-hv-storvsc-Rename-must_get_stor_device.patch
@@ -0,0 +1,50 @@
+From bf49e809986f11c9046239e3d2439b5581f2421b Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:02 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Rename must_get_stor_device()
+
+In preparation for cleaning up how we manage reference counts on the stor
+device, clearly distinguish why we are attempting to acquire a reference.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index cd38cd6..89708b1 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -41,7 +41,7 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ return NULL;
+
+ /* Set to 2 to allow both inbound and outbound traffics */
+- /* (ie get_stor_device() and must_get_stor_device()) to proceed. */
++ /* (ie get_stor_device() and get_in_stor_device()) to proceed. */
+ atomic_cmpxchg(&stor_device->ref_count, 0, 2);
+
+ init_waitqueue_head(&stor_device->waiting_to_drain);
+@@ -53,7 +53,7 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+
+
+ /* Get the stordevice object iff exists and its refcount > 0 */
+-static inline struct storvsc_device *must_get_stor_device(
++static inline struct storvsc_device *get_in_stor_device(
+ struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+@@ -305,7 +305,7 @@ static void storvsc_on_channel_callback(void *context)
+ int ret;
+
+
+- stor_device = must_get_stor_device(device);
++ stor_device = get_in_stor_device(device);
+ if (!stor_device)
+ return;
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0306-Staging-hv-storvsc-Rename-get_stor_device.patch b/patches.suse/staging-hv-staging-next-20110829-0306-Staging-hv-storvsc-Rename-get_stor_device.patch
new file mode 100644
index 0000000000..ba68308b57
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0306-Staging-hv-storvsc-Rename-get_stor_device.patch
@@ -0,0 +1,88 @@
+From 1eaaddf93853b222a08ec37d4d8c4edc1085d312 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:03 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Rename get_stor_device()
+
+In preparation for cleaning up how we manage reference counts on the stor
+device, clearly distinguish why we are attempting to acquire a reference.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv_storage.h | 3 ++-
+ drivers/staging/hv/storvsc.c | 8 ++++----
+ drivers/staging/hv/storvsc_drv.c | 2 +-
+ 3 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/hyperv_storage.h b/drivers/staging/hv/hyperv_storage.h
+index a01f9a0..a224413 100644
+--- a/drivers/staging/hv/hyperv_storage.h
++++ b/drivers/staging/hv/hyperv_storage.h
+@@ -288,7 +288,8 @@ struct storvsc_device {
+
+
+ /* Get the stordevice object iff exists and its refcount > 1 */
+-static inline struct storvsc_device *get_stor_device(struct hv_device *device)
++static inline struct storvsc_device *get_out_stor_device(
++ struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 89708b1..313a3f8 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -41,7 +41,7 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ return NULL;
+
+ /* Set to 2 to allow both inbound and outbound traffics */
+- /* (ie get_stor_device() and get_in_stor_device()) to proceed. */
++ /* (ie get_out_stor_device() and get_in_stor_device()) to proceed. */
+ atomic_cmpxchg(&stor_device->ref_count, 0, 2);
+
+ init_waitqueue_head(&stor_device->waiting_to_drain);
+@@ -67,7 +67,7 @@ static inline struct storvsc_device *get_in_stor_device(
+ return stor_device;
+ }
+
+-/* Drop ref count to 1 to effectively disable get_stor_device() */
++/* Drop ref count to 1 to effectively disable get_out_stor_device() */
+ static inline struct storvsc_device *release_stor_device(
+ struct hv_device *device)
+ {
+@@ -105,7 +105,7 @@ static int storvsc_channel_init(struct hv_device *device)
+ struct vstor_packet *vstor_packet;
+ int ret, t;
+
+- stor_device = get_stor_device(device);
++ stor_device = get_out_stor_device(device);
+ if (!stor_device)
+ return -ENODEV;
+
+@@ -427,7 +427,7 @@ int storvsc_do_io(struct hv_device *device,
+ int ret = 0;
+
+ vstor_packet = &request->vstor_packet;
+- stor_device = get_stor_device(device);
++ stor_device = get_out_stor_device(device);
+
+ if (!stor_device)
+ return -ENODEV;
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index faa8d57..5b2004f 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -344,7 +344,7 @@ static int storvsc_host_reset(struct hv_device *device)
+ int ret, t;
+
+
+- stor_device = get_stor_device(device);
++ stor_device = get_out_stor_device(device);
+ if (!stor_device)
+ return -ENODEV;
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0307-Staging-hv-storvsc-Cleanup-alloc_stor_device.patch b/patches.suse/staging-hv-staging-next-20110829-0307-Staging-hv-storvsc-Cleanup-alloc_stor_device.patch
new file mode 100644
index 0000000000..9ed6c1126e
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0307-Staging-hv-storvsc-Cleanup-alloc_stor_device.patch
@@ -0,0 +1,31 @@
+From df977d6c90632b3868055862262529007019d4ef Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:04 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup alloc_stor_device()
+
+Cleanup alloc_stor_device(), we can set the ref_count directly.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 313a3f8..48bd8da 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -42,7 +42,7 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+
+ /* Set to 2 to allow both inbound and outbound traffics */
+ /* (ie get_out_stor_device() and get_in_stor_device()) to proceed. */
+- atomic_cmpxchg(&stor_device->ref_count, 0, 2);
++ atomic_set(&stor_device->ref_count, 2);
+
+ init_waitqueue_head(&stor_device->waiting_to_drain);
+ stor_device->device = device;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0308-Staging-hv-storvsc-Introduce-state-to-manage-the.patch b/patches.suse/staging-hv-staging-next-20110829-0308-Staging-hv-storvsc-Introduce-state-to-manage-the.patch
new file mode 100644
index 0000000000..1cab557c87
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0308-Staging-hv-storvsc-Introduce-state-to-manage-the.patch
@@ -0,0 +1,62 @@
+From f6c17484eb386014ee52d9edc8b3e8263d57c640 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:05 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Introduce state to manage the lifecycle of stor device
+
+Introduce state to manage the lifecycle of stor device. This would be the
+basis for managing the references on the stor object.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv_storage.h | 2 +-
+ drivers/staging/hv/storvsc.c | 8 +++++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/staging/hv/hyperv_storage.h b/drivers/staging/hv/hyperv_storage.h
+index a224413..d93bf93 100644
+--- a/drivers/staging/hv/hyperv_storage.h
++++ b/drivers/staging/hv/hyperv_storage.h
+@@ -266,7 +266,7 @@ struct storvsc_device {
+
+ /* 0 indicates the device is being destroyed */
+ atomic_t ref_count;
+-
++ bool destroy;
+ bool drain_notify;
+ atomic_t num_outstanding_req;
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 48bd8da..0f8c609 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -43,7 +43,7 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ /* Set to 2 to allow both inbound and outbound traffics */
+ /* (ie get_out_stor_device() and get_in_stor_device()) to proceed. */
+ atomic_set(&stor_device->ref_count, 2);
+-
++ stor_device->destroy = false;
+ init_waitqueue_head(&stor_device->waiting_to_drain);
+ stor_device->device = device;
+ device->ext = stor_device;
+@@ -399,9 +399,15 @@ int storvsc_dev_add(struct hv_device *device,
+ int storvsc_dev_remove(struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
++ unsigned long flags;
++
+
+ stor_device = release_stor_device(device);
+
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
++ stor_device->destroy = true;
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
++
+ /*
+ * At this point, all outbound traffic should be disable. We
+ * only allow inbound traffic (responses) to proceed so that
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0309-Staging-hv-storvsc-Prevent-outgoing-traffic-when.patch b/patches.suse/staging-hv-staging-next-20110829-0309-Staging-hv-storvsc-Prevent-outgoing-traffic-when.patch
new file mode 100644
index 0000000000..ab823ff595
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0309-Staging-hv-storvsc-Prevent-outgoing-traffic-when.patch
@@ -0,0 +1,32 @@
+From 582f445fde4886959deacf93b6dea6817f41ba88 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:06 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Prevent outgoing traffic when stor dev is being destroyed
+
+Prevent outgoing traffic when stor dev is destroyed.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv_storage.h | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/hyperv_storage.h b/drivers/staging/hv/hyperv_storage.h
+index d93bf93..1a59ca0 100644
+--- a/drivers/staging/hv/hyperv_storage.h
++++ b/drivers/staging/hv/hyperv_storage.h
+@@ -294,7 +294,8 @@ static inline struct storvsc_device *get_out_stor_device(
+ struct storvsc_device *stor_device;
+
+ stor_device = (struct storvsc_device *)device->ext;
+- if (stor_device && atomic_read(&stor_device->ref_count) > 1)
++ if (stor_device && (atomic_read(&stor_device->ref_count) > 1) &&
++ !stor_device->destroy)
+ atomic_inc(&stor_device->ref_count);
+ else
+ stor_device = NULL;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0310-Staging-hv-storvsc-Get-rid-of-release_stor_device.patch b/patches.suse/staging-hv-staging-next-20110829-0310-Staging-hv-storvsc-Get-rid-of-release_stor_device.patch
new file mode 100644
index 0000000000..8ad0c6803c
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0310-Staging-hv-storvsc-Get-rid-of-release_stor_device.patch
@@ -0,0 +1,55 @@
+From c352ee8f610bb136d5666b142bff8f48fa7a9289 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:07 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Get rid of release_stor_device() by inlining the code
+
+Get rid of release_stor_device() by inlining the code.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 19 ++-----------------
+ 1 files changed, 2 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 0f8c609..1976a34 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -67,21 +67,6 @@ static inline struct storvsc_device *get_in_stor_device(
+ return stor_device;
+ }
+
+-/* Drop ref count to 1 to effectively disable get_out_stor_device() */
+-static inline struct storvsc_device *release_stor_device(
+- struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+-
+- stor_device = (struct storvsc_device *)device->ext;
+-
+- /* Busy wait until the ref drop to 2, then set it to 1 */
+- while (atomic_cmpxchg(&stor_device->ref_count, 2, 1) != 2)
+- udelay(100);
+-
+- return stor_device;
+-}
+-
+ /* Drop ref count to 0. No one can use stor_device object. */
+ static inline struct storvsc_device *final_release_stor_device(
+ struct hv_device *device)
+@@ -401,8 +386,8 @@ int storvsc_dev_remove(struct hv_device *device)
+ struct storvsc_device *stor_device;
+ unsigned long flags;
+
+-
+- stor_device = release_stor_device(device);
++ stor_device = (struct storvsc_device *)device->ext;
++ atomic_dec(&stor_device->ref_count);
+
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ stor_device->destroy = true;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0311-Staging-hv-storvsc-Get-rid-of-final_release_stor_.patch b/patches.suse/staging-hv-staging-next-20110829-0311-Staging-hv-storvsc-Get-rid-of-final_release_stor_.patch
new file mode 100644
index 0000000000..2640ba8787
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0311-Staging-hv-storvsc-Get-rid-of-final_release_stor_.patch
@@ -0,0 +1,59 @@
+From a5b2359b05925ade4b9a645b9e45a6c4b8fb1ff0 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:08 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Get rid of final_release_stor_device() by inlining code
+
+Get rid of final_release_stor_device() by inlining code.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc.c | 23 ++++++-----------------
+ 1 files changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 1976a34..3e9829f 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -67,22 +67,6 @@ static inline struct storvsc_device *get_in_stor_device(
+ return stor_device;
+ }
+
+-/* Drop ref count to 0. No one can use stor_device object. */
+-static inline struct storvsc_device *final_release_stor_device(
+- struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+-
+- stor_device = (struct storvsc_device *)device->ext;
+-
+- /* Busy wait until the ref drop to 1, then set it to 0 */
+- while (atomic_cmpxchg(&stor_device->ref_count, 1, 0) != 1)
+- udelay(100);
+-
+- device->ext = NULL;
+- return stor_device;
+-}
+-
+ static int storvsc_channel_init(struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+@@ -401,7 +385,12 @@ int storvsc_dev_remove(struct hv_device *device)
+
+ storvsc_wait_to_drain(stor_device);
+
+- stor_device = final_release_stor_device(device);
++ /*
++ * Since we have already drained, we don't need to busy wait
++ * as was done in final_release_stor_device()
++ */
++ atomic_set(&stor_device->ref_count, 0);
++ device->ext = NULL;
+
+ /* Close the channel */
+ vmbus_close(device->channel);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0312-Staging-hv-storvsc-Get-rid-of-the-reference-count.patch b/patches.suse/staging-hv-staging-next-20110829-0312-Staging-hv-storvsc-Get-rid-of-the-reference-count.patch
new file mode 100644
index 0000000000..7798da83d9
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0312-Staging-hv-storvsc-Get-rid-of-the-reference-count.patch
@@ -0,0 +1,182 @@
+From 5e6f4d069f102b6a49433943cf37e3bdc52e2314 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:09 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Get rid of the reference counting in struct storvsc_device
+
+Get rid of the reference counting in struct storvsc_device. We manage the lifecycle with
+the following logic: If the device is marked for destruction, we dot allow any
+outgoing traffic on the device. Incoming traffic is allowed only to drain pending
+outgoing traffic. Note that while the upper level code in Linux deals with outstanding
+I/Os, we may have situations on Hyper-V where some book keeping messages are sent out
+that the upper level Linux code may not be aware of.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv_storage.h | 18 ++----------------
+ drivers/staging/hv/storvsc.c | 33 +++++++++++++++++++++------------
+ drivers/staging/hv/storvsc_drv.c | 1 -
+ 3 files changed, 23 insertions(+), 29 deletions(-)
+
+diff --git a/drivers/staging/hv/hyperv_storage.h b/drivers/staging/hv/hyperv_storage.h
+index 1a59ca0..687cdc5 100644
+--- a/drivers/staging/hv/hyperv_storage.h
++++ b/drivers/staging/hv/hyperv_storage.h
+@@ -264,8 +264,6 @@ struct storvsc_major_info {
+ struct storvsc_device {
+ struct hv_device *device;
+
+- /* 0 indicates the device is being destroyed */
+- atomic_t ref_count;
+ bool destroy;
+ bool drain_notify;
+ atomic_t num_outstanding_req;
+@@ -287,32 +285,20 @@ struct storvsc_device {
+ };
+
+
+-/* Get the stordevice object iff exists and its refcount > 1 */
+ static inline struct storvsc_device *get_out_stor_device(
+ struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+
+ stor_device = (struct storvsc_device *)device->ext;
+- if (stor_device && (atomic_read(&stor_device->ref_count) > 1) &&
+- !stor_device->destroy)
+- atomic_inc(&stor_device->ref_count);
+- else
++
++ if (stor_device && stor_device->destroy)
+ stor_device = NULL;
+
+ return stor_device;
+ }
+
+
+-static inline void put_stor_device(struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+-
+- stor_device = (struct storvsc_device *)device->ext;
+-
+- atomic_dec(&stor_device->ref_count);
+-}
+-
+ static inline void storvsc_wait_to_drain(struct storvsc_device *dev)
+ {
+ dev->drain_notify = true;
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+index 3e9829f..fb7b3ca 100644
+--- a/drivers/staging/hv/storvsc.c
++++ b/drivers/staging/hv/storvsc.c
+@@ -40,9 +40,6 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ if (!stor_device)
+ return NULL;
+
+- /* Set to 2 to allow both inbound and outbound traffics */
+- /* (ie get_out_stor_device() and get_in_stor_device()) to proceed. */
+- atomic_set(&stor_device->ref_count, 2);
+ stor_device->destroy = false;
+ init_waitqueue_head(&stor_device->waiting_to_drain);
+ stor_device->device = device;
+@@ -52,19 +49,31 @@ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ }
+
+
+-/* Get the stordevice object iff exists and its refcount > 0 */
+ static inline struct storvsc_device *get_in_stor_device(
+ struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
++ unsigned long flags;
+
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ stor_device = (struct storvsc_device *)device->ext;
+- if (stor_device && atomic_read(&stor_device->ref_count))
+- atomic_inc(&stor_device->ref_count);
+- else
++
++ if (!stor_device)
++ goto get_in_err;
++
++ /*
++ * If the device is being destroyed; allow incoming
++ * traffic only to cleanup outstanding requests.
++ */
++
++ if (stor_device->destroy &&
++ (atomic_read(&stor_device->num_outstanding_req) == 0))
+ stor_device = NULL;
+
++get_in_err:
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+ return stor_device;
++
+ }
+
+ static int storvsc_channel_init(struct hv_device *device)
+@@ -190,7 +199,6 @@ static int storvsc_channel_init(struct hv_device *device)
+
+
+ cleanup:
+- put_stor_device(device);
+ return ret;
+ }
+
+@@ -303,7 +311,6 @@ static void storvsc_on_channel_callback(void *context)
+ }
+ } while (1);
+
+- put_stor_device(device);
+ return;
+ }
+
+@@ -371,7 +378,6 @@ int storvsc_dev_remove(struct hv_device *device)
+ unsigned long flags;
+
+ stor_device = (struct storvsc_device *)device->ext;
+- atomic_dec(&stor_device->ref_count);
+
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ stor_device->destroy = true;
+@@ -388,9 +394,13 @@ int storvsc_dev_remove(struct hv_device *device)
+ /*
+ * Since we have already drained, we don't need to busy wait
+ * as was done in final_release_stor_device()
++ * Note that we cannot set the ext pointer to NULL until
++ * we have drained - to drain the outgoing packets, we need to
++ * allow incoming packets.
+ */
+- atomic_set(&stor_device->ref_count, 0);
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ device->ext = NULL;
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+
+ /* Close the channel */
+ vmbus_close(device->channel);
+@@ -448,7 +458,6 @@ int storvsc_do_io(struct hv_device *device,
+
+ atomic_inc(&stor_device->num_outstanding_req);
+
+- put_stor_device(device);
+ return ret;
+ }
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 5b2004f..ae74f50 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -378,7 +378,6 @@ static int storvsc_host_reset(struct hv_device *device)
+ */
+
+ cleanup:
+- put_stor_device(device);
+ return ret;
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0313-Staging-hv-netvsc-Inline-the-code-for-free_net_de.patch b/patches.suse/staging-hv-staging-next-20110829-0313-Staging-hv-netvsc-Inline-the-code-for-free_net_de.patch
new file mode 100644
index 0000000000..885cff041a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0313-Staging-hv-netvsc-Inline-the-code-for-free_net_de.patch
@@ -0,0 +1,55 @@
+From 356c4657193c8a5b3aff84fe8cdf5ddc64742801 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:10 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: Inline the code for free_net_device()
+
+Inline the code for free_net_device().
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 12 ++----------
+ 1 files changed, 2 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index b6e1fb9..75c6ed7 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -49,14 +49,6 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ return net_device;
+ }
+
+-static void free_net_device(struct netvsc_device *device)
+-{
+- WARN_ON(atomic_read(&device->refcnt) != 0);
+- device->dev->ext = NULL;
+- kfree(device);
+-}
+-
+-
+ /* Get the net device object iff exists and its refcount > 1 */
+ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
+ {
+@@ -438,7 +430,7 @@ int netvsc_device_remove(struct hv_device *device)
+ kfree(netvsc_packet);
+ }
+
+- free_net_device(net_device);
++ kfree(net_device);
+ return 0;
+ }
+
+@@ -980,7 +972,7 @@ cleanup:
+ release_outbound_net_device(device);
+ release_inbound_net_device(device);
+
+- free_net_device(net_device);
++ kfree(net_device);
+ }
+
+ return ret;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0314-Staging-hv-netvsc-Cleanup-alloc_net_device.patch b/patches.suse/staging-hv-staging-next-20110829-0314-Staging-hv-netvsc-Cleanup-alloc_net_device.patch
new file mode 100644
index 0000000000..b0d377fa91
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0314-Staging-hv-netvsc-Cleanup-alloc_net_device.patch
@@ -0,0 +1,31 @@
+From 509ee3878b8f0f8908892579d679c123084f5ac5 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:11 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup alloc_net_device()
+
+Cleanup alloc_net_device(); we can directly set the refcnt.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 75c6ed7..7722102 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -41,7 +41,7 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ return NULL;
+
+ /* Set to 2 to allow both inbound and outbound traffic */
+- atomic_cmpxchg(&net_device->refcnt, 0, 2);
++ atomic_set(&net_device->refcnt, 2);
+
+ net_device->dev = device;
+ device->ext = net_device;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0315-Staging-hv-netvsc-Introduce-state-to-manage-the-l.patch b/patches.suse/staging-hv-staging-next-20110829-0315-Staging-hv-netvsc-Introduce-state-to-manage-the-l.patch
new file mode 100644
index 0000000000..1e59a465e1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0315-Staging-hv-netvsc-Introduce-state-to-manage-the-l.patch
@@ -0,0 +1,62 @@
+From c38b9c7118b95aa48bfa38d3bcd241dba3d23c10 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:12 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: Introduce state to manage the lifecycle of net device
+
+Introduce state to manage the lifecycle of net device.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv_net.h | 1 +
+ drivers/staging/hv/netvsc.c | 6 ++++++
+ 2 files changed, 7 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/staging/hv/hyperv_net.h b/drivers/staging/hv/hyperv_net.h
+index 5782fea..0b347c1 100644
+--- a/drivers/staging/hv/hyperv_net.h
++++ b/drivers/staging/hv/hyperv_net.h
+@@ -371,6 +371,7 @@ struct netvsc_device {
+
+ atomic_t refcnt;
+ atomic_t num_outstanding_sends;
++ bool destroy;
+ /*
+ * List of free preallocated hv_netvsc_packet to represent receive
+ * packet
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 7722102..8eb4039 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -43,6 +43,7 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ /* Set to 2 to allow both inbound and outbound traffic */
+ atomic_set(&net_device->refcnt, 2);
+
++ net_device->destroy = false;
+ net_device->dev = device;
+ device->ext = net_device;
+
+@@ -396,6 +397,7 @@ int netvsc_device_remove(struct hv_device *device)
+ {
+ struct netvsc_device *net_device;
+ struct hv_netvsc_packet *netvsc_packet, *pos;
++ unsigned long flags;
+
+ /* Stop outbound traffic ie sends and receives completions */
+ net_device = release_outbound_net_device(device);
+@@ -404,6 +406,10 @@ int netvsc_device_remove(struct hv_device *device)
+ return -ENODEV;
+ }
+
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
++ net_device->destroy = true;
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
++
+ /* Wait for all send completions */
+ while (atomic_read(&net_device->num_outstanding_sends)) {
+ dev_err(&device->device,
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0316-Staging-hv-netvsc-Prevent-outgoing-traffic-when-n.patch b/patches.suse/staging-hv-staging-next-20110829-0316-Staging-hv-netvsc-Prevent-outgoing-traffic-when-n.patch
new file mode 100644
index 0000000000..8935428db5
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0316-Staging-hv-netvsc-Prevent-outgoing-traffic-when-n.patch
@@ -0,0 +1,32 @@
+From 2ef7714397cd49dc378e20afa6dd19306e5f2b5e Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:13 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: Prevent outgoing traffic when netvsc dev is destroyed
+
+Prevent outgoing traffic when netvsc dev is destroyed.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 8eb4039..67065c1 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -56,7 +56,8 @@ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
+ struct netvsc_device *net_device;
+
+ net_device = device->ext;
+- if (net_device && atomic_read(&net_device->refcnt) > 1)
++ if (net_device && (atomic_read(&net_device->refcnt) > 1) &&
++ !net_device->destroy)
+ atomic_inc(&net_device->refcnt);
+ else
+ net_device = NULL;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0317-Staging-hv-netvsc-Get-rid-of-release_outbound_net.patch b/patches.suse/staging-hv-staging-next-20110829-0317-Staging-hv-netvsc-Get-rid-of-release_outbound_net.patch
new file mode 100644
index 0000000000..8db2c86c43
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0317-Staging-hv-netvsc-Get-rid-of-release_outbound_net.patch
@@ -0,0 +1,88 @@
+From 3852409b88e8ec2a8abb28db5be25a7503297208 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:14 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: Get rid of release_outbound_net_device() by inlining the code
+
+Get rid of release_outbound_net_device() by inlining the code.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 38 ++++++++++++++------------------------
+ 1 files changed, 14 insertions(+), 24 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 67065c1..e46161d 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -88,22 +88,6 @@ static void put_net_device(struct hv_device *device)
+ atomic_dec(&net_device->refcnt);
+ }
+
+-static struct netvsc_device *release_outbound_net_device(
+- struct hv_device *device)
+-{
+- struct netvsc_device *net_device;
+-
+- net_device = device->ext;
+- if (net_device == NULL)
+- return NULL;
+-
+- /* Busy wait until the ref drop to 2, then set it to 1 */
+- while (atomic_cmpxchg(&net_device->refcnt, 2, 1) != 2)
+- udelay(100);
+-
+- return net_device;
+-}
+-
+ static struct netvsc_device *release_inbound_net_device(
+ struct hv_device *device)
+ {
+@@ -400,13 +384,8 @@ int netvsc_device_remove(struct hv_device *device)
+ struct hv_netvsc_packet *netvsc_packet, *pos;
+ unsigned long flags;
+
+- /* Stop outbound traffic ie sends and receives completions */
+- net_device = release_outbound_net_device(device);
+- if (!net_device) {
+- dev_err(&device->device, "No net device present!!");
+- return -ENODEV;
+- }
+-
++ net_device = (struct netvsc_device *)device->ext;
++ atomic_dec(&net_device->refcnt);
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ net_device->destroy = true;
+ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+@@ -424,6 +403,18 @@ int netvsc_device_remove(struct hv_device *device)
+ /* Stop inbound traffic ie receives and sends completions */
+ net_device = release_inbound_net_device(device);
+
++ /*
++ * Wait until the ref cnt falls to 0.
++ * We have already stopped any new references
++ * for outgoing traffic. Also, at this point we don't have any
++ * incoming traffic as well. So this must be outgoing refrences
++ * established prior to marking the device as being destroyed.
++ * Since the send path is non-blocking, it is reasonable to busy
++ * wait here.
++ */
++ while (atomic_read(&net_device->refcnt))
++ udelay(100);
++
+ /* At this point, no one should be accessing netDevice except in here */
+ dev_notice(&device->device, "net device safe to remove");
+
+@@ -976,7 +967,6 @@ cleanup:
+ kfree(packet);
+ }
+
+- release_outbound_net_device(device);
+ release_inbound_net_device(device);
+
+ kfree(net_device);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0318-Staging-hv-netvsc-Get-rid-of-release_inbound_net_.patch b/patches.suse/staging-hv-staging-next-20110829-0318-Staging-hv-netvsc-Get-rid-of-release_inbound_net_.patch
new file mode 100644
index 0000000000..47471c68d6
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0318-Staging-hv-netvsc-Get-rid-of-release_inbound_net_.patch
@@ -0,0 +1,67 @@
+From 124f506dc1bbfc79c32dd17566f09ef51f7cf863 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:15 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: Get rid of release_inbound_net_device() by inlining the code
+
+Get rid of release_inbound_net_device() by inlining the code.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 24 ++----------------------
+ 1 files changed, 2 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index e46161d..388f083 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -88,23 +88,6 @@ static void put_net_device(struct hv_device *device)
+ atomic_dec(&net_device->refcnt);
+ }
+
+-static struct netvsc_device *release_inbound_net_device(
+- struct hv_device *device)
+-{
+- struct netvsc_device *net_device;
+-
+- net_device = device->ext;
+- if (net_device == NULL)
+- return NULL;
+-
+- /* Busy wait until the ref drop to 1, then set it to 0 */
+- while (atomic_cmpxchg(&net_device->refcnt, 1, 0) != 1)
+- udelay(100);
+-
+- device->ext = NULL;
+- return net_device;
+-}
+-
+ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
+ {
+ struct nvsp_message *revoke_packet;
+@@ -400,9 +383,8 @@ int netvsc_device_remove(struct hv_device *device)
+
+ netvsc_disconnect_vsp(net_device);
+
+- /* Stop inbound traffic ie receives and sends completions */
+- net_device = release_inbound_net_device(device);
+-
++ atomic_dec(&net_device->refcnt);
++ device->ext = NULL;
+ /*
+ * Wait until the ref cnt falls to 0.
+ * We have already stopped any new references
+@@ -967,8 +949,6 @@ cleanup:
+ kfree(packet);
+ }
+
+- release_inbound_net_device(device);
+-
+ kfree(net_device);
+ }
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0319-Staging-hv-netvsc-Get-rid-of-the-refcnt-field-in.patch b/patches.suse/staging-hv-staging-next-20110829-0319-Staging-hv-netvsc-Get-rid-of-the-refcnt-field-in.patch
new file mode 100644
index 0000000000..31ccb86d8c
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0319-Staging-hv-netvsc-Get-rid-of-the-refcnt-field-in.patch
@@ -0,0 +1,229 @@
+From 9d88f33a1530f4241227226e7479d36ac959e9ce Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:16 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: Get rid of the refcnt field in struct netvsc_device
+
+Get rid of the refcnt field in struct netvsc_device. We implement the following
+logic to manage the life cycle of the device: If the device is being destroyed,
+we do not allow any outgoing traffic. Furthermore, if the device is being
+destroyed, we allow incoming traffic only to drain outgoing traffic. Note that
+the driver may send some book keeping messages to the host not known to
+upper level Linux code.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv_net.h | 1 -
+ drivers/staging/hv/netvsc.c | 62 ++++++++++++--------------------------
+ 2 files changed, 20 insertions(+), 43 deletions(-)
+
+diff --git a/drivers/staging/hv/hyperv_net.h b/drivers/staging/hv/hyperv_net.h
+index 0b347c1..af8a37f 100644
+--- a/drivers/staging/hv/hyperv_net.h
++++ b/drivers/staging/hv/hyperv_net.h
+@@ -369,7 +369,6 @@ struct nvsp_message {
+ struct netvsc_device {
+ struct hv_device *dev;
+
+- atomic_t refcnt;
+ atomic_t num_outstanding_sends;
+ bool destroy;
+ /*
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 388f083..9828f0b 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -40,8 +40,6 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ if (!net_device)
+ return NULL;
+
+- /* Set to 2 to allow both inbound and outbound traffic */
+- atomic_set(&net_device->refcnt, 2);
+
+ net_device->destroy = false;
+ net_device->dev = device;
+@@ -50,43 +48,37 @@ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ return net_device;
+ }
+
+-/* Get the net device object iff exists and its refcount > 1 */
+ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
+ {
+ struct netvsc_device *net_device;
+
+ net_device = device->ext;
+- if (net_device && (atomic_read(&net_device->refcnt) > 1) &&
+- !net_device->destroy)
+- atomic_inc(&net_device->refcnt);
+- else
++ if (net_device && net_device->destroy)
+ net_device = NULL;
+
+ return net_device;
+ }
+
+-/* Get the net device object iff exists and its refcount > 0 */
+ static struct netvsc_device *get_inbound_net_device(struct hv_device *device)
+ {
+ struct netvsc_device *net_device;
++ unsigned long flags;
+
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ net_device = device->ext;
+- if (net_device && atomic_read(&net_device->refcnt))
+- atomic_inc(&net_device->refcnt);
+- else
++
++ if (!net_device)
++ goto get_in_err;
++
++ if (net_device->destroy &&
++ atomic_read(&net_device->num_outstanding_sends) == 0)
+ net_device = NULL;
+
++get_in_err:
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+ return net_device;
+ }
+
+-static void put_net_device(struct hv_device *device)
+-{
+- struct netvsc_device *net_device;
+-
+- net_device = device->ext;
+-
+- atomic_dec(&net_device->refcnt);
+-}
+
+ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
+ {
+@@ -268,7 +260,6 @@ cleanup:
+ netvsc_destroy_recv_buf(net_device);
+
+ exit:
+- put_net_device(device);
+ return ret;
+ }
+
+@@ -349,7 +340,6 @@ static int netvsc_connect_vsp(struct hv_device *device)
+ ret = netvsc_init_recv_buf(device);
+
+ cleanup:
+- put_net_device(device);
+ return ret;
+ }
+
+@@ -368,7 +358,6 @@ int netvsc_device_remove(struct hv_device *device)
+ unsigned long flags;
+
+ net_device = (struct netvsc_device *)device->ext;
+- atomic_dec(&net_device->refcnt);
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ net_device->destroy = true;
+ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+@@ -383,19 +372,17 @@ int netvsc_device_remove(struct hv_device *device)
+
+ netvsc_disconnect_vsp(net_device);
+
+- atomic_dec(&net_device->refcnt);
+- device->ext = NULL;
+ /*
+- * Wait until the ref cnt falls to 0.
+- * We have already stopped any new references
+- * for outgoing traffic. Also, at this point we don't have any
+- * incoming traffic as well. So this must be outgoing refrences
+- * established prior to marking the device as being destroyed.
+- * Since the send path is non-blocking, it is reasonable to busy
+- * wait here.
++ * Since we have already drained, we don't need to busy wait
++ * as was done in final_release_stor_device()
++ * Note that we cannot set the ext pointer to NULL until
++ * we have drained - to drain the outgoing packets, we need to
++ * allow incoming packets.
+ */
+- while (atomic_read(&net_device->refcnt))
+- udelay(100);
++
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
++ device->ext = NULL;
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+
+ /* At this point, no one should be accessing netDevice except in here */
+ dev_notice(&device->device, "net device safe to remove");
+@@ -456,7 +443,6 @@ static void netvsc_send_completion(struct hv_device *device,
+ "%d received!!", nvsp_packet->hdr.msg_type);
+ }
+
+- put_net_device(device);
+ }
+
+ int netvsc_send(struct hv_device *device,
+@@ -509,7 +495,6 @@ int netvsc_send(struct hv_device *device,
+ packet, ret);
+
+ atomic_inc(&net_device->num_outstanding_sends);
+- put_net_device(device);
+ return ret;
+ }
+
+@@ -602,7 +587,6 @@ static void netvsc_receive_completion(void *context)
+ if (fsend_receive_comp)
+ netvsc_send_recv_completion(device, transaction_id);
+
+- put_net_device(device);
+ }
+
+ static void netvsc_receive(struct hv_device *device,
+@@ -636,7 +620,6 @@ static void netvsc_receive(struct hv_device *device,
+ if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) {
+ dev_err(&device->device, "Unknown packet type received - %d",
+ packet->type);
+- put_net_device(device);
+ return;
+ }
+
+@@ -648,7 +631,6 @@ static void netvsc_receive(struct hv_device *device,
+ NVSP_MSG1_TYPE_SEND_RNDIS_PKT) {
+ dev_err(&device->device, "Unknown nvsp packet type received-"
+ " %d", nvsp_packet->hdr.msg_type);
+- put_net_device(device);
+ return;
+ }
+
+@@ -658,7 +640,6 @@ static void netvsc_receive(struct hv_device *device,
+ dev_err(&device->device, "Invalid xfer page set id - "
+ "expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID,
+ vmxferpage_packet->xfer_pageset_id);
+- put_net_device(device);
+ return;
+ }
+
+@@ -698,7 +679,6 @@ static void netvsc_receive(struct hv_device *device,
+ netvsc_send_recv_completion(device,
+ vmxferpage_packet->d.trans_id);
+
+- put_net_device(device);
+ return;
+ }
+
+@@ -786,7 +766,6 @@ static void netvsc_receive(struct hv_device *device,
+ completion.recv.recv_completion_ctx);
+ }
+
+- put_net_device(device);
+ }
+
+ static void netvsc_channel_cb(void *context)
+@@ -869,7 +848,6 @@ static void netvsc_channel_cb(void *context)
+ }
+ } while (1);
+
+- put_net_device(device);
+ out:
+ kfree(buffer);
+ return;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0320-Staging-hv-storvsc-Add-code-to-handle-IDE-devices.patch b/patches.suse/staging-hv-staging-next-20110829-0320-Staging-hv-storvsc-Add-code-to-handle-IDE-devices.patch
new file mode 100644
index 0000000000..9b8b2d487d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0320-Staging-hv-storvsc-Add-code-to-handle-IDE-devices.patch
@@ -0,0 +1,122 @@
+From bd1f5d6a0098debce610dc23729ebff691a5c3f5 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:17 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Add code to handle IDE devices using the storvsc driver
+
+Add code to handle IDE devices using the storvsc driver. The storvsc_probe()
+is modified so that the storvsc driver can surface all disks presented to the
+guest as scsi devices using generic upper level Linux scsi drivers.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 60 ++++++++++++++++++++++++++++++++-----
+ 1 files changed, 52 insertions(+), 8 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index ae74f50..f434200 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -59,6 +59,17 @@ struct storvsc_cmd_request {
+ struct hv_storvsc_request request;
+ };
+
++static void storvsc_get_ide_info(struct hv_device *dev, int *target, int *path)
++{
++ *target =
++ dev->dev_instance.b[5] << 8 | dev->dev_instance.b[4];
++
++ *path =
++ dev->dev_instance.b[3] << 24 |
++ dev->dev_instance.b[2] << 16 |
++ dev->dev_instance.b[1] << 8 | dev->dev_instance.b[0];
++}
++
+
+ static int storvsc_device_alloc(struct scsi_device *sdevice)
+ {
+@@ -642,6 +653,20 @@ static const struct hv_vmbus_device_id id_table[] = {
+ };
+
+ MODULE_DEVICE_TABLE(vmbus, id_table);
++
++/*
++ * This declaration is temporary; once we get the
++ * infrastructure in place, we will integrate with
++ * id_table.
++ */
++
++static const uuid_le ide_blk_guid = {
++ .b = {
++ 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
++ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
++ }
++};
++
+ /*
+ * storvsc_probe - Add a new device for this driver
+ */
+@@ -652,6 +677,14 @@ static int storvsc_probe(struct hv_device *device)
+ struct Scsi_Host *host;
+ struct hv_host_device *host_dev;
+ struct storvsc_device_info device_info;
++ bool dev_is_ide;
++ int path = 0;
++ int target = 0;
++
++ if (!uuid_le_cmp(device->dev_type, ide_blk_guid))
++ dev_is_ide = true;
++ else
++ dev_is_ide = false;
+
+ host = scsi_host_alloc(&scsi_driver,
+ sizeof(struct hv_host_device));
+@@ -687,6 +720,9 @@ static int storvsc_probe(struct hv_device *device)
+ return -ENODEV;
+ }
+
++ if (dev_is_ide)
++ storvsc_get_ide_info(device, &target, &path);
++
+ host_dev->path = device_info.path_id;
+ host_dev->target = device_info.target_id;
+
+@@ -699,17 +735,25 @@ static int storvsc_probe(struct hv_device *device)
+
+ /* Register the HBA and start the scsi bus scan */
+ ret = scsi_add_host(host, &device->device);
+- if (ret != 0) {
+-
+- storvsc_dev_remove(device);
++ if (ret != 0)
++ goto err_out;
+
+- kmem_cache_destroy(host_dev->request_pool);
+- scsi_host_put(host);
+- return -ENODEV;
++ if (!dev_is_ide) {
++ scsi_scan_host(host);
++ return 0;
++ }
++ ret = scsi_add_device(host, 0, target, 0);
++ if (ret) {
++ scsi_remove_host(host);
++ goto err_out;
+ }
++ return 0;
+
+- scsi_scan_host(host);
+- return ret;
++err_out:
++ storvsc_dev_remove(device);
++ kmem_cache_destroy(host_dev->request_pool);
++ scsi_host_put(host);
++ return -ENODEV;
+ }
+
+ /* The one and only one */
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0321-Staging-hv-storvsc-Handle-IDE-devices-using-the-s.patch b/patches.suse/staging-hv-staging-next-20110829-0321-Staging-hv-storvsc-Handle-IDE-devices-using-the-s.patch
new file mode 100644
index 0000000000..3af31ca6bf
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0321-Staging-hv-storvsc-Handle-IDE-devices-using-the-s.patch
@@ -0,0 +1,106 @@
+From 21e37742361fe408d534c004b6e39717cb6b5999 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:18 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Handle IDE devices using the storvsc driver
+
+Now, enable handling of all IDE devices by extending the storvsc
+device id table to handle IDE guid. As part of this cleanup Kconfig
+and Hyper-V Makefile to not build the IDE driver (blkvsc).
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/Kconfig | 7 -------
+ drivers/staging/hv/Makefile | 2 --
+ drivers/staging/hv/storvsc_drv.c | 21 ++++++++-------------
+ 3 files changed, 8 insertions(+), 22 deletions(-)
+
+diff --git a/drivers/staging/hv/Kconfig b/drivers/staging/hv/Kconfig
+index 5e0c9f6..26b5064 100644
+--- a/drivers/staging/hv/Kconfig
++++ b/drivers/staging/hv/Kconfig
+@@ -15,13 +15,6 @@ config HYPERV_STORAGE
+ help
+ Select this option to enable the Hyper-V virtual storage driver.
+
+-config HYPERV_BLOCK
+- tristate "Microsoft Hyper-V virtual block driver"
+- depends on BLOCK && SCSI && (LBDAF || 64BIT)
+- default HYPERV
+- help
+- Select this option to enable the Hyper-V virtual block driver.
+-
+ config HYPERV_NET
+ tristate "Microsoft Hyper-V virtual network driver"
+ depends on NET
+diff --git a/drivers/staging/hv/Makefile b/drivers/staging/hv/Makefile
+index 3004674..bb89437 100644
+--- a/drivers/staging/hv/Makefile
++++ b/drivers/staging/hv/Makefile
+@@ -1,6 +1,5 @@
+ obj-$(CONFIG_HYPERV) += hv_vmbus.o hv_timesource.o
+ obj-$(CONFIG_HYPERV_STORAGE) += hv_storvsc.o
+-obj-$(CONFIG_HYPERV_BLOCK) += hv_blkvsc.o
+ obj-$(CONFIG_HYPERV_NET) += hv_netvsc.o
+ obj-$(CONFIG_HYPERV_UTILS) += hv_utils.o
+ obj-$(CONFIG_HYPERV_MOUSE) += hv_mouse.o
+@@ -9,6 +8,5 @@ hv_vmbus-y := vmbus_drv.o \
+ hv.o connection.o channel.o \
+ channel_mgmt.o ring_buffer.o
+ hv_storvsc-y := storvsc_drv.o storvsc.o
+-hv_blkvsc-y := blkvsc_drv.o storvsc.o
+ hv_netvsc-y := netvsc_drv.o netvsc.o rndis_filter.o
+ hv_utils-y := hv_util.o hv_kvp.o
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index f434200..9464f99 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -645,27 +645,22 @@ static struct scsi_host_template scsi_driver = {
+ .dma_boundary = PAGE_SIZE-1,
+ };
+
++/*
++ * The storvsc_probe function assumes that the IDE guid
++ * is the second entry.
++ */
+ static const struct hv_vmbus_device_id id_table[] = {
+ /* SCSI guid */
+ { VMBUS_DEVICE(0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f) },
++ /* IDE guid */
++ { VMBUS_DEVICE(0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
++ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5) },
+ { },
+ };
+
+ MODULE_DEVICE_TABLE(vmbus, id_table);
+
+-/*
+- * This declaration is temporary; once we get the
+- * infrastructure in place, we will integrate with
+- * id_table.
+- */
+-
+-static const uuid_le ide_blk_guid = {
+- .b = {
+- 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+- 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
+- }
+-};
+
+ /*
+ * storvsc_probe - Add a new device for this driver
+@@ -681,7 +676,7 @@ static int storvsc_probe(struct hv_device *device)
+ int path = 0;
+ int target = 0;
+
+- if (!uuid_le_cmp(device->dev_type, ide_blk_guid))
++ if (!memcmp(&device->dev_type.b, id_table[1].guid, sizeof(uuid_le)))
+ dev_is_ide = true;
+ else
+ dev_is_ide = false;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0322-Staging-hv-blkvsc-Get-rid-of-blkvsc_drv.c-as-this.patch b/patches.suse/staging-hv-staging-next-20110829-0322-Staging-hv-blkvsc-Get-rid-of-blkvsc_drv.c-as-this.patch
new file mode 100644
index 0000000000..01af9c50c8
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0322-Staging-hv-blkvsc-Get-rid-of-blkvsc_drv.c-as-this.patch
@@ -0,0 +1,1039 @@
+From b38cc43432d7b7b0a4dc0a13d261a85944fc7c65 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:19 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: blkvsc: Get rid of blkvsc_drv.c as this code is not used
+
+Now that blkvsc driver is no longer needed, remove blkvsc_drv.c
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/blkvsc_drv.c | 1014 ---------------------------------------
+ 1 files changed, 0 insertions(+), 1014 deletions(-)
+ delete mode 100644 drivers/staging/hv/blkvsc_drv.c
+
+diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
+deleted file mode 100644
+index 2b41eb6..0000000
+--- a/drivers/staging/hv/blkvsc_drv.c
++++ /dev/null
+@@ -1,1014 +0,0 @@
+-/*
+- * Copyright (c) 2009, Microsoft Corporation.
+- *
+- * This program is free software; you can redistribute it and/or modify it
+- * under the terms and conditions of the GNU General Public License,
+- * version 2, as published by the Free Software Foundation.
+- *
+- * This program is distributed in the hope it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+- * more details.
+- *
+- * You should have received a copy of the GNU General Public License along with
+- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+- * Place - Suite 330, Boston, MA 02111-1307 USA.
+- *
+- * Authors:
+- * Haiyang Zhang <haiyangz@microsoft.com>
+- * Hank Janssen <hjanssen@microsoft.com>
+- * K. Y. Srinivasan <kys@microsoft.com>
+- */
+-#include <linux/init.h>
+-#include <linux/module.h>
+-#include <linux/device.h>
+-#include <linux/blkdev.h>
+-#include <linux/major.h>
+-#include <linux/delay.h>
+-#include <linux/hdreg.h>
+-#include <linux/slab.h>
+-#include <scsi/scsi.h>
+-#include <scsi/scsi_cmnd.h>
+-#include <scsi/scsi_eh.h>
+-#include <scsi/scsi_dbg.h>
+-
+-#include "hyperv.h"
+-#include "hyperv_storage.h"
+-
+-
+-#define BLKVSC_MINORS 64
+-
+-enum blkvsc_device_type {
+- UNKNOWN_DEV_TYPE,
+- HARDDISK_TYPE,
+- DVD_TYPE,
+-};
+-
+-enum blkvsc_op_type {
+- DO_INQUIRY,
+- DO_CAPACITY,
+- DO_FLUSH,
+-};
+-
+-/*
+- * This request ties the struct request and struct
+- * blkvsc_request/hv_storvsc_request together A struct request may be
+- * represented by 1 or more struct blkvsc_request
+- */
+-struct blkvsc_request_group {
+- int outstanding;
+- int status;
+- struct list_head blkvsc_req_list; /* list of blkvsc_requests */
+-};
+-
+-struct blkvsc_request {
+- /* blkvsc_request_group.blkvsc_req_list */
+- struct list_head req_entry;
+-
+- /* block_device_context.pending_list */
+- struct list_head pend_entry;
+-
+- /* This may be null if we generate a request internally */
+- struct request *req;
+-
+- struct block_device_context *dev;
+-
+- /* The group this request is part of. Maybe null */
+- struct blkvsc_request_group *group;
+-
+- int write;
+- sector_t sector_start;
+- unsigned long sector_count;
+-
+- unsigned char sense_buffer[SCSI_SENSE_BUFFERSIZE];
+- unsigned char cmd_len;
+- unsigned char cmnd[MAX_COMMAND_SIZE];
+-
+- struct hv_storvsc_request request;
+-};
+-
+-/* Per device structure */
+-struct block_device_context {
+- /* point back to our device context */
+- struct hv_device *device_ctx;
+- struct kmem_cache *request_pool;
+- spinlock_t lock;
+- struct gendisk *gd;
+- enum blkvsc_device_type device_type;
+- struct list_head pending_list;
+-
+- unsigned char device_id[64];
+- unsigned int device_id_len;
+- int num_outstanding_reqs;
+- int shutting_down;
+- unsigned int sector_size;
+- sector_t capacity;
+- unsigned int port;
+- unsigned char path;
+- unsigned char target;
+- int users;
+-};
+-
+-
+-/*
+- * There is a circular dependency involving blkvsc_request_completion()
+- * and blkvsc_do_request().
+- */
+-static void blkvsc_request_completion(struct hv_storvsc_request *request);
+-
+-static int blkvsc_ringbuffer_size = BLKVSC_RING_BUFFER_SIZE;
+-
+-module_param(blkvsc_ringbuffer_size, int, S_IRUGO);
+-MODULE_PARM_DESC(ring_size, "Ring buffer size (in bytes)");
+-
+-/*
+- * There is a circular dependency involving blkvsc_probe()
+- * and block_ops.
+- */
+-static int blkvsc_probe(struct hv_device *dev);
+-
+-static int blkvsc_device_add(struct hv_device *device,
+- void *additional_info)
+-{
+- struct storvsc_device_info *device_info;
+- int ret = 0;
+-
+- device_info = (struct storvsc_device_info *)additional_info;
+-
+- device_info->ring_buffer_size = blkvsc_ringbuffer_size;
+-
+- ret = storvsc_dev_add(device, additional_info);
+- if (ret != 0)
+- return ret;
+-
+- /*
+- * We need to use the device instance guid to set the path and target
+- * id. For IDE devices, the device instance id is formatted as
+- * <bus id> * - <device id> - 8899 - 000000000000.
+- */
+- device_info->path_id = device->dev_instance.b[3] << 24 |
+- device->dev_instance.b[2] << 16 |
+- device->dev_instance.b[1] << 8 |
+- device->dev_instance.b[0];
+-
+- device_info->target_id = device->dev_instance.b[5] << 8 |
+- device->dev_instance.b[4];
+-
+- return ret;
+-}
+-
+-static int blkvsc_submit_request(struct blkvsc_request *blkvsc_req,
+- void (*request_completion)(struct hv_storvsc_request *))
+-{
+- struct block_device_context *blkdev = blkvsc_req->dev;
+- struct hv_storvsc_request *storvsc_req;
+- struct vmscsi_request *vm_srb;
+- int ret;
+-
+-
+- storvsc_req = &blkvsc_req->request;
+- vm_srb = &storvsc_req->vstor_packet.vm_srb;
+-
+- vm_srb->data_in = blkvsc_req->write ? WRITE_TYPE : READ_TYPE;
+-
+- storvsc_req->on_io_completion = request_completion;
+- storvsc_req->context = blkvsc_req;
+-
+- vm_srb->port_number = blkdev->port;
+- vm_srb->path_id = blkdev->path;
+- vm_srb->target_id = blkdev->target;
+- vm_srb->lun = 0; /* this is not really used at all */
+-
+- vm_srb->cdb_length = blkvsc_req->cmd_len;
+-
+- memcpy(vm_srb->cdb, blkvsc_req->cmnd, vm_srb->cdb_length);
+-
+- storvsc_req->sense_buffer = blkvsc_req->sense_buffer;
+-
+- ret = storvsc_do_io(blkdev->device_ctx,
+- &blkvsc_req->request);
+- if (ret == 0)
+- blkdev->num_outstanding_reqs++;
+-
+- return ret;
+-}
+-
+-
+-static int blkvsc_open(struct block_device *bdev, fmode_t mode)
+-{
+- struct block_device_context *blkdev = bdev->bd_disk->private_data;
+- unsigned long flags;
+-
+- spin_lock_irqsave(&blkdev->lock, flags);
+-
+- blkdev->users++;
+-
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-
+- return 0;
+-}
+-
+-
+-static int blkvsc_getgeo(struct block_device *bd, struct hd_geometry *hg)
+-{
+- sector_t nsect = get_capacity(bd->bd_disk);
+- sector_t cylinders = nsect;
+-
+- /*
+- * We are making up these values; let us keep it simple.
+- */
+- hg->heads = 0xff;
+- hg->sectors = 0x3f;
+- sector_div(cylinders, hg->heads * hg->sectors);
+- hg->cylinders = cylinders;
+- if ((sector_t)(hg->cylinders + 1) * hg->heads * hg->sectors < nsect)
+- hg->cylinders = 0xffff;
+- return 0;
+-
+-}
+-
+-
+-static void blkvsc_init_rw(struct blkvsc_request *blkvsc_req)
+-{
+-
+- blkvsc_req->cmd_len = 16;
+-
+- if (rq_data_dir(blkvsc_req->req)) {
+- blkvsc_req->write = 1;
+- blkvsc_req->cmnd[0] = WRITE_16;
+- } else {
+- blkvsc_req->write = 0;
+- blkvsc_req->cmnd[0] = READ_16;
+- }
+-
+- blkvsc_req->cmnd[1] |=
+- (blkvsc_req->req->cmd_flags & REQ_FUA) ? 0x8 : 0;
+-
+- *(unsigned long long *)&blkvsc_req->cmnd[2] =
+- cpu_to_be64(blkvsc_req->sector_start);
+- *(unsigned int *)&blkvsc_req->cmnd[10] =
+- cpu_to_be32(blkvsc_req->sector_count);
+-}
+-
+-
+-static int blkvsc_ioctl(struct block_device *bd, fmode_t mode,
+- unsigned cmd, unsigned long arg)
+-{
+- struct block_device_context *blkdev = bd->bd_disk->private_data;
+- int ret = 0;
+-
+- switch (cmd) {
+- case HDIO_GET_IDENTITY:
+- if (copy_to_user((void __user *)arg, blkdev->device_id,
+- blkdev->device_id_len))
+- ret = -EFAULT;
+- break;
+- default:
+- ret = -EINVAL;
+- break;
+- }
+-
+- return ret;
+-}
+-
+-static void blkvsc_cmd_completion(struct hv_storvsc_request *request)
+-{
+- struct blkvsc_request *blkvsc_req =
+- (struct blkvsc_request *)request->context;
+- struct block_device_context *blkdev =
+- (struct block_device_context *)blkvsc_req->dev;
+- struct scsi_sense_hdr sense_hdr;
+- struct vmscsi_request *vm_srb;
+- unsigned long flags;
+-
+-
+- vm_srb = &blkvsc_req->request.vstor_packet.vm_srb;
+-
+- spin_lock_irqsave(&blkdev->lock, flags);
+- blkdev->num_outstanding_reqs--;
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-
+- if (vm_srb->scsi_status)
+- if (scsi_normalize_sense(blkvsc_req->sense_buffer,
+- SCSI_SENSE_BUFFERSIZE, &sense_hdr))
+- scsi_print_sense_hdr("blkvsc", &sense_hdr);
+-
+- complete(&blkvsc_req->request.wait_event);
+-}
+-
+-
+-static int blkvsc_do_operation(struct block_device_context *blkdev,
+- enum blkvsc_op_type op)
+-{
+- struct blkvsc_request *blkvsc_req;
+- struct page *page_buf;
+- unsigned char *buf;
+- unsigned char device_type;
+- struct scsi_sense_hdr sense_hdr;
+- struct vmscsi_request *vm_srb;
+- unsigned long flags;
+-
+- int ret = 0;
+-
+- blkvsc_req = kmem_cache_zalloc(blkdev->request_pool, GFP_KERNEL);
+- if (!blkvsc_req)
+- return -ENOMEM;
+-
+- page_buf = alloc_page(GFP_KERNEL);
+- if (!page_buf) {
+- kmem_cache_free(blkdev->request_pool, blkvsc_req);
+- return -ENOMEM;
+- }
+-
+- vm_srb = &blkvsc_req->request.vstor_packet.vm_srb;
+- init_completion(&blkvsc_req->request.wait_event);
+- blkvsc_req->dev = blkdev;
+- blkvsc_req->req = NULL;
+- blkvsc_req->write = 0;
+-
+- blkvsc_req->request.data_buffer.pfn_array[0] =
+- page_to_pfn(page_buf);
+- blkvsc_req->request.data_buffer.offset = 0;
+-
+- switch (op) {
+- case DO_INQUIRY:
+- blkvsc_req->cmnd[0] = INQUIRY;
+- blkvsc_req->cmnd[1] = 0x1; /* Get product data */
+- blkvsc_req->cmnd[2] = 0x83; /* mode page 83 */
+- blkvsc_req->cmnd[4] = 64;
+- blkvsc_req->cmd_len = 6;
+- blkvsc_req->request.data_buffer.len = 64;
+- break;
+-
+- case DO_CAPACITY:
+- blkdev->sector_size = 0;
+- blkdev->capacity = 0;
+-
+- blkvsc_req->cmnd[0] = READ_CAPACITY;
+- blkvsc_req->cmd_len = 16;
+- blkvsc_req->request.data_buffer.len = 8;
+- break;
+-
+- case DO_FLUSH:
+- blkvsc_req->cmnd[0] = SYNCHRONIZE_CACHE;
+- blkvsc_req->cmd_len = 10;
+- blkvsc_req->request.data_buffer.pfn_array[0] = 0;
+- blkvsc_req->request.data_buffer.len = 0;
+- break;
+- default:
+- ret = -EINVAL;
+- goto cleanup;
+- }
+-
+- spin_lock_irqsave(&blkdev->lock, flags);
+- blkvsc_submit_request(blkvsc_req, blkvsc_cmd_completion);
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-
+- wait_for_completion_interruptible(&blkvsc_req->request.wait_event);
+-
+- /* check error */
+- if (vm_srb->scsi_status) {
+- scsi_normalize_sense(blkvsc_req->sense_buffer,
+- SCSI_SENSE_BUFFERSIZE, &sense_hdr);
+-
+- return 0;
+- }
+-
+- buf = kmap(page_buf);
+-
+- switch (op) {
+- case DO_INQUIRY:
+- device_type = buf[0] & 0x1F;
+-
+- if (device_type == 0x0)
+- blkdev->device_type = HARDDISK_TYPE;
+- else
+- blkdev->device_type = UNKNOWN_DEV_TYPE;
+-
+- blkdev->device_id_len = buf[7];
+- if (blkdev->device_id_len > 64)
+- blkdev->device_id_len = 64;
+-
+- memcpy(blkdev->device_id, &buf[8], blkdev->device_id_len);
+- break;
+-
+- case DO_CAPACITY:
+- /* be to le */
+- blkdev->capacity =
+- ((buf[0] << 24) | (buf[1] << 16) |
+- (buf[2] << 8) | buf[3]) + 1;
+-
+- blkdev->sector_size =
+- (buf[4] << 24) | (buf[5] << 16) |
+- (buf[6] << 8) | buf[7];
+- break;
+- default:
+- break;
+-
+- }
+-
+-cleanup:
+-
+- kunmap(page_buf);
+-
+- __free_page(page_buf);
+-
+- kmem_cache_free(blkdev->request_pool, blkvsc_req);
+-
+- return ret;
+-}
+-
+-
+-static int blkvsc_cancel_pending_reqs(struct block_device_context *blkdev)
+-{
+- struct blkvsc_request *pend_req, *tmp;
+- struct blkvsc_request *comp_req, *tmp2;
+- struct vmscsi_request *vm_srb;
+-
+- int ret = 0;
+-
+-
+- /* Flush the pending list first */
+- list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list,
+- pend_entry) {
+- /*
+- * The pend_req could be part of a partially completed
+- * request. If so, complete those req first until we
+- * hit the pend_req
+- */
+- list_for_each_entry_safe(comp_req, tmp2,
+- &pend_req->group->blkvsc_req_list,
+- req_entry) {
+-
+- if (comp_req == pend_req)
+- break;
+-
+- list_del(&comp_req->req_entry);
+-
+- if (comp_req->req) {
+- vm_srb =
+- &comp_req->request.vstor_packet.
+- vm_srb;
+- ret = __blk_end_request(comp_req->req,
+- (!vm_srb->scsi_status ? 0 : -EIO),
+- comp_req->sector_count *
+- blkdev->sector_size);
+-
+- /* FIXME: shouldn't this do more than return? */
+- if (ret)
+- goto out;
+- }
+-
+- kmem_cache_free(blkdev->request_pool, comp_req);
+- }
+-
+- list_del(&pend_req->pend_entry);
+-
+- list_del(&pend_req->req_entry);
+-
+- if (comp_req->req) {
+- if (!__blk_end_request(pend_req->req, -EIO,
+- pend_req->sector_count *
+- blkdev->sector_size)) {
+- /*
+- * All the sectors have been xferred ie the
+- * request is done
+- */
+- kmem_cache_free(blkdev->request_pool,
+- pend_req->group);
+- }
+- }
+-
+- kmem_cache_free(blkdev->request_pool, pend_req);
+- }
+-
+-out:
+- return ret;
+-}
+-
+-
+-/*
+- * blkvsc_remove() - Callback when our device is removed
+- */
+-static int blkvsc_remove(struct hv_device *dev)
+-{
+- struct block_device_context *blkdev = dev_get_drvdata(&dev->device);
+- unsigned long flags;
+-
+-
+- /* Get to a known state */
+- spin_lock_irqsave(&blkdev->lock, flags);
+-
+- blkdev->shutting_down = 1;
+-
+- blk_stop_queue(blkdev->gd->queue);
+-
+- blkvsc_cancel_pending_reqs(blkdev);
+-
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-
+- blkvsc_do_operation(blkdev, DO_FLUSH);
+-
+- if (blkdev->users == 0) {
+- del_gendisk(blkdev->gd);
+- put_disk(blkdev->gd);
+- blk_cleanup_queue(blkdev->gd->queue);
+-
+- storvsc_dev_remove(blkdev->device_ctx);
+-
+- kmem_cache_destroy(blkdev->request_pool);
+- kfree(blkdev);
+- }
+-
+- return 0;
+-}
+-
+-static void blkvsc_shutdown(struct hv_device *dev)
+-{
+- struct block_device_context *blkdev = dev_get_drvdata(&dev->device);
+- unsigned long flags;
+-
+- if (!blkdev)
+- return;
+-
+- spin_lock_irqsave(&blkdev->lock, flags);
+-
+- blkdev->shutting_down = 1;
+-
+- blk_stop_queue(blkdev->gd->queue);
+-
+- blkvsc_cancel_pending_reqs(blkdev);
+-
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-
+- blkvsc_do_operation(blkdev, DO_FLUSH);
+-
+- /*
+- * Now wait for all outgoing I/O to be drained.
+- */
+- storvsc_wait_to_drain((struct storvsc_device *)dev->ext);
+-
+-}
+-
+-static int blkvsc_release(struct gendisk *disk, fmode_t mode)
+-{
+- struct block_device_context *blkdev = disk->private_data;
+- unsigned long flags;
+-
+- spin_lock_irqsave(&blkdev->lock, flags);
+-
+- if ((--blkdev->users == 0) && (blkdev->shutting_down)) {
+- blk_stop_queue(blkdev->gd->queue);
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-
+- blkvsc_do_operation(blkdev, DO_FLUSH);
+- del_gendisk(blkdev->gd);
+- put_disk(blkdev->gd);
+- blk_cleanup_queue(blkdev->gd->queue);
+-
+- storvsc_dev_remove(blkdev->device_ctx);
+-
+- kmem_cache_destroy(blkdev->request_pool);
+- kfree(blkdev);
+- } else
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-
+- return 0;
+-}
+-
+-
+-/*
+- * We break the request into 1 or more blkvsc_requests and submit
+- * them. If we cant submit them all, we put them on the
+- * pending_list. The blkvsc_request() will work on the pending_list.
+- */
+-static int blkvsc_do_request(struct block_device_context *blkdev,
+- struct request *req)
+-{
+- struct bio *bio = NULL;
+- struct bio_vec *bvec = NULL;
+- struct bio_vec *prev_bvec = NULL;
+- struct blkvsc_request *blkvsc_req = NULL;
+- struct blkvsc_request *tmp;
+- int databuf_idx = 0;
+- int seg_idx = 0;
+- sector_t start_sector;
+- unsigned long num_sectors = 0;
+- int ret = 0;
+- int pending = 0;
+- struct blkvsc_request_group *group = NULL;
+-
+- /* Create a group to tie req to list of blkvsc_reqs */
+- group = kmem_cache_zalloc(blkdev->request_pool, GFP_ATOMIC);
+- if (!group)
+- return -ENOMEM;
+-
+- INIT_LIST_HEAD(&group->blkvsc_req_list);
+- group->outstanding = group->status = 0;
+-
+- start_sector = blk_rq_pos(req);
+-
+- /* foreach bio in the request */
+- if (req->bio) {
+- for (bio = req->bio; bio; bio = bio->bi_next) {
+- /*
+- * Map this bio into an existing or new storvsc request
+- */
+- bio_for_each_segment(bvec, bio, seg_idx) {
+- /* Get a new storvsc request */
+- /* 1st-time */
+- if ((!blkvsc_req) ||
+- (databuf_idx >= MAX_MULTIPAGE_BUFFER_COUNT)
+- /* hole at the begin of page */
+- || (bvec->bv_offset != 0) ||
+- /* hold at the end of page */
+- (prev_bvec &&
+- (prev_bvec->bv_len != PAGE_SIZE))) {
+- /* submit the prev one */
+- if (blkvsc_req) {
+- blkvsc_req->sector_start =
+- start_sector;
+- sector_div(
+- blkvsc_req->sector_start,
+- (blkdev->sector_size >> 9));
+-
+- blkvsc_req->sector_count =
+- num_sectors /
+- (blkdev->sector_size >> 9);
+- blkvsc_init_rw(blkvsc_req);
+- }
+-
+- /*
+- * Create new blkvsc_req to represent
+- * the current bvec
+- */
+- blkvsc_req =
+- kmem_cache_zalloc(
+- blkdev->request_pool, GFP_ATOMIC);
+- if (!blkvsc_req) {
+- /* free up everything */
+- list_for_each_entry_safe(
+- blkvsc_req, tmp,
+- &group->blkvsc_req_list,
+- req_entry) {
+- list_del(
+- &blkvsc_req->req_entry);
+- kmem_cache_free(
+- blkdev->request_pool,
+- blkvsc_req);
+- }
+-
+- kmem_cache_free(
+- blkdev->request_pool, group);
+- return -ENOMEM;
+- }
+-
+- memset(blkvsc_req, 0,
+- sizeof(struct blkvsc_request));
+-
+- blkvsc_req->dev = blkdev;
+- blkvsc_req->req = req;
+- blkvsc_req->request.
+- data_buffer.offset
+- = bvec->bv_offset;
+- blkvsc_req->request.
+- data_buffer.len = 0;
+-
+- /* Add to the group */
+- blkvsc_req->group = group;
+- blkvsc_req->group->outstanding++;
+- list_add_tail(&blkvsc_req->req_entry,
+- &blkvsc_req->group->blkvsc_req_list);
+-
+- start_sector += num_sectors;
+- num_sectors = 0;
+- databuf_idx = 0;
+- }
+-
+- /*
+- * Add the curr bvec/segment to the curr
+- * blkvsc_req
+- */
+- blkvsc_req->request.data_buffer.
+- pfn_array[databuf_idx]
+- = page_to_pfn(bvec->bv_page);
+- blkvsc_req->request.data_buffer.len
+- += bvec->bv_len;
+-
+- prev_bvec = bvec;
+-
+- databuf_idx++;
+- num_sectors += bvec->bv_len >> 9;
+-
+- } /* bio_for_each_segment */
+-
+- } /* rq_for_each_bio */
+- }
+-
+- /* Handle the last one */
+- if (blkvsc_req) {
+- blkvsc_req->sector_start = start_sector;
+- sector_div(blkvsc_req->sector_start,
+- (blkdev->sector_size >> 9));
+-
+- blkvsc_req->sector_count = num_sectors /
+- (blkdev->sector_size >> 9);
+-
+- blkvsc_init_rw(blkvsc_req);
+- }
+-
+- list_for_each_entry(blkvsc_req, &group->blkvsc_req_list, req_entry) {
+- if (pending) {
+-
+- list_add_tail(&blkvsc_req->pend_entry,
+- &blkdev->pending_list);
+- } else {
+- ret = blkvsc_submit_request(blkvsc_req,
+- blkvsc_request_completion);
+- if (ret == -EAGAIN) {
+- pending = 1;
+- list_add_tail(&blkvsc_req->pend_entry,
+- &blkdev->pending_list);
+- }
+-
+- }
+- }
+-
+- return pending;
+-}
+-
+-static int blkvsc_do_pending_reqs(struct block_device_context *blkdev)
+-{
+- struct blkvsc_request *pend_req, *tmp;
+- int ret = 0;
+-
+- /* Flush the pending list first */
+- list_for_each_entry_safe(pend_req, tmp, &blkdev->pending_list,
+- pend_entry) {
+-
+- ret = blkvsc_submit_request(pend_req,
+- blkvsc_request_completion);
+- if (ret != 0)
+- break;
+- else
+- list_del(&pend_req->pend_entry);
+- }
+-
+- return ret;
+-}
+-
+-
+-static void blkvsc_request(struct request_queue *queue)
+-{
+- struct block_device_context *blkdev = NULL;
+- struct request *req;
+- int ret = 0;
+-
+- while ((req = blk_peek_request(queue)) != NULL) {
+-
+- blkdev = req->rq_disk->private_data;
+- if (blkdev->shutting_down || req->cmd_type != REQ_TYPE_FS) {
+- __blk_end_request_cur(req, 0);
+- continue;
+- }
+-
+- ret = blkvsc_do_pending_reqs(blkdev);
+-
+- if (ret != 0) {
+- blk_stop_queue(queue);
+- break;
+- }
+-
+- blk_start_request(req);
+-
+- ret = blkvsc_do_request(blkdev, req);
+- if (ret > 0) {
+- blk_stop_queue(queue);
+- break;
+- } else if (ret < 0) {
+- blk_requeue_request(queue, req);
+- blk_stop_queue(queue);
+- break;
+- }
+- }
+-}
+-
+-static const struct hv_vmbus_device_id id_table[] = {
+- /* IDE guid */
+- { VMBUS_DEVICE(0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+- 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5) },
+- { },
+-};
+-
+-MODULE_DEVICE_TABLE(vmbus, id_table);
+-
+-/* The one and only one */
+-static struct hv_driver blkvsc_drv = {
+- .name = "blkvsc",
+- .id_table = id_table,
+- .probe = blkvsc_probe,
+- .remove = blkvsc_remove,
+- .shutdown = blkvsc_shutdown,
+-};
+-
+-static const struct block_device_operations block_ops = {
+- .owner = THIS_MODULE,
+- .open = blkvsc_open,
+- .release = blkvsc_release,
+- .getgeo = blkvsc_getgeo,
+- .ioctl = blkvsc_ioctl,
+-};
+-
+-/*
+- * blkvsc_drv_init - BlkVsc driver initialization.
+- */
+-static int blkvsc_drv_init(void)
+-{
+- BUILD_BUG_ON(sizeof(sector_t) != 8);
+- return vmbus_driver_register(&blkvsc_drv);
+-}
+-
+-static void blkvsc_drv_exit(void)
+-{
+- vmbus_driver_unregister(&blkvsc_drv);
+-}
+-
+-/*
+- * blkvsc_probe - Add a new device for this driver
+- */
+-static int blkvsc_probe(struct hv_device *dev)
+-{
+- struct block_device_context *blkdev = NULL;
+- struct storvsc_device_info device_info;
+- struct storvsc_major_info major_info;
+- int ret = 0;
+-
+- blkdev = kzalloc(sizeof(struct block_device_context), GFP_KERNEL);
+- if (!blkdev) {
+- ret = -ENOMEM;
+- goto cleanup;
+- }
+-
+- INIT_LIST_HEAD(&blkdev->pending_list);
+-
+- /* Initialize what we can here */
+- spin_lock_init(&blkdev->lock);
+-
+-
+- blkdev->request_pool = kmem_cache_create(dev_name(&dev->device),
+- sizeof(struct blkvsc_request), 0,
+- SLAB_HWCACHE_ALIGN, NULL);
+- if (!blkdev->request_pool) {
+- ret = -ENOMEM;
+- goto cleanup;
+- }
+-
+-
+- ret = blkvsc_device_add(dev, &device_info);
+- if (ret != 0)
+- goto cleanup;
+-
+- blkdev->device_ctx = dev;
+- /* this identified the device 0 or 1 */
+- blkdev->target = device_info.target_id;
+- /* this identified the ide ctrl 0 or 1 */
+- blkdev->path = device_info.path_id;
+-
+- dev_set_drvdata(&dev->device, blkdev);
+-
+- ret = storvsc_get_major_info(&device_info, &major_info);
+-
+- if (ret)
+- goto cleanup;
+-
+- if (major_info.do_register) {
+- ret = register_blkdev(major_info.major, major_info.devname);
+-
+- if (ret != 0) {
+- DPRINT_ERR(BLKVSC_DRV,
+- "register_blkdev() failed! ret %d", ret);
+- goto remove;
+- }
+- }
+-
+- DPRINT_INFO(BLKVSC_DRV, "blkvsc registered for major %d!!",
+- major_info.major);
+-
+- blkdev->gd = alloc_disk(BLKVSC_MINORS);
+- if (!blkdev->gd) {
+- ret = -1;
+- goto cleanup;
+- }
+-
+- blkdev->gd->queue = blk_init_queue(blkvsc_request, &blkdev->lock);
+-
+- blk_queue_max_segment_size(blkdev->gd->queue, PAGE_SIZE);
+- blk_queue_max_segments(blkdev->gd->queue, MAX_MULTIPAGE_BUFFER_COUNT);
+- blk_queue_segment_boundary(blkdev->gd->queue, PAGE_SIZE-1);
+- blk_queue_bounce_limit(blkdev->gd->queue, BLK_BOUNCE_ANY);
+- blk_queue_dma_alignment(blkdev->gd->queue, 511);
+-
+- blkdev->gd->major = major_info.major;
+- if (major_info.index == 1 || major_info.index == 3)
+- blkdev->gd->first_minor = BLKVSC_MINORS;
+- else
+- blkdev->gd->first_minor = 0;
+- blkdev->gd->fops = &block_ops;
+- blkdev->gd->private_data = blkdev;
+- blkdev->gd->driverfs_dev = &(blkdev->device_ctx->device);
+- sprintf(blkdev->gd->disk_name, "hd%c", 'a' + major_info.index);
+-
+- blkvsc_do_operation(blkdev, DO_INQUIRY);
+- blkvsc_do_operation(blkdev, DO_CAPACITY);
+-
+- set_capacity(blkdev->gd, blkdev->capacity * (blkdev->sector_size/512));
+- blk_queue_logical_block_size(blkdev->gd->queue, blkdev->sector_size);
+- /* go! */
+- add_disk(blkdev->gd);
+-
+- DPRINT_INFO(BLKVSC_DRV, "%s added!! capacity %lu sector_size %d",
+- blkdev->gd->disk_name, (unsigned long)blkdev->capacity,
+- blkdev->sector_size);
+-
+- return ret;
+-
+-remove:
+- storvsc_dev_remove(dev);
+-
+-cleanup:
+- if (blkdev) {
+- if (blkdev->request_pool) {
+- kmem_cache_destroy(blkdev->request_pool);
+- blkdev->request_pool = NULL;
+- }
+- kfree(blkdev);
+- blkdev = NULL;
+- }
+-
+- return ret;
+-}
+-
+-static void blkvsc_request_completion(struct hv_storvsc_request *request)
+-{
+- struct blkvsc_request *blkvsc_req =
+- (struct blkvsc_request *)request->context;
+- struct block_device_context *blkdev =
+- (struct block_device_context *)blkvsc_req->dev;
+- unsigned long flags;
+- struct blkvsc_request *comp_req, *tmp;
+- struct vmscsi_request *vm_srb;
+-
+-
+- spin_lock_irqsave(&blkdev->lock, flags);
+-
+- blkdev->num_outstanding_reqs--;
+- blkvsc_req->group->outstanding--;
+-
+- /*
+- * Only start processing when all the blkvsc_reqs are
+- * completed. This guarantees no out-of-order blkvsc_req
+- * completion when calling end_that_request_first()
+- */
+- if (blkvsc_req->group->outstanding == 0) {
+- list_for_each_entry_safe(comp_req, tmp,
+- &blkvsc_req->group->blkvsc_req_list,
+- req_entry) {
+-
+- list_del(&comp_req->req_entry);
+-
+- vm_srb =
+- &comp_req->request.vstor_packet.vm_srb;
+- if (!__blk_end_request(comp_req->req,
+- (!vm_srb->scsi_status ? 0 : -EIO),
+- comp_req->sector_count * blkdev->sector_size)) {
+- /*
+- * All the sectors have been xferred ie the
+- * request is done
+- */
+- kmem_cache_free(blkdev->request_pool,
+- comp_req->group);
+- }
+-
+- kmem_cache_free(blkdev->request_pool, comp_req);
+- }
+-
+- if (!blkdev->shutting_down) {
+- blkvsc_do_pending_reqs(blkdev);
+- blk_start_queue(blkdev->gd->queue);
+- blkvsc_request(blkdev->gd->queue);
+- }
+- }
+-
+- spin_unlock_irqrestore(&blkdev->lock, flags);
+-}
+-
+-static void __exit blkvsc_exit(void)
+-{
+- blkvsc_drv_exit();
+-}
+-
+-MODULE_LICENSE("GPL");
+-MODULE_VERSION(HV_DRV_VERSION);
+-MODULE_DESCRIPTION("Microsoft Hyper-V virtual block driver");
+-module_init(blkvsc_drv_init);
+-module_exit(blkvsc_exit);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0323-Staging-hv-storvsc-Optimize-bounce-buffer-handlin.patch b/patches.suse/staging-hv-staging-next-20110829-0323-Staging-hv-storvsc-Optimize-bounce-buffer-handlin.patch
new file mode 100644
index 0000000000..e0715db783
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0323-Staging-hv-storvsc-Optimize-bounce-buffer-handlin.patch
@@ -0,0 +1,46 @@
+From 3612ef99b05f107d5cd85f6bc45b94ed880d78f3 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:20 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Optimize bounce buffer handling for the "write" case
+
+Optimize bounce buffer handling for the "write" case.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 9464f99..90b91ad 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -425,17 +425,17 @@ static void storvsc_commmand_completion(struct hv_storvsc_request *request)
+ struct scsi_sense_hdr sense_hdr;
+ struct vmscsi_request *vm_srb;
+
++ vm_srb = &request->vstor_packet.vm_srb;
+ if (cmd_request->bounce_sgl_count) {
+-
+- /* FIXME: We can optimize on writes by just skipping this */
+- copy_from_bounce_buffer(scsi_sglist(scmnd),
++ if (vm_srb->data_in == READ_TYPE) {
++ copy_from_bounce_buffer(scsi_sglist(scmnd),
+ cmd_request->bounce_sgl,
+ scsi_sg_count(scmnd));
+- destroy_bounce_buffer(cmd_request->bounce_sgl,
+- cmd_request->bounce_sgl_count);
++ destroy_bounce_buffer(cmd_request->bounce_sgl,
++ cmd_request->bounce_sgl_count);
++ }
+ }
+
+- vm_srb = &request->vstor_packet.vm_srb;
+ scmnd->result = vm_srb->scsi_status;
+
+ if (scmnd->result) {
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0324-Staging-hv-storvsc-Optimize-the-bounce-buffer-han.patch b/patches.suse/staging-hv-staging-next-20110829-0324-Staging-hv-storvsc-Optimize-the-bounce-buffer-han.patch
new file mode 100644
index 0000000000..8d93536314
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0324-Staging-hv-storvsc-Optimize-the-bounce-buffer-han.patch
@@ -0,0 +1,39 @@
+From fa23b8c78fefae4e8033a28e685673c35ff10789 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:21 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Optimize the bounce buffer handling in the "read" case
+
+Optimize the bounce buffer handling in the "read" case.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 10 ++++------
+ 1 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 90b91ad..3e00e70 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -560,12 +560,10 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
+ ALIGN(scsi_bufflen(scmnd), PAGE_SIZE) >>
+ PAGE_SHIFT;
+
+- /*
+- * FIXME: We can optimize on reads by just skipping
+- * this
+- */
+- copy_to_bounce_buffer(sgl, cmd_request->bounce_sgl,
+- scsi_sg_count(scmnd));
++ if (vm_srb->data_in == WRITE_TYPE)
++ copy_to_bounce_buffer(sgl,
++ cmd_request->bounce_sgl,
++ scsi_sg_count(scmnd));
+
+ sgl = cmd_request->bounce_sgl;
+ sg_count = cmd_request->bounce_sgl_count;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0325-Staging-hv-storvsc-Include-storvsc.c-in-storvsc_d.patch b/patches.suse/staging-hv-staging-next-20110829-0325-Staging-hv-storvsc-Include-storvsc.c-in-storvsc_d.patch
new file mode 100644
index 0000000000..ec197a0825
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0325-Staging-hv-storvsc-Include-storvsc.c-in-storvsc_d.patch
@@ -0,0 +1,1109 @@
+From 8dcf37d446f103d55b96beddb100db6a0ad8d0ba Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:22 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Include storvsc.c in storvsc_drv.c
+
+As part of further cleanup of our storage drivers, include the content
+of storvsc.c into storvsc_drv.c and delete storvsc.c and do the necessary
+adjustments.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/Makefile | 2 +-
+ drivers/staging/hv/storvsc.c | 528 -------------------------------------
+ drivers/staging/hv/storvsc_drv.c | 529 ++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 530 insertions(+), 529 deletions(-)
+ delete mode 100644 drivers/staging/hv/storvsc.c
+
+diff --git a/drivers/staging/hv/Makefile b/drivers/staging/hv/Makefile
+index bb89437..bd176b1 100644
+--- a/drivers/staging/hv/Makefile
++++ b/drivers/staging/hv/Makefile
+@@ -7,6 +7,6 @@ obj-$(CONFIG_HYPERV_MOUSE) += hv_mouse.o
+ hv_vmbus-y := vmbus_drv.o \
+ hv.o connection.o channel.o \
+ channel_mgmt.o ring_buffer.o
+-hv_storvsc-y := storvsc_drv.o storvsc.o
++hv_storvsc-y := storvsc_drv.o
+ hv_netvsc-y := netvsc_drv.o netvsc.o rndis_filter.o
+ hv_utils-y := hv_util.o hv_kvp.o
+diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
+deleted file mode 100644
+index fb7b3ca..0000000
+--- a/drivers/staging/hv/storvsc.c
++++ /dev/null
+@@ -1,528 +0,0 @@
+-/*
+- * Copyright (c) 2009, Microsoft Corporation.
+- *
+- * This program is free software; you can redistribute it and/or modify it
+- * under the terms and conditions of the GNU General Public License,
+- * version 2, as published by the Free Software Foundation.
+- *
+- * This program is distributed in the hope it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+- * more details.
+- *
+- * You should have received a copy of the GNU General Public License along with
+- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+- * Place - Suite 330, Boston, MA 02111-1307 USA.
+- *
+- * Authors:
+- * Haiyang Zhang <haiyangz@microsoft.com>
+- * Hank Janssen <hjanssen@microsoft.com>
+- * K. Y. Srinivasan <kys@microsoft.com>
+- *
+- */
+-#include <linux/kernel.h>
+-#include <linux/sched.h>
+-#include <linux/completion.h>
+-#include <linux/string.h>
+-#include <linux/slab.h>
+-#include <linux/mm.h>
+-#include <linux/delay.h>
+-
+-#include "hyperv.h"
+-#include "hyperv_storage.h"
+-
+-
+-static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+-
+- stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL);
+- if (!stor_device)
+- return NULL;
+-
+- stor_device->destroy = false;
+- init_waitqueue_head(&stor_device->waiting_to_drain);
+- stor_device->device = device;
+- device->ext = stor_device;
+-
+- return stor_device;
+-}
+-
+-
+-static inline struct storvsc_device *get_in_stor_device(
+- struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+- unsigned long flags;
+-
+- spin_lock_irqsave(&device->channel->inbound_lock, flags);
+- stor_device = (struct storvsc_device *)device->ext;
+-
+- if (!stor_device)
+- goto get_in_err;
+-
+- /*
+- * If the device is being destroyed; allow incoming
+- * traffic only to cleanup outstanding requests.
+- */
+-
+- if (stor_device->destroy &&
+- (atomic_read(&stor_device->num_outstanding_req) == 0))
+- stor_device = NULL;
+-
+-get_in_err:
+- spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+- return stor_device;
+-
+-}
+-
+-static int storvsc_channel_init(struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+- struct hv_storvsc_request *request;
+- struct vstor_packet *vstor_packet;
+- int ret, t;
+-
+- stor_device = get_out_stor_device(device);
+- if (!stor_device)
+- return -ENODEV;
+-
+- request = &stor_device->init_request;
+- vstor_packet = &request->vstor_packet;
+-
+- /*
+- * Now, initiate the vsc/vsp initialization protocol on the open
+- * channel
+- */
+- memset(request, 0, sizeof(struct hv_storvsc_request));
+- init_completion(&request->wait_event);
+- vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION;
+- vstor_packet->flags = REQUEST_COMPLETION_FLAG;
+-
+- ret = vmbus_sendpacket(device->channel, vstor_packet,
+- sizeof(struct vstor_packet),
+- (unsigned long)request,
+- VM_PKT_DATA_INBAND,
+- VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+- if (ret != 0)
+- goto cleanup;
+-
+- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+- if (t == 0) {
+- ret = -ETIMEDOUT;
+- goto cleanup;
+- }
+-
+- if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
+- vstor_packet->status != 0)
+- goto cleanup;
+-
+-
+- /* reuse the packet for version range supported */
+- memset(vstor_packet, 0, sizeof(struct vstor_packet));
+- vstor_packet->operation = VSTOR_OPERATION_QUERY_PROTOCOL_VERSION;
+- vstor_packet->flags = REQUEST_COMPLETION_FLAG;
+-
+- vstor_packet->version.major_minor = VMSTOR_PROTOCOL_VERSION_CURRENT;
+- FILL_VMSTOR_REVISION(vstor_packet->version.revision);
+-
+- ret = vmbus_sendpacket(device->channel, vstor_packet,
+- sizeof(struct vstor_packet),
+- (unsigned long)request,
+- VM_PKT_DATA_INBAND,
+- VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+- if (ret != 0)
+- goto cleanup;
+-
+- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+- if (t == 0) {
+- ret = -ETIMEDOUT;
+- goto cleanup;
+- }
+-
+- if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
+- vstor_packet->status != 0)
+- goto cleanup;
+-
+-
+- memset(vstor_packet, 0, sizeof(struct vstor_packet));
+- vstor_packet->operation = VSTOR_OPERATION_QUERY_PROPERTIES;
+- vstor_packet->flags = REQUEST_COMPLETION_FLAG;
+- vstor_packet->storage_channel_properties.port_number =
+- stor_device->port_number;
+-
+- ret = vmbus_sendpacket(device->channel, vstor_packet,
+- sizeof(struct vstor_packet),
+- (unsigned long)request,
+- VM_PKT_DATA_INBAND,
+- VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+-
+- if (ret != 0)
+- goto cleanup;
+-
+- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+- if (t == 0) {
+- ret = -ETIMEDOUT;
+- goto cleanup;
+- }
+-
+- if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
+- vstor_packet->status != 0)
+- goto cleanup;
+-
+- stor_device->path_id = vstor_packet->storage_channel_properties.path_id;
+- stor_device->target_id
+- = vstor_packet->storage_channel_properties.target_id;
+-
+- memset(vstor_packet, 0, sizeof(struct vstor_packet));
+- vstor_packet->operation = VSTOR_OPERATION_END_INITIALIZATION;
+- vstor_packet->flags = REQUEST_COMPLETION_FLAG;
+-
+- ret = vmbus_sendpacket(device->channel, vstor_packet,
+- sizeof(struct vstor_packet),
+- (unsigned long)request,
+- VM_PKT_DATA_INBAND,
+- VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+-
+- if (ret != 0)
+- goto cleanup;
+-
+- t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+- if (t == 0) {
+- ret = -ETIMEDOUT;
+- goto cleanup;
+- }
+-
+- if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
+- vstor_packet->status != 0)
+- goto cleanup;
+-
+-
+-cleanup:
+- return ret;
+-}
+-
+-static void storvsc_on_io_completion(struct hv_device *device,
+- struct vstor_packet *vstor_packet,
+- struct hv_storvsc_request *request)
+-{
+- struct storvsc_device *stor_device;
+- struct vstor_packet *stor_pkt;
+-
+- stor_device = (struct storvsc_device *)device->ext;
+-
+- stor_pkt = &request->vstor_packet;
+-
+-
+- /* Copy over the status...etc */
+- stor_pkt->vm_srb.scsi_status = vstor_packet->vm_srb.scsi_status;
+- stor_pkt->vm_srb.srb_status = vstor_packet->vm_srb.srb_status;
+- stor_pkt->vm_srb.sense_info_length =
+- vstor_packet->vm_srb.sense_info_length;
+-
+- if (vstor_packet->vm_srb.scsi_status != 0 ||
+- vstor_packet->vm_srb.srb_status != 1){
+- DPRINT_WARN(STORVSC,
+- "cmd 0x%x scsi status 0x%x srb status 0x%x\n",
+- stor_pkt->vm_srb.cdb[0],
+- vstor_packet->vm_srb.scsi_status,
+- vstor_packet->vm_srb.srb_status);
+- }
+-
+- if ((vstor_packet->vm_srb.scsi_status & 0xFF) == 0x02) {
+- /* CHECK_CONDITION */
+- if (vstor_packet->vm_srb.srb_status & 0x80) {
+- /* autosense data available */
+- DPRINT_WARN(STORVSC, "storvsc pkt %p autosense data "
+- "valid - len %d\n", request,
+- vstor_packet->vm_srb.sense_info_length);
+-
+- memcpy(request->sense_buffer,
+- vstor_packet->vm_srb.sense_data,
+- vstor_packet->vm_srb.sense_info_length);
+-
+- }
+- }
+-
+- stor_pkt->vm_srb.data_transfer_length =
+- vstor_packet->vm_srb.data_transfer_length;
+-
+- request->on_io_completion(request);
+-
+- if (atomic_dec_and_test(&stor_device->num_outstanding_req) &&
+- stor_device->drain_notify)
+- wake_up(&stor_device->waiting_to_drain);
+-
+-
+-}
+-
+-static void storvsc_on_receive(struct hv_device *device,
+- struct vstor_packet *vstor_packet,
+- struct hv_storvsc_request *request)
+-{
+- switch (vstor_packet->operation) {
+- case VSTOR_OPERATION_COMPLETE_IO:
+- storvsc_on_io_completion(device, vstor_packet, request);
+- break;
+- case VSTOR_OPERATION_REMOVE_DEVICE:
+-
+- default:
+- break;
+- }
+-}
+-
+-static void storvsc_on_channel_callback(void *context)
+-{
+- struct hv_device *device = (struct hv_device *)context;
+- struct storvsc_device *stor_device;
+- u32 bytes_recvd;
+- u64 request_id;
+- unsigned char packet[ALIGN(sizeof(struct vstor_packet), 8)];
+- struct hv_storvsc_request *request;
+- int ret;
+-
+-
+- stor_device = get_in_stor_device(device);
+- if (!stor_device)
+- return;
+-
+- do {
+- ret = vmbus_recvpacket(device->channel, packet,
+- ALIGN(sizeof(struct vstor_packet), 8),
+- &bytes_recvd, &request_id);
+- if (ret == 0 && bytes_recvd > 0) {
+-
+- request = (struct hv_storvsc_request *)
+- (unsigned long)request_id;
+-
+- if ((request == &stor_device->init_request) ||
+- (request == &stor_device->reset_request)) {
+-
+- memcpy(&request->vstor_packet, packet,
+- sizeof(struct vstor_packet));
+- complete(&request->wait_event);
+- } else {
+- storvsc_on_receive(device,
+- (struct vstor_packet *)packet,
+- request);
+- }
+- } else {
+- break;
+- }
+- } while (1);
+-
+- return;
+-}
+-
+-static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size)
+-{
+- struct vmstorage_channel_properties props;
+- int ret;
+-
+- memset(&props, 0, sizeof(struct vmstorage_channel_properties));
+-
+- /* Open the channel */
+- ret = vmbus_open(device->channel,
+- ring_size,
+- ring_size,
+- (void *)&props,
+- sizeof(struct vmstorage_channel_properties),
+- storvsc_on_channel_callback, device);
+-
+- if (ret != 0)
+- return ret;
+-
+- ret = storvsc_channel_init(device);
+-
+- return ret;
+-}
+-
+-int storvsc_dev_add(struct hv_device *device,
+- void *additional_info)
+-{
+- struct storvsc_device *stor_device;
+- struct storvsc_device_info *device_info;
+- int ret = 0;
+-
+- device_info = (struct storvsc_device_info *)additional_info;
+- stor_device = alloc_stor_device(device);
+- if (!stor_device)
+- return -ENOMEM;
+-
+- /* Save the channel properties to our storvsc channel */
+-
+- /*
+- * If we support more than 1 scsi channel, we need to set the
+- * port number here to the scsi channel but how do we get the
+- * scsi channel prior to the bus scan.
+- *
+- * The host does not support this.
+- */
+-
+- stor_device->port_number = device_info->port_number;
+- /* Send it back up */
+- ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
+- if (ret) {
+- kfree(stor_device);
+- return ret;
+- }
+- device_info->path_id = stor_device->path_id;
+- device_info->target_id = stor_device->target_id;
+-
+- return ret;
+-}
+-
+-int storvsc_dev_remove(struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+- unsigned long flags;
+-
+- stor_device = (struct storvsc_device *)device->ext;
+-
+- spin_lock_irqsave(&device->channel->inbound_lock, flags);
+- stor_device->destroy = true;
+- spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+-
+- /*
+- * At this point, all outbound traffic should be disable. We
+- * only allow inbound traffic (responses) to proceed so that
+- * outstanding requests can be completed.
+- */
+-
+- storvsc_wait_to_drain(stor_device);
+-
+- /*
+- * Since we have already drained, we don't need to busy wait
+- * as was done in final_release_stor_device()
+- * Note that we cannot set the ext pointer to NULL until
+- * we have drained - to drain the outgoing packets, we need to
+- * allow incoming packets.
+- */
+- spin_lock_irqsave(&device->channel->inbound_lock, flags);
+- device->ext = NULL;
+- spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+-
+- /* Close the channel */
+- vmbus_close(device->channel);
+-
+- kfree(stor_device);
+- return 0;
+-}
+-
+-int storvsc_do_io(struct hv_device *device,
+- struct hv_storvsc_request *request)
+-{
+- struct storvsc_device *stor_device;
+- struct vstor_packet *vstor_packet;
+- int ret = 0;
+-
+- vstor_packet = &request->vstor_packet;
+- stor_device = get_out_stor_device(device);
+-
+- if (!stor_device)
+- return -ENODEV;
+-
+-
+- request->device = device;
+-
+-
+- vstor_packet->flags |= REQUEST_COMPLETION_FLAG;
+-
+- vstor_packet->vm_srb.length = sizeof(struct vmscsi_request);
+-
+-
+- vstor_packet->vm_srb.sense_info_length = SENSE_BUFFER_SIZE;
+-
+-
+- vstor_packet->vm_srb.data_transfer_length =
+- request->data_buffer.len;
+-
+- vstor_packet->operation = VSTOR_OPERATION_EXECUTE_SRB;
+-
+- if (request->data_buffer.len) {
+- ret = vmbus_sendpacket_multipagebuffer(device->channel,
+- &request->data_buffer,
+- vstor_packet,
+- sizeof(struct vstor_packet),
+- (unsigned long)request);
+- } else {
+- ret = vmbus_sendpacket(device->channel, vstor_packet,
+- sizeof(struct vstor_packet),
+- (unsigned long)request,
+- VM_PKT_DATA_INBAND,
+- VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+- }
+-
+- if (ret != 0)
+- return ret;
+-
+- atomic_inc(&stor_device->num_outstanding_req);
+-
+- return ret;
+-}
+-
+-/*
+- * The channel properties uniquely specify how the device is to be
+- * presented to the guest. Map this information for use by the block
+- * driver. For Linux guests on Hyper-V, we emulate a scsi HBA in the guest
+- * (storvsc_drv) and so scsi devices in the guest are handled by
+- * native upper level Linux drivers. Consequently, Hyper-V
+- * block driver, while being a generic block driver, presently does not
+- * deal with anything other than devices that would need to be presented
+- * to the guest as an IDE disk.
+- *
+- * This function maps the channel properties as embedded in the input
+- * parameter device_info onto information necessary to register the
+- * corresponding block device.
+- *
+- * Currently, there is no way to stop the emulation of the block device
+- * on the host side. And so, to prevent the native IDE drivers in Linux
+- * from taking over these devices (to be managedby Hyper-V block
+- * driver), we will take over if need be the major of the IDE controllers.
+- *
+- */
+-
+-int storvsc_get_major_info(struct storvsc_device_info *device_info,
+- struct storvsc_major_info *major_info)
+-{
+- static bool ide0_registered;
+- static bool ide1_registered;
+-
+- /*
+- * For now we only support IDE disks.
+- */
+- major_info->devname = "ide";
+- major_info->diskname = "hd";
+-
+- if (device_info->path_id) {
+- major_info->major = 22;
+- if (!ide1_registered) {
+- major_info->do_register = true;
+- ide1_registered = true;
+- } else
+- major_info->do_register = false;
+-
+- if (device_info->target_id)
+- major_info->index = 3;
+- else
+- major_info->index = 2;
+-
+- return 0;
+- } else {
+- major_info->major = 3;
+- if (!ide0_registered) {
+- major_info->do_register = true;
+- ide0_registered = true;
+- } else
+- major_info->do_register = false;
+-
+- if (device_info->target_id)
+- major_info->index = 1;
+- else
+- major_info->index = 0;
+-
+- return 0;
+- }
+-
+- return -ENODEV;
+-}
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 3e00e70..ddb31cf 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -36,6 +36,535 @@
+ #include "hyperv.h"
+ #include "hyperv_storage.h"
+
++
++/*
++ * Copyright (c) 2009, Microsoft Corporation.
++ *
++ * This program is free software; you can redistribute it and/or modify it
++ * under the terms and conditions of the GNU General Public License,
++ * version 2, as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope it will be useful, but WITHOUT
++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
++ * more details.
++ *
++ * You should have received a copy of the GNU General Public License along with
++ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
++ * Place - Suite 330, Boston, MA 02111-1307 USA.
++ *
++ * Authors:
++ * Haiyang Zhang <haiyangz@microsoft.com>
++ * Hank Janssen <hjanssen@microsoft.com>
++ * K. Y. Srinivasan <kys@microsoft.com>
++ *
++ */
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/completion.h>
++#include <linux/string.h>
++#include <linux/slab.h>
++#include <linux/mm.h>
++#include <linux/delay.h>
++
++#include "hyperv.h"
++#include "hyperv_storage.h"
++
++
++static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
++{
++ struct storvsc_device *stor_device;
++
++ stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL);
++ if (!stor_device)
++ return NULL;
++
++ stor_device->destroy = false;
++ init_waitqueue_head(&stor_device->waiting_to_drain);
++ stor_device->device = device;
++ device->ext = stor_device;
++
++ return stor_device;
++}
++
++
++static inline struct storvsc_device *get_in_stor_device(
++ struct hv_device *device)
++{
++ struct storvsc_device *stor_device;
++ unsigned long flags;
++
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
++ stor_device = (struct storvsc_device *)device->ext;
++
++ if (!stor_device)
++ goto get_in_err;
++
++ /*
++ * If the device is being destroyed; allow incoming
++ * traffic only to cleanup outstanding requests.
++ */
++
++ if (stor_device->destroy &&
++ (atomic_read(&stor_device->num_outstanding_req) == 0))
++ stor_device = NULL;
++
++get_in_err:
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
++ return stor_device;
++
++}
++
++static int storvsc_channel_init(struct hv_device *device)
++{
++ struct storvsc_device *stor_device;
++ struct hv_storvsc_request *request;
++ struct vstor_packet *vstor_packet;
++ int ret, t;
++
++ stor_device = get_out_stor_device(device);
++ if (!stor_device)
++ return -ENODEV;
++
++ request = &stor_device->init_request;
++ vstor_packet = &request->vstor_packet;
++
++ /*
++ * Now, initiate the vsc/vsp initialization protocol on the open
++ * channel
++ */
++ memset(request, 0, sizeof(struct hv_storvsc_request));
++ init_completion(&request->wait_event);
++ vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION;
++ vstor_packet->flags = REQUEST_COMPLETION_FLAG;
++
++ ret = vmbus_sendpacket(device->channel, vstor_packet,
++ sizeof(struct vstor_packet),
++ (unsigned long)request,
++ VM_PKT_DATA_INBAND,
++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++ if (ret != 0)
++ goto cleanup;
++
++ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
++ if (t == 0) {
++ ret = -ETIMEDOUT;
++ goto cleanup;
++ }
++
++ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
++ vstor_packet->status != 0)
++ goto cleanup;
++
++
++ /* reuse the packet for version range supported */
++ memset(vstor_packet, 0, sizeof(struct vstor_packet));
++ vstor_packet->operation = VSTOR_OPERATION_QUERY_PROTOCOL_VERSION;
++ vstor_packet->flags = REQUEST_COMPLETION_FLAG;
++
++ vstor_packet->version.major_minor = VMSTOR_PROTOCOL_VERSION_CURRENT;
++ FILL_VMSTOR_REVISION(vstor_packet->version.revision);
++
++ ret = vmbus_sendpacket(device->channel, vstor_packet,
++ sizeof(struct vstor_packet),
++ (unsigned long)request,
++ VM_PKT_DATA_INBAND,
++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++ if (ret != 0)
++ goto cleanup;
++
++ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
++ if (t == 0) {
++ ret = -ETIMEDOUT;
++ goto cleanup;
++ }
++
++ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
++ vstor_packet->status != 0)
++ goto cleanup;
++
++
++ memset(vstor_packet, 0, sizeof(struct vstor_packet));
++ vstor_packet->operation = VSTOR_OPERATION_QUERY_PROPERTIES;
++ vstor_packet->flags = REQUEST_COMPLETION_FLAG;
++ vstor_packet->storage_channel_properties.port_number =
++ stor_device->port_number;
++
++ ret = vmbus_sendpacket(device->channel, vstor_packet,
++ sizeof(struct vstor_packet),
++ (unsigned long)request,
++ VM_PKT_DATA_INBAND,
++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++
++ if (ret != 0)
++ goto cleanup;
++
++ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
++ if (t == 0) {
++ ret = -ETIMEDOUT;
++ goto cleanup;
++ }
++
++ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
++ vstor_packet->status != 0)
++ goto cleanup;
++
++ stor_device->path_id = vstor_packet->storage_channel_properties.path_id;
++ stor_device->target_id
++ = vstor_packet->storage_channel_properties.target_id;
++
++ memset(vstor_packet, 0, sizeof(struct vstor_packet));
++ vstor_packet->operation = VSTOR_OPERATION_END_INITIALIZATION;
++ vstor_packet->flags = REQUEST_COMPLETION_FLAG;
++
++ ret = vmbus_sendpacket(device->channel, vstor_packet,
++ sizeof(struct vstor_packet),
++ (unsigned long)request,
++ VM_PKT_DATA_INBAND,
++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++
++ if (ret != 0)
++ goto cleanup;
++
++ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
++ if (t == 0) {
++ ret = -ETIMEDOUT;
++ goto cleanup;
++ }
++
++ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO ||
++ vstor_packet->status != 0)
++ goto cleanup;
++
++
++cleanup:
++ return ret;
++}
++
++static void storvsc_on_io_completion(struct hv_device *device,
++ struct vstor_packet *vstor_packet,
++ struct hv_storvsc_request *request)
++{
++ struct storvsc_device *stor_device;
++ struct vstor_packet *stor_pkt;
++
++ stor_device = (struct storvsc_device *)device->ext;
++
++ stor_pkt = &request->vstor_packet;
++
++
++ /* Copy over the status...etc */
++ stor_pkt->vm_srb.scsi_status = vstor_packet->vm_srb.scsi_status;
++ stor_pkt->vm_srb.srb_status = vstor_packet->vm_srb.srb_status;
++ stor_pkt->vm_srb.sense_info_length =
++ vstor_packet->vm_srb.sense_info_length;
++
++ if (vstor_packet->vm_srb.scsi_status != 0 ||
++ vstor_packet->vm_srb.srb_status != 1){
++ DPRINT_WARN(STORVSC,
++ "cmd 0x%x scsi status 0x%x srb status 0x%x\n",
++ stor_pkt->vm_srb.cdb[0],
++ vstor_packet->vm_srb.scsi_status,
++ vstor_packet->vm_srb.srb_status);
++ }
++
++ if ((vstor_packet->vm_srb.scsi_status & 0xFF) == 0x02) {
++ /* CHECK_CONDITION */
++ if (vstor_packet->vm_srb.srb_status & 0x80) {
++ /* autosense data available */
++ DPRINT_WARN(STORVSC, "storvsc pkt %p autosense data "
++ "valid - len %d\n", request,
++ vstor_packet->vm_srb.sense_info_length);
++
++ memcpy(request->sense_buffer,
++ vstor_packet->vm_srb.sense_data,
++ vstor_packet->vm_srb.sense_info_length);
++
++ }
++ }
++
++ stor_pkt->vm_srb.data_transfer_length =
++ vstor_packet->vm_srb.data_transfer_length;
++
++ request->on_io_completion(request);
++
++ if (atomic_dec_and_test(&stor_device->num_outstanding_req) &&
++ stor_device->drain_notify)
++ wake_up(&stor_device->waiting_to_drain);
++
++
++}
++
++static void storvsc_on_receive(struct hv_device *device,
++ struct vstor_packet *vstor_packet,
++ struct hv_storvsc_request *request)
++{
++ switch (vstor_packet->operation) {
++ case VSTOR_OPERATION_COMPLETE_IO:
++ storvsc_on_io_completion(device, vstor_packet, request);
++ break;
++ case VSTOR_OPERATION_REMOVE_DEVICE:
++
++ default:
++ break;
++ }
++}
++
++static void storvsc_on_channel_callback(void *context)
++{
++ struct hv_device *device = (struct hv_device *)context;
++ struct storvsc_device *stor_device;
++ u32 bytes_recvd;
++ u64 request_id;
++ unsigned char packet[ALIGN(sizeof(struct vstor_packet), 8)];
++ struct hv_storvsc_request *request;
++ int ret;
++
++
++ stor_device = get_in_stor_device(device);
++ if (!stor_device)
++ return;
++
++ do {
++ ret = vmbus_recvpacket(device->channel, packet,
++ ALIGN(sizeof(struct vstor_packet), 8),
++ &bytes_recvd, &request_id);
++ if (ret == 0 && bytes_recvd > 0) {
++
++ request = (struct hv_storvsc_request *)
++ (unsigned long)request_id;
++
++ if ((request == &stor_device->init_request) ||
++ (request == &stor_device->reset_request)) {
++
++ memcpy(&request->vstor_packet, packet,
++ sizeof(struct vstor_packet));
++ complete(&request->wait_event);
++ } else {
++ storvsc_on_receive(device,
++ (struct vstor_packet *)packet,
++ request);
++ }
++ } else {
++ break;
++ }
++ } while (1);
++
++ return;
++}
++
++static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size)
++{
++ struct vmstorage_channel_properties props;
++ int ret;
++
++ memset(&props, 0, sizeof(struct vmstorage_channel_properties));
++
++ /* Open the channel */
++ ret = vmbus_open(device->channel,
++ ring_size,
++ ring_size,
++ (void *)&props,
++ sizeof(struct vmstorage_channel_properties),
++ storvsc_on_channel_callback, device);
++
++ if (ret != 0)
++ return ret;
++
++ ret = storvsc_channel_init(device);
++
++ return ret;
++}
++
++int storvsc_dev_add(struct hv_device *device,
++ void *additional_info)
++{
++ struct storvsc_device *stor_device;
++ struct storvsc_device_info *device_info;
++ int ret = 0;
++
++ device_info = (struct storvsc_device_info *)additional_info;
++ stor_device = alloc_stor_device(device);
++ if (!stor_device)
++ return -ENOMEM;
++
++ /* Save the channel properties to our storvsc channel */
++
++ /*
++ * If we support more than 1 scsi channel, we need to set the
++ * port number here to the scsi channel but how do we get the
++ * scsi channel prior to the bus scan.
++ *
++ * The host does not support this.
++ */
++
++ stor_device->port_number = device_info->port_number;
++ /* Send it back up */
++ ret = storvsc_connect_to_vsp(device, device_info->ring_buffer_size);
++ if (ret) {
++ kfree(stor_device);
++ return ret;
++ }
++ device_info->path_id = stor_device->path_id;
++ device_info->target_id = stor_device->target_id;
++
++ return ret;
++}
++
++int storvsc_dev_remove(struct hv_device *device)
++{
++ struct storvsc_device *stor_device;
++ unsigned long flags;
++
++ stor_device = (struct storvsc_device *)device->ext;
++
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
++ stor_device->destroy = true;
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
++
++ /*
++ * At this point, all outbound traffic should be disable. We
++ * only allow inbound traffic (responses) to proceed so that
++ * outstanding requests can be completed.
++ */
++
++ storvsc_wait_to_drain(stor_device);
++
++ /*
++ * Since we have already drained, we don't need to busy wait
++ * as was done in final_release_stor_device()
++ * Note that we cannot set the ext pointer to NULL until
++ * we have drained - to drain the outgoing packets, we need to
++ * allow incoming packets.
++ */
++ spin_lock_irqsave(&device->channel->inbound_lock, flags);
++ device->ext = NULL;
++ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
++
++ /* Close the channel */
++ vmbus_close(device->channel);
++
++ kfree(stor_device);
++ return 0;
++}
++
++int storvsc_do_io(struct hv_device *device,
++ struct hv_storvsc_request *request)
++{
++ struct storvsc_device *stor_device;
++ struct vstor_packet *vstor_packet;
++ int ret = 0;
++
++ vstor_packet = &request->vstor_packet;
++ stor_device = get_out_stor_device(device);
++
++ if (!stor_device)
++ return -ENODEV;
++
++
++ request->device = device;
++
++
++ vstor_packet->flags |= REQUEST_COMPLETION_FLAG;
++
++ vstor_packet->vm_srb.length = sizeof(struct vmscsi_request);
++
++
++ vstor_packet->vm_srb.sense_info_length = SENSE_BUFFER_SIZE;
++
++
++ vstor_packet->vm_srb.data_transfer_length =
++ request->data_buffer.len;
++
++ vstor_packet->operation = VSTOR_OPERATION_EXECUTE_SRB;
++
++ if (request->data_buffer.len) {
++ ret = vmbus_sendpacket_multipagebuffer(device->channel,
++ &request->data_buffer,
++ vstor_packet,
++ sizeof(struct vstor_packet),
++ (unsigned long)request);
++ } else {
++ ret = vmbus_sendpacket(device->channel, vstor_packet,
++ sizeof(struct vstor_packet),
++ (unsigned long)request,
++ VM_PKT_DATA_INBAND,
++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++ }
++
++ if (ret != 0)
++ return ret;
++
++ atomic_inc(&stor_device->num_outstanding_req);
++
++ return ret;
++}
++
++/*
++ * The channel properties uniquely specify how the device is to be
++ * presented to the guest. Map this information for use by the block
++ * driver. For Linux guests on Hyper-V, we emulate a scsi HBA in the guest
++ * (storvsc_drv) and so scsi devices in the guest are handled by
++ * native upper level Linux drivers. Consequently, Hyper-V
++ * block driver, while being a generic block driver, presently does not
++ * deal with anything other than devices that would need to be presented
++ * to the guest as an IDE disk.
++ *
++ * This function maps the channel properties as embedded in the input
++ * parameter device_info onto information necessary to register the
++ * corresponding block device.
++ *
++ * Currently, there is no way to stop the emulation of the block device
++ * on the host side. And so, to prevent the native IDE drivers in Linux
++ * from taking over these devices (to be managedby Hyper-V block
++ * driver), we will take over if need be the major of the IDE controllers.
++ *
++ */
++
++int storvsc_get_major_info(struct storvsc_device_info *device_info,
++ struct storvsc_major_info *major_info)
++{
++ static bool ide0_registered;
++ static bool ide1_registered;
++
++ /*
++ * For now we only support IDE disks.
++ */
++ major_info->devname = "ide";
++ major_info->diskname = "hd";
++
++ if (device_info->path_id) {
++ major_info->major = 22;
++ if (!ide1_registered) {
++ major_info->do_register = true;
++ ide1_registered = true;
++ } else
++ major_info->do_register = false;
++
++ if (device_info->target_id)
++ major_info->index = 3;
++ else
++ major_info->index = 2;
++
++ return 0;
++ } else {
++ major_info->major = 3;
++ if (!ide0_registered) {
++ major_info->do_register = true;
++ ide0_registered = true;
++ } else
++ major_info->do_register = false;
++
++ if (device_info->target_id)
++ major_info->index = 1;
++ else
++ major_info->index = 0;
++
++ return 0;
++ }
++
++ return -ENODEV;
++}
+ static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
+
+ module_param(storvsc_ringbuffer_size, int, S_IRUGO);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0326-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch b/patches.suse/staging-hv-staging-next-20110829-0326-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch
new file mode 100644
index 0000000000..7528a28b9a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0326-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch
@@ -0,0 +1,196 @@
+From a1be1706ed0c6d8b93a1aa8fdb03810508fdae3e Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:23 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of storvsc.c
+
+Cleanup storvsc_drv.c after adding the contents of storvsc.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 147 +++++++-------------------------------
+ 1 files changed, 27 insertions(+), 120 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index ddb31cf..096f615 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -19,11 +19,17 @@
+ * Hank Janssen <hjanssen@microsoft.com>
+ * K. Y. Srinivasan <kys@microsoft.com>
+ */
++
++#include <linux/kernel.h>
++#include <linux/sched.h>
++#include <linux/completion.h>
++#include <linux/string.h>
++#include <linux/mm.h>
++#include <linux/delay.h>
+ #include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/module.h>
+ #include <linux/device.h>
+-#include <linux/blkdev.h>
+ #include <scsi/scsi.h>
+ #include <scsi/scsi_cmnd.h>
+ #include <scsi/scsi_host.h>
+@@ -37,39 +43,28 @@
+ #include "hyperv_storage.h"
+
+
+-/*
+- * Copyright (c) 2009, Microsoft Corporation.
+- *
+- * This program is free software; you can redistribute it and/or modify it
+- * under the terms and conditions of the GNU General Public License,
+- * version 2, as published by the Free Software Foundation.
+- *
+- * This program is distributed in the hope it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+- * more details.
+- *
+- * You should have received a copy of the GNU General Public License along with
+- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+- * Place - Suite 330, Boston, MA 02111-1307 USA.
+- *
+- * Authors:
+- * Haiyang Zhang <haiyangz@microsoft.com>
+- * Hank Janssen <hjanssen@microsoft.com>
+- * K. Y. Srinivasan <kys@microsoft.com>
+- *
+- */
+-#include <linux/kernel.h>
+-#include <linux/sched.h>
+-#include <linux/completion.h>
+-#include <linux/string.h>
+-#include <linux/slab.h>
+-#include <linux/mm.h>
+-#include <linux/delay.h>
++static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
+
+-#include "hyperv.h"
+-#include "hyperv_storage.h"
++module_param(storvsc_ringbuffer_size, int, S_IRUGO);
++MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
++
++struct hv_host_device {
++ struct hv_device *dev;
++ struct kmem_cache *request_pool;
++ unsigned int port;
++ unsigned char path;
++ unsigned char target;
++};
++
++struct storvsc_cmd_request {
++ struct list_head entry;
++ struct scsi_cmnd *cmd;
+
++ unsigned int bounce_sgl_count;
++ struct scatterlist *bounce_sgl;
++
++ struct hv_storvsc_request request;
++};
+
+ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ {
+@@ -500,94 +495,6 @@ int storvsc_do_io(struct hv_device *device,
+ return ret;
+ }
+
+-/*
+- * The channel properties uniquely specify how the device is to be
+- * presented to the guest. Map this information for use by the block
+- * driver. For Linux guests on Hyper-V, we emulate a scsi HBA in the guest
+- * (storvsc_drv) and so scsi devices in the guest are handled by
+- * native upper level Linux drivers. Consequently, Hyper-V
+- * block driver, while being a generic block driver, presently does not
+- * deal with anything other than devices that would need to be presented
+- * to the guest as an IDE disk.
+- *
+- * This function maps the channel properties as embedded in the input
+- * parameter device_info onto information necessary to register the
+- * corresponding block device.
+- *
+- * Currently, there is no way to stop the emulation of the block device
+- * on the host side. And so, to prevent the native IDE drivers in Linux
+- * from taking over these devices (to be managedby Hyper-V block
+- * driver), we will take over if need be the major of the IDE controllers.
+- *
+- */
+-
+-int storvsc_get_major_info(struct storvsc_device_info *device_info,
+- struct storvsc_major_info *major_info)
+-{
+- static bool ide0_registered;
+- static bool ide1_registered;
+-
+- /*
+- * For now we only support IDE disks.
+- */
+- major_info->devname = "ide";
+- major_info->diskname = "hd";
+-
+- if (device_info->path_id) {
+- major_info->major = 22;
+- if (!ide1_registered) {
+- major_info->do_register = true;
+- ide1_registered = true;
+- } else
+- major_info->do_register = false;
+-
+- if (device_info->target_id)
+- major_info->index = 3;
+- else
+- major_info->index = 2;
+-
+- return 0;
+- } else {
+- major_info->major = 3;
+- if (!ide0_registered) {
+- major_info->do_register = true;
+- ide0_registered = true;
+- } else
+- major_info->do_register = false;
+-
+- if (device_info->target_id)
+- major_info->index = 1;
+- else
+- major_info->index = 0;
+-
+- return 0;
+- }
+-
+- return -ENODEV;
+-}
+-static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
+-
+-module_param(storvsc_ringbuffer_size, int, S_IRUGO);
+-MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
+-
+-struct hv_host_device {
+- struct hv_device *dev;
+- struct kmem_cache *request_pool;
+- unsigned int port;
+- unsigned char path;
+- unsigned char target;
+-};
+-
+-struct storvsc_cmd_request {
+- struct list_head entry;
+- struct scsi_cmnd *cmd;
+-
+- unsigned int bounce_sgl_count;
+- struct scatterlist *bounce_sgl;
+-
+- struct hv_storvsc_request request;
+-};
+-
+ static void storvsc_get_ide_info(struct hv_device *dev, int *target, int *path)
+ {
+ *target =
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0327-Staging-hv-storvsc-Add-the-contents-of-hyperv_sto.patch b/patches.suse/staging-hv-staging-next-20110829-0327-Staging-hv-storvsc-Add-the-contents-of-hyperv_sto.patch
new file mode 100644
index 0000000000..0a2479857e
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0327-Staging-hv-storvsc-Add-the-contents-of-hyperv_sto.patch
@@ -0,0 +1,644 @@
+From f0d79fe9c564fbe1e09d8366d0863611bc57cafa Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:24 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Add the contents of hyperv_storage.h to storvsc_drv.c
+
+As part of further cleanup of storvsc, add the contents of hyperv_storage.h
+to storvsc_drv.c and do the necessary adjustments.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hyperv_storage.h | 322 -----------------------------------
+ drivers/staging/hv/storvsc_drv.c | 277 ++++++++++++++++++++++++++++++-
+ 2 files changed, 276 insertions(+), 323 deletions(-)
+ delete mode 100644 drivers/staging/hv/hyperv_storage.h
+
+diff --git a/drivers/staging/hv/hyperv_storage.h b/drivers/staging/hv/hyperv_storage.h
+deleted file mode 100644
+index 687cdc5..0000000
+--- a/drivers/staging/hv/hyperv_storage.h
++++ /dev/null
+@@ -1,322 +0,0 @@
+-/*
+- *
+- * Copyright (c) 2011, Microsoft Corporation.
+- *
+- * This program is free software; you can redistribute it and/or modify it
+- * under the terms and conditions of the GNU General Public License,
+- * version 2, as published by the Free Software Foundation.
+- *
+- * This program is distributed in the hope it will be useful, but WITHOUT
+- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+- * more details.
+- *
+- * You should have received a copy of the GNU General Public License along with
+- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+- * Place - Suite 330, Boston, MA 02111-1307 USA.
+- *
+- * Authors:
+- * Haiyang Zhang <haiyangz@microsoft.com>
+- * Hank Janssen <hjanssen@microsoft.com>
+- * K. Y. Srinivasan <kys@microsoft.com>
+- *
+- */
+-
+-#ifndef _HYPERV_STORAGE_H
+-#define _HYPERV_STORAGE_H
+-
+-
+-/* vstorage.w revision number. This is used in the case of a version match, */
+-/* to alert the user that structure sizes may be mismatched even though the */
+-/* protocol versions match. */
+-
+-
+-#define REVISION_STRING(REVISION_) #REVISION_
+-#define FILL_VMSTOR_REVISION(RESULT_LVALUE_) \
+- do { \
+- char *revision_string \
+- = REVISION_STRING($Rev : 6 $) + 6; \
+- RESULT_LVALUE_ = 0; \
+- while (*revision_string >= '0' \
+- && *revision_string <= '9') { \
+- RESULT_LVALUE_ *= 10; \
+- RESULT_LVALUE_ += *revision_string - '0'; \
+- revision_string++; \
+- } \
+- } while (0)
+-
+-/* Major/minor macros. Minor version is in LSB, meaning that earlier flat */
+-/* version numbers will be interpreted as "0.x" (i.e., 1 becomes 0.1). */
+-#define VMSTOR_PROTOCOL_MAJOR(VERSION_) (((VERSION_) >> 8) & 0xff)
+-#define VMSTOR_PROTOCOL_MINOR(VERSION_) (((VERSION_)) & 0xff)
+-#define VMSTOR_PROTOCOL_VERSION(MAJOR_, MINOR_) ((((MAJOR_) & 0xff) << 8) | \
+- (((MINOR_) & 0xff)))
+-#define VMSTOR_INVALID_PROTOCOL_VERSION (-1)
+-
+-/* Version history: */
+-/* V1 Beta 0.1 */
+-/* V1 RC < 2008/1/31 1.0 */
+-/* V1 RC > 2008/1/31 2.0 */
+-#define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(2, 0)
+-
+-
+-
+-
+-/* This will get replaced with the max transfer length that is possible on */
+-/* the host adapter. */
+-/* The max transfer length will be published when we offer a vmbus channel. */
+-#define MAX_TRANSFER_LENGTH 0x40000
+-#define DEFAULT_PACKET_SIZE (sizeof(struct vmdata_gpa_direct) + \
+- sizeof(struct vstor_packet) + \
+- sizesizeof(u64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE)))
+-
+-
+-/* Packet structure describing virtual storage requests. */
+-enum vstor_packet_operation {
+- VSTOR_OPERATION_COMPLETE_IO = 1,
+- VSTOR_OPERATION_REMOVE_DEVICE = 2,
+- VSTOR_OPERATION_EXECUTE_SRB = 3,
+- VSTOR_OPERATION_RESET_LUN = 4,
+- VSTOR_OPERATION_RESET_ADAPTER = 5,
+- VSTOR_OPERATION_RESET_BUS = 6,
+- VSTOR_OPERATION_BEGIN_INITIALIZATION = 7,
+- VSTOR_OPERATION_END_INITIALIZATION = 8,
+- VSTOR_OPERATION_QUERY_PROTOCOL_VERSION = 9,
+- VSTOR_OPERATION_QUERY_PROPERTIES = 10,
+- VSTOR_OPERATION_MAXIMUM = 10
+-};
+-
+-/*
+- * Platform neutral description of a scsi request -
+- * this remains the same across the write regardless of 32/64 bit
+- * note: it's patterned off the SCSI_PASS_THROUGH structure
+- */
+-#define CDB16GENERIC_LENGTH 0x10
+-
+-#ifndef SENSE_BUFFER_SIZE
+-#define SENSE_BUFFER_SIZE 0x12
+-#endif
+-
+-#define MAX_DATA_BUF_LEN_WITH_PADDING 0x14
+-
+-struct vmscsi_request {
+- unsigned short length;
+- unsigned char srb_status;
+- unsigned char scsi_status;
+-
+- unsigned char port_number;
+- unsigned char path_id;
+- unsigned char target_id;
+- unsigned char lun;
+-
+- unsigned char cdb_length;
+- unsigned char sense_info_length;
+- unsigned char data_in;
+- unsigned char reserved;
+-
+- unsigned int data_transfer_length;
+-
+- union {
+- unsigned char cdb[CDB16GENERIC_LENGTH];
+- unsigned char sense_data[SENSE_BUFFER_SIZE];
+- unsigned char reserved_array[MAX_DATA_BUF_LEN_WITH_PADDING];
+- };
+-} __attribute((packed));
+-
+-
+-/*
+- * This structure is sent during the intialization phase to get the different
+- * properties of the channel.
+- */
+-struct vmstorage_channel_properties {
+- unsigned short protocol_version;
+- unsigned char path_id;
+- unsigned char target_id;
+-
+- /* Note: port number is only really known on the client side */
+- unsigned int port_number;
+- unsigned int flags;
+- unsigned int max_transfer_bytes;
+-
+- /* This id is unique for each channel and will correspond with */
+- /* vendor specific data in the inquirydata */
+- unsigned long long unique_id;
+-} __packed;
+-
+-/* This structure is sent during the storage protocol negotiations. */
+-struct vmstorage_protocol_version {
+- /* Major (MSW) and minor (LSW) version numbers. */
+- unsigned short major_minor;
+-
+- /*
+- * Revision number is auto-incremented whenever this file is changed
+- * (See FILL_VMSTOR_REVISION macro above). Mismatch does not
+- * definitely indicate incompatibility--but it does indicate mismatched
+- * builds.
+- */
+- unsigned short revision;
+-} __packed;
+-
+-/* Channel Property Flags */
+-#define STORAGE_CHANNEL_REMOVABLE_FLAG 0x1
+-#define STORAGE_CHANNEL_EMULATED_IDE_FLAG 0x2
+-
+-struct vstor_packet {
+- /* Requested operation type */
+- enum vstor_packet_operation operation;
+-
+- /* Flags - see below for values */
+- unsigned int flags;
+-
+- /* Status of the request returned from the server side. */
+- unsigned int status;
+-
+- /* Data payload area */
+- union {
+- /*
+- * Structure used to forward SCSI commands from the
+- * client to the server.
+- */
+- struct vmscsi_request vm_srb;
+-
+- /* Structure used to query channel properties. */
+- struct vmstorage_channel_properties storage_channel_properties;
+-
+- /* Used during version negotiations. */
+- struct vmstorage_protocol_version version;
+- };
+-} __packed;
+-
+-/* Packet flags */
+-/*
+- * This flag indicates that the server should send back a completion for this
+- * packet.
+- */
+-#define REQUEST_COMPLETION_FLAG 0x1
+-
+-/* This is the set of flags that the vsc can set in any packets it sends */
+-#define VSC_LEGAL_FLAGS (REQUEST_COMPLETION_FLAG)
+-
+-
+-#include <linux/kernel.h>
+-#include <linux/wait.h>
+-#include "hyperv_storage.h"
+-#include "hyperv.h"
+-
+-/* Defines */
+-#define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
+-#define BLKVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
+-
+-#define STORVSC_MAX_IO_REQUESTS 128
+-
+-/*
+- * In Hyper-V, each port/path/target maps to 1 scsi host adapter. In
+- * reality, the path/target is not used (ie always set to 0) so our
+- * scsi host adapter essentially has 1 bus with 1 target that contains
+- * up to 256 luns.
+- */
+-#define STORVSC_MAX_LUNS_PER_TARGET 64
+-#define STORVSC_MAX_TARGETS 1
+-#define STORVSC_MAX_CHANNELS 1
+-
+-struct hv_storvsc_request;
+-
+-/* Matches Windows-end */
+-enum storvsc_request_type {
+- WRITE_TYPE,
+- READ_TYPE,
+- UNKNOWN_TYPE,
+-};
+-
+-
+-struct hv_storvsc_request {
+- struct hv_storvsc_request *request;
+- struct hv_device *device;
+-
+- /* Synchronize the request/response if needed */
+- struct completion wait_event;
+-
+- unsigned char *sense_buffer;
+- void *context;
+- void (*on_io_completion)(struct hv_storvsc_request *request);
+- struct hv_multipage_buffer data_buffer;
+-
+- struct vstor_packet vstor_packet;
+-};
+-
+-
+-struct storvsc_device_info {
+- u32 ring_buffer_size;
+- unsigned int port_number;
+- unsigned char path_id;
+- unsigned char target_id;
+-};
+-
+-struct storvsc_major_info {
+- int major;
+- int index;
+- bool do_register;
+- char *devname;
+- char *diskname;
+-};
+-
+-/* A storvsc device is a device object that contains a vmbus channel */
+-struct storvsc_device {
+- struct hv_device *device;
+-
+- bool destroy;
+- bool drain_notify;
+- atomic_t num_outstanding_req;
+-
+- wait_queue_head_t waiting_to_drain;
+-
+- /*
+- * Each unique Port/Path/Target represents 1 channel ie scsi
+- * controller. In reality, the pathid, targetid is always 0
+- * and the port is set by us
+- */
+- unsigned int port_number;
+- unsigned char path_id;
+- unsigned char target_id;
+-
+- /* Used for vsc/vsp channel reset process */
+- struct hv_storvsc_request init_request;
+- struct hv_storvsc_request reset_request;
+-};
+-
+-
+-static inline struct storvsc_device *get_out_stor_device(
+- struct hv_device *device)
+-{
+- struct storvsc_device *stor_device;
+-
+- stor_device = (struct storvsc_device *)device->ext;
+-
+- if (stor_device && stor_device->destroy)
+- stor_device = NULL;
+-
+- return stor_device;
+-}
+-
+-
+-static inline void storvsc_wait_to_drain(struct storvsc_device *dev)
+-{
+- dev->drain_notify = true;
+- wait_event(dev->waiting_to_drain,
+- atomic_read(&dev->num_outstanding_req) == 0);
+- dev->drain_notify = false;
+-}
+-
+-/* Interface */
+-
+-int storvsc_dev_add(struct hv_device *device,
+- void *additional_info);
+-int storvsc_dev_remove(struct hv_device *device);
+-
+-int storvsc_do_io(struct hv_device *device,
+- struct hv_storvsc_request *request);
+-
+-int storvsc_get_major_info(struct storvsc_device_info *device_info,
+- struct storvsc_major_info *major_info);
+-
+-#endif /* _HYPERV_STORAGE_H */
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 096f615..4a95f8b 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -21,6 +21,7 @@
+ */
+
+ #include <linux/kernel.h>
++#include <linux/wait.h>
+ #include <linux/sched.h>
+ #include <linux/completion.h>
+ #include <linux/string.h>
+@@ -40,7 +41,281 @@
+ #include <scsi/scsi_dbg.h>
+
+ #include "hyperv.h"
+-#include "hyperv_storage.h"
++
++/* to alert the user that structure sizes may be mismatched even though the */
++/* protocol versions match. */
++
++
++#define REVISION_STRING(REVISION_) #REVISION_
++#define FILL_VMSTOR_REVISION(RESULT_LVALUE_) \
++ do { \
++ char *revision_string \
++ = REVISION_STRING($Rev : 6 $) + 6; \
++ RESULT_LVALUE_ = 0; \
++ while (*revision_string >= '0' \
++ && *revision_string <= '9') { \
++ RESULT_LVALUE_ *= 10; \
++ RESULT_LVALUE_ += *revision_string - '0'; \
++ revision_string++; \
++ } \
++ } while (0)
++
++/* Major/minor macros. Minor version is in LSB, meaning that earlier flat */
++/* version numbers will be interpreted as "0.x" (i.e., 1 becomes 0.1). */
++#define VMSTOR_PROTOCOL_MAJOR(VERSION_) (((VERSION_) >> 8) & 0xff)
++#define VMSTOR_PROTOCOL_MINOR(VERSION_) (((VERSION_)) & 0xff)
++#define VMSTOR_PROTOCOL_VERSION(MAJOR_, MINOR_) ((((MAJOR_) & 0xff) << 8) | \
++ (((MINOR_) & 0xff)))
++#define VMSTOR_INVALID_PROTOCOL_VERSION (-1)
++
++/* Version history: */
++/* V1 Beta 0.1 */
++/* V1 RC < 2008/1/31 1.0 */
++/* V1 RC > 2008/1/31 2.0 */
++#define VMSTOR_PROTOCOL_VERSION_CURRENT VMSTOR_PROTOCOL_VERSION(2, 0)
++
++
++
++
++/* This will get replaced with the max transfer length that is possible on */
++/* the host adapter. */
++/* The max transfer length will be published when we offer a vmbus channel. */
++#define MAX_TRANSFER_LENGTH 0x40000
++#define DEFAULT_PACKET_SIZE (sizeof(struct vmdata_gpa_direct) + \
++ sizeof(struct vstor_packet) + \
++ sizesizeof(u64) * (MAX_TRANSFER_LENGTH / PAGE_SIZE)))
++
++
++/* Packet structure describing virtual storage requests. */
++enum vstor_packet_operation {
++ VSTOR_OPERATION_COMPLETE_IO = 1,
++ VSTOR_OPERATION_REMOVE_DEVICE = 2,
++ VSTOR_OPERATION_EXECUTE_SRB = 3,
++ VSTOR_OPERATION_RESET_LUN = 4,
++ VSTOR_OPERATION_RESET_ADAPTER = 5,
++ VSTOR_OPERATION_RESET_BUS = 6,
++ VSTOR_OPERATION_BEGIN_INITIALIZATION = 7,
++ VSTOR_OPERATION_END_INITIALIZATION = 8,
++ VSTOR_OPERATION_QUERY_PROTOCOL_VERSION = 9,
++ VSTOR_OPERATION_QUERY_PROPERTIES = 10,
++ VSTOR_OPERATION_MAXIMUM = 10
++};
++
++/*
++ * Platform neutral description of a scsi request -
++ * this remains the same across the write regardless of 32/64 bit
++ * note: it's patterned off the SCSI_PASS_THROUGH structure
++ */
++#define CDB16GENERIC_LENGTH 0x10
++
++#ifndef SENSE_BUFFER_SIZE
++#define SENSE_BUFFER_SIZE 0x12
++#endif
++
++#define MAX_DATA_BUF_LEN_WITH_PADDING 0x14
++
++struct vmscsi_request {
++ unsigned short length;
++ unsigned char srb_status;
++ unsigned char scsi_status;
++
++ unsigned char port_number;
++ unsigned char path_id;
++ unsigned char target_id;
++ unsigned char lun;
++
++ unsigned char cdb_length;
++ unsigned char sense_info_length;
++ unsigned char data_in;
++ unsigned char reserved;
++
++ unsigned int data_transfer_length;
++
++ union {
++ unsigned char cdb[CDB16GENERIC_LENGTH];
++ unsigned char sense_data[SENSE_BUFFER_SIZE];
++ unsigned char reserved_array[MAX_DATA_BUF_LEN_WITH_PADDING];
++ };
++} __attribute((packed));
++
++
++/*
++ * This structure is sent during the intialization phase to get the different
++ * properties of the channel.
++ */
++struct vmstorage_channel_properties {
++ unsigned short protocol_version;
++ unsigned char path_id;
++ unsigned char target_id;
++
++ /* Note: port number is only really known on the client side */
++ unsigned int port_number;
++ unsigned int flags;
++ unsigned int max_transfer_bytes;
++
++ /* This id is unique for each channel and will correspond with */
++ /* vendor specific data in the inquirydata */
++ unsigned long long unique_id;
++} __packed;
++
++/* This structure is sent during the storage protocol negotiations. */
++struct vmstorage_protocol_version {
++ /* Major (MSW) and minor (LSW) version numbers. */
++ unsigned short major_minor;
++
++ /*
++ * Revision number is auto-incremented whenever this file is changed
++ * (See FILL_VMSTOR_REVISION macro above). Mismatch does not
++ * definitely indicate incompatibility--but it does indicate mismatched
++ * builds.
++ */
++ unsigned short revision;
++} __packed;
++
++/* Channel Property Flags */
++#define STORAGE_CHANNEL_REMOVABLE_FLAG 0x1
++#define STORAGE_CHANNEL_EMULATED_IDE_FLAG 0x2
++
++struct vstor_packet {
++ /* Requested operation type */
++ enum vstor_packet_operation operation;
++
++ /* Flags - see below for values */
++ unsigned int flags;
++
++ /* Status of the request returned from the server side. */
++ unsigned int status;
++
++ /* Data payload area */
++ union {
++ /*
++ * Structure used to forward SCSI commands from the
++ * client to the server.
++ */
++ struct vmscsi_request vm_srb;
++
++ /* Structure used to query channel properties. */
++ struct vmstorage_channel_properties storage_channel_properties;
++
++ /* Used during version negotiations. */
++ struct vmstorage_protocol_version version;
++ };
++} __packed;
++
++/* Packet flags */
++/*
++ * This flag indicates that the server should send back a completion for this
++ * packet.
++ */
++#define REQUEST_COMPLETION_FLAG 0x1
++
++/* This is the set of flags that the vsc can set in any packets it sends */
++#define VSC_LEGAL_FLAGS (REQUEST_COMPLETION_FLAG)
++
++
++/* Defines */
++#define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
++#define BLKVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
++
++#define STORVSC_MAX_IO_REQUESTS 128
++
++/*
++ * In Hyper-V, each port/path/target maps to 1 scsi host adapter. In
++ * reality, the path/target is not used (ie always set to 0) so our
++ * scsi host adapter essentially has 1 bus with 1 target that contains
++ * up to 256 luns.
++ */
++#define STORVSC_MAX_LUNS_PER_TARGET 64
++#define STORVSC_MAX_TARGETS 1
++#define STORVSC_MAX_CHANNELS 1
++
++struct hv_storvsc_request;
++
++/* Matches Windows-end */
++enum storvsc_request_type {
++ WRITE_TYPE,
++ READ_TYPE,
++ UNKNOWN_TYPE,
++};
++
++
++struct hv_storvsc_request {
++ struct hv_storvsc_request *request;
++ struct hv_device *device;
++
++ /* Synchronize the request/response if needed */
++ struct completion wait_event;
++
++ unsigned char *sense_buffer;
++ void *context;
++ void (*on_io_completion)(struct hv_storvsc_request *request);
++ struct hv_multipage_buffer data_buffer;
++
++ struct vstor_packet vstor_packet;
++};
++
++
++struct storvsc_device_info {
++ u32 ring_buffer_size;
++ unsigned int port_number;
++ unsigned char path_id;
++ unsigned char target_id;
++};
++
++struct storvsc_major_info {
++ int major;
++ int index;
++ bool do_register;
++ char *devname;
++ char *diskname;
++};
++
++/* A storvsc device is a device object that contains a vmbus channel */
++struct storvsc_device {
++ struct hv_device *device;
++
++ bool destroy;
++ bool drain_notify;
++ atomic_t num_outstanding_req;
++
++ wait_queue_head_t waiting_to_drain;
++
++ /*
++ * Each unique Port/Path/Target represents 1 channel ie scsi
++ * controller. In reality, the pathid, targetid is always 0
++ * and the port is set by us
++ */
++ unsigned int port_number;
++ unsigned char path_id;
++ unsigned char target_id;
++
++ /* Used for vsc/vsp channel reset process */
++ struct hv_storvsc_request init_request;
++ struct hv_storvsc_request reset_request;
++};
++
++
++static inline struct storvsc_device *get_out_stor_device(
++ struct hv_device *device)
++{
++ struct storvsc_device *stor_device;
++
++ stor_device = (struct storvsc_device *)device->ext;
++
++ if (stor_device && stor_device->destroy)
++ stor_device = NULL;
++
++ return stor_device;
++}
++
++
++static inline void storvsc_wait_to_drain(struct storvsc_device *dev)
++{
++ dev->drain_notify = true;
++ wait_event(dev->waiting_to_drain,
++ atomic_read(&dev->num_outstanding_req) == 0);
++ dev->drain_notify = false;
++}
+
+
+ static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0328-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch b/patches.suse/staging-hv-staging-next-20110829-0328-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch
new file mode 100644
index 0000000000..ead05bb87f
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0328-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch
@@ -0,0 +1,140 @@
+From c1b3d067e419dee621ddd5e8f5d812973a6d0946 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:25 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Cleanup storvsc_drv.c after adding the contents of hyperv_storage.h
+
+Cleanup storvsc_drv.c after adding the contents of hyperv_storage.h.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 62 ++++++++++++++++----------------------
+ 1 files changed, 26 insertions(+), 36 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 4a95f8b..0bb4e0e 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -42,6 +42,12 @@
+
+ #include "hyperv.h"
+
++#define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
++static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
++
++module_param(storvsc_ringbuffer_size, int, S_IRUGO);
++MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
++
+ /* to alert the user that structure sizes may be mismatched even though the */
+ /* protocol versions match. */
+
+@@ -214,8 +220,6 @@ struct vstor_packet {
+
+
+ /* Defines */
+-#define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
+-#define BLKVSC_RING_BUFFER_SIZE (20*PAGE_SIZE)
+
+ #define STORVSC_MAX_IO_REQUESTS 128
+
+@@ -262,13 +266,6 @@ struct storvsc_device_info {
+ unsigned char target_id;
+ };
+
+-struct storvsc_major_info {
+- int major;
+- int index;
+- bool do_register;
+- char *devname;
+- char *diskname;
+-};
+
+ /* A storvsc device is a device object that contains a vmbus channel */
+ struct storvsc_device {
+@@ -294,6 +291,23 @@ struct storvsc_device {
+ struct hv_storvsc_request reset_request;
+ };
+
++struct hv_host_device {
++ struct hv_device *dev;
++ struct kmem_cache *request_pool;
++ unsigned int port;
++ unsigned char path;
++ unsigned char target;
++};
++
++struct storvsc_cmd_request {
++ struct list_head entry;
++ struct scsi_cmnd *cmd;
++
++ unsigned int bounce_sgl_count;
++ struct scatterlist *bounce_sgl;
++
++ struct hv_storvsc_request request;
++};
+
+ static inline struct storvsc_device *get_out_stor_device(
+ struct hv_device *device)
+@@ -317,30 +331,6 @@ static inline void storvsc_wait_to_drain(struct storvsc_device *dev)
+ dev->drain_notify = false;
+ }
+
+-
+-static int storvsc_ringbuffer_size = STORVSC_RING_BUFFER_SIZE;
+-
+-module_param(storvsc_ringbuffer_size, int, S_IRUGO);
+-MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
+-
+-struct hv_host_device {
+- struct hv_device *dev;
+- struct kmem_cache *request_pool;
+- unsigned int port;
+- unsigned char path;
+- unsigned char target;
+-};
+-
+-struct storvsc_cmd_request {
+- struct list_head entry;
+- struct scsi_cmnd *cmd;
+-
+- unsigned int bounce_sgl_count;
+- struct scatterlist *bounce_sgl;
+-
+- struct hv_storvsc_request request;
+-};
+-
+ static inline struct storvsc_device *alloc_stor_device(struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+@@ -646,7 +636,7 @@ static int storvsc_connect_to_vsp(struct hv_device *device, u32 ring_size)
+ return ret;
+ }
+
+-int storvsc_dev_add(struct hv_device *device,
++static int storvsc_dev_add(struct hv_device *device,
+ void *additional_info)
+ {
+ struct storvsc_device *stor_device;
+@@ -681,7 +671,7 @@ int storvsc_dev_add(struct hv_device *device,
+ return ret;
+ }
+
+-int storvsc_dev_remove(struct hv_device *device)
++static int storvsc_dev_remove(struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+ unsigned long flags;
+@@ -718,7 +708,7 @@ int storvsc_dev_remove(struct hv_device *device)
+ return 0;
+ }
+
+-int storvsc_do_io(struct hv_device *device,
++static int storvsc_do_io(struct hv_device *device,
+ struct hv_storvsc_request *request)
+ {
+ struct storvsc_device *stor_device;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0329-Staging-hv-storvsc-Fixup-srb-and-scsi-status-for.patch b/patches.suse/staging-hv-staging-next-20110829-0329-Staging-hv-storvsc-Fixup-srb-and-scsi-status-for.patch
new file mode 100644
index 0000000000..677a063a17
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0329-Staging-hv-storvsc-Fixup-srb-and-scsi-status-for.patch
@@ -0,0 +1,48 @@
+From 4ed51a21c0f69e1379cf858fc21a9d9022bfe0e7 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:26 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Fixup srb and scsi status for INQUIRY and MODE_SENSE
+
+The current VHD handler on the Windows Host does not correctly handle
+INQUIRY and MODE_SENSE commands with some options. Fixup srb_status
+in these cases since the failure is not fatal.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 17 +++++++++++++++++
+ 1 files changed, 17 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 0bb4e0e..72ca25c 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -512,6 +512,23 @@ static void storvsc_on_io_completion(struct hv_device *device,
+
+ stor_pkt = &request->vstor_packet;
+
++ /*
++ * The current SCSI handling on the host side does
++ * not correctly handle:
++ * INQUIRY command with page code parameter set to 0x80
++ * MODE_SENSE command with cmd[2] == 0x1c
++ *
++ * Setup srb and scsi status so this won't be fatal.
++ * We do this so we can distinguish truly fatal failues
++ * (srb status == 0x4) and off-line the device in that case.
++ */
++
++ if ((stor_pkt->vm_srb.cdb[0] == INQUIRY) ||
++ (stor_pkt->vm_srb.cdb[0] == MODE_SENSE)) {
++ vstor_packet->vm_srb.scsi_status = 0;
++ vstor_packet->vm_srb.srb_status = 0x1;
++ }
++
+
+ /* Copy over the status...etc */
+ stor_pkt->vm_srb.scsi_status = vstor_packet->vm_srb.scsi_status;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0330-Staging-hv-storvsc-Fix-a-typo.patch b/patches.suse/staging-hv-staging-next-20110829-0330-Staging-hv-storvsc-Fix-a-typo.patch
new file mode 100644
index 0000000000..265d17bf5d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0330-Staging-hv-storvsc-Fix-a-typo.patch
@@ -0,0 +1,43 @@
+From b8de73df1b5143c3d567e707e4dab0b20c82ab54 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:27 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: Fix a typo
+
+Fix a typo in a function name.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 72ca25c..ad0f9d4 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1130,9 +1130,9 @@ static int storvsc_host_reset_handler(struct scsi_cmnd *scmnd)
+
+
+ /*
+- * storvsc_commmand_completion - Command completion processing
++ * storvsc_command_completion - Command completion processing
+ */
+-static void storvsc_commmand_completion(struct hv_storvsc_request *request)
++static void storvsc_command_completion(struct hv_storvsc_request *request)
+ {
+ struct storvsc_cmd_request *cmd_request =
+ (struct storvsc_cmd_request *)request->context;
+@@ -1240,7 +1240,7 @@ static int storvsc_queuecommand_lck(struct scsi_cmnd *scmnd,
+ break;
+ }
+
+- request->on_io_completion = storvsc_commmand_completion;
++ request->on_io_completion = storvsc_command_completion;
+ request->context = cmd_request;/* scmnd; */
+
+ vm_srb->port_number = host_dev->port;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0331-Staging-hv-storvsc-In-case-of-scsi-errors-offline.patch b/patches.suse/staging-hv-staging-next-20110829-0331-Staging-hv-storvsc-In-case-of-scsi-errors-offline.patch
new file mode 100644
index 0000000000..0ae5a1a2a8
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0331-Staging-hv-storvsc-In-case-of-scsi-errors-offline.patch
@@ -0,0 +1,40 @@
+From 2544b794372b63e46384ac4af91c5630e92cf7f4 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:28 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: In case of scsi errors offline the device
+
+When we do get fatal errors from the host, offline the device since the
+host has already tried all possible recovery actions.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 10 +++++++++-
+ 1 files changed, 9 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index ad0f9d4..22a1d75 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1154,7 +1154,15 @@ static void storvsc_command_completion(struct hv_storvsc_request *request)
+ }
+ }
+
+- scmnd->result = vm_srb->scsi_status;
++ /*
++ * If there is an error; offline the device since all
++ * error recovery strategies would have already been
++ * deployed on the host side.
++ */
++ if (vm_srb->srb_status == 0x4)
++ scmnd->result = DID_TARGET_FAILURE << 16;
++ else
++ scmnd->result = vm_srb->scsi_status;
+
+ if (scmnd->result) {
+ if (scsi_normalize_sense(scmnd->sense_buffer,
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0332-Staging-hv-storvsc-No-need-to-copy-from-bounce-bu.patch b/patches.suse/staging-hv-staging-next-20110829-0332-Staging-hv-storvsc-No-need-to-copy-from-bounce-bu.patch
new file mode 100644
index 0000000000..f6348d41f3
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0332-Staging-hv-storvsc-No-need-to-copy-from-bounce-bu.patch
@@ -0,0 +1,43 @@
+From 70691ec666a6c04f6f1438d9a0bf495b24e22610 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:29 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: storvsc: No need to copy from bounce buffer in case of a failure
+
+No need to copy from bounce buffer in case of a failure; cleanup the code
+accordingly.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 12 ++----------
+ 1 files changed, 2 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index 22a1d75..d575bc9 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1315,17 +1315,9 @@ retry_request:
+ if (ret == -EAGAIN) {
+ /* no more space */
+
+- if (cmd_request->bounce_sgl_count) {
+- /*
+- * FIXME: We can optimize on writes by just skipping
+- * this
+- */
+- copy_from_bounce_buffer(scsi_sglist(scmnd),
+- cmd_request->bounce_sgl,
+- scsi_sg_count(scmnd));
++ if (cmd_request->bounce_sgl_count)
+ destroy_bounce_buffer(cmd_request->bounce_sgl,
+- cmd_request->bounce_sgl_count);
+- }
++ cmd_request->bounce_sgl_count);
+
+ kmem_cache_free(host_dev->request_pool, cmd_request);
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0333-Staging-hv-util-Forcefully-shutdown-when-shutdown.patch b/patches.suse/staging-hv-staging-next-20110829-0333-Staging-hv-util-Forcefully-shutdown-when-shutdown.patch
new file mode 100644
index 0000000000..1944ca698d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0333-Staging-hv-util-Forcefully-shutdown-when-shutdown.patch
@@ -0,0 +1,31 @@
+From ae2a0b42bfe6e7eb9251bfb05f7a03008df446a8 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:30 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: util: Forcefully shutdown when shutdown is requested
+
+When the host requests a "shutdown", make sure we shutdown!
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_util.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
+index f2f456f..876d44a 100644
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -89,7 +89,7 @@ static void shutdown_onchannelcallback(void *context)
+ }
+
+ if (execute_shutdown == true)
+- orderly_poweroff(false);
++ orderly_poweroff(true);
+ }
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0334-Staging-hv-util-Adjust-guest-time-in-a-process-co.patch b/patches.suse/staging-hv-staging-next-20110829-0334-Staging-hv-util-Adjust-guest-time-in-a-process-co.patch
new file mode 100644
index 0000000000..6e932d0990
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0334-Staging-hv-util-Adjust-guest-time-in-a-process-co.patch
@@ -0,0 +1,79 @@
+From 95ff7cde91f5513ebc95ccf0cd482f07dc3454e4 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:31 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: util: Adjust guest time in a process context
+
+The current code was adjusting guest time in interrupt context; do this
+in process context since we may have to initiate cross-processor
+interrupts as part of setting time.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_util.c | 33 ++++++++++++++++++++++++++++++---
+ 1 files changed, 30 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
+index 876d44a..e29a2a2 100644
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -107,6 +107,24 @@ static inline void do_adj_guesttime(u64 hosttime)
+ }
+
+ /*
++ * Set the host time in a process context.
++ */
++
++struct adj_time_work {
++ struct work_struct work;
++ u64 host_time;
++};
++
++static void hv_set_host_time(struct work_struct *work)
++{
++ struct adj_time_work *wrk;
++
++ wrk = container_of(work, struct adj_time_work, work);
++ do_adj_guesttime(wrk->host_time);
++ kfree(wrk);
++}
++
++/*
+ * Synchronize time with host after reboot, restore, etc.
+ *
+ * ICTIMESYNCFLAG_SYNC flag bit indicates reboot, restore events of the VM.
+@@ -119,17 +137,26 @@ static inline void do_adj_guesttime(u64 hosttime)
+ */
+ static inline void adj_guesttime(u64 hosttime, u8 flags)
+ {
++ struct adj_time_work *wrk;
+ static s32 scnt = 50;
+
++ wrk = kmalloc(sizeof(struct adj_time_work), GFP_ATOMIC);
++ if (wrk == NULL)
++ return;
++
++ wrk->host_time = hosttime;
+ if ((flags & ICTIMESYNCFLAG_SYNC) != 0) {
+- do_adj_guesttime(hosttime);
++ INIT_WORK(&wrk->work, hv_set_host_time);
++ schedule_work(&wrk->work);
+ return;
+ }
+
+ if ((flags & ICTIMESYNCFLAG_SAMPLE) != 0 && scnt > 0) {
+ scnt--;
+- do_adj_guesttime(hosttime);
+- }
++ INIT_WORK(&wrk->work, hv_set_host_time);
++ schedule_work(&wrk->work);
++ } else
++ kfree(wrk);
+ }
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0335-Staging-hv-vmbus-Check-before-invoking-the-channe.patch b/patches.suse/staging-hv-staging-next-20110829-0335-Staging-hv-vmbus-Check-before-invoking-the-channe.patch
new file mode 100644
index 0000000000..647e5ac955
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0335-Staging-hv-vmbus-Check-before-invoking-the-channe.patch
@@ -0,0 +1,32 @@
+From 76c39d429d606d8f9b354ee2b1973b76c8331b1f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:32 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Check before invoking the channel callback
+
+When we close a channel, we set the corresponding callback function to NULL.
+Check before invoking the channel callback.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/connection.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
+index a88ad70..7a3ec75 100644
+--- a/drivers/staging/hv/connection.c
++++ b/drivers/staging/hv/connection.c
+@@ -222,7 +222,7 @@ static void process_chn_event(u32 relid)
+ */
+ channel = relid2channel(relid);
+
+- if (channel) {
++ if (channel && (channel->onchannel_callback != NULL)) {
+ channel->onchannel_callback(channel->channel_callback_context);
+ } else {
+ pr_err("channel not found for relid - %u\n", relid);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0336-Staging-hv-vmbus-Properly-deal-with-de-registerin.patch b/patches.suse/staging-hv-staging-next-20110829-0336-Staging-hv-vmbus-Properly-deal-with-de-registerin.patch
new file mode 100644
index 0000000000..6040db2351
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0336-Staging-hv-vmbus-Properly-deal-with-de-registerin.patch
@@ -0,0 +1,186 @@
+From dad76bf73fc20b42d020fe5a93dbe4b4868e7681 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:33 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Properly deal with de-registering channel callback
+
+Ensure that we correctly handle racing invocations of the channel callback
+when the channel is being closed. We do this using the channel's inbound_lock.
+A side-effect of this strategy is that we avoid repeatedly picking up this lock
+as we drain the inbound ring-buffer.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/channel.c | 20 +++++---------------
+ drivers/staging/hv/connection.c | 3 +++
+ drivers/staging/hv/netvsc.c | 3 ---
+ drivers/staging/hv/storvsc_drv.c | 3 ---
+ 4 files changed, 8 insertions(+), 21 deletions(-)
+
+diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
+index ac92c1f..b6f3d38 100644
+--- a/drivers/staging/hv/channel.c
++++ b/drivers/staging/hv/channel.c
+@@ -513,9 +513,12 @@ void vmbus_close(struct vmbus_channel *channel)
+ {
+ struct vmbus_channel_close_channel *msg;
+ int ret;
++ unsigned long flags;
+
+ /* Stop callback and cancel the timer asap */
++ spin_lock_irqsave(&channel->inbound_lock, flags);
+ channel->onchannel_callback = NULL;
++ spin_unlock_irqrestore(&channel->inbound_lock, flags);
+
+ /* Send a closing message */
+
+@@ -735,19 +738,15 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
+ u32 packetlen;
+ u32 userlen;
+ int ret;
+- unsigned long flags;
+
+ *buffer_actual_len = 0;
+ *requestid = 0;
+
+- spin_lock_irqsave(&channel->inbound_lock, flags);
+
+ ret = hv_ringbuffer_peek(&channel->inbound, &desc,
+ sizeof(struct vmpacket_descriptor));
+- if (ret != 0) {
+- spin_unlock_irqrestore(&channel->inbound_lock, flags);
++ if (ret != 0)
+ return 0;
+- }
+
+ packetlen = desc.len8 << 3;
+ userlen = packetlen - (desc.offset8 << 3);
+@@ -755,7 +754,6 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
+ *buffer_actual_len = userlen;
+
+ if (userlen > bufferlen) {
+- spin_unlock_irqrestore(&channel->inbound_lock, flags);
+
+ pr_err("Buffer too small - got %d needs %d\n",
+ bufferlen, userlen);
+@@ -768,7 +766,6 @@ int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
+ ret = hv_ringbuffer_read(&channel->inbound, buffer, userlen,
+ (desc.offset8 << 3));
+
+- spin_unlock_irqrestore(&channel->inbound_lock, flags);
+
+ return 0;
+ }
+@@ -785,19 +782,15 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
+ u32 packetlen;
+ u32 userlen;
+ int ret;
+- unsigned long flags;
+
+ *buffer_actual_len = 0;
+ *requestid = 0;
+
+- spin_lock_irqsave(&channel->inbound_lock, flags);
+
+ ret = hv_ringbuffer_peek(&channel->inbound, &desc,
+ sizeof(struct vmpacket_descriptor));
+- if (ret != 0) {
+- spin_unlock_irqrestore(&channel->inbound_lock, flags);
++ if (ret != 0)
+ return 0;
+- }
+
+
+ packetlen = desc.len8 << 3;
+@@ -806,8 +799,6 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
+ *buffer_actual_len = packetlen;
+
+ if (packetlen > bufferlen) {
+- spin_unlock_irqrestore(&channel->inbound_lock, flags);
+-
+ pr_err("Buffer too small - needed %d bytes but "
+ "got space for only %d bytes\n",
+ packetlen, bufferlen);
+@@ -819,7 +810,6 @@ int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
+ /* Copy over the entire packet to the user buffer */
+ ret = hv_ringbuffer_read(&channel->inbound, buffer, packetlen, 0);
+
+- spin_unlock_irqrestore(&channel->inbound_lock, flags);
+ return 0;
+ }
+ EXPORT_SYMBOL_GPL(vmbus_recvpacket_raw);
+diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
+index 7a3ec75..6aab802 100644
+--- a/drivers/staging/hv/connection.c
++++ b/drivers/staging/hv/connection.c
+@@ -215,6 +215,7 @@ struct vmbus_channel *relid2channel(u32 relid)
+ static void process_chn_event(u32 relid)
+ {
+ struct vmbus_channel *channel;
++ unsigned long flags;
+
+ /*
+ * Find the channel based on this relid and invokes the
+@@ -222,11 +223,13 @@ static void process_chn_event(u32 relid)
+ */
+ channel = relid2channel(relid);
+
++ spin_lock_irqsave(&channel->inbound_lock, flags);
+ if (channel && (channel->onchannel_callback != NULL)) {
+ channel->onchannel_callback(channel->channel_callback_context);
+ } else {
+ pr_err("channel not found for relid - %u\n", relid);
+ }
++ spin_unlock_irqrestore(&channel->inbound_lock, flags);
+ }
+
+ /*
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index 9828f0b..e4cc40a 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -62,9 +62,7 @@ static struct netvsc_device *get_outbound_net_device(struct hv_device *device)
+ static struct netvsc_device *get_inbound_net_device(struct hv_device *device)
+ {
+ struct netvsc_device *net_device;
+- unsigned long flags;
+
+- spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ net_device = device->ext;
+
+ if (!net_device)
+@@ -75,7 +73,6 @@ static struct netvsc_device *get_inbound_net_device(struct hv_device *device)
+ net_device = NULL;
+
+ get_in_err:
+- spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+ return net_device;
+ }
+
+diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
+index d575bc9..3686d10 100644
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -352,9 +352,7 @@ static inline struct storvsc_device *get_in_stor_device(
+ struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+- unsigned long flags;
+
+- spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ stor_device = (struct storvsc_device *)device->ext;
+
+ if (!stor_device)
+@@ -370,7 +368,6 @@ static inline struct storvsc_device *get_in_stor_device(
+ stor_device = NULL;
+
+ get_in_err:
+- spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+ return stor_device;
+
+ }
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0337-Staging-hv-Fix-a-bug-in-vmbus_match.patch b/patches.suse/staging-hv-staging-next-20110829-0337-Staging-hv-Fix-a-bug-in-vmbus_match.patch
new file mode 100644
index 0000000000..31dc9fc017
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0337-Staging-hv-Fix-a-bug-in-vmbus_match.patch
@@ -0,0 +1,32 @@
+From e61ee14f0e9be1ff3d0d3e6168d47125729864c7 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:34 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: Fix a bug in vmbus_match()
+
+The recent checkin that add a private pointer to hv_vmbus_device_id
+introduced this bug in vmbus_match; fix it.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index be62b62..51002c0 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -273,7 +273,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
+
+ for (; !is_null_guid(id_array->guid); id_array++)
+ if (!memcmp(&id_array->guid, &hv_dev->dev_type.b,
+- sizeof(struct hv_vmbus_device_id)))
++ sizeof(uuid_le)))
+ return 1;
+
+ return 0;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0338-Staging-hv-vmbus-Get-rid-of-vmbus_on_isr-by-inl.patch b/patches.suse/staging-hv-staging-next-20110829-0338-Staging-hv-vmbus-Get-rid-of-vmbus_on_isr-by-inl.patch
new file mode 100644
index 0000000000..00a22c9187
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0338-Staging-hv-vmbus-Get-rid-of-vmbus_on_isr-by-inl.patch
@@ -0,0 +1,88 @@
+From ae4636e6c0d1d8d326f38586121478d7b32150b7 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:35 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of vmbus_on_isr() by inlining the code
+
+Get rid of vmbus_on_isr() by inlining the code.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 41 +++++++++++----------------------------
+ 1 files changed, 12 insertions(+), 29 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 51002c0..5dcc8c3 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -437,53 +437,36 @@ static void vmbus_on_msg_dpc(unsigned long data)
+ }
+ }
+
+-/*
+- * vmbus_on_isr - ISR routine
+- */
+-static int vmbus_on_isr(void)
++static irqreturn_t vmbus_isr(int irq, void *dev_id)
+ {
+- int ret = 0;
+ int cpu = smp_processor_id();
+ void *page_addr;
+ struct hv_message *msg;
+ union hv_synic_event_flags *event;
++ bool handled = false;
+
+ page_addr = hv_context.synic_message_page[cpu];
+ msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
+
+ /* Check if there are actual msgs to be process */
+- if (msg->header.message_type != HVMSG_NONE)
+- ret |= 0x1;
++ if (msg->header.message_type != HVMSG_NONE) {
++ handled = true;
++ tasklet_schedule(&msg_dpc);
++ }
+
+ page_addr = hv_context.synic_event_page[cpu];
+ event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;
+
+ /* Since we are a child, we only need to check bit 0 */
+- if (sync_test_and_clear_bit(0, (unsigned long *) &event->flags32[0]))
+- ret |= 0x2;
+-
+- return ret;
+-}
+-
+-
+-static irqreturn_t vmbus_isr(int irq, void *dev_id)
+-{
+- int ret;
+-
+- ret = vmbus_on_isr();
+-
+- /* Schedules a dpc if necessary */
+- if (ret > 0) {
+- if (test_bit(0, (unsigned long *)&ret))
+- tasklet_schedule(&msg_dpc);
+-
+- if (test_bit(1, (unsigned long *)&ret))
+- tasklet_schedule(&event_dpc);
++ if (sync_test_and_clear_bit(0, (unsigned long *) &event->flags32[0])) {
++ handled = true;
++ tasklet_schedule(&event_dpc);
++ }
+
++ if (handled)
+ return IRQ_HANDLED;
+- } else {
++ else
+ return IRQ_NONE;
+- }
+ }
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0339-Staging-hv-vmbus-Do-not-enable-auto-eoi.patch b/patches.suse/staging-hv-staging-next-20110829-0339-Staging-hv-vmbus-Do-not-enable-auto-eoi.patch
new file mode 100644
index 0000000000..4c36824668
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0339-Staging-hv-vmbus-Do-not-enable-auto-eoi.patch
@@ -0,0 +1,31 @@
+From 93511baa06437785758be98ee7a7149c49c8e9c5 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:37 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Do not enable auto eoi
+
+Linux interrupt handling code generates the eoi; don't enable auto eoi.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/hv.c b/drivers/staging/hv/hv.c
+index 736794e..06f1e15 100644
+--- a/drivers/staging/hv/hv.c
++++ b/drivers/staging/hv/hv.c
+@@ -369,7 +369,7 @@ void hv_synic_init(void *irqarg)
+ shared_sint.as_uint64 = 0;
+ shared_sint.vector = irq_vector; /* HV_SHARED_SINT_IDT_VECTOR + 0x20; */
+ shared_sint.masked = false;
+- shared_sint.auto_eoi = true;
++ shared_sint.auto_eoi = false;
+
+ wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64);
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0340-Staging-hv-vmbus-Fixup-indentation-in-vmbus_acpi_.patch b/patches.suse/staging-hv-staging-next-20110829-0340-Staging-hv-vmbus-Fixup-indentation-in-vmbus_acpi_.patch
new file mode 100644
index 0000000000..185e875dbc
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0340-Staging-hv-vmbus-Fixup-indentation-in-vmbus_acpi_.patch
@@ -0,0 +1,34 @@
+From 0a4425b65dcdb3dc767c05308dd1078ef86e914c Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:38 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Fixup indentation in vmbus_acpi_add()
+
+Fixup indentation in vmbus_acpi_add().
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index 5dcc8c3..ed18488 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -678,9 +678,8 @@ static int vmbus_acpi_add(struct acpi_device *device)
+
+ hv_acpi_dev = device;
+
+- result =
+- acpi_walk_resources(device->handle, METHOD_NAME__CRS,
+- vmbus_walk_resources, &irq);
++ result = acpi_walk_resources(device->handle, METHOD_NAME__CRS,
++ vmbus_walk_resources, &irq);
+
+ if (ACPI_FAILURE(result)) {
+ complete(&probe_event);
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0341-Staging-hv-vmbus-Get-rid-of-some-dated-redundant.patch b/patches.suse/staging-hv-staging-next-20110829-0341-Staging-hv-vmbus-Get-rid-of-some-dated-redundant.patch
new file mode 100644
index 0000000000..5393bcd436
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0341-Staging-hv-vmbus-Get-rid-of-some-dated-redundant.patch
@@ -0,0 +1,71 @@
+From 0bce28b62e1927565566f8a1a7f127d196b87039 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:39 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of some dated/redundant comments
+
+Get rid of some dated/redundant comments in vmbus_drv.c
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/vmbus_drv.c | 11 +----------
+ 1 files changed, 1 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
+index ed18488..757943b 100644
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -391,9 +391,6 @@ static void vmbus_onmessage_work(struct work_struct *work)
+ kfree(ctx);
+ }
+
+-/*
+- * vmbus_on_msg_dpc - DPC routine to handle messages from the hypervisior
+- */
+ static void vmbus_on_msg_dpc(unsigned long data)
+ {
+ int cpu = smp_processor_id();
+@@ -490,16 +487,13 @@ static int vmbus_bus_init(int irq)
+ return ret;
+ }
+
+- /* Initialize the bus context */
+ tasklet_init(&msg_dpc, vmbus_on_msg_dpc, 0);
+ tasklet_init(&event_dpc, vmbus_on_event, 0);
+
+- /* Now, register the bus with LDM */
+ ret = bus_register(&hv_bus);
+ if (ret)
+ return ret;
+
+- /* Get the interrupt resource */
+ ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
+ driver_name, hv_acpi_dev);
+
+@@ -588,7 +582,6 @@ struct hv_device *vmbus_child_device_create(uuid_le *type,
+ {
+ struct hv_device *child_device_obj;
+
+- /* Allocate the new child device */
+ child_device_obj = kzalloc(sizeof(struct hv_device), GFP_KERNEL);
+ if (!child_device_obj) {
+ pr_err("Unable to allocate device object for child device\n");
+@@ -613,12 +606,10 @@ int vmbus_child_device_register(struct hv_device *child_device_obj)
+
+ static atomic_t device_num = ATOMIC_INIT(0);
+
+- /* Set the device name. Otherwise, device_register() will fail. */
+ dev_set_name(&child_device_obj->device, "vmbus_0_%d",
+ atomic_inc_return(&device_num));
+
+- /* The new device belongs to this bus */
+- child_device_obj->device.bus = &hv_bus; /* device->dev.bus; */
++ child_device_obj->device.bus = &hv_bus;
+ child_device_obj->device.parent = &hv_acpi_dev->dev;
+ child_device_obj->device.release = vmbus_device_release;
+
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0342-Staging-hv-vmbus-Get-rid-of-an-unnecessary-check.patch b/patches.suse/staging-hv-staging-next-20110829-0342-Staging-hv-vmbus-Get-rid-of-an-unnecessary-check.patch
new file mode 100644
index 0000000000..a0f51d248c
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0342-Staging-hv-vmbus-Get-rid-of-an-unnecessary-check.patch
@@ -0,0 +1,33 @@
+From c2ec81cb3e9d6cb6d819155883684d94fab005ad Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:41 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of an unnecessary check in vmbus_connect()
+
+Get rid of an unnecessary check in vmbus_connect().
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/connection.c | 4 ----
+ 1 files changed, 0 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
+index 6aab802..ca92ca3 100644
+--- a/drivers/staging/hv/connection.c
++++ b/drivers/staging/hv/connection.c
+@@ -50,10 +50,6 @@ int vmbus_connect(void)
+ struct vmbus_channel_initiate_contact *msg;
+ unsigned long flags;
+
+- /* Make sure we are not connecting or connected */
+- if (vmbus_connection.conn_state != DISCONNECTED)
+- return -EISCONN;
+-
+ /* Initialize the vmbus connection */
+ vmbus_connection.conn_state = CONNECTING;
+ vmbus_connection.work_queue = create_workqueue("hv_vmbus_con");
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0343-Staging-hv-vmbus-Fix-a-checkpatch-warning-in-ring.patch b/patches.suse/staging-hv-staging-next-20110829-0343-Staging-hv-vmbus-Fix-a-checkpatch-warning-in-ring.patch
new file mode 100644
index 0000000000..ee9514f78b
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0343-Staging-hv-vmbus-Fix-a-checkpatch-warning-in-ring.patch
@@ -0,0 +1,32 @@
+From b737b2e00d99a4c07ba3e50d2f5b154addfe7c76 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:42 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Fix a checkpatch warning in ring_buffer.c
+
+Fix a checkpatch warning in ring_buffer.c
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/ring_buffer.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/ring_buffer.c b/drivers/staging/hv/ring_buffer.c
+index 9212699..70e2e66 100644
+--- a/drivers/staging/hv/ring_buffer.c
++++ b/drivers/staging/hv/ring_buffer.c
+@@ -34,7 +34,8 @@
+
+
+ /* Amount of space to write to */
+-#define BYTES_AVAIL_TO_WRITE(r, w, z) ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))
++#define BYTES_AVAIL_TO_WRITE(r, w, z) \
++ ((w) >= (r)) ? ((z) - ((w) - (r))) : ((r) - (w))
+
+
+ /*
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0344-Staging-hv-vmbus-Fix-checkpatch-warnings-in-conne.patch b/patches.suse/staging-hv-staging-next-20110829-0344-Staging-hv-vmbus-Fix-checkpatch-warnings-in-conne.patch
new file mode 100644
index 0000000000..d28736376a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0344-Staging-hv-vmbus-Fix-checkpatch-warnings-in-conne.patch
@@ -0,0 +1,58 @@
+From d9add43b485538bd1e6c52d8177231ae31143265 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:43 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: vmbus: Fix checkpatch warnings in connection.c
+
+Fix checkpatch warnings in connection.c.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/connection.c | 13 +++++++------
+ 1 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
+index ca92ca3..9e99c04 100644
+--- a/drivers/staging/hv/connection.c
++++ b/drivers/staging/hv/connection.c
+@@ -220,11 +220,11 @@ static void process_chn_event(u32 relid)
+ channel = relid2channel(relid);
+
+ spin_lock_irqsave(&channel->inbound_lock, flags);
+- if (channel && (channel->onchannel_callback != NULL)) {
++ if (channel && (channel->onchannel_callback != NULL))
+ channel->onchannel_callback(channel->channel_callback_context);
+- } else {
++ else
+ pr_err("channel not found for relid - %u\n", relid);
+- }
++
+ spin_unlock_irqrestore(&channel->inbound_lock, flags);
+ }
+
+@@ -246,16 +246,17 @@ void vmbus_on_event(unsigned long data)
+ if (!recv_int_page[dword])
+ continue;
+ for (bit = 0; bit < 32; bit++) {
+- if (sync_test_and_clear_bit(bit, (unsigned long *)&recv_int_page[dword])) {
++ if (sync_test_and_clear_bit(bit,
++ (unsigned long *)&recv_int_page[dword])) {
+ relid = (dword << 5) + bit;
+
+- if (relid == 0) {
++ if (relid == 0)
+ /*
+ * Special case - vmbus
+ * channel protocol msg
+ */
+ continue;
+- }
++
+ process_chn_event(relid);
+ }
+ }
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0345-Staging-hv-mousevsc-Fix-checkpatch-errors-and-war.patch b/patches.suse/staging-hv-staging-next-20110829-0345-Staging-hv-mousevsc-Fix-checkpatch-errors-and-war.patch
new file mode 100644
index 0000000000..bd67deeb36
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0345-Staging-hv-mousevsc-Fix-checkpatch-errors-and-war.patch
@@ -0,0 +1,51 @@
+From bb5da491ffd48f7e401da364d4fb0577ce0e9939 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sat, 27 Aug 2011 11:31:44 -0700
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: mousevsc: Fix checkpatch errors and warnings
+
+Fix checkpatch errors and warnings.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/hv_mouse.c | 15 ++++++++-------
+ 1 files changed, 8 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
+index 090736a..dbb04ee 100644
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -335,7 +335,8 @@ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+ input_device->hid_desc = kzalloc(desc->bLength, GFP_KERNEL);
+
+ if (!input_device->hid_desc) {
+- pr_err("unable to allocate hid descriptor - size %d", desc->bLength);
++ pr_err("unable to allocate hid descriptor - size %d",
++ desc->bLength);
+ goto cleanup;
+ }
+
+@@ -598,12 +599,12 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
+ pr_info("synthhid protocol request...");
+
+ ret = vmbus_sendpacket(device->channel, request,
+- sizeof(struct pipe_prt_msg) -
+- sizeof(unsigned char) +
+- sizeof(struct synthhid_protocol_request),
+- (unsigned long)request,
+- VM_PKT_DATA_INBAND,
+- VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
++ sizeof(struct pipe_prt_msg) -
++ sizeof(unsigned char) +
++ sizeof(struct synthhid_protocol_request),
++ (unsigned long)request,
++ VM_PKT_DATA_INBAND,
++ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+ if (ret != 0) {
+ pr_err("unable to send synthhid protocol request.");
+ goto cleanup;
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-staging-next-20110829-0346-Staging-hv-netvsc-return-negative-error-codes.patch b/patches.suse/staging-hv-staging-next-20110829-0346-Staging-hv-netvsc-return-negative-error-codes.patch
new file mode 100644
index 0000000000..480342154f
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20110829-0346-Staging-hv-netvsc-return-negative-error-codes.patch
@@ -0,0 +1,31 @@
+From 7f9615e6f6c703c68f84460fe22b858be6c258d1 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <error27@gmail.com>
+Date: Sat, 27 Aug 2011 14:06:07 +0300
+Patch-mainline: staging-next-20110829 ?
+Subject: [PATCH] Staging: hv: netvsc: return negative error codes
+
+There was a typo here and we changed the -ENOMEM into +ENOMEM. The
+error codes aren't used, so this is just a cleanup.
+
+Signed-off-by: Dan Carpenter <error27@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/staging/hv/netvsc.c b/drivers/staging/hv/netvsc.c
+index e4cc40a..30d3139 100644
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -125,7 +125,7 @@ static int netvsc_destroy_recv_buf(struct netvsc_device *net_device)
+ if (ret != 0) {
+ dev_err(&net_device->dev->device,
+ "unable to teardown receive buffer's gpadl");
+- return -ret;
++ return ret;
+ }
+ net_device->recv_buf_gpadl_handle = 0;
+ }
+--
+1.6.0.2
+
diff --git a/patches.suse/staging-hv-vmbus-init-on-dmi-match.patch b/patches.suse/staging-hv-vmbus-init-on-dmi-match.patch
deleted file mode 100644
index 56650587d5..0000000000
--- a/patches.suse/staging-hv-vmbus-init-on-dmi-match.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From: <ohering@suse.de>
-Subject: hv: only load the driver in a hyper-v guest
-References: bnc#704957
-Patch-mainline: obsolete
-
----
- drivers/staging/hv/vmbus_drv.c | 18 ++++++++++++++++++
- 1 file changed, 18 insertions(+)
-
---- a/drivers/staging/hv/vmbus_drv.c
-+++ b/drivers/staging/hv/vmbus_drv.c
-@@ -32,6 +32,7 @@
- #include <linux/dmi.h>
- #include <linux/slab.h>
- #include <linux/acpi.h>
-+#include <linux/dmi.h>
- #include <acpi/acpi_bus.h>
- #include <linux/completion.h>
-
-@@ -824,10 +825,27 @@ static struct pci_driver hv_bus_driver =
- };
- MODULE_DEVICE_TABLE(pci, microsoft_hv_pci_table);
-
-+static const struct dmi_system_id __initconst
-+hv_vmbus_dmi_table[] __maybe_unused = {
-+ {
-+ .ident = "Hyper-V",
-+ .matches = {
-+ DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
-+ DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
-+ DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
-+ },
-+ },
-+ { },
-+};
-+MODULE_DEVICE_TABLE(dmi, hv_vmbus_dmi_table);
-+
- static int __init hv_acpi_init(void)
- {
- int ret;
-
-+ if (!dmi_check_system(hv_vmbus_dmi_table))
-+ return -ENODEV;
-+
- init_completion(&probe_event);
-
- /*
diff --git a/series.conf b/series.conf
index 796d75c2a3..f7abf92c0a 100644
--- a/series.conf
+++ b/series.conf
@@ -423,7 +423,125 @@
########################################################
# Other driver fixes
########################################################
- patches.suse/staging-hv-vmbus-init-on-dmi-match.patch
+ # http://git.kernel.org/?p=linux/kernel/git/gregkh/staging-2.6.git;a=history;f=drivers/staging/hv;hb=refs/heads/staging-next
+ patches.suse/staging-hv-staging-next-20110825-0001-Staging-hv-vmbus-Don-t-wait-indefinitely-for-IRQ.patch
+ patches.suse/staging-hv-staging-next-20110825-0002-Staging-hv-tools-Fix-a-checkpatch-warning-in-hv_k.patch
+ patches.suse/staging-hv-staging-next-20110825-0003-Staging-hv-vmbus-Fix-checkpatch-warnings.patch
+ patches.suse/staging-hv-staging-next-20110825-0004-Staging-hv-util-kvp-Fix-the-reported-OSVersion-s.patch
+ patches.suse/staging-hv-staging-next-20110825-0005-Staging-hv-util-kvp-Cleanup-kvp_get_domain_name.patch
+ patches.suse/staging-hv-staging-next-20110825-0006-Staging-hv-Fix-macros-tab-errors-and-warning-in-d.patch
+ patches.suse/staging-hv-staging-next-20110825-0007-Staging-hv-vmbus-VMBUS-is-an-ACPI-enumerated-devi.patch
+ patches.suse/staging-hv-staging-next-20110825-0008-Staging-hv-Replace-struct-hv_guid-with-the-uuid-ty.patch
+ patches.suse/staging-hv-staging-next-20110825-0009-Staging-hv-vmbus-Introduce-vmbus-ID-space-in-stru.patch
+ patches.suse/staging-hv-staging-next-20110825-0010-Staging-hv-blkvsc-Use-the-newly-introduced-vmbus.patch
+ patches.suse/staging-hv-staging-next-20110825-0011-Staging-hv-storvsc-Use-the-newly-introduced-vmbus.patch
+ patches.suse/staging-hv-staging-next-20110825-0012-Staging-hv-netvsc-Use-the-newly-introduced-vmbus.patch
+ patches.suse/staging-hv-staging-next-20110825-0013-Staging-hv-mousevsc-Use-the-newly-introduced-vmbu.patch
+ patches.suse/staging-hv-staging-next-20110825-0014-Staging-hv-util-Make-hv_utils-a-vmbus-device-driv.patch
+ patches.suse/staging-hv-staging-next-20110825-0015-Staging-hv-create-VMBUS_DEVICE-macro-and-use-it.patch
+ patches.suse/staging-hv-staging-next-20110825-0016-Staging-hv-vmbus-Cleanup-vmbus_match.patch
+ patches.suse/staging-hv-staging-next-20110825-0017-Staging-hv-vmbus-Cleanup-vmbus_uevent-code.patch
+ patches.suse/staging-hv-staging-next-20110825-0018-Staging-hv-vmbus-Support-the-notion-of-id-tables.patch
+ patches.suse/staging-hv-staging-next-20110825-0019-Staging-hv-vmbus-Get-rid-of-an-unnecessary-includ.patch
+ patches.suse/staging-hv-staging-next-20110825-0020-Staging-hv-storvsc-Get-rid-of-the-DMI-signature.patch
+ patches.suse/staging-hv-staging-next-20110825-0021-Staging-hv-netvsc-Get-rid-of-the-PCI-signature.patch
+ patches.suse/staging-hv-staging-next-20110825-0022-Staging-hv-netvsc-Get-rid-of-the-DMI-signature-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0023-Staging-hv-util-Get-rid-of-the-DMI-signature-in-h.patch
+ patches.suse/staging-hv-staging-next-20110825-0024-Staging-hv-util-Get-rid-of-the-PCI-signature-in-h.patch
+ patches.suse/staging-hv-staging-next-20110825-0025-Staging-hv-fix-up-driver-registering-mess.patch
+ patches.suse/staging-hv-staging-next-20110825-0026-Staging-hv-vmbus-Get-rid-of-some-unnecessary-comm.patch
+ patches.suse/staging-hv-staging-next-20110825-0027-Staging-hv-vmbus-Cleanup-unnecessary-comments-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0028-Staging-hv-vmbus-Cleanup-error-handling-in-hv_ini.patch
+ patches.suse/staging-hv-staging-next-20110825-0029-Staging-hv-vmbus-Get-rid-of-unnecessay-comments-i.patch
+ patches.suse/staging-hv-staging-next-20110825-0030-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch
+ patches.suse/staging-hv-staging-next-20110825-0031-Staging-hv-vmbus-Get-rid-of-the-function-dump_gpa.patch
+ patches.suse/staging-hv-staging-next-20110825-0032-Staging-hv-vmbus-Rename-openMsg-to-open_msg-in-ch.patch
+ patches.suse/staging-hv-staging-next-20110825-0033-Staging-hv-vmbus-Get-rid-of-unnecessary-comments.patch
+ patches.suse/staging-hv-staging-next-20110825-0034-Staging-hv-vmbus-Change-the-variable-name-openInf.patch
+ patches.suse/staging-hv-staging-next-20110825-0035-Staging-hv-vmbus-Cleanup-error-values-in-ringbuff.patch
+ patches.suse/staging-hv-staging-next-20110825-0036-Staging-hv-vmbus-Cleanup-the-error-return-value-i.patch
+ patches.suse/staging-hv-staging-next-20110825-0037-Staging-hv-netvsc-Get-rid-of-an-unnecessary-print.patch
+ patches.suse/staging-hv-staging-next-20110825-0038-Staging-hv-vmbus-Retry-vmbus_post_msg-before-gi.patch
+ patches.suse/staging-hv-staging-next-20110825-0039-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
+ patches.suse/staging-hv-staging-next-20110825-0040-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
+ patches.suse/staging-hv-staging-next-20110825-0041-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
+ patches.suse/staging-hv-staging-next-20110825-0042-Staging-hv-storvsc-Cleanup-error-handling-in-stor.patch
+ patches.suse/staging-hv-staging-next-20110825-0043-Storage-hv-storvsc-Get-rid-of-some-unnecessary-DP.patch
+ patches.suse/staging-hv-staging-next-20110825-0044-Staging-hv-storvsc-Fix-cleanup-some-dated-comment.patch
+ patches.suse/staging-hv-staging-next-20110825-0045-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0046-Staging-hv-storvsc-Cleanup-error-code-returned-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0047-Staging-hv-storvsc-Cleanup-returned-error-code-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0048-Staging-hv-netvsc-Cleanup-the-returned-error-code.patch
+ patches.suse/staging-hv-staging-next-20110825-0049-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch
+ patches.suse/staging-hv-staging-next-20110825-0050-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0051-Staging-hv-netvsc-Cleanup-error-returns-in-netvsc.patch
+ patches.suse/staging-hv-staging-next-20110825-0052-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0053-Staging-hv-netvsc-Cleanup-error-return-codes-in-n.patch
+ patches.suse/staging-hv-staging-next-20110825-0054-Staging-hv-netvsc-Cleanup-error-codes-in-rndis_fi.patch
+ patches.suse/staging-hv-staging-next-20110825-0055-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch
+ patches.suse/staging-hv-staging-next-20110825-0056-Staging-hv-netvsc-Cleanup-error-return-values-in.patch
+ patches.suse/staging-hv-staging-next-20110825-0057-Staging-hv-netvsc-Cleanup-error-returns-in-rndis_.patch
+ patches.suse/staging-hv-staging-next-20110825-0058-Staging-hv-netvsc-Cleanup-error-code-in-rndis_fil.patch
+ patches.suse/staging-hv-staging-next-20110825-0059-Staging-hv-mouse-Change-the-jump-label-Cleanup-to.patch
+ patches.suse/staging-hv-staging-next-20110825-0060-Staging-hv-netvsc-Change-the-jump-label-Cleanup-t.patch
+ patches.suse/staging-hv-staging-next-20110825-0061-Staging-hv-netvsc-Change-the-jump-label-Exit-to-e.patch
+ patches.suse/staging-hv-staging-next-20110825-0062-Staging-hv-mouse-Get-rid-of-the-unused-PCI-signat.patch
+ patches.suse/staging-hv-staging-next-20110825-0063-Staging-hv-hv_mouse-remove-deviceinfo_callback-fu.patch
+ patches.suse/staging-hv-staging-next-20110825-0064-Staging-hv-hv_mouse-remove-inputreport_callback-f.patch
+ patches.suse/staging-hv-staging-next-20110825-0065-Staging-hv-hv_mouse-remove-a-forward-declaration.patch
+ patches.suse/staging-hv-staging-next-20110825-0066-Staging-hv-hv_mouse-fix-up-remove-function.patch
+ # module support patches outside of drivers/staging/hv
+ patches.suse/staging-hv-staging-next-20110825-0562-Staging-hv-Add-struct-hv_vmbus_device_id-to-mod_de.patch
+ patches.suse/staging-hv-staging-next-20110825-0563-Staging-hv-add-driver_data-to-hv_vmbus_device_id.patch
+ patches.suse/staging-hv-staging-next-20110825-0568-Staging-hv-Add-code-to-parse-struct-hv_vmbus_devic.patch
+ patches.suse/staging-hv-staging-next-20110825-0570-Staging-hv-file2alias-fix-up-alias-creation-logic.patch
+
+ patches.suse/staging-hv-staging-next-20110829-0303-Staging-hv-storvsc-Inline-free_stor_device.patch
+ patches.suse/staging-hv-staging-next-20110829-0304-Staging-hv-storvsc-Do-not-aquire-an-unnecessary-r.patch
+ patches.suse/staging-hv-staging-next-20110829-0305-Staging-hv-storvsc-Rename-must_get_stor_device.patch
+ patches.suse/staging-hv-staging-next-20110829-0306-Staging-hv-storvsc-Rename-get_stor_device.patch
+ patches.suse/staging-hv-staging-next-20110829-0307-Staging-hv-storvsc-Cleanup-alloc_stor_device.patch
+ patches.suse/staging-hv-staging-next-20110829-0308-Staging-hv-storvsc-Introduce-state-to-manage-the.patch
+ patches.suse/staging-hv-staging-next-20110829-0309-Staging-hv-storvsc-Prevent-outgoing-traffic-when.patch
+ patches.suse/staging-hv-staging-next-20110829-0310-Staging-hv-storvsc-Get-rid-of-release_stor_device.patch
+ patches.suse/staging-hv-staging-next-20110829-0311-Staging-hv-storvsc-Get-rid-of-final_release_stor_.patch
+ patches.suse/staging-hv-staging-next-20110829-0312-Staging-hv-storvsc-Get-rid-of-the-reference-count.patch
+ patches.suse/staging-hv-staging-next-20110829-0313-Staging-hv-netvsc-Inline-the-code-for-free_net_de.patch
+ patches.suse/staging-hv-staging-next-20110829-0314-Staging-hv-netvsc-Cleanup-alloc_net_device.patch
+ patches.suse/staging-hv-staging-next-20110829-0315-Staging-hv-netvsc-Introduce-state-to-manage-the-l.patch
+ patches.suse/staging-hv-staging-next-20110829-0316-Staging-hv-netvsc-Prevent-outgoing-traffic-when-n.patch
+ patches.suse/staging-hv-staging-next-20110829-0317-Staging-hv-netvsc-Get-rid-of-release_outbound_net.patch
+ patches.suse/staging-hv-staging-next-20110829-0318-Staging-hv-netvsc-Get-rid-of-release_inbound_net_.patch
+ patches.suse/staging-hv-staging-next-20110829-0319-Staging-hv-netvsc-Get-rid-of-the-refcnt-field-in.patch
+ patches.suse/staging-hv-staging-next-20110829-0320-Staging-hv-storvsc-Add-code-to-handle-IDE-devices.patch
+ patches.suse/staging-hv-staging-next-20110829-0321-Staging-hv-storvsc-Handle-IDE-devices-using-the-s.patch
+ patches.suse/staging-hv-staging-next-20110829-0322-Staging-hv-blkvsc-Get-rid-of-blkvsc_drv.c-as-this.patch
+ patches.suse/staging-hv-staging-next-20110829-0323-Staging-hv-storvsc-Optimize-bounce-buffer-handlin.patch
+ patches.suse/staging-hv-staging-next-20110829-0324-Staging-hv-storvsc-Optimize-the-bounce-buffer-han.patch
+ patches.suse/staging-hv-staging-next-20110829-0325-Staging-hv-storvsc-Include-storvsc.c-in-storvsc_d.patch
+ patches.suse/staging-hv-staging-next-20110829-0326-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch
+ patches.suse/staging-hv-staging-next-20110829-0327-Staging-hv-storvsc-Add-the-contents-of-hyperv_sto.patch
+ patches.suse/staging-hv-staging-next-20110829-0328-Staging-hv-storvsc-Cleanup-storvsc_drv.c-after-ad.patch
+ patches.suse/staging-hv-staging-next-20110829-0329-Staging-hv-storvsc-Fixup-srb-and-scsi-status-for.patch
+ patches.suse/staging-hv-staging-next-20110829-0330-Staging-hv-storvsc-Fix-a-typo.patch
+ patches.suse/staging-hv-staging-next-20110829-0331-Staging-hv-storvsc-In-case-of-scsi-errors-offline.patch
+ patches.suse/staging-hv-staging-next-20110829-0332-Staging-hv-storvsc-No-need-to-copy-from-bounce-bu.patch
+ patches.suse/staging-hv-staging-next-20110829-0333-Staging-hv-util-Forcefully-shutdown-when-shutdown.patch
+ patches.suse/staging-hv-staging-next-20110829-0334-Staging-hv-util-Adjust-guest-time-in-a-process-co.patch
+ patches.suse/staging-hv-staging-next-20110829-0335-Staging-hv-vmbus-Check-before-invoking-the-channe.patch
+ patches.suse/staging-hv-staging-next-20110829-0336-Staging-hv-vmbus-Properly-deal-with-de-registerin.patch
+ patches.suse/staging-hv-staging-next-20110829-0337-Staging-hv-Fix-a-bug-in-vmbus_match.patch
+ patches.suse/staging-hv-staging-next-20110829-0338-Staging-hv-vmbus-Get-rid-of-vmbus_on_isr-by-inl.patch
+ patches.suse/staging-hv-staging-next-20110829-0339-Staging-hv-vmbus-Do-not-enable-auto-eoi.patch
+ patches.suse/staging-hv-staging-next-20110829-0340-Staging-hv-vmbus-Fixup-indentation-in-vmbus_acpi_.patch
+ patches.suse/staging-hv-staging-next-20110829-0341-Staging-hv-vmbus-Get-rid-of-some-dated-redundant.patch
+ patches.suse/staging-hv-staging-next-20110829-0342-Staging-hv-vmbus-Get-rid-of-an-unnecessary-check.patch
+ patches.suse/staging-hv-staging-next-20110829-0343-Staging-hv-vmbus-Fix-a-checkpatch-warning-in-ring.patch
+ patches.suse/staging-hv-staging-next-20110829-0344-Staging-hv-vmbus-Fix-checkpatch-warnings-in-conne.patch
+ patches.suse/staging-hv-staging-next-20110829-0345-Staging-hv-mousevsc-Fix-checkpatch-errors-and-war.patch
+ patches.suse/staging-hv-staging-next-20110829-0346-Staging-hv-netvsc-return-negative-error-codes.patch
+
+ patches.suse/staging-hv-pata_piix-ignore-disks.patch
patches.fixes/parport-mutex
patches.suse/no-partition-scan