Home Home > GIT Browse > SLE12-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlaf Hering <ohering@suse.de>2011-10-12 21:56:23 +0200
committerOlaf Hering <ohering@suse.de>2011-10-12 21:56:23 +0200
commitc836841c92e5dddedad6b9283c93b1146d7d149b (patch)
treef1f85483945c534f5920dbe9f48c0ec5d46058e4
parent2fc2aaf9b6e1d7e7c8eb49347885317da97ca7ce (diff)
- Various updates for hv drivers, which fix also the hv_mouse driver
- staging: hv: storvsc: ignore SET_WINDOWN scsi command (bnc#722646). - staging/hv: advertise hv_storvsc instead of storvsc as sysfs driver name (bnc#716708). - staging/hv: fill scsi/proc_name for the sake of mkinitrd (bnc#716708). - Staging: hv: util: Invoke cn_netlink_send() in a work context. - Refresh patches.suse/staging-hv-pata_piix-ignore-disks.patch. - Refresh patches.xen/xen3-patch-2.6.32. - Delete patches.suse/staging-hv-vmbus-modalias-show.patch.
-rw-r--r--patches.suse/staging-hv-bind-hv_blkkvsc-to-hv_storvsc.patch17
-rw-r--r--patches.suse/staging-hv-netvsc-module-name.patch29
-rw-r--r--patches.suse/staging-hv-netvsc-rndis_filter_receive-dereferencing-issue.patch30
-rw-r--r--patches.suse/staging-hv-pata_piix-ignore-disks.patch39
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0051-Staging-hv-util-Deal-with-driver-register-failure.patch61
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0052-Staging-hv-vmbus-Fix-a-bug-in-error-handling-in-v.patch68
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0053-Staging-hv-vmbus-Check-for-events-before-messages.patch55
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0054-Staging-hv-vmbus-Cleanup-the-code-in-process_chn_.patch51
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0055-staging-hv-remove-unnecessary-includes-in-netvsc.patch48
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0056-staging-hv-add-newline-to-log-messages-in-netvsc.patch267
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0057-staging-hv-convert-dev_-loglevel-to-netdev_-logle.patch423
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0058-staging-hv-fix-a-kernel-warning-in-netvsc_linkstat.patch34
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0059-staging-hv-re-order-the-code-in-netvsc_probe.patch67
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0060-staging-hv-fix-counting-of-outstanding-sends-in-f.patch29
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0061-staging-hv-fix-counting-of-available-buffer-slots.patch30
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0062-staging-hv-fix-the-return-status-of-netvsc_start_x.patch42
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0063-staging-hv-fix-the-page-buffer-when-rndis-data-go.patch43
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0064-staging-hv-fix-some-typos-in-netvsc.c.patch34
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0065-Staging-hv-Update-TODO-file.patch34
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0066-Staging-hv-vmbus-Show-the-modalias-in-sys-bus-vm.patch (renamed from patches.suse/staging-hv-vmbus-modalias-show.patch)15
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0129-Staging-hv-Add-support-for-2-TB-LUN-in-storage-dr.patch39
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0243-Staging-hv-vmbus-Rename-vmbus_child_device_create.patch55
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0244-Staging-hv-vmbus-Rename-vmbus_child_device_regist.patch54
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0245-Staging-hv-vmbus-Rename-vmbus_child_device_unregi.patch55
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0246-Staging-hv-vmbus-Cleanup-dated-comments-in-channe.patch27
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0293-Staging-hv-vmbus-Introduce-a-utility-function-to.patch55
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0294-Staging-hv-vmbus-Change-the-signature-of-struct-h.patch95
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0295-Staging-hv-storvsc-Use-the-driver_data-to-identif.patch61
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0296-Staging-hv-vmbus-Introduce-functions-for-setting.patch33
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0297-Staging-hv-vmbus-Cleanup-vmbus_remove.patch46
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0298-Staging-hv-storvsc-Get-rid-of-storvsc_dev_add-b.patch107
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0299-Staging-hv-storvsc-Get-rid-of-alloc_stor_device.patch61
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0300-Staging-hv-storvsc-Get-rid-of-some-unnecessary-st.patch40
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0301-Staging-hv-storvsc-Eliminate-the-usage-of-ext-fie.patch106
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0302-Staging-hv-netvsc-Get-rid-of-the-usage-of-the-ext.patch437
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0303-Staging-hv-mousevsc-Get-rid-of-the-usage-of-the-e.patch98
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0304-Staging-hv-vmbus-Get-rid-of-the-ext-field-in-stru.patch28
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0305-Staging-hv-vmbus-Do-not-allocate-struct-hv_device.patch189
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0306-Staging-hv-vmbus-Get-rid-of-the-module-dependency.patch26
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0307-Staging-hv-netvsc-Rename-netDevice-as-net_device.patch71
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0308-Staging-hv-netvsc-Rename-rndisDevice-to-rndis_dev.patch83
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0309-Staging-hv-netvsc-Rename-deviceInfo-as-device_inf.patch45
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0310-Staging-hv-netvsc-Cleanup-the-name-and-type-of-li.patch62
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0421-Staging-hv-util-Perform-some-service-specific-ini.patch254
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0422-Staging-hv-util-Properly-handle-util-services-in.patch186
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0423-Staging-hv-vmbus-Get-rid-of-hv_cb_utils-and-oth.patch155
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0476-Staging-hv-Update-the-TODO-file.patch25
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0479-staging-hv-remove-the-carrier-status-check-from-ne.patch56
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0579-Staging-hv-mousevsc-Fixup-struct-hv_input_dev_inf.patch48
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0580-Staging-hv-mousevsc-Get-rid-of-the-struct-input_d.patch163
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0581-Staging-hv-mousevsc-Fixup-some-bogus-WARN_ON-ca.patch44
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0582-Staging-hv-mousevsc-Change-the-allocation-flags-t.patch44
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0583-Staging-hv-mousevsc-Handle-the-case-where-we-may.patch26
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0584-Staging-hv-mousevsc-Correctly-initialize-the-head.patch26
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0585-Staging-hv-mousevsc-Use-completion-primitive-to-s.patch110
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0586-Staging-hv-mousevsc-Cleanup-and-properly-implemen.patch105
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0587-Staging-hv-mousevsc-Get-rid-of-unnecessary-DPRINT.patch65
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0588-Staging-hv-mousevsc-Cleanup-error-handling.patch92
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0589-Staging-hv-mousevsc-Get-rid-of-unnecessary-pr_-c.patch212
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0590-Staging-hv-mousevsc-Free-allocated-memory-in-free.patch26
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0591-Staging-hv-mousevsc-Get-rid-of-the-unused-state.patch34
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0592-Staging-hv-mousevsc-Cleanup-alloc_input_device.patch26
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0593-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_send_c.patch53
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0594-Staging-hv-mousevsc-Cleanup-mousevsc_connect_to_v.patch77
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0595-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_device.patch80
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0596-Staging-hv-mousevsc-Now-cleanup-mousevsc_remove.patch103
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0597-Staging-hv-mousevsc-Get-rid-of-ref_count-state-in.patch132
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0598-Staging-hv-mousevsc-Cleanup-camel-cased-enums.patch108
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0599-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_receiv.patch64
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0600-Staging-hv-mousevsc-Cleanup-mousevsc_on_device_ad.patch50
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0601-Staging-hv-mousevsc-Enable-autoloading-of-the-mou.patch29
-rw-r--r--patches.suse/staging-hv-staging-next-20111001-0602-Staging-hv-mousevsc-Get-rid-of-unnecessary-commen.patch111
-rw-r--r--patches.suse/staging-hv-storvsc-ignore-SET_WINDOW.patch50
-rw-r--r--patches.suse/staging-hv-storvsc-module-name.patch40
-rw-r--r--patches.suse/staging-hv-storvsc-scsi-proc_name.patch26
-rw-r--r--patches.suse/staging-hv-util-fix-a-bug-in-kvp-implementation.patch82
-rw-r--r--patches.suse/staging-hv-util-invoke-cn_netlink_send-in-a-work-context.patch92
-rw-r--r--patches.xen/xen3-patch-2.6.324
-rw-r--r--series.conf62
79 files changed, 6116 insertions, 33 deletions
diff --git a/patches.suse/staging-hv-bind-hv_blkkvsc-to-hv_storvsc.patch b/patches.suse/staging-hv-bind-hv_blkkvsc-to-hv_storvsc.patch
new file mode 100644
index 0000000000..26f72845d6
--- /dev/null
+++ b/patches.suse/staging-hv-bind-hv_blkkvsc-to-hv_storvsc.patch
@@ -0,0 +1,17 @@
+Subject: staging-hv: bind old hv_blkvsc to hv_storvsc
+From: <ohering@suse.de>
+Patch-mainline: never
+---
+ drivers/staging/hv/storvsc_drv.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1456,5 +1456,7 @@ static void __exit storvsc_drv_exit(void
+ MODULE_LICENSE("GPL");
+ MODULE_VERSION(HV_DRV_VERSION);
+ MODULE_DESCRIPTION("Microsoft Hyper-V virtual storage driver");
++/* bind to old driver to simplify upgrade path */
++MODULE_ALIAS("hv_blkvsc");
+ module_init(storvsc_drv_init);
+ module_exit(storvsc_drv_exit);
diff --git a/patches.suse/staging-hv-netvsc-module-name.patch b/patches.suse/staging-hv-netvsc-module-name.patch
new file mode 100644
index 0000000000..6f42f8230b
--- /dev/null
+++ b/patches.suse/staging-hv-netvsc-module-name.patch
@@ -0,0 +1,29 @@
+From: <ohering@suse.de>
+Subject: staging/hv: advertise hv_netvsc instead of netvsc as sysfs driver name
+References: bnc#716708
+Patch-mainline: 3.4.2 ?
+
+---
+ drivers/staging/hv/netvsc_drv.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -294,7 +294,7 @@ int netvsc_recv_callback(struct hv_devic
+ static void netvsc_get_drvinfo(struct net_device *net,
+ struct ethtool_drvinfo *info)
+ {
+- strcpy(info->driver, "hv_netvsc");
++ strcpy(info->driver, KBUILD_MODNAME);
+ strcpy(info->version, HV_DRV_VERSION);
+ strcpy(info->fw_version, "N/A");
+ }
+@@ -432,7 +432,7 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
+
+ /* The one and only one */
+ static struct hv_driver netvsc_drv = {
+- .name = "netvsc",
++ .name = KBUILD_MODNAME,
+ .id_table = id_table,
+ .probe = netvsc_probe,
+ .remove = netvsc_remove,
diff --git a/patches.suse/staging-hv-netvsc-rndis_filter_receive-dereferencing-issue.patch b/patches.suse/staging-hv-netvsc-rndis_filter_receive-dereferencing-issue.patch
new file mode 100644
index 0000000000..0d6471cc21
--- /dev/null
+++ b/patches.suse/staging-hv-netvsc-rndis_filter_receive-dereferencing-issue.patch
@@ -0,0 +1,30 @@
+Subject: [PATCH 1/1] Staging: hv: netvsc: Fix a dereferencing issue
+Message-Id: <1317921056-17141-1-git-send-email-kys@microsoft.com>
+From: <ohering@suse.de>
+Patch-mainline: Submitted staging-next 20111009
+
+net_dev is being de-referenced without proper checking; fix it.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+---
+ drivers/staging/hv/rndis_filter.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -368,11 +368,11 @@ int rndis_filter_receive(struct hv_devic
+ struct rndis_message *rndis_hdr;
+ struct net_device *ndev;
+
+- ndev = net_dev->ndev;
+-
+ if (!net_dev)
+ return -EINVAL;
+
++ ndev = net_dev->ndev;
++
+ /* Make sure the rndis device state is initialized */
+ if (!net_dev->extension) {
+ netdev_err(ndev, "got rndis message but no rndis device - "
diff --git a/patches.suse/staging-hv-pata_piix-ignore-disks.patch b/patches.suse/staging-hv-pata_piix-ignore-disks.patch
index 207a7f9b72..6d9644768b 100644
--- a/patches.suse/staging-hv-pata_piix-ignore-disks.patch
+++ b/patches.suse/staging-hv-pata_piix-ignore-disks.patch
@@ -7,23 +7,12 @@ See comments inline.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
- drivers/ata/ata_piix.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 54 insertions(+)
+ drivers/ata/ata_piix.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 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 {
+@@ -164,6 +164,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);
@@ -31,7 +20,7 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
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
+@@ -346,6 +347,7 @@ static struct ata_port_operations piix_p
.set_piomode = piix_set_piomode,
.set_dmamode = piix_set_dmamode,
.prereset = piix_pata_prereset,
@@ -39,11 +28,11 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
};
static struct ata_port_operations piix_vmw_ops = {
-@@ -619,6 +625,24 @@ MODULE_LICENSE("GPL");
+@@ -619,6 +621,29 @@ MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
MODULE_VERSION(DRV_VERSION);
-+#if defined(PIIX_IGNORE_ATA_ON_HYPERV)
++#if defined(CONFIG_HYPERV_STORAGE) || defined(CONFIG_HYPERV_STORAGE_MODULE)
+static int piix_msft_hyperv(void)
+{
+ static const struct dmi_system_id hv_dmi_ident[] = {
@@ -59,22 +48,23 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
+ };
+ return !!dmi_check_system(hv_dmi_ident);
+}
++#else
++static inline int piix_msft_hyperv(void)
++{
++ return 0;
++}
+#endif
+
struct ich_laptop {
u16 device;
u16 subvendor;
-@@ -702,6 +726,29 @@ static int piix_pata_prereset(struct ata
+@@ -702,6 +727,24 @@ 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.
@@ -87,24 +77,21 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
+ 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)
+@@ -1679,6 +1722,11 @@ 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-20111001-0051-Staging-hv-util-Deal-with-driver-register-failure.patch b/patches.suse/staging-hv-staging-next-20111001-0051-Staging-hv-util-Deal-with-driver-register-failure.patch
new file mode 100644
index 0000000000..5cdcc06ca9
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0051-Staging-hv-util-Deal-with-driver-register-failure.patch
@@ -0,0 +1,61 @@
+From d531babe8259992be32144f2c80fa5e15f9d4d26 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Wed, 31 Aug 2011 14:35:54 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: util: Deal with driver register failures
+
+Properly deal with vmbus_driver_register() failures.
+
+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 | 21 ++++++++++++++++-----
+ 1 file changed, 16 insertions(+), 5 deletions(-)
+
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -277,6 +277,7 @@ static struct hv_driver util_drv = {
+
+ static int __init init_hyperv_utils(void)
+ {
++ int ret;
+ pr_info("Registering HyperV Utility Driver\n");
+
+ if (hv_kvp_init())
+@@ -289,12 +290,15 @@ static int __init init_hyperv_utils(void
+
+ if (!shut_txf_buf || !time_txf_buf || !hbeat_txf_buf) {
+ pr_info("Unable to allocate memory for receive buffer\n");
+- kfree(shut_txf_buf);
+- kfree(time_txf_buf);
+- kfree(hbeat_txf_buf);
+- return -ENOMEM;
++ ret = -ENOMEM;
++ goto err;
+ }
+
++ ret = vmbus_driver_register(&util_drv);
++
++ if (ret != 0)
++ goto err;
++
+ hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback;
+
+ hv_cb_utils[HV_TIMESYNC_MSG].callback = &timesync_onchannelcallback;
+@@ -303,7 +307,14 @@ static int __init init_hyperv_utils(void
+
+ hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
+
+- return vmbus_driver_register(&util_drv);
++ return 0;
++
++err:
++ kfree(shut_txf_buf);
++ kfree(time_txf_buf);
++ kfree(hbeat_txf_buf);
++
++ return ret;
+ }
+
+ static void exit_hyperv_utils(void)
diff --git a/patches.suse/staging-hv-staging-next-20111001-0052-Staging-hv-vmbus-Fix-a-bug-in-error-handling-in-v.patch b/patches.suse/staging-hv-staging-next-20111001-0052-Staging-hv-vmbus-Fix-a-bug-in-error-handling-in-v.patch
new file mode 100644
index 0000000000..da5937ac4c
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0052-Staging-hv-vmbus-Fix-a-bug-in-error-handling-in-v.patch
@@ -0,0 +1,68 @@
+From 8b9987e9050aeba12325a3f0ab0f4a2934c37c3c Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Wed, 31 Aug 2011 14:35:55 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Fix a bug in error handling in vmbus_bus_init()
+
+Fix a bug in error handling in vmbus_bus_init().
+
+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 | 26 +++++++++++++++-----------
+ 1 file changed, 15 insertions(+), 11 deletions(-)
+
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -492,7 +492,7 @@ static int vmbus_bus_init(int irq)
+
+ ret = bus_register(&hv_bus);
+ if (ret)
+- return ret;
++ goto err_cleanup;
+
+ ret = request_irq(irq, vmbus_isr, IRQF_SAMPLE_RANDOM,
+ driver_name, hv_acpi_dev);
+@@ -500,10 +500,7 @@ static int vmbus_bus_init(int irq)
+ if (ret != 0) {
+ pr_err("Unable to request IRQ %d\n",
+ irq);
+-
+- bus_unregister(&hv_bus);
+-
+- return ret;
++ goto err_unregister;
+ }
+
+ vector = IRQ0_VECTOR + irq;
+@@ -514,16 +511,23 @@ static int vmbus_bus_init(int irq)
+ */
+ on_each_cpu(hv_synic_init, (void *)&vector, 1);
+ ret = vmbus_connect();
+- if (ret) {
+- free_irq(irq, hv_acpi_dev);
+- bus_unregister(&hv_bus);
+- return ret;
+- }
+-
++ if (ret)
++ goto err_irq;
+
+ vmbus_request_offers();
+
+ return 0;
++
++err_irq:
++ free_irq(irq, hv_acpi_dev);
++
++err_unregister:
++ bus_unregister(&hv_bus);
++
++err_cleanup:
++ hv_cleanup();
++
++ return ret;
+ }
+
+ /**
diff --git a/patches.suse/staging-hv-staging-next-20111001-0053-Staging-hv-vmbus-Check-for-events-before-messages.patch b/patches.suse/staging-hv-staging-next-20111001-0053-Staging-hv-vmbus-Check-for-events-before-messages.patch
new file mode 100644
index 0000000000..45a801448a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0053-Staging-hv-vmbus-Check-for-events-before-messages.patch
@@ -0,0 +1,55 @@
+From 7341d908af307a34098a9da52f49037d815c868f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Wed, 31 Aug 2011 14:35:56 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Check for events before messages
+
+The Windows team has informed us that on Windows guests on Hyper-V,
+they check for events before messages. They also recommended that we do
+the same. This patch addresses this.
+
+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 | 22 ++++++++++++++--------
+ 1 file changed, 14 insertions(+), 8 deletions(-)
+
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -442,14 +442,11 @@ static irqreturn_t vmbus_isr(int irq, vo
+ 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) {
+- handled = true;
+- tasklet_schedule(&msg_dpc);
+- }
++ /*
++ * Check for events before checking for messages. This is the order
++ * in which events and messages are checked in Windows guests on
++ * Hyper-V, and the Windows team suggested we do the same.
++ */
+
+ page_addr = hv_context.synic_event_page[cpu];
+ event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;
+@@ -460,6 +457,15 @@ static irqreturn_t vmbus_isr(int irq, vo
+ tasklet_schedule(&event_dpc);
+ }
+
++ 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 processed */
++ if (msg->header.message_type != HVMSG_NONE) {
++ handled = true;
++ tasklet_schedule(&msg_dpc);
++ }
++
+ if (handled)
+ return IRQ_HANDLED;
+ else
diff --git a/patches.suse/staging-hv-staging-next-20111001-0054-Staging-hv-vmbus-Cleanup-the-code-in-process_chn_.patch b/patches.suse/staging-hv-staging-next-20111001-0054-Staging-hv-vmbus-Cleanup-the-code-in-process_chn_.patch
new file mode 100644
index 0000000000..b4a7a382d2
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0054-Staging-hv-vmbus-Cleanup-the-code-in-process_chn_.patch
@@ -0,0 +1,51 @@
+From 24326039b9685e8bfb1532932e18cb458f2a3517 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Wed, 31 Aug 2011 14:35:57 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup the code in process_chn_event()
+
+A channel in Hyper-V is equivalent to a device. Thus, a channel is
+persistent once it is presented to the guest, even if the driver
+managing this device is unloaded. By checking and invoking the driver
+specific callback function under the protection of the channel
+inbound_lock, we can properly deal with racing driver unloads since an
+unloading driver sets the callback to NULL under the protection of this
+inbound_lock.
+
+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 | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/hv/connection.c
++++ b/drivers/staging/hv/connection.c
+@@ -219,11 +219,25 @@ static void process_chn_event(u32 relid)
+ */
+ channel = relid2channel(relid);
+
++ if (!channel) {
++ pr_err("channel not found for relid - %u\n", relid);
++ return;
++ }
++
++ /*
++ * A channel once created is persistent even when there
++ * is no driver handling the device. An unloading driver
++ * sets the onchannel_callback to NULL under the
++ * protection of the channel inbound_lock. Thus, checking
++ * and invoking the driver specific callback takes care of
++ * orderly unloading of the driver.
++ */
++
+ spin_lock_irqsave(&channel->inbound_lock, flags);
+- if (channel && (channel->onchannel_callback != NULL))
++ if (channel->onchannel_callback != NULL)
+ channel->onchannel_callback(channel->channel_callback_context);
+ else
+- pr_err("channel not found for relid - %u\n", relid);
++ pr_err("no channel callback for relid - %u\n", relid);
+
+ spin_unlock_irqrestore(&channel->inbound_lock, flags);
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0055-staging-hv-remove-unnecessary-includes-in-netvsc.patch b/patches.suse/staging-hv-staging-next-20111001-0055-staging-hv-remove-unnecessary-includes-in-netvsc.patch
new file mode 100644
index 0000000000..c19655e4fc
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0055-staging-hv-remove-unnecessary-includes-in-netvsc.patch
@@ -0,0 +1,48 @@
+From a3e8095886b65af402e24cd5c32173d9acd0123a Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:39 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: remove unnecessary includes in netvsc
+
+hyperv.h is included by hyperv_net.h already, so no need to include it
+again in these C files.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 1 -
+ drivers/staging/hv/netvsc_drv.c | 1 -
+ drivers/staging/hv/rndis_filter.c | 1 -
+ 3 files changed, 3 deletions(-)
+
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -28,7 +28,6 @@
+ #include <linux/io.h>
+ #include <linux/slab.h>
+
+-#include "hyperv.h"
+ #include "hyperv_net.h"
+
+
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -38,7 +38,6 @@
+ #include <net/sock.h>
+ #include <net/pkt_sched.h>
+
+-#include "hyperv.h"
+ #include "hyperv_net.h"
+
+ struct net_device_context {
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -27,7 +27,6 @@
+ #include <linux/if_ether.h>
+ #include <linux/netdevice.h>
+
+-#include "hyperv.h"
+ #include "hyperv_net.h"
+
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0056-staging-hv-add-newline-to-log-messages-in-netvsc.patch b/patches.suse/staging-hv-staging-next-20111001-0056-staging-hv-add-newline-to-log-messages-in-netvsc.patch
new file mode 100644
index 0000000000..0793490fc7
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0056-staging-hv-add-newline-to-log-messages-in-netvsc.patch
@@ -0,0 +1,267 @@
+From c909ebbd0dcf19c617408c2cfde56c4bbd4f6cb4 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:40 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: add newline to log messages in netvsc
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 58 ++++++++++++++++++++++----------------------
+ 1 file changed, 29 insertions(+), 29 deletions(-)
+
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -108,7 +108,7 @@ static int netvsc_destroy_recv_buf(struc
+ */
+ if (ret != 0) {
+ dev_err(&net_device->dev->device, "unable to send "
+- "revoke receive buffer to netvsp");
++ "revoke receive buffer to netvsp\n");
+ return ret;
+ }
+ }
+@@ -123,7 +123,7 @@ static int netvsc_destroy_recv_buf(struc
+ */
+ if (ret != 0) {
+ dev_err(&net_device->dev->device,
+- "unable to teardown receive buffer's gpadl");
++ "unable to teardown receive buffer's gpadl\n");
+ return ret;
+ }
+ net_device->recv_buf_gpadl_handle = 0;
+@@ -155,7 +155,7 @@ static int netvsc_init_recv_buf(struct h
+ net_device = get_outbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "unable to get net device..."
+- "device being destroyed?");
++ "device being destroyed?\n");
+ return -ENODEV;
+ }
+
+@@ -164,7 +164,7 @@ static int netvsc_init_recv_buf(struct h
+ get_order(net_device->recv_buf_size));
+ if (!net_device->recv_buf) {
+ dev_err(&device->device, "unable to allocate receive "
+- "buffer of size %d", net_device->recv_buf_size);
++ "buffer of size %d\n", net_device->recv_buf_size);
+ ret = -ENOMEM;
+ goto cleanup;
+ }
+@@ -179,7 +179,7 @@ static int netvsc_init_recv_buf(struct h
+ &net_device->recv_buf_gpadl_handle);
+ if (ret != 0) {
+ dev_err(&device->device,
+- "unable to establish receive buffer's gpadl");
++ "unable to establish receive buffer's gpadl\n");
+ goto cleanup;
+ }
+
+@@ -203,7 +203,7 @@ static int netvsc_init_recv_buf(struct h
+ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+ if (ret != 0) {
+ dev_err(&device->device,
+- "unable to send receive buffer's gpadl to netvsp");
++ "unable to send receive buffer's gpadl to netvsp\n");
+ goto cleanup;
+ }
+
+@@ -215,7 +215,7 @@ static int netvsc_init_recv_buf(struct h
+ if (init_packet->msg.v1_msg.
+ send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
+ dev_err(&device->device, "Unable to complete receive buffer "
+- "initialzation with NetVsp - status %d",
++ "initialzation with NetVsp - status %d\n",
+ init_packet->msg.v1_msg.
+ send_recv_buf_complete.status);
+ ret = -EINVAL;
+@@ -270,7 +270,7 @@ static int netvsc_connect_vsp(struct hv_
+ net_device = get_outbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "unable to get net device..."
+- "device being destroyed?");
++ "device being destroyed?\n");
+ return -ENODEV;
+ }
+
+@@ -361,7 +361,7 @@ int netvsc_device_remove(struct hv_devic
+ /* Wait for all send completions */
+ while (atomic_read(&net_device->num_outstanding_sends)) {
+ dev_err(&device->device,
+- "waiting for %d requests to complete...",
++ "waiting for %d requests to complete...\n",
+ atomic_read(&net_device->num_outstanding_sends));
+ udelay(100);
+ }
+@@ -381,7 +381,7 @@ int netvsc_device_remove(struct hv_devic
+ 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");
++ dev_notice(&device->device, "net device safe to remove\n");
+
+ /* Now, we can close the channel safely */
+ vmbus_close(device->channel);
+@@ -407,7 +407,7 @@ static void netvsc_send_completion(struc
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "unable to get net device..."
+- "device being destroyed?");
++ "device being destroyed?\n");
+ return;
+ }
+
+@@ -436,7 +436,7 @@ static void netvsc_send_completion(struc
+ atomic_dec(&net_device->num_outstanding_sends);
+ } else {
+ dev_err(&device->device, "Unknown send completion packet type- "
+- "%d received!!", nvsp_packet->hdr.msg_type);
++ "%d received!!\n", nvsp_packet->hdr.msg_type);
+ }
+
+ }
+@@ -452,7 +452,7 @@ int netvsc_send(struct hv_device *device
+ net_device = get_outbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "net device (%p) shutting down..."
+- "ignoring outbound packets", net_device);
++ "ignoring outbound packets\n", net_device);
+ return -ENODEV;
+ }
+
+@@ -487,7 +487,7 @@ int netvsc_send(struct hv_device *device
+ }
+
+ if (ret != 0)
+- dev_err(&device->device, "Unable to send packet %p ret %d",
++ dev_err(&device->device, "Unable to send packet %p ret %d\n",
+ packet, ret);
+
+ atomic_inc(&net_device->num_outstanding_sends);
+@@ -520,19 +520,19 @@ retry_send_cmplt:
+ /* no more room...wait a bit and attempt to retry 3 times */
+ retries++;
+ dev_err(&device->device, "unable to send receive completion pkt"
+- " (tid %llx)...retrying %d", transaction_id, retries);
++ " (tid %llx)...retrying %d\n", transaction_id, retries);
+
+ if (retries < 4) {
+ udelay(100);
+ goto retry_send_cmplt;
+ } else {
+ dev_err(&device->device, "unable to send receive "
+- "completion pkt (tid %llx)...give up retrying",
++ "completion pkt (tid %llx)...give up retrying\n",
+ transaction_id);
+ }
+ } else {
+ dev_err(&device->device, "unable to send receive "
+- "completion pkt - %llx", transaction_id);
++ "completion pkt - %llx\n", transaction_id);
+ }
+ }
+
+@@ -554,7 +554,7 @@ static void netvsc_receive_completion(vo
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "unable to get net device..."
+- "device being destroyed?");
++ "device being destroyed?\n");
+ return;
+ }
+
+@@ -605,7 +605,7 @@ static void netvsc_receive(struct hv_dev
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "unable to get net device..."
+- "device being destroyed?");
++ "device being destroyed?\n");
+ return;
+ }
+
+@@ -614,7 +614,7 @@ static void netvsc_receive(struct hv_dev
+ * packet
+ */
+ if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) {
+- dev_err(&device->device, "Unknown packet type received - %d",
++ dev_err(&device->device, "Unknown packet type received - %d\n",
+ packet->type);
+ return;
+ }
+@@ -626,7 +626,7 @@ static void netvsc_receive(struct hv_dev
+ if (nvsp_packet->hdr.msg_type !=
+ NVSP_MSG1_TYPE_SEND_RNDIS_PKT) {
+ dev_err(&device->device, "Unknown nvsp packet type received-"
+- " %d", nvsp_packet->hdr.msg_type);
++ " %d\n", nvsp_packet->hdr.msg_type);
+ return;
+ }
+
+@@ -634,7 +634,7 @@ static void netvsc_receive(struct hv_dev
+
+ if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) {
+ dev_err(&device->device, "Invalid xfer page set id - "
+- "expecting %x got %x", NETVSC_RECEIVE_BUFFER_ID,
++ "expecting %x got %x\n", NETVSC_RECEIVE_BUFFER_ID,
+ vmxferpage_packet->xfer_pageset_id);
+ return;
+ }
+@@ -660,7 +660,7 @@ static void netvsc_receive(struct hv_dev
+ */
+ if (count < 2) {
+ dev_err(&device->device, "Got only %d netvsc pkt...needed "
+- "%d pkts. Dropping this xfer page packet completely!",
++ "%d pkts. Dropping this xfer page packet completely!\n",
+ count, vmxferpage_packet->range_cnt + 1);
+
+ /* Return it to the freelist */
+@@ -687,7 +687,7 @@ static void netvsc_receive(struct hv_dev
+
+ if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
+ dev_err(&device->device, "Needed %d netvsc pkts to satisy "
+- "this xfer page...got %d",
++ "this xfer page...got %d\n",
+ vmxferpage_packet->range_cnt, xferpage_packet->count);
+ }
+
+@@ -785,7 +785,7 @@ static void netvsc_channel_cb(void *cont
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+ dev_err(&device->device, "net device (%p) shutting down..."
+- "ignoring inbound packets", net_device);
++ "ignoring inbound packets\n", net_device);
+ goto out;
+ }
+
+@@ -836,7 +836,7 @@ static void netvsc_channel_cb(void *cont
+ /* Try again next time around */
+ dev_err(&device->device,
+ "unable to allocate buffer of size "
+- "(%d)!!", bytes_recvd);
++ "(%d)!!\n", bytes_recvd);
+ break;
+ }
+
+@@ -892,18 +892,18 @@ int netvsc_device_add(struct hv_device *
+ netvsc_channel_cb, device);
+
+ if (ret != 0) {
+- dev_err(&device->device, "unable to open channel: %d", ret);
++ dev_err(&device->device, "unable to open channel: %d\n", ret);
+ goto cleanup;
+ }
+
+ /* Channel is opened */
+- pr_info("hv_netvsc channel opened successfully");
++ pr_info("hv_netvsc channel opened successfully\n");
+
+ /* Connect with the NetVsp */
+ ret = netvsc_connect_vsp(device);
+ if (ret != 0) {
+ dev_err(&device->device,
+- "unable to connect to NetVSP - %d", ret);
++ "unable to connect to NetVSP - %d\n", ret);
+ goto close;
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0057-staging-hv-convert-dev_-loglevel-to-netdev_-logle.patch b/patches.suse/staging-hv-staging-next-20111001-0057-staging-hv-convert-dev_-loglevel-to-netdev_-logle.patch
new file mode 100644
index 0000000000..7f9afab98a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0057-staging-hv-convert-dev_-loglevel-to-netdev_-logle.patch
@@ -0,0 +1,423 @@
+From d9871158718778ff060f08cbee0c61eb23041671 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:41 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: convert dev_<loglevel> to netdev_<loglevel> in netvsc
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 68 +++++++++++++++++++++-----------------
+ drivers/staging/hv/rndis_filter.c | 17 +++++----
+ 2 files changed, 49 insertions(+), 36 deletions(-)
+
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -27,6 +27,7 @@
+ #include <linux/delay.h>
+ #include <linux/io.h>
+ #include <linux/slab.h>
++#include <linux/netdevice.h>
+
+ #include "hyperv_net.h"
+
+@@ -80,6 +81,7 @@ static int netvsc_destroy_recv_buf(struc
+ {
+ struct nvsp_message *revoke_packet;
+ int ret = 0;
++ struct net_device *ndev = dev_get_drvdata(&net_device->dev->device);
+
+ /*
+ * If we got a section count, it means we received a
+@@ -107,7 +109,7 @@ static int netvsc_destroy_recv_buf(struc
+ * have a leak rather than continue and a bugchk
+ */
+ if (ret != 0) {
+- dev_err(&net_device->dev->device, "unable to send "
++ netdev_err(ndev, "unable to send "
+ "revoke receive buffer to netvsp\n");
+ return ret;
+ }
+@@ -122,7 +124,7 @@ static int netvsc_destroy_recv_buf(struc
+ * rather than continue and a bugchk
+ */
+ if (ret != 0) {
+- dev_err(&net_device->dev->device,
++ netdev_err(ndev,
+ "unable to teardown receive buffer's gpadl\n");
+ return ret;
+ }
+@@ -151,10 +153,11 @@ static int netvsc_init_recv_buf(struct h
+ int t;
+ struct netvsc_device *net_device;
+ struct nvsp_message *init_packet;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ net_device = get_outbound_net_device(device);
+ if (!net_device) {
+- dev_err(&device->device, "unable to get net device..."
++ netdev_err(ndev, "unable to get net device..."
+ "device being destroyed?\n");
+ return -ENODEV;
+ }
+@@ -163,7 +166,7 @@ static int netvsc_init_recv_buf(struct h
+ (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
+ get_order(net_device->recv_buf_size));
+ if (!net_device->recv_buf) {
+- dev_err(&device->device, "unable to allocate receive "
++ netdev_err(ndev, "unable to allocate receive "
+ "buffer of size %d\n", net_device->recv_buf_size);
+ ret = -ENOMEM;
+ goto cleanup;
+@@ -178,7 +181,7 @@ static int netvsc_init_recv_buf(struct h
+ net_device->recv_buf_size,
+ &net_device->recv_buf_gpadl_handle);
+ if (ret != 0) {
+- dev_err(&device->device,
++ netdev_err(ndev,
+ "unable to establish receive buffer's gpadl\n");
+ goto cleanup;
+ }
+@@ -202,7 +205,7 @@ static int netvsc_init_recv_buf(struct h
+ VM_PKT_DATA_INBAND,
+ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+ if (ret != 0) {
+- dev_err(&device->device,
++ netdev_err(ndev,
+ "unable to send receive buffer's gpadl to netvsp\n");
+ goto cleanup;
+ }
+@@ -214,7 +217,7 @@ static int netvsc_init_recv_buf(struct h
+ /* Check the response */
+ if (init_packet->msg.v1_msg.
+ send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
+- dev_err(&device->device, "Unable to complete receive buffer "
++ netdev_err(ndev, "Unable to complete receive buffer "
+ "initialzation with NetVsp - status %d\n",
+ init_packet->msg.v1_msg.
+ send_recv_buf_complete.status);
+@@ -266,10 +269,11 @@ static int netvsc_connect_vsp(struct hv_
+ struct netvsc_device *net_device;
+ struct nvsp_message *init_packet;
+ int ndis_version;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ net_device = get_outbound_net_device(device);
+ if (!net_device) {
+- dev_err(&device->device, "unable to get net device..."
++ netdev_err(ndev, "unable to get net device..."
+ "device being destroyed?\n");
+ return -ENODEV;
+ }
+@@ -360,7 +364,7 @@ int netvsc_device_remove(struct hv_devic
+
+ /* Wait for all send completions */
+ while (atomic_read(&net_device->num_outstanding_sends)) {
+- dev_err(&device->device,
++ dev_info(&device->device,
+ "waiting for %d requests to complete...\n",
+ atomic_read(&net_device->num_outstanding_sends));
+ udelay(100);
+@@ -403,10 +407,11 @@ static void netvsc_send_completion(struc
+ struct netvsc_device *net_device;
+ struct nvsp_message *nvsp_packet;
+ struct hv_netvsc_packet *nvsc_packet;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+- dev_err(&device->device, "unable to get net device..."
++ netdev_err(ndev, "unable to get net device..."
+ "device being destroyed?\n");
+ return;
+ }
+@@ -435,7 +440,7 @@ static void netvsc_send_completion(struc
+
+ atomic_dec(&net_device->num_outstanding_sends);
+ } else {
+- dev_err(&device->device, "Unknown send completion packet type- "
++ netdev_err(ndev, "Unknown send completion packet type- "
+ "%d received!!\n", nvsp_packet->hdr.msg_type);
+ }
+
+@@ -446,12 +451,12 @@ int netvsc_send(struct hv_device *device
+ {
+ struct netvsc_device *net_device;
+ int ret = 0;
+-
+ struct nvsp_message sendMessage;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ net_device = get_outbound_net_device(device);
+ if (!net_device) {
+- dev_err(&device->device, "net device (%p) shutting down..."
++ netdev_err(ndev, "net device (%p) shutting down..."
+ "ignoring outbound packets\n", net_device);
+ return -ENODEV;
+ }
+@@ -487,7 +492,7 @@ int netvsc_send(struct hv_device *device
+ }
+
+ if (ret != 0)
+- dev_err(&device->device, "Unable to send packet %p ret %d\n",
++ netdev_err(ndev, "Unable to send packet %p ret %d\n",
+ packet, ret);
+
+ atomic_inc(&net_device->num_outstanding_sends);
+@@ -500,6 +505,7 @@ static void netvsc_send_recv_completion(
+ struct nvsp_message recvcompMessage;
+ int retries = 0;
+ int ret;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ recvcompMessage.hdr.msg_type =
+ NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE;
+@@ -519,19 +525,19 @@ retry_send_cmplt:
+ } 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"
++ netdev_err(ndev, "unable to send receive completion pkt"
+ " (tid %llx)...retrying %d\n", transaction_id, retries);
+
+ if (retries < 4) {
+ udelay(100);
+ goto retry_send_cmplt;
+ } else {
+- dev_err(&device->device, "unable to send receive "
++ netdev_err(ndev, "unable to send receive "
+ "completion pkt (tid %llx)...give up retrying\n",
+ transaction_id);
+ }
+ } else {
+- dev_err(&device->device, "unable to send receive "
++ netdev_err(ndev, "unable to send receive "
+ "completion pkt - %llx\n", transaction_id);
+ }
+ }
+@@ -545,6 +551,7 @@ static void netvsc_receive_completion(vo
+ u64 transaction_id = 0;
+ bool fsend_receive_comp = false;
+ unsigned long flags;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ /*
+ * Even though it seems logical to do a GetOutboundNetDevice() here to
+@@ -553,7 +560,7 @@ static void netvsc_receive_completion(vo
+ */
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+- dev_err(&device->device, "unable to get net device..."
++ netdev_err(ndev, "unable to get net device..."
+ "device being destroyed?\n");
+ return;
+ }
+@@ -599,12 +606,13 @@ static void netvsc_receive(struct hv_dev
+ int i, j;
+ int count = 0, bytes_remain = 0;
+ unsigned long flags;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ LIST_HEAD(listHead);
+
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+- dev_err(&device->device, "unable to get net device..."
++ netdev_err(ndev, "unable to get net device..."
+ "device being destroyed?\n");
+ return;
+ }
+@@ -614,7 +622,7 @@ static void netvsc_receive(struct hv_dev
+ * packet
+ */
+ if (packet->type != VM_PKT_DATA_USING_XFER_PAGES) {
+- dev_err(&device->device, "Unknown packet type received - %d\n",
++ netdev_err(ndev, "Unknown packet type received - %d\n",
+ packet->type);
+ return;
+ }
+@@ -625,7 +633,7 @@ static void netvsc_receive(struct hv_dev
+ /* Make sure this is a valid nvsp packet */
+ if (nvsp_packet->hdr.msg_type !=
+ NVSP_MSG1_TYPE_SEND_RNDIS_PKT) {
+- dev_err(&device->device, "Unknown nvsp packet type received-"
++ netdev_err(ndev, "Unknown nvsp packet type received-"
+ " %d\n", nvsp_packet->hdr.msg_type);
+ return;
+ }
+@@ -633,7 +641,7 @@ static void netvsc_receive(struct hv_dev
+ vmxferpage_packet = (struct vmtransfer_page_packet_header *)packet;
+
+ if (vmxferpage_packet->xfer_pageset_id != NETVSC_RECEIVE_BUFFER_ID) {
+- dev_err(&device->device, "Invalid xfer page set id - "
++ netdev_err(ndev, "Invalid xfer page set id - "
+ "expecting %x got %x\n", NETVSC_RECEIVE_BUFFER_ID,
+ vmxferpage_packet->xfer_pageset_id);
+ return;
+@@ -659,7 +667,7 @@ static void netvsc_receive(struct hv_dev
+ * some of the xfer page packet ranges...
+ */
+ if (count < 2) {
+- dev_err(&device->device, "Got only %d netvsc pkt...needed "
++ netdev_err(ndev, "Got only %d netvsc pkt...needed "
+ "%d pkts. Dropping this xfer page packet completely!\n",
+ count, vmxferpage_packet->range_cnt + 1);
+
+@@ -686,7 +694,7 @@ static void netvsc_receive(struct hv_dev
+ xferpage_packet->count = count - 1;
+
+ if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
+- dev_err(&device->device, "Needed %d netvsc pkts to satisy "
++ netdev_err(ndev, "Needed %d netvsc pkts to satisy "
+ "this xfer page...got %d\n",
+ vmxferpage_packet->range_cnt, xferpage_packet->count);
+ }
+@@ -775,6 +783,7 @@ static void netvsc_channel_cb(void *cont
+ struct vmpacket_descriptor *desc;
+ unsigned char *buffer;
+ int bufferlen = NETVSC_PACKET_SIZE;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
+ GFP_ATOMIC);
+@@ -784,7 +793,7 @@ static void netvsc_channel_cb(void *cont
+
+ net_device = get_inbound_net_device(device);
+ if (!net_device) {
+- dev_err(&device->device, "net device (%p) shutting down..."
++ netdev_err(ndev, "net device (%p) shutting down..."
+ "ignoring inbound packets\n", net_device);
+ goto out;
+ }
+@@ -805,7 +814,7 @@ static void netvsc_channel_cb(void *cont
+ break;
+
+ default:
+- dev_err(&device->device,
++ netdev_err(ndev,
+ "unhandled packet type %d, "
+ "tid %llx len %d\n",
+ desc->type, request_id,
+@@ -834,7 +843,7 @@ static void netvsc_channel_cb(void *cont
+ buffer = kmalloc(bytes_recvd, GFP_ATOMIC);
+ if (buffer == NULL) {
+ /* Try again next time around */
+- dev_err(&device->device,
++ netdev_err(ndev,
+ "unable to allocate buffer of size "
+ "(%d)!!\n", bytes_recvd);
+ break;
+@@ -861,6 +870,7 @@ int netvsc_device_add(struct hv_device *
+ ((struct netvsc_device_info *)additional_info)->ring_size;
+ struct netvsc_device *net_device;
+ struct hv_netvsc_packet *packet, *pos;
++ struct net_device *ndev = dev_get_drvdata(&device->device);
+
+ net_device = alloc_net_device(device);
+ if (!net_device) {
+@@ -892,7 +902,7 @@ int netvsc_device_add(struct hv_device *
+ netvsc_channel_cb, device);
+
+ if (ret != 0) {
+- dev_err(&device->device, "unable to open channel: %d\n", ret);
++ netdev_err(ndev, "unable to open channel: %d\n", ret);
+ goto cleanup;
+ }
+
+@@ -902,7 +912,7 @@ int netvsc_device_add(struct hv_device *
+ /* Connect with the NetVsp */
+ ret = netvsc_connect_vsp(device);
+ if (ret != 0) {
+- dev_err(&device->device,
++ netdev_err(ndev,
+ "unable to connect to NetVSP - %d\n", ret);
+ goto close;
+ }
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -249,6 +249,7 @@ static void rndis_filter_receive_respons
+ struct rndis_request *request = NULL;
+ bool found = false;
+ unsigned long flags;
++ struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
+
+ spin_lock_irqsave(&dev->request_lock, flags);
+ list_for_each_entry(request, &dev->req_list, list_ent) {
+@@ -269,7 +270,7 @@ static void rndis_filter_receive_respons
+ memcpy(&request->response_msg, resp,
+ resp->msg_len);
+ } else {
+- dev_err(&dev->net_dev->dev->device,
++ netdev_err(ndev,
+ "rndis response buffer overflow "
+ "detected (size %u max %zu)\n",
+ resp->msg_len,
+@@ -289,7 +290,7 @@ static void rndis_filter_receive_respons
+
+ complete(&request->wait_event);
+ } else {
+- dev_err(&dev->net_dev->dev->device,
++ netdev_err(ndev,
+ "no rndis request found for this response "
+ "(id 0x%x res type 0x%x)\n",
+ resp->msg.init_complete.req_id,
+@@ -349,20 +350,21 @@ int rndis_filter_receive(struct hv_devic
+ struct rndis_device *rndis_dev;
+ struct rndis_message rndis_msg;
+ struct rndis_message *rndis_hdr;
++ struct net_device *ndev = dev_get_drvdata(&dev->device);
+
+ if (!net_dev)
+ return -EINVAL;
+
+ /* Make sure the rndis device state is initialized */
+ if (!net_dev->extension) {
+- dev_err(&dev->device, "got rndis message but no rndis device - "
++ netdev_err(ndev, "got rndis message but no rndis device - "
+ "dropping this message!\n");
+ 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 "
++ netdev_err(ndev, "got rndis message but rndis device "
+ "uninitialized...dropping this message!\n");
+ return -ENODEV;
+ }
+@@ -376,7 +378,7 @@ int rndis_filter_receive(struct hv_devic
+ /* Make sure we got a valid rndis message */
+ if ((rndis_hdr->ndis_msg_type != REMOTE_NDIS_PACKET_MSG) &&
+ (rndis_hdr->msg_len > sizeof(struct rndis_message))) {
+- dev_err(&dev->device, "incoming rndis message buffer overflow "
++ netdev_err(ndev, "incoming rndis message buffer overflow "
+ "detected (got %u, max %zu)..marking it an error!\n",
+ rndis_hdr->msg_len,
+ sizeof(struct rndis_message));
+@@ -409,7 +411,7 @@ int rndis_filter_receive(struct hv_devic
+ rndis_filter_receive_indicate_status(rndis_dev, &rndis_msg);
+ break;
+ default:
+- dev_err(&dev->device,
++ netdev_err(ndev,
+ "unhandled rndis message (type %u len %u)\n",
+ rndis_msg.ndis_msg_type,
+ rndis_msg.msg_len);
+@@ -505,6 +507,7 @@ static int rndis_filter_set_packet_filte
+ struct rndis_set_complete *set_complete;
+ u32 status;
+ int ret, t;
++ struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
+
+ request = get_rndis_request(dev, REMOTE_NDIS_SET_MSG,
+ RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
+@@ -530,7 +533,7 @@ static int rndis_filter_set_packet_filte
+ t = wait_for_completion_timeout(&request->wait_event, 5*HZ);
+
+ if (t == 0) {
+- dev_err(&dev->net_dev->dev->device,
++ netdev_err(ndev,
+ "timeout before we got a set response...\n");
+ /*
+ * We can't deallocate the request since we may still receive a
diff --git a/patches.suse/staging-hv-staging-next-20111001-0058-staging-hv-fix-a-kernel-warning-in-netvsc_linkstat.patch b/patches.suse/staging-hv-staging-next-20111001-0058-staging-hv-fix-a-kernel-warning-in-netvsc_linkstat.patch
new file mode 100644
index 0000000000..1c15db19be
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0058-staging-hv-fix-a-kernel-warning-in-netvsc_linkstat.patch
@@ -0,0 +1,34 @@
+From c4b6a2eaf1c14810a4803d658f68614365978738 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:42 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: fix a kernel warning in netvsc_linkstatus_callback()
+
+netif_notify_peers() caused a kernel warning in netvsc_linkstatus_callback(),
+because netvsc_linkstatus_callback() is within IRQ context. So we move
+the first call to netif_notify_peers() into queued work as well, but with
+zero delay.
+
+In addition to "staging-next", this should also be back-ported to stable
+kernels 2.6.32 and later.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -214,8 +214,8 @@ void netvsc_linkstatus_callback(struct h
+ if (status == 1) {
+ netif_carrier_on(net);
+ netif_wake_queue(net);
+- netif_notify_peers(net);
+ ndev_ctx = netdev_priv(net);
++ schedule_delayed_work(&ndev_ctx->dwork, 0);
+ schedule_delayed_work(&ndev_ctx->dwork, msecs_to_jiffies(20));
+ } else {
+ netif_carrier_off(net);
diff --git a/patches.suse/staging-hv-staging-next-20111001-0059-staging-hv-re-order-the-code-in-netvsc_probe.patch b/patches.suse/staging-hv-staging-next-20111001-0059-staging-hv-re-order-the-code-in-netvsc_probe.patch
new file mode 100644
index 0000000000..e7c0ed9f51
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0059-staging-hv-re-order-the-code-in-netvsc_probe.patch
@@ -0,0 +1,67 @@
+From 692e084e773b76c30a3e5d823db131ed1a15924a Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:43 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: re-order the code in netvsc_probe()
+
+Re-order the code in netvsc_probe() to prevent a guest crash caused by
+packets possibly received from NetVSP before call to register_netdev().
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 32 +++++++++++++++++---------------
+ 1 file changed, 17 insertions(+), 15 deletions(-)
+
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -348,19 +348,6 @@ static int netvsc_probe(struct hv_device
+ dev_set_drvdata(&dev->device, net);
+ INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp);
+
+- /* Notify the netvsc driver of the new device */
+- device_info.ring_size = ring_size;
+- ret = rndis_filter_device_add(dev, &device_info);
+- if (ret != 0) {
+- free_netdev(net);
+- dev_set_drvdata(&dev->device, NULL);
+- return ret;
+- }
+-
+- netif_carrier_on(net);
+-
+- memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
+-
+ net->netdev_ops = &device_ops;
+
+ /* TODO: Add GSO and Checksum offload */
+@@ -372,11 +359,26 @@ static int netvsc_probe(struct hv_device
+
+ ret = register_netdev(net);
+ if (ret != 0) {
+- /* Remove the device and release the resource */
+- rndis_filter_device_remove(dev);
++ pr_err("Unable to register netdev.\n");
+ free_netdev(net);
++ goto out;
+ }
+
++ /* Notify the netvsc driver of the new device */
++ device_info.ring_size = ring_size;
++ ret = rndis_filter_device_add(dev, &device_info);
++ if (ret != 0) {
++ netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
++ unregister_netdev(net);
++ free_netdev(net);
++ dev_set_drvdata(&dev->device, NULL);
++ return ret;
++ }
++ memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
++
++ netif_carrier_on(net);
++
++out:
+ return ret;
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0060-staging-hv-fix-counting-of-outstanding-sends-in-f.patch b/patches.suse/staging-hv-staging-next-20111001-0060-staging-hv-fix-counting-of-outstanding-sends-in-f.patch
new file mode 100644
index 0000000000..d9e7a0a6b0
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0060-staging-hv-fix-counting-of-outstanding-sends-in-f.patch
@@ -0,0 +1,29 @@
+From 7db1d946c4db748b631fe4885110349cc259987f Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:44 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: fix counting of #outstanding-sends in failed sends
+
+If the packet failed to be sent, we shouldn't count it as the
+number of outstanding sends.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -494,8 +494,9 @@ int netvsc_send(struct hv_device *device
+ if (ret != 0)
+ netdev_err(ndev, "Unable to send packet %p ret %d\n",
+ packet, ret);
++ else
++ atomic_inc(&net_device->num_outstanding_sends);
+
+- atomic_inc(&net_device->num_outstanding_sends);
+ return ret;
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0061-staging-hv-fix-counting-of-available-buffer-slots.patch b/patches.suse/staging-hv-staging-next-20111001-0061-staging-hv-fix-counting-of-available-buffer-slots.patch
new file mode 100644
index 0000000000..c7cccec923
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0061-staging-hv-fix-counting-of-available-buffer-slots.patch
@@ -0,0 +1,30 @@
+From 8a5f9edc4dd6c1f9fb2446a36e7cd44b79412271 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:45 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: fix counting of available buffer slots when send fails
+
+Because the number of available buffer slots doesn't decrease for failed
+sends, we should not call netvsc_xmit_completion(), which increase the
+count of available slots. In this failed case, just free the memory is
+enough.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -190,7 +190,8 @@ static int netvsc_start_xmit(struct sk_b
+ } else {
+ /* we are shutting down or bus overloaded, just drop packet */
+ net->stats.tx_dropped++;
+- netvsc_xmit_completion(packet);
++ kfree(packet);
++ dev_kfree_skb_any(skb);
+ }
+
+ return NETDEV_TX_OK;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0062-staging-hv-fix-the-return-status-of-netvsc_start_x.patch b/patches.suse/staging-hv-staging-next-20111001-0062-staging-hv-fix-the-return-status-of-netvsc_start_x.patch
new file mode 100644
index 0000000000..c4474af8c1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0062-staging-hv-fix-the-return-status-of-netvsc_start_x.patch
@@ -0,0 +1,42 @@
+From bf769375c9175b29fe72b10394888e0090c6b133 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:46 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: fix the return status of netvsc_start_xmit()
+
+Fix the return status, so the upper layer will retry if transmission
+fails.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc_drv.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -140,12 +140,12 @@ static int netvsc_start_xmit(struct sk_b
+ (num_pages * sizeof(struct hv_page_buffer)) +
+ sizeof(struct rndis_filter_packet), GFP_ATOMIC);
+ if (!packet) {
+- /* out of memory, silently drop packet */
++ /* out of memory, drop packet */
+ netdev_err(net, "unable to allocate hv_netvsc_packet\n");
+
+ dev_kfree_skb(skb);
+ net->stats.tx_dropped++;
+- return NETDEV_TX_OK;
++ return NETDEV_TX_BUSY;
+ }
+
+ packet->extension = (void *)(unsigned long)packet +
+@@ -194,7 +194,7 @@ static int netvsc_start_xmit(struct sk_b
+ dev_kfree_skb_any(skb);
+ }
+
+- return NETDEV_TX_OK;
++ return ret ? NETDEV_TX_BUSY : NETDEV_TX_OK;
+ }
+
+ /*
diff --git a/patches.suse/staging-hv-staging-next-20111001-0063-staging-hv-fix-the-page-buffer-when-rndis-data-go.patch b/patches.suse/staging-hv-staging-next-20111001-0063-staging-hv-fix-the-page-buffer-when-rndis-data-go.patch
new file mode 100644
index 0000000000..4cb21862fc
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0063-staging-hv-fix-the-page-buffer-when-rndis-data-go.patch
@@ -0,0 +1,43 @@
+From 669c1fc61679f7e85f467c852bfe7b6c9dd75d25 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:47 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: fix the page buffer when rndis data go across page boundary
+
+In rndis_filter_receive_data(), we need to drop the 0th page and move the
+rest of pages forward if the rndis data go across page boundary, otherwise
+the page offset will overflow.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/rndis_filter.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -323,6 +323,7 @@ static void rndis_filter_receive_data(st
+ {
+ struct rndis_packet *rndis_pkt;
+ u32 data_offset;
++ int i;
+
+ rndis_pkt = &msg->msg.pkt;
+
+@@ -338,6 +339,15 @@ static void rndis_filter_receive_data(st
+ pkt->page_buf[0].offset += data_offset;
+ pkt->page_buf[0].len -= data_offset;
+
++ /* Drop the 0th page, if rndis data go beyond page boundary */
++ if (pkt->page_buf[0].offset >= PAGE_SIZE) {
++ pkt->page_buf[1].offset = pkt->page_buf[0].offset - PAGE_SIZE;
++ pkt->page_buf[1].len -= pkt->page_buf[1].offset;
++ pkt->page_buf_cnt--;
++ for (i = 0; i < pkt->page_buf_cnt; i++)
++ pkt->page_buf[i] = pkt->page_buf[i+1];
++ }
++
+ pkt->is_data_pkt = true;
+
+ netvsc_recv_callback(dev->net_dev->dev, pkt);
diff --git a/patches.suse/staging-hv-staging-next-20111001-0064-staging-hv-fix-some-typos-in-netvsc.c.patch b/patches.suse/staging-hv-staging-next-20111001-0064-staging-hv-fix-some-typos-in-netvsc.c.patch
new file mode 100644
index 0000000000..3dfc533ca1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0064-staging-hv-fix-some-typos-in-netvsc.c.patch
@@ -0,0 +1,34 @@
+From 8bff33ab417f246dac4ab9835be6894eaddfb546 Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Thu, 1 Sep 2011 12:19:48 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: fix some typos in netvsc.c
+
+Reported-by: Joe Perches <joe@perches.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/netvsc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -218,7 +218,7 @@ static int netvsc_init_recv_buf(struct h
+ if (init_packet->msg.v1_msg.
+ send_recv_buf_complete.status != NVSP_STAT_SUCCESS) {
+ netdev_err(ndev, "Unable to complete receive buffer "
+- "initialzation with NetVsp - status %d\n",
++ "initialization with NetVsp - status %d\n",
+ init_packet->msg.v1_msg.
+ send_recv_buf_complete.status);
+ ret = -EINVAL;
+@@ -695,7 +695,7 @@ static void netvsc_receive(struct hv_dev
+ xferpage_packet->count = count - 1;
+
+ if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
+- netdev_err(ndev, "Needed %d netvsc pkts to satisy "
++ netdev_err(ndev, "Needed %d netvsc pkts to satisfy "
+ "this xfer page...got %d\n",
+ vmxferpage_packet->range_cnt, xferpage_packet->count);
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0065-Staging-hv-Update-TODO-file.patch b/patches.suse/staging-hv-staging-next-20111001-0065-Staging-hv-Update-TODO-file.patch
new file mode 100644
index 0000000000..2b0d746a66
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0065-Staging-hv-Update-TODO-file.patch
@@ -0,0 +1,34 @@
+From b2451a4907fdcd718c3580d1e64d75fde04148fa Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Fri, 2 Sep 2011 08:55:41 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: Update TODO file
+
+Based on input from Greg, update the TODO file.
+
+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/TODO | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+--- a/drivers/staging/hv/TODO
++++ b/drivers/staging/hv/TODO
+@@ -1,14 +1,11 @@
+ TODO:
+- - fix remaining checkpatch warnings and errors
+ - audit the vmbus to verify it is working properly with the
+ driver model
+- - see if the vmbus can be merged with the other virtual busses
+- in the kernel
+ - audit the network driver
+ - checking for carrier inside open is wrong, network device API
+ confusion??
+- - audit the block driver
+ - audit the scsi driver
+
+ Please send patches for this code to Greg Kroah-Hartman <gregkh@suse.de>,
+-Hank Janssen <hjanssen@microsoft.com>, and Haiyang Zhang <haiyangz@microsoft.com>.
++Hank Janssen <hjanssen@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>,
++K. Y. Srinivasan <kys@microsoft.com>
diff --git a/patches.suse/staging-hv-vmbus-modalias-show.patch b/patches.suse/staging-hv-staging-next-20111001-0066-Staging-hv-vmbus-Show-the-modalias-in-sys-bus-vm.patch
index 4f68c822e1..45fa17321b 100644
--- a/patches.suse/staging-hv-vmbus-modalias-show.patch
+++ b/patches.suse/staging-hv-staging-next-20111001-0066-Staging-hv-vmbus-Show-the-modalias-in-sys-bus-vm.patch
@@ -1,8 +1,15 @@
-From: <ohering@suse.de>
-Subject: Staging: hv: vmbus: Show the modalias in /sys/bus/vmbus/devices/*/
-Patch-mainline: submitted 20110902 lkml
-References: fate#311487
+From fd776ba9abdb6a89aa1ef500d7046caa35a0905a Mon Sep 17 00:00:00 2001
+From: Olaf Hering <olaf@aepfle.de>
+Date: Fri, 2 Sep 2011 18:25:56 +0200
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Show the modalias in /sys/bus/vmbus/devices/*/
+Show a modalias file in /sys/bus/vmbus/devices/*/
+Add a helper function to print the same content in modalias and uevent.
+
+Signed-off-by: Olaf Hering <olaf@aepfle.de>
+Acked-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/hv/vmbus_drv.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/patches.suse/staging-hv-staging-next-20111001-0129-Staging-hv-Add-support-for-2-TB-LUN-in-storage-dr.patch b/patches.suse/staging-hv-staging-next-20111001-0129-Staging-hv-Add-support-for-2-TB-LUN-in-storage-dr.patch
new file mode 100644
index 0000000000..9e601c81ba
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0129-Staging-hv-Add-support-for-2-TB-LUN-in-storage-dr.patch
@@ -0,0 +1,39 @@
+From cf55f4a8b6243b42fb91c56d1421db0d36d60f96 Mon Sep 17 00:00:00 2001
+From: Mike Sterling <mike.sterling@microsoft.com>
+Date: Tue, 6 Sep 2011 16:10:55 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: Add support for >2 TB LUN in storage driver.
+
+If a LUN larger than 2 TB is attached to a Linux VM on Hyper-V, we currently
+report a maximum size of 2 TB. This patch resolves the issue in hv_storvsc.
+Thanks to Robert Scheck <robert.scheck@etes.de> for reporting the issue.
+
+Reported-by: Robert Scheck <robert.scheck@etes.de>
+Signed-off-by: Mike Sterling <mike.sterling@microsoft.com>
+Signed-off-by: K.Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Cc: stable <stable@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/storvsc_drv.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -232,6 +232,7 @@ struct vstor_packet {
+ #define STORVSC_MAX_LUNS_PER_TARGET 64
+ #define STORVSC_MAX_TARGETS 1
+ #define STORVSC_MAX_CHANNELS 1
++#define STORVSC_MAX_CMD_LEN 16
+
+ struct hv_storvsc_request;
+
+@@ -1440,6 +1441,8 @@ static int storvsc_probe(struct hv_devic
+ host->max_id = STORVSC_MAX_TARGETS;
+ /* max # of channels */
+ host->max_channel = STORVSC_MAX_CHANNELS - 1;
++ /* max cmd length */
++ host->max_cmd_len = STORVSC_MAX_CMD_LEN;
+
+ /* Register the HBA and start the scsi bus scan */
+ ret = scsi_add_host(host, &device->device);
diff --git a/patches.suse/staging-hv-staging-next-20111001-0243-Staging-hv-vmbus-Rename-vmbus_child_device_create.patch b/patches.suse/staging-hv-staging-next-20111001-0243-Staging-hv-vmbus-Rename-vmbus_child_device_create.patch
new file mode 100644
index 0000000000..6ad614ba0b
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0243-Staging-hv-vmbus-Rename-vmbus_child_device_create.patch
@@ -0,0 +1,55 @@
+From f2c73011117f6b45dea01f5450285405b5e88efb Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 8 Sep 2011 07:24:12 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Rename vmbus_child_device_create
+
+The vmbus devices are NOT child devices; rename vmbus_child_device_create
+to reflect this.
+
+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_mgmt.c | 2 +-
+ drivers/staging/hv/hyperv_vmbus.h | 2 +-
+ drivers/staging/hv/vmbus_drv.c | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/staging/hv/channel_mgmt.c
++++ b/drivers/staging/hv/channel_mgmt.c
+@@ -383,7 +383,7 @@ static void vmbus_process_offer(struct w
+ * We need to set the DeviceObject field before calling
+ * vmbus_child_dev_add()
+ */
+- newchannel->device_obj = vmbus_child_device_create(
++ newchannel->device_obj = vmbus_device_create(
+ &newchannel->offermsg.offer.if_type,
+ &newchannel->offermsg.offer.if_instance,
+ newchannel);
+--- a/drivers/staging/hv/hyperv_vmbus.h
++++ b/drivers/staging/hv/hyperv_vmbus.h
+@@ -601,7 +601,7 @@ extern struct vmbus_connection vmbus_con
+
+ /* General vmbus interface */
+
+-struct hv_device *vmbus_child_device_create(uuid_le *type,
++struct hv_device *vmbus_device_create(uuid_le *type,
+ uuid_le *instance,
+ struct vmbus_channel *channel);
+
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -594,10 +594,10 @@ void vmbus_driver_unregister(struct hv_d
+ EXPORT_SYMBOL_GPL(vmbus_driver_unregister);
+
+ /*
+- * vmbus_child_device_create - Creates and registers a new child device
++ * vmbus_device_create - Creates and registers a new child device
+ * on the vmbus.
+ */
+-struct hv_device *vmbus_child_device_create(uuid_le *type,
++struct hv_device *vmbus_device_create(uuid_le *type,
+ uuid_le *instance,
+ struct vmbus_channel *channel)
+ {
diff --git a/patches.suse/staging-hv-staging-next-20111001-0244-Staging-hv-vmbus-Rename-vmbus_child_device_regist.patch b/patches.suse/staging-hv-staging-next-20111001-0244-Staging-hv-vmbus-Rename-vmbus_child_device_regist.patch
new file mode 100644
index 0000000000..0b00bfe616
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0244-Staging-hv-vmbus-Rename-vmbus_child_device_regist.patch
@@ -0,0 +1,54 @@
+From 22794281974f9ba7770615191c382cca03067736 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 8 Sep 2011 07:24:13 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Rename vmbus_child_device_register
+
+The vmbus devices are NOT child devices; rename vmbus_child_device_register
+to reflect this.
+
+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_mgmt.c | 2 +-
+ drivers/staging/hv/hyperv_vmbus.h | 2 +-
+ drivers/staging/hv/vmbus_drv.c | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/staging/hv/channel_mgmt.c
++++ b/drivers/staging/hv/channel_mgmt.c
+@@ -393,7 +393,7 @@ static void vmbus_process_offer(struct w
+ * binding which eventually invokes the device driver's AddDevice()
+ * method.
+ */
+- ret = vmbus_child_device_register(newchannel->device_obj);
++ ret = vmbus_device_register(newchannel->device_obj);
+ if (ret != 0) {
+ pr_err("unable to add child device object (relid %d)\n",
+ newchannel->offermsg.child_relid);
+--- a/drivers/staging/hv/hyperv_vmbus.h
++++ b/drivers/staging/hv/hyperv_vmbus.h
+@@ -605,7 +605,7 @@ struct hv_device *vmbus_device_create(uu
+ uuid_le *instance,
+ struct vmbus_channel *channel);
+
+-int vmbus_child_device_register(struct hv_device *child_device_obj);
++int vmbus_device_register(struct hv_device *child_device_obj);
+ void vmbus_child_device_unregister(struct hv_device *device_obj);
+
+ /* static void */
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -619,9 +619,9 @@ struct hv_device *vmbus_device_create(uu
+ }
+
+ /*
+- * vmbus_child_device_register - Register the child device
++ * vmbus_device_register - Register the child device
+ */
+-int vmbus_child_device_register(struct hv_device *child_device_obj)
++int vmbus_device_register(struct hv_device *child_device_obj)
+ {
+ int ret = 0;
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0245-Staging-hv-vmbus-Rename-vmbus_child_device_unregi.patch b/patches.suse/staging-hv-staging-next-20111001-0245-Staging-hv-vmbus-Rename-vmbus_child_device_unregi.patch
new file mode 100644
index 0000000000..c4dee30d97
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0245-Staging-hv-vmbus-Rename-vmbus_child_device_unregi.patch
@@ -0,0 +1,55 @@
+From 696453ba2830501274b17a5953c40f7794a56df0 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 8 Sep 2011 07:24:14 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Rename vmbus_child_device_unregister
+
+The vmbus devices are NOT child devices; rename vmbus_child_device_unregister
+to reflect this.
+
+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_mgmt.c | 2 +-
+ drivers/staging/hv/hyperv_vmbus.h | 2 +-
+ drivers/staging/hv/vmbus_drv.c | 4 ++--
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/staging/hv/channel_mgmt.c
++++ b/drivers/staging/hv/channel_mgmt.c
+@@ -333,7 +333,7 @@ static void vmbus_process_rescind_offer(
+ struct vmbus_channel,
+ work);
+
+- vmbus_child_device_unregister(channel->device_obj);
++ vmbus_device_unregister(channel->device_obj);
+ }
+
+ /*
+--- a/drivers/staging/hv/hyperv_vmbus.h
++++ b/drivers/staging/hv/hyperv_vmbus.h
+@@ -606,7 +606,7 @@ struct hv_device *vmbus_device_create(uu
+ struct vmbus_channel *channel);
+
+ int vmbus_device_register(struct hv_device *child_device_obj);
+-void vmbus_child_device_unregister(struct hv_device *device_obj);
++void vmbus_device_unregister(struct hv_device *device_obj);
+
+ /* static void */
+ /* VmbusChildDeviceDestroy( */
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -650,10 +650,10 @@ int vmbus_device_register(struct hv_devi
+ }
+
+ /*
+- * vmbus_child_device_unregister - Remove the specified child device
++ * vmbus_device_unregister - Remove the specified child device
+ * from the vmbus.
+ */
+-void vmbus_child_device_unregister(struct hv_device *device_obj)
++void vmbus_device_unregister(struct hv_device *device_obj)
+ {
+ /*
+ * Kick off the process of unregistering the device.
diff --git a/patches.suse/staging-hv-staging-next-20111001-0246-Staging-hv-vmbus-Cleanup-dated-comments-in-channe.patch b/patches.suse/staging-hv-staging-next-20111001-0246-Staging-hv-vmbus-Cleanup-dated-comments-in-channe.patch
new file mode 100644
index 0000000000..97ab55553e
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0246-Staging-hv-vmbus-Cleanup-dated-comments-in-channe.patch
@@ -0,0 +1,27 @@
+From 66e60413db488e4830286220152ae63d31c32a6a Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 8 Sep 2011 07:24:15 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup dated comments in channel_mgmt.c
+
+Cleanup dated comments in channel_mgmt.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_mgmt.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/staging/hv/channel_mgmt.c
++++ b/drivers/staging/hv/channel_mgmt.c
+@@ -433,9 +433,6 @@ static void vmbus_process_offer(struct w
+ /*
+ * vmbus_onoffer - Handler for channel offers from vmbus in parent partition.
+ *
+- * We ignore all offers except network and storage offers. For each network and
+- * storage offers, we create a channel object and queue a work item to the
+- * channel object to process the offer synchronously
+ */
+ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
+ {
diff --git a/patches.suse/staging-hv-staging-next-20111001-0293-Staging-hv-vmbus-Introduce-a-utility-function-to.patch b/patches.suse/staging-hv-staging-next-20111001-0293-Staging-hv-vmbus-Introduce-a-utility-function-to.patch
new file mode 100644
index 0000000000..340360a064
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0293-Staging-hv-vmbus-Introduce-a-utility-function-to.patch
@@ -0,0 +1,55 @@
+From 3037a7b61fa63160f2bd76555aa9ae59c6f71faf Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:37 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Introduce a utility function to match hv_vmbus_device_id
+
+Introduce a utility function to match 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 | 23 ++++++++++++++++++-----
+ 1 file changed, 18 insertions(+), 5 deletions(-)
+
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -272,6 +272,22 @@ static inline bool is_null_guid(const __
+ return true;
+ }
+
++/*
++ * Return a matching hv_vmbus_device_id pointer.
++ * If there is no match, return NULL.
++ */
++static const struct hv_vmbus_device_id *hv_vmbus_get_id(
++ const struct hv_vmbus_device_id *id,
++ __u8 *guid)
++{
++ for (; !is_null_guid(id->guid); id++)
++ if (!memcmp(&id->guid, guid, sizeof(uuid_le)))
++ return id;
++
++ return NULL;
++}
++
++
+
+ /*
+ * vmbus_match - Attempt to match the specified device to the specified driver
+@@ -280,12 +296,9 @@ static int vmbus_match(struct device *de
+ {
+ 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;
+
+- for (; !is_null_guid(id_array->guid); id_array++)
+- if (!memcmp(&id_array->guid, &hv_dev->dev_type.b,
+- sizeof(uuid_le)))
+- return 1;
++ if (hv_vmbus_get_id(drv->id_table, hv_dev->dev_type.b))
++ return 1;
+
+ return 0;
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0294-Staging-hv-vmbus-Change-the-signature-of-struct-h.patch b/patches.suse/staging-hv-staging-next-20111001-0294-Staging-hv-vmbus-Change-the-signature-of-struct-h.patch
new file mode 100644
index 0000000000..e979387fae
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0294-Staging-hv-vmbus-Change-the-signature-of-struct-h.patch
@@ -0,0 +1,95 @@
+From 84946899bd50035c50d88da9da809aa25de60471 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:38 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Change the signature of struct hv_driver probe function
+
+In preparation to leveraging the driver_data field in struct
+hv_vmbus_device_id, change the signature of struct hv_driver probe 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/hv_mouse.c | 3 ++-
+ drivers/staging/hv/hv_util.c | 3 ++-
+ drivers/staging/hv/hyperv.h | 2 +-
+ drivers/staging/hv/netvsc_drv.c | 3 ++-
+ drivers/staging/hv/storvsc_drv.c | 3 ++-
+ drivers/staging/hv/vmbus_drv.c | 4 +++-
+ 6 files changed, 12 insertions(+), 6 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -823,7 +823,8 @@ static int mousevsc_on_device_remove(str
+ }
+
+
+-static int mousevsc_probe(struct hv_device *dev)
++static int mousevsc_probe(struct hv_device *dev,
++ const struct hv_vmbus_device_id *dev_id)
+ {
+ int ret = 0;
+
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -239,7 +239,8 @@ static void heartbeat_onchannelcallback(
+ * The devices managed by the util driver don't need any additional
+ * setup.
+ */
+-static int util_probe(struct hv_device *dev)
++static int util_probe(struct hv_device *dev,
++ const struct hv_vmbus_device_id *dev_id)
+ {
+ return 0;
+ }
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -810,7 +810,7 @@ struct hv_driver {
+
+ struct device_driver driver;
+
+- int (*probe)(struct hv_device *);
++ int (*probe)(struct hv_device *, const struct hv_vmbus_device_id *);
+ int (*remove)(struct hv_device *);
+ void (*shutdown)(struct hv_device *);
+
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -329,7 +329,8 @@ static void netvsc_send_garp(struct work
+ }
+
+
+-static int netvsc_probe(struct hv_device *dev)
++static int netvsc_probe(struct hv_device *dev,
++ const struct hv_vmbus_device_id *dev_id)
+ {
+ struct net_device *net = NULL;
+ struct net_device_context *net_device_ctx;
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1380,7 +1380,8 @@ MODULE_DEVICE_TABLE(vmbus, id_table);
+ * storvsc_probe - Add a new device for this driver
+ */
+
+-static int storvsc_probe(struct hv_device *device)
++static int storvsc_probe(struct hv_device *device,
++ const struct hv_vmbus_device_id *dev_id)
+ {
+ int ret;
+ struct Scsi_Host *host;
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -312,9 +312,11 @@ static int vmbus_probe(struct device *ch
+ struct hv_driver *drv =
+ drv_to_hv_drv(child_device->driver);
+ struct hv_device *dev = device_to_hv_device(child_device);
++ const struct hv_vmbus_device_id *dev_id;
+
++ dev_id = hv_vmbus_get_id(drv->id_table, dev->dev_type.b);
+ if (drv->probe) {
+- ret = drv->probe(dev);
++ ret = drv->probe(dev, dev_id);
+ if (ret != 0)
+ pr_err("probe failed for device %s (%d)\n",
+ dev_name(child_device), ret);
diff --git a/patches.suse/staging-hv-staging-next-20111001-0295-Staging-hv-storvsc-Use-the-driver_data-to-identif.patch b/patches.suse/staging-hv-staging-next-20111001-0295-Staging-hv-storvsc-Use-the-driver_data-to-identif.patch
new file mode 100644
index 0000000000..6eed5293c8
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0295-Staging-hv-storvsc-Use-the-driver_data-to-identif.patch
@@ -0,0 +1,61 @@
+From ef52a81bf5b229d74b76a25c5de22ae10e1fbb77 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:39 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: storvsc: Use the driver_data to identify ide
+
+Use the driver_data to identify ide devices in storvsc_probe().
+
+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 file changed, 10 insertions(+), 12 deletions(-)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1359,17 +1359,20 @@ static struct scsi_host_template scsi_dr
+ .dma_boundary = PAGE_SIZE-1,
+ };
+
+-/*
+- * The storvsc_probe function assumes that the IDE guid
+- * is the second entry.
+- */
++enum {
++ SCSI_GUID,
++ IDE_GUID,
++};
++
+ 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) },
++ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f)
++ .driver_data = SCSI_GUID },
+ /* IDE guid */
+ { VMBUS_DEVICE(0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+- 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5) },
++ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5)
++ .driver_data = IDE_GUID },
+ { },
+ };
+
+@@ -1387,15 +1390,10 @@ static int storvsc_probe(struct hv_devic
+ struct Scsi_Host *host;
+ struct hv_host_device *host_dev;
+ struct storvsc_device_info device_info;
+- bool dev_is_ide;
++ bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false);
+ int path = 0;
+ int target = 0;
+
+- if (!memcmp(&device->dev_type.b, id_table[1].guid, sizeof(uuid_le)))
+- dev_is_ide = true;
+- else
+- dev_is_ide = false;
+-
+ host = scsi_host_alloc(&scsi_driver,
+ sizeof(struct hv_host_device));
+ if (!host)
diff --git a/patches.suse/staging-hv-staging-next-20111001-0296-Staging-hv-vmbus-Introduce-functions-for-setting.patch b/patches.suse/staging-hv-staging-next-20111001-0296-Staging-hv-vmbus-Introduce-functions-for-setting.patch
new file mode 100644
index 0000000000..c91a440561
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0296-Staging-hv-vmbus-Introduce-functions-for-setting.patch
@@ -0,0 +1,33 @@
+From ab101e86d0f2c00c11aec5b16e27246ccecb0870 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:40 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Introduce functions for setting and getting driver data
+
+Introduce vmbus specific wrapper functions to set/get driver specific data.
+
+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 | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -843,6 +843,15 @@ static inline struct hv_driver *drv_to_h
+ return container_of(d, struct hv_driver, driver);
+ }
+
++static inline void hv_set_drvdata(struct hv_device *dev, void *data)
++{
++ dev_set_drvdata(&dev->device, data);
++}
++
++static inline void *hv_get_drvdata(struct hv_device *dev)
++{
++ return dev_get_drvdata(&dev->device);
++}
+
+ /* Vmbus interface */
+ #define vmbus_driver_register(driver) \
diff --git a/patches.suse/staging-hv-staging-next-20111001-0297-Staging-hv-vmbus-Cleanup-vmbus_remove.patch b/patches.suse/staging-hv-staging-next-20111001-0297-Staging-hv-vmbus-Cleanup-vmbus_remove.patch
new file mode 100644
index 0000000000..1c1fac8102
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0297-Staging-hv-vmbus-Cleanup-vmbus_remove.patch
@@ -0,0 +1,46 @@
+From d4372179c85b50cf0a468c1d573113056b0c46a0 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:44 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Cleanup vmbus_remove()
+
+vmbus_remove() cannot fail; clean it up 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/vmbus_drv.c | 20 ++++++--------------
+ 1 file changed, 6 insertions(+), 14 deletions(-)
+
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -334,22 +334,14 @@ static int vmbus_probe(struct device *ch
+ */
+ static int vmbus_remove(struct device *child_device)
+ {
+- int ret;
+- struct hv_driver *drv;
+-
++ struct hv_driver *drv = drv_to_hv_drv(child_device->driver);
+ struct hv_device *dev = device_to_hv_device(child_device);
+
+- if (child_device->driver) {
+- drv = drv_to_hv_drv(child_device->driver);
+-
+- if (drv->remove) {
+- ret = drv->remove(dev);
+- } else {
+- pr_err("remove not set for driver %s\n",
+- dev_name(child_device));
+- ret = -ENODEV;
+- }
+- }
++ if (drv->remove)
++ drv->remove(dev);
++ else
++ pr_err("remove not set for driver %s\n",
++ dev_name(child_device));
+
+ return 0;
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0298-Staging-hv-storvsc-Get-rid-of-storvsc_dev_add-b.patch b/patches.suse/staging-hv-staging-next-20111001-0298-Staging-hv-storvsc-Get-rid-of-storvsc_dev_add-b.patch
new file mode 100644
index 0000000000..911d77faef
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0298-Staging-hv-storvsc-Get-rid-of-storvsc_dev_add-b.patch
@@ -0,0 +1,107 @@
+From 6e4198ce18859953019d8f32f71e3a7aa309b72d Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:45 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: storvsc: Get rid of storvsc_dev_add() by inlining the code
+
+Get rid of storvsc_dev_add() 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_drv.c | 58 +++++++++------------------------------
+ 1 file changed, 14 insertions(+), 44 deletions(-)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -651,41 +651,6 @@ static int storvsc_connect_to_vsp(struct
+ return ret;
+ }
+
+-static 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;
+-}
+-
+ static int storvsc_dev_remove(struct hv_device *device)
+ {
+ struct storvsc_device *stor_device;
+@@ -1389,10 +1354,10 @@ static int storvsc_probe(struct hv_devic
+ int ret;
+ struct Scsi_Host *host;
+ struct hv_host_device *host_dev;
+- struct storvsc_device_info device_info;
+ bool dev_is_ide = ((dev_id->driver_data == IDE_GUID) ? true : false);
+ int path = 0;
+ int target = 0;
++ struct storvsc_device *stor_device;
+
+ host = scsi_host_alloc(&scsi_driver,
+ sizeof(struct hv_host_device));
+@@ -1417,22 +1382,27 @@ static int storvsc_probe(struct hv_devic
+ return -ENOMEM;
+ }
+
+- device_info.port_number = host->host_no;
+- device_info.ring_buffer_size = storvsc_ringbuffer_size;
+- /* Call to the vsc driver to add the device */
+- ret = storvsc_dev_add(device, (void *)&device_info);
++ stor_device = alloc_stor_device(device);
++ if (!stor_device) {
++ kmem_cache_destroy(host_dev->request_pool);
++ scsi_host_put(host);
++ return -ENOMEM;
++ }
+
+- if (ret != 0) {
++ stor_device->port_number = host->host_no;
++ ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size);
++ if (ret) {
+ kmem_cache_destroy(host_dev->request_pool);
+ scsi_host_put(host);
+- return -ENODEV;
++ kfree(stor_device);
++ return ret;
+ }
+
+ 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;
++ host_dev->path = stor_device->path_id;
++ host_dev->target = stor_device->target_id;
+
+ /* max # of devices per target */
+ host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0299-Staging-hv-storvsc-Get-rid-of-alloc_stor_device.patch b/patches.suse/staging-hv-staging-next-20111001-0299-Staging-hv-storvsc-Get-rid-of-alloc_stor_device.patch
new file mode 100644
index 0000000000..60ebc735e2
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0299-Staging-hv-storvsc-Get-rid-of-alloc_stor_device.patch
@@ -0,0 +1,61 @@
+From a13d35ab9fdcc8e40af570039120a35179426c08 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:46 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: storvsc: Get rid of alloc_stor_device() by inlining the code
+
+Get rid of alloc_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_drv.c | 24 ++++++------------------
+ 1 file changed, 6 insertions(+), 18 deletions(-)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -332,23 +332,6 @@ static inline void storvsc_wait_to_drain
+ dev->drain_notify = false;
+ }
+
+-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)
+ {
+@@ -1382,13 +1365,18 @@ static int storvsc_probe(struct hv_devic
+ return -ENOMEM;
+ }
+
+- stor_device = alloc_stor_device(device);
++ stor_device = kzalloc(sizeof(struct storvsc_device), GFP_KERNEL);
+ if (!stor_device) {
+ kmem_cache_destroy(host_dev->request_pool);
+ scsi_host_put(host);
+ return -ENOMEM;
+ }
+
++ stor_device->destroy = false;
++ init_waitqueue_head(&stor_device->waiting_to_drain);
++ stor_device->device = device;
++ device->ext = stor_device;
++
+ stor_device->port_number = host->host_no;
+ ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size);
+ if (ret) {
diff --git a/patches.suse/staging-hv-staging-next-20111001-0300-Staging-hv-storvsc-Get-rid-of-some-unnecessary-st.patch b/patches.suse/staging-hv-staging-next-20111001-0300-Staging-hv-storvsc-Get-rid-of-some-unnecessary-st.patch
new file mode 100644
index 0000000000..7d76660720
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0300-Staging-hv-storvsc-Get-rid-of-some-unnecessary-st.patch
@@ -0,0 +1,40 @@
+From f810d592a29314ade8cce29f8dac858c90a50409 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:47 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: storvsc: Get rid of some unnecessary state and definitions
+
+Now, get rid of some unnecessary state and definitions.
+
+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 | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -245,7 +245,6 @@ enum storvsc_request_type {
+
+
+ struct hv_storvsc_request {
+- struct hv_storvsc_request *request;
+ struct hv_device *device;
+
+ /* Synchronize the request/response if needed */
+@@ -260,14 +259,6 @@ struct hv_storvsc_request {
+ };
+
+
+-struct storvsc_device_info {
+- u32 ring_buffer_size;
+- unsigned int port_number;
+- unsigned char path_id;
+- unsigned char target_id;
+-};
+-
+-
+ /* A storvsc device is a device object that contains a vmbus channel */
+ struct storvsc_device {
+ struct hv_device *device;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0301-Staging-hv-storvsc-Eliminate-the-usage-of-ext-fie.patch b/patches.suse/staging-hv-staging-next-20111001-0301-Staging-hv-storvsc-Eliminate-the-usage-of-ext-fie.patch
new file mode 100644
index 0000000000..09f907ead0
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0301-Staging-hv-storvsc-Eliminate-the-usage-of-ext-fie.patch
@@ -0,0 +1,106 @@
+From cd654ea1cc72aed95e871971d87c4a988924fdda Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:48 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: storvsc: Eliminate the usage of ext field in struct hv_device
+
+Now, eliminate the usage of ext field in struct hv_device for storvsc driver.
+We do this by registering pointer to struct storvsc_device as the driver
+specific data and eliminating the current usage of driver specific data to
+save and retrieve the pointer to struct Scsi_Host.
+Additionally, all access to the driver specific data is through
+the vmbus wrapper functions. Note that function to allocate the host
+gives us a reference on the host 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/storvsc_drv.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -266,6 +266,7 @@ struct storvsc_device {
+ bool destroy;
+ bool drain_notify;
+ atomic_t num_outstanding_req;
++ struct Scsi_Host *host;
+
+ wait_queue_head_t waiting_to_drain;
+
+@@ -306,7 +307,7 @@ static inline struct storvsc_device *get
+ {
+ struct storvsc_device *stor_device;
+
+- stor_device = (struct storvsc_device *)device->ext;
++ stor_device = hv_get_drvdata(device);
+
+ if (stor_device && stor_device->destroy)
+ stor_device = NULL;
+@@ -328,7 +329,7 @@ static inline struct storvsc_device *get
+ {
+ struct storvsc_device *stor_device;
+
+- stor_device = (struct storvsc_device *)device->ext;
++ stor_device = hv_get_drvdata(device);
+
+ if (!stor_device)
+ goto get_in_err;
+@@ -480,8 +481,7 @@ static void storvsc_on_io_completion(str
+ struct storvsc_device *stor_device;
+ struct vstor_packet *stor_pkt;
+
+- stor_device = (struct storvsc_device *)device->ext;
+-
++ stor_device = hv_get_drvdata(device);
+ stor_pkt = &request->vstor_packet;
+
+ /*
+@@ -630,7 +630,7 @@ static int storvsc_dev_remove(struct hv_
+ struct storvsc_device *stor_device;
+ unsigned long flags;
+
+- stor_device = (struct storvsc_device *)device->ext;
++ stor_device = hv_get_drvdata(device);
+
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ stor_device->destroy = true;
+@@ -652,7 +652,7 @@ static int storvsc_dev_remove(struct hv_
+ * allow incoming packets.
+ */
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+- device->ext = NULL;
++ hv_set_drvdata(device, NULL);
+ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+
+ /* Close the channel */
+@@ -962,7 +962,8 @@ static unsigned int copy_to_bounce_buffe
+
+ static int storvsc_remove(struct hv_device *dev)
+ {
+- struct Scsi_Host *host = dev_get_drvdata(&dev->device);
++ struct storvsc_device *stor_device = hv_get_drvdata(dev);
++ struct Scsi_Host *host = stor_device->host;
+ struct hv_host_device *host_dev =
+ (struct hv_host_device *)host->hostdata;
+
+@@ -1338,8 +1339,6 @@ static int storvsc_probe(struct hv_devic
+ if (!host)
+ return -ENOMEM;
+
+- dev_set_drvdata(&device->device, host);
+-
+ host_dev = (struct hv_host_device *)host->hostdata;
+ memset(host_dev, 0, sizeof(struct hv_host_device));
+
+@@ -1366,7 +1365,8 @@ static int storvsc_probe(struct hv_devic
+ stor_device->destroy = false;
+ init_waitqueue_head(&stor_device->waiting_to_drain);
+ stor_device->device = device;
+- device->ext = stor_device;
++ stor_device->host = host;
++ hv_set_drvdata(device, stor_device);
+
+ stor_device->port_number = host->host_no;
+ ret = storvsc_connect_to_vsp(device, storvsc_ringbuffer_size);
diff --git a/patches.suse/staging-hv-staging-next-20111001-0302-Staging-hv-netvsc-Get-rid-of-the-usage-of-the-ext.patch b/patches.suse/staging-hv-staging-next-20111001-0302-Staging-hv-netvsc-Get-rid-of-the-usage-of-the-ext.patch
new file mode 100644
index 0000000000..3957e5aa38
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0302-Staging-hv-netvsc-Get-rid-of-the-usage-of-the-ext.patch
@@ -0,0 +1,437 @@
+From 2ddd5e5fb342b9f014d61941a4f73c0bd9b50a60 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:49 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: netvsc: Get rid of the usage of the ext field in struct hv_device
+
+Now, eliminate the usage of ext field in struct hv_device for netvsc driver.
+We do this by registering pointer to struct netvsc_device as the driver
+specific data and eliminating the current usage of driver specific data
+to save and retrieve the pointer to struct net_device.
+Additionally, all access to the driver specific data is through
+the vmbus wrapper functions. As part of this cleanup, we also get rid
+of some unnecessary debug print statements.
+
+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 | 2
+ drivers/staging/hv/netvsc.c | 86 +++++++++++++++++++-------------------
+ drivers/staging/hv/netvsc_drv.c | 24 ++++++++--
+ drivers/staging/hv/rndis_filter.c | 28 ++++++++----
+ 4 files changed, 83 insertions(+), 57 deletions(-)
+
+--- a/drivers/staging/hv/hyperv_net.h
++++ b/drivers/staging/hv/hyperv_net.h
+@@ -392,6 +392,8 @@ struct netvsc_device {
+ struct nvsp_message revoke_packet;
+ /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */
+
++ struct net_device *ndev;
++
+ /* Holds rndis device info */
+ void *extension;
+ };
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -35,6 +35,7 @@
+ static struct netvsc_device *alloc_net_device(struct hv_device *device)
+ {
+ struct netvsc_device *net_device;
++ struct net_device *ndev = hv_get_drvdata(device);
+
+ net_device = kzalloc(sizeof(struct netvsc_device), GFP_KERNEL);
+ if (!net_device)
+@@ -43,8 +44,9 @@ static struct netvsc_device *alloc_net_d
+
+ net_device->destroy = false;
+ net_device->dev = device;
+- device->ext = net_device;
++ net_device->ndev = ndev;
+
++ hv_set_drvdata(device, net_device);
+ return net_device;
+ }
+
+@@ -52,7 +54,7 @@ static struct netvsc_device *get_outboun
+ {
+ struct netvsc_device *net_device;
+
+- net_device = device->ext;
++ net_device = hv_get_drvdata(device);
+ if (net_device && net_device->destroy)
+ net_device = NULL;
+
+@@ -63,7 +65,7 @@ static struct netvsc_device *get_inbound
+ {
+ struct netvsc_device *net_device;
+
+- net_device = device->ext;
++ net_device = hv_get_drvdata(device);
+
+ if (!net_device)
+ goto get_in_err;
+@@ -81,7 +83,7 @@ static int netvsc_destroy_recv_buf(struc
+ {
+ struct nvsp_message *revoke_packet;
+ int ret = 0;
+- struct net_device *ndev = dev_get_drvdata(&net_device->dev->device);
++ struct net_device *ndev = net_device->ndev;
+
+ /*
+ * If we got a section count, it means we received a
+@@ -153,14 +155,12 @@ static int netvsc_init_recv_buf(struct h
+ int t;
+ struct netvsc_device *net_device;
+ struct nvsp_message *init_packet;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ net_device = get_outbound_net_device(device);
+- if (!net_device) {
+- netdev_err(ndev, "unable to get net device..."
+- "device being destroyed?\n");
++ if (!net_device)
+ return -ENODEV;
+- }
++ ndev = net_device->ndev;
+
+ net_device->recv_buf =
+ (void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
+@@ -269,14 +269,12 @@ static int netvsc_connect_vsp(struct hv_
+ struct netvsc_device *net_device;
+ struct nvsp_message *init_packet;
+ int ndis_version;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ net_device = get_outbound_net_device(device);
+- if (!net_device) {
+- netdev_err(ndev, "unable to get net device..."
+- "device being destroyed?\n");
++ if (!net_device)
+ return -ENODEV;
+- }
++ ndev = net_device->ndev;
+
+ init_packet = &net_device->channel_init_pkt;
+
+@@ -357,7 +355,7 @@ int netvsc_device_remove(struct hv_devic
+ struct hv_netvsc_packet *netvsc_packet, *pos;
+ unsigned long flags;
+
+- net_device = (struct netvsc_device *)device->ext;
++ net_device = hv_get_drvdata(device);
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+ net_device->destroy = true;
+ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+@@ -381,7 +379,7 @@ int netvsc_device_remove(struct hv_devic
+ */
+
+ spin_lock_irqsave(&device->channel->inbound_lock, flags);
+- device->ext = NULL;
++ hv_set_drvdata(device, NULL);
+ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+
+ /* At this point, no one should be accessing netDevice except in here */
+@@ -407,14 +405,12 @@ static void netvsc_send_completion(struc
+ struct netvsc_device *net_device;
+ struct nvsp_message *nvsp_packet;
+ struct hv_netvsc_packet *nvsc_packet;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ net_device = get_inbound_net_device(device);
+- if (!net_device) {
+- netdev_err(ndev, "unable to get net device..."
+- "device being destroyed?\n");
++ if (!net_device)
+ return;
+- }
++ ndev = net_device->ndev;
+
+ nvsp_packet = (struct nvsp_message *)((unsigned long)packet +
+ (packet->offset8 << 3));
+@@ -452,14 +448,12 @@ int netvsc_send(struct hv_device *device
+ struct netvsc_device *net_device;
+ int ret = 0;
+ struct nvsp_message sendMessage;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ net_device = get_outbound_net_device(device);
+- if (!net_device) {
+- netdev_err(ndev, "net device (%p) shutting down..."
+- "ignoring outbound packets\n", net_device);
++ if (!net_device)
+ return -ENODEV;
+- }
++ ndev = net_device->ndev;
+
+ sendMessage.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
+ if (packet->is_data_pkt) {
+@@ -506,7 +500,10 @@ static void netvsc_send_recv_completion(
+ struct nvsp_message recvcompMessage;
+ int retries = 0;
+ int ret;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
++ struct netvsc_device *net_device = hv_get_drvdata(device);
++
++ ndev = net_device->ndev;
+
+ recvcompMessage.hdr.msg_type =
+ NVSP_MSG1_TYPE_SEND_RNDIS_PKT_COMPLETE;
+@@ -552,7 +549,7 @@ static void netvsc_receive_completion(vo
+ u64 transaction_id = 0;
+ bool fsend_receive_comp = false;
+ unsigned long flags;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ /*
+ * Even though it seems logical to do a GetOutboundNetDevice() here to
+@@ -560,11 +557,9 @@ static void netvsc_receive_completion(vo
+ * since we may have disable outbound traffic already.
+ */
+ net_device = get_inbound_net_device(device);
+- if (!net_device) {
+- netdev_err(ndev, "unable to get net device..."
+- "device being destroyed?\n");
++ if (!net_device)
+ return;
+- }
++ ndev = net_device->ndev;
+
+ /* Overloading use of the lock. */
+ spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
+@@ -607,16 +602,14 @@ static void netvsc_receive(struct hv_dev
+ int i, j;
+ int count = 0, bytes_remain = 0;
+ unsigned long flags;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ LIST_HEAD(listHead);
+
+ net_device = get_inbound_net_device(device);
+- if (!net_device) {
+- netdev_err(ndev, "unable to get net device..."
+- "device being destroyed?\n");
++ if (!net_device)
+ return;
+- }
++ ndev = net_device->ndev;
+
+ /*
+ * All inbound packets other than send completion should be xfer page
+@@ -784,7 +777,7 @@ static void netvsc_channel_cb(void *cont
+ struct vmpacket_descriptor *desc;
+ unsigned char *buffer;
+ int bufferlen = NETVSC_PACKET_SIZE;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
+ GFP_ATOMIC);
+@@ -793,11 +786,9 @@ static void netvsc_channel_cb(void *cont
+ buffer = packet;
+
+ net_device = get_inbound_net_device(device);
+- if (!net_device) {
+- netdev_err(ndev, "net device (%p) shutting down..."
+- "ignoring inbound packets\n", net_device);
++ if (!net_device)
+ goto out;
+- }
++ ndev = net_device->ndev;
+
+ do {
+ ret = vmbus_recvpacket_raw(device->channel, buffer, bufferlen,
+@@ -871,7 +862,7 @@ int netvsc_device_add(struct hv_device *
+ ((struct netvsc_device_info *)additional_info)->ring_size;
+ struct netvsc_device *net_device;
+ struct hv_netvsc_packet *packet, *pos;
+- struct net_device *ndev = dev_get_drvdata(&device->device);
++ struct net_device *ndev;
+
+ net_device = alloc_net_device(device);
+ if (!net_device) {
+@@ -879,6 +870,15 @@ int netvsc_device_add(struct hv_device *
+ goto cleanup;
+ }
+
++ /*
++ * Coming into this function, struct net_device * is
++ * registered as the driver private data.
++ * In alloc_net_device(), we register struct netvsc_device *
++ * as the driver private data and stash away struct net_device *
++ * in struct netvsc_device *.
++ */
++ ndev = net_device->ndev;
++
+ /* Initialize the NetVSC channel extension */
+ net_device->recv_buf_size = NETVSC_RECEIVE_BUFFER_SIZE;
+ spin_lock_init(&net_device->recv_pkt_list_lock);
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -203,8 +203,12 @@ static int netvsc_start_xmit(struct sk_b
+ void netvsc_linkstatus_callback(struct hv_device *device_obj,
+ unsigned int status)
+ {
+- struct net_device *net = dev_get_drvdata(&device_obj->device);
++ struct net_device *net;
+ struct net_device_context *ndev_ctx;
++ struct netvsc_device *net_device;
++
++ net_device = hv_get_drvdata(device_obj);
++ net = net_device->ndev;
+
+ if (!net) {
+ netdev_err(net, "got link status but net device "
+@@ -236,6 +240,10 @@ int netvsc_recv_callback(struct hv_devic
+ void *data;
+ int i;
+ unsigned long flags;
++ struct netvsc_device *net_device;
++
++ net_device = hv_get_drvdata(device_obj);
++ net = net_device->ndev;
+
+ if (!net) {
+ netdev_err(net, "got receive callback but net device"
+@@ -322,9 +330,11 @@ static void netvsc_send_garp(struct work
+ {
+ struct net_device_context *ndev_ctx;
+ struct net_device *net;
++ struct netvsc_device *net_device;
+
+ ndev_ctx = container_of(w, struct net_device_context, dwork.work);
+- net = dev_get_drvdata(&ndev_ctx->device_ctx->device);
++ net_device = hv_get_drvdata(ndev_ctx->device_ctx);
++ net = net_device->ndev;
+ netif_notify_peers(net);
+ }
+
+@@ -347,7 +357,7 @@ static int netvsc_probe(struct hv_device
+ net_device_ctx = netdev_priv(net);
+ net_device_ctx->device_ctx = dev;
+ atomic_set(&net_device_ctx->avail, ring_size);
+- dev_set_drvdata(&dev->device, net);
++ hv_set_drvdata(dev, net);
+ INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_send_garp);
+
+ net->netdev_ops = &device_ops;
+@@ -373,7 +383,7 @@ static int netvsc_probe(struct hv_device
+ netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
+ unregister_netdev(net);
+ free_netdev(net);
+- dev_set_drvdata(&dev->device, NULL);
++ hv_set_drvdata(dev, NULL);
+ return ret;
+ }
+ memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
+@@ -386,8 +396,12 @@ out:
+
+ static int netvsc_remove(struct hv_device *dev)
+ {
+- struct net_device *net = dev_get_drvdata(&dev->device);
++ struct net_device *net;
+ struct net_device_context *ndev_ctx;
++ struct netvsc_device *net_device;
++
++ net_device = hv_get_drvdata(dev);
++ net = net_device->ndev;
+
+ if (net == NULL) {
+ dev_err(&dev->device, "No net device to remove\n");
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -141,7 +141,11 @@ static void put_rndis_request(struct rnd
+ static void dump_rndis_message(struct hv_device *hv_dev,
+ struct rndis_message *rndis_msg)
+ {
+- struct net_device *netdev = dev_get_drvdata(&hv_dev->device);
++ struct net_device *netdev;
++ struct netvsc_device *net_device;
++
++ net_device = hv_get_drvdata(hv_dev);
++ netdev = net_device->ndev;
+
+ switch (rndis_msg->ndis_msg_type) {
+ case REMOTE_NDIS_PACKET_MSG:
+@@ -249,7 +253,9 @@ static void rndis_filter_receive_respons
+ struct rndis_request *request = NULL;
+ bool found = false;
+ unsigned long flags;
+- struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
++ struct net_device *ndev;
++
++ ndev = dev->net_dev->ndev;
+
+ spin_lock_irqsave(&dev->request_lock, flags);
+ list_for_each_entry(request, &dev->req_list, list_ent) {
+@@ -356,11 +362,13 @@ static void rndis_filter_receive_data(st
+ int rndis_filter_receive(struct hv_device *dev,
+ struct hv_netvsc_packet *pkt)
+ {
+- struct netvsc_device *net_dev = dev->ext;
++ struct netvsc_device *net_dev = hv_get_drvdata(dev);
+ struct rndis_device *rndis_dev;
+ struct rndis_message rndis_msg;
+ struct rndis_message *rndis_hdr;
+- struct net_device *ndev = dev_get_drvdata(&dev->device);
++ struct net_device *ndev;
++
++ ndev = net_dev->ndev;
+
+ if (!net_dev)
+ return -EINVAL;
+@@ -517,7 +525,9 @@ static int rndis_filter_set_packet_filte
+ struct rndis_set_complete *set_complete;
+ u32 status;
+ int ret, t;
+- struct net_device *ndev = dev_get_drvdata(&dev->net_dev->dev->device);
++ struct net_device *ndev;
++
++ ndev = dev->net_dev->ndev;
+
+ request = get_rndis_request(dev, REMOTE_NDIS_SET_MSG,
+ RNDIS_MESSAGE_SIZE(struct rndis_set_request) +
+@@ -700,7 +710,7 @@ int rndis_filter_device_add(struct hv_de
+
+
+ /* Initialize the rndis device */
+- netDevice = dev->ext;
++ netDevice = hv_get_drvdata(dev);
+
+ netDevice->extension = rndisDevice;
+ rndisDevice->net_dev = netDevice;
+@@ -737,7 +747,7 @@ int rndis_filter_device_add(struct hv_de
+
+ void rndis_filter_device_remove(struct hv_device *dev)
+ {
+- struct netvsc_device *net_dev = dev->ext;
++ struct netvsc_device *net_dev = hv_get_drvdata(dev);
+ struct rndis_device *rndis_dev = net_dev->extension;
+
+ /* Halt and release the rndis device */
+@@ -752,7 +762,7 @@ void rndis_filter_device_remove(struct h
+
+ int rndis_filter_open(struct hv_device *dev)
+ {
+- struct netvsc_device *netDevice = dev->ext;
++ struct netvsc_device *netDevice = hv_get_drvdata(dev);
+
+ if (!netDevice)
+ return -EINVAL;
+@@ -762,7 +772,7 @@ int rndis_filter_open(struct hv_device *
+
+ int rndis_filter_close(struct hv_device *dev)
+ {
+- struct netvsc_device *netDevice = dev->ext;
++ struct netvsc_device *netDevice = hv_get_drvdata(dev);
+
+ if (!netDevice)
+ return -EINVAL;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0303-Staging-hv-mousevsc-Get-rid-of-the-usage-of-the-e.patch b/patches.suse/staging-hv-staging-next-20111001-0303-Staging-hv-mousevsc-Get-rid-of-the-usage-of-the-e.patch
new file mode 100644
index 0000000000..89aaabe976
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0303-Staging-hv-mousevsc-Get-rid-of-the-usage-of-the-e.patch
@@ -0,0 +1,98 @@
+From 80e623887ef6a86718ecab257c592e214ecad82d Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:50 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of the usage of the ext field in struct hv_device
+
+Get rid of the usage of the ext field in struct hv_device for the mouse driver.
+We do this by using the newly introduced functions to set and and get driver
+specific data.
+
+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 | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -196,7 +196,7 @@ static struct mousevsc_dev *alloc_input_
+ atomic_cmpxchg(&input_dev->ref_count, 0, 2);
+
+ input_dev->device = device;
+- device->ext = input_dev;
++ hv_set_drvdata(device, input_dev);
+
+ return input_dev;
+ }
+@@ -214,7 +214,7 @@ static struct mousevsc_dev *get_input_de
+ {
+ struct mousevsc_dev *input_dev;
+
+- input_dev = (struct mousevsc_dev *)device->ext;
++ input_dev = hv_get_drvdata(device);
+
+ /*
+ * FIXME
+@@ -240,7 +240,7 @@ static struct mousevsc_dev *must_get_inp
+ {
+ struct mousevsc_dev *input_dev;
+
+- input_dev = (struct mousevsc_dev *)device->ext;
++ input_dev = hv_get_drvdata(device);
+
+ if (input_dev && atomic_read(&input_dev->ref_count))
+ atomic_inc(&input_dev->ref_count);
+@@ -254,7 +254,7 @@ static void put_input_device(struct hv_d
+ {
+ struct mousevsc_dev *input_dev;
+
+- input_dev = (struct mousevsc_dev *)device->ext;
++ input_dev = hv_get_drvdata(device);
+
+ atomic_dec(&input_dev->ref_count);
+ }
+@@ -266,7 +266,7 @@ static struct mousevsc_dev *release_inpu
+ {
+ struct mousevsc_dev *input_dev;
+
+- input_dev = (struct mousevsc_dev *)device->ext;
++ input_dev = hv_get_drvdata(device);
+
+ /* Busy wait until the ref drop to 2, then set it to 1 */
+ while (atomic_cmpxchg(&input_dev->ref_count, 2, 1) != 2)
+@@ -282,13 +282,13 @@ static struct mousevsc_dev *final_releas
+ {
+ struct mousevsc_dev *input_dev;
+
+- input_dev = (struct mousevsc_dev *)device->ext;
++ input_dev = hv_get_drvdata(device);
+
+ /* Busy wait until the ref drop to 1, then set it to 0 */
+ while (atomic_cmpxchg(&input_dev->ref_count, 1, 0) != 1)
+ udelay(100);
+
+- device->ext = NULL;
++ hv_set_drvdata(device, NULL);
+ return input_dev;
+ }
+
+@@ -790,7 +790,7 @@ static int mousevsc_on_device_remove(str
+ int ret = 0;
+
+ pr_info("disabling input device (%p)...",
+- device->ext);
++ hv_get_drvdata(device));
+
+ input_dev = release_input_device(device);
+
+@@ -808,7 +808,7 @@ static int mousevsc_on_device_remove(str
+ udelay(100);
+ }
+
+- pr_info("removing input device (%p)...", device->ext);
++ pr_info("removing input device (%p)...", hv_get_drvdata(device));
+
+ input_dev = final_release_input_device(device);
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0304-Staging-hv-vmbus-Get-rid-of-the-ext-field-in-stru.patch b/patches.suse/staging-hv-staging-next-20111001-0304-Staging-hv-vmbus-Get-rid-of-the-ext-field-in-stru.patch
new file mode 100644
index 0000000000..85c3205285
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0304-Staging-hv-vmbus-Get-rid-of-the-ext-field-in-stru.patch
@@ -0,0 +1,28 @@
+From b0bb55175f846909e06952583e38982a77f7ecea Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:51 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of the ext field in struct hv_device
+
+Now that we have eliminated all uses of the ext field in struct hv_device,
+get rid of the ext field.
+
+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 | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -827,9 +827,6 @@ struct hv_device {
+ struct device device;
+
+ struct vmbus_channel *channel;
+-
+- /* Device extension; */
+- void *ext;
+ };
+
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0305-Staging-hv-vmbus-Do-not-allocate-struct-hv_device.patch b/patches.suse/staging-hv-staging-next-20111001-0305-Staging-hv-vmbus-Do-not-allocate-struct-hv_device.patch
new file mode 100644
index 0000000000..c96af7e144
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0305-Staging-hv-vmbus-Do-not-allocate-struct-hv_device.patch
@@ -0,0 +1,189 @@
+From 7bb52384b2678fcbcebfa97be8f98dfb3219edc1 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:52 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Do not allocate struct hv_device_info on the stack
+
+struct hv_device_info is about 101 bytes in size. Do not allocate this structure
+on the stack.
+
+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 | 134 +++++++++++++++++++++--------------------
+ 1 file changed, 69 insertions(+), 65 deletions(-)
+
+--- a/drivers/staging/hv/vmbus_drv.c
++++ b/drivers/staging/hv/vmbus_drv.c
+@@ -112,101 +112,105 @@ static ssize_t vmbus_show_device_attr(st
+ char *buf)
+ {
+ struct hv_device *hv_dev = device_to_hv_device(dev);
+- struct hv_device_info device_info;
++ struct hv_device_info *device_info;
+ char alias_name[VMBUS_ALIAS_LEN + 1];
++ int ret = 0;
+
+- memset(&device_info, 0, sizeof(struct hv_device_info));
++ device_info = kzalloc(sizeof(struct hv_device_info), GFP_KERNEL);
++ if (!device_info)
++ return ret;
+
+- get_channel_info(hv_dev, &device_info);
++ get_channel_info(hv_dev, device_info);
+
+ if (!strcmp(dev_attr->attr.name, "class_id")) {
+- return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
++ ret = sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
+- 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]);
++ 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-"
++ ret = sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+ "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
+- 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]);
++ 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, "modalias")) {
+ print_alias_name(hv_dev, alias_name);
+- return sprintf(buf, "vmbus:%s\n", alias_name);
++ ret = sprintf(buf, "vmbus:%s\n", alias_name);
+ } else if (!strcmp(dev_attr->attr.name, "state")) {
+- return sprintf(buf, "%d\n", device_info.chn_state);
++ ret = sprintf(buf, "%d\n", device_info->chn_state);
+ } else if (!strcmp(dev_attr->attr.name, "id")) {
+- return sprintf(buf, "%d\n", device_info.chn_id);
++ ret = sprintf(buf, "%d\n", device_info->chn_id);
+ } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) {
+- return sprintf(buf, "%d\n", device_info.outbound.int_mask);
++ ret = sprintf(buf, "%d\n", device_info->outbound.int_mask);
+ } else if (!strcmp(dev_attr->attr.name, "out_read_index")) {
+- return sprintf(buf, "%d\n", device_info.outbound.read_idx);
++ ret = sprintf(buf, "%d\n", device_info->outbound.read_idx);
+ } else if (!strcmp(dev_attr->attr.name, "out_write_index")) {
+- return sprintf(buf, "%d\n", device_info.outbound.write_idx);
++ ret = sprintf(buf, "%d\n", device_info->outbound.write_idx);
+ } else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) {
+- return sprintf(buf, "%d\n",
+- device_info.outbound.bytes_avail_toread);
++ ret = sprintf(buf, "%d\n",
++ device_info->outbound.bytes_avail_toread);
+ } else if (!strcmp(dev_attr->attr.name, "out_write_bytes_avail")) {
+- return sprintf(buf, "%d\n",
+- device_info.outbound.bytes_avail_towrite);
++ ret = sprintf(buf, "%d\n",
++ device_info->outbound.bytes_avail_towrite);
+ } else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) {
+- return sprintf(buf, "%d\n", device_info.inbound.int_mask);
++ ret = sprintf(buf, "%d\n", device_info->inbound.int_mask);
+ } else if (!strcmp(dev_attr->attr.name, "in_read_index")) {
+- return sprintf(buf, "%d\n", device_info.inbound.read_idx);
++ ret = sprintf(buf, "%d\n", device_info->inbound.read_idx);
+ } else if (!strcmp(dev_attr->attr.name, "in_write_index")) {
+- return sprintf(buf, "%d\n", device_info.inbound.write_idx);
++ ret = sprintf(buf, "%d\n", device_info->inbound.write_idx);
+ } else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) {
+- return sprintf(buf, "%d\n",
+- device_info.inbound.bytes_avail_toread);
++ ret = sprintf(buf, "%d\n",
++ device_info->inbound.bytes_avail_toread);
+ } else if (!strcmp(dev_attr->attr.name, "in_write_bytes_avail")) {
+- return sprintf(buf, "%d\n",
+- device_info.inbound.bytes_avail_towrite);
++ ret = sprintf(buf, "%d\n",
++ device_info->inbound.bytes_avail_towrite);
+ } else if (!strcmp(dev_attr->attr.name, "monitor_id")) {
+- return sprintf(buf, "%d\n", device_info.monitor_id);
++ ret = sprintf(buf, "%d\n", device_info->monitor_id);
+ } else if (!strcmp(dev_attr->attr.name, "server_monitor_pending")) {
+- return sprintf(buf, "%d\n", device_info.server_monitor_pending);
++ ret = sprintf(buf, "%d\n", device_info->server_monitor_pending);
+ } else if (!strcmp(dev_attr->attr.name, "server_monitor_latency")) {
+- return sprintf(buf, "%d\n", device_info.server_monitor_latency);
++ ret = sprintf(buf, "%d\n", device_info->server_monitor_latency);
+ } else if (!strcmp(dev_attr->attr.name, "server_monitor_conn_id")) {
+- return sprintf(buf, "%d\n",
+- device_info.server_monitor_conn_id);
++ ret = sprintf(buf, "%d\n",
++ device_info->server_monitor_conn_id);
+ } else if (!strcmp(dev_attr->attr.name, "client_monitor_pending")) {
+- return sprintf(buf, "%d\n", device_info.client_monitor_pending);
++ ret = sprintf(buf, "%d\n", device_info->client_monitor_pending);
+ } else if (!strcmp(dev_attr->attr.name, "client_monitor_latency")) {
+- return sprintf(buf, "%d\n", device_info.client_monitor_latency);
++ ret = sprintf(buf, "%d\n", device_info->client_monitor_latency);
+ } else if (!strcmp(dev_attr->attr.name, "client_monitor_conn_id")) {
+- return sprintf(buf, "%d\n",
+- device_info.client_monitor_conn_id);
+- } else {
+- return 0;
++ ret = sprintf(buf, "%d\n",
++ device_info->client_monitor_conn_id);
+ }
++
++ kfree(device_info);
++ return ret;
+ }
+
+ /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */
diff --git a/patches.suse/staging-hv-staging-next-20111001-0306-Staging-hv-vmbus-Get-rid-of-the-module-dependency.patch b/patches.suse/staging-hv-staging-next-20111001-0306-Staging-hv-vmbus-Get-rid-of-the-module-dependency.patch
new file mode 100644
index 0000000000..d23a329c0b
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0306-Staging-hv-vmbus-Get-rid-of-the-module-dependency.patch
@@ -0,0 +1,26 @@
+From d982042b9b62f3a966e7de5572fd30d131eb5357 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:53 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of the module dependency
+
+Hyper-V modules can be built as part of the kernel (not just as modules).
+Get rid of the module dependency in Kconfig.
+
+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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/hv/Kconfig
++++ b/drivers/staging/hv/Kconfig
+@@ -1,6 +1,6 @@
+ config HYPERV
+ tristate "Microsoft Hyper-V client drivers"
+- depends on X86 && ACPI && PCI && m
++ depends on X86 && ACPI && PCI
+ default n
+ help
+ Select this option to run Linux as a Hyper-V client operating
diff --git a/patches.suse/staging-hv-staging-next-20111001-0307-Staging-hv-netvsc-Rename-netDevice-as-net_device.patch b/patches.suse/staging-hv-staging-next-20111001-0307-Staging-hv-netvsc-Rename-netDevice-as-net_device.patch
new file mode 100644
index 0000000000..8a2ad2804e
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0307-Staging-hv-netvsc-Rename-netDevice-as-net_device.patch
@@ -0,0 +1,71 @@
+From 86c921af41f0d40ff9105a73fb20378440f0299f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:54 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: netvsc: Rename netDevice as net_device
+
+Rename netDevice as 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 | 5 ++++-
+ drivers/staging/hv/rndis_filter.c | 14 +++++++-------
+ 2 files changed, 11 insertions(+), 8 deletions(-)
+
+--- a/drivers/staging/hv/netvsc.c
++++ b/drivers/staging/hv/netvsc.c
+@@ -382,7 +382,10 @@ int netvsc_device_remove(struct hv_devic
+ hv_set_drvdata(device, NULL);
+ spin_unlock_irqrestore(&device->channel->inbound_lock, flags);
+
+- /* At this point, no one should be accessing netDevice except in here */
++ /*
++ * At this point, no one should be accessing net_device
++ * except in here
++ */
+ dev_notice(&device->device, "net device safe to remove\n");
+
+ /* Now, we can close the channel safely */
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -689,7 +689,7 @@ int rndis_filter_device_add(struct hv_de
+ void *additional_info)
+ {
+ int ret;
+- struct netvsc_device *netDevice;
++ struct netvsc_device *net_device;
+ struct rndis_device *rndisDevice;
+ struct netvsc_device_info *deviceInfo = additional_info;
+
+@@ -710,10 +710,10 @@ int rndis_filter_device_add(struct hv_de
+
+
+ /* Initialize the rndis device */
+- netDevice = hv_get_drvdata(dev);
++ net_device = hv_get_drvdata(dev);
+
+- netDevice->extension = rndisDevice;
+- rndisDevice->net_dev = netDevice;
++ net_device->extension = rndisDevice;
++ rndisDevice->net_dev = net_device;
+
+ /* Send the rndis initialization message */
+ ret = rndis_filter_init_device(rndisDevice);
+@@ -762,12 +762,12 @@ void rndis_filter_device_remove(struct h
+
+ int rndis_filter_open(struct hv_device *dev)
+ {
+- struct netvsc_device *netDevice = hv_get_drvdata(dev);
++ struct netvsc_device *net_device = hv_get_drvdata(dev);
+
+- if (!netDevice)
++ if (!net_device)
+ return -EINVAL;
+
+- return rndis_filter_open_device(netDevice->extension);
++ return rndis_filter_open_device(net_device->extension);
+ }
+
+ int rndis_filter_close(struct hv_device *dev)
diff --git a/patches.suse/staging-hv-staging-next-20111001-0308-Staging-hv-netvsc-Rename-rndisDevice-to-rndis_dev.patch b/patches.suse/staging-hv-staging-next-20111001-0308-Staging-hv-netvsc-Rename-rndisDevice-to-rndis_dev.patch
new file mode 100644
index 0000000000..02e3a50f75
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0308-Staging-hv-netvsc-Rename-rndisDevice-to-rndis_dev.patch
@@ -0,0 +1,83 @@
+From b13cc345b6f7aae293050c33e86f585ea30b2e38 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:55 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: netvsc: Rename rndisDevice to rndis_device
+
+Rename rndisDevice to rndis_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/rndis_filter.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -690,11 +690,11 @@ int rndis_filter_device_add(struct hv_de
+ {
+ int ret;
+ struct netvsc_device *net_device;
+- struct rndis_device *rndisDevice;
++ struct rndis_device *rndis_device;
+ struct netvsc_device_info *deviceInfo = additional_info;
+
+- rndisDevice = get_rndis_device();
+- if (!rndisDevice)
++ rndis_device = get_rndis_device();
++ if (!rndis_device)
+ return -ENODEV;
+
+ /*
+@@ -704,7 +704,7 @@ int rndis_filter_device_add(struct hv_de
+ */
+ ret = netvsc_device_add(dev, additional_info);
+ if (ret != 0) {
+- kfree(rndisDevice);
++ kfree(rndis_device);
+ return ret;
+ }
+
+@@ -712,11 +712,11 @@ int rndis_filter_device_add(struct hv_de
+ /* Initialize the rndis device */
+ net_device = hv_get_drvdata(dev);
+
+- net_device->extension = rndisDevice;
+- rndisDevice->net_dev = net_device;
++ net_device->extension = rndis_device;
++ rndis_device->net_dev = net_device;
+
+ /* Send the rndis initialization message */
+- ret = rndis_filter_init_device(rndisDevice);
++ ret = rndis_filter_init_device(rndis_device);
+ if (ret != 0) {
+ /*
+ * TODO: If rndis init failed, we will need to shut down the
+@@ -725,21 +725,21 @@ int rndis_filter_device_add(struct hv_de
+ }
+
+ /* Get the mac address */
+- ret = rndis_filter_query_device_mac(rndisDevice);
++ ret = rndis_filter_query_device_mac(rndis_device);
+ if (ret != 0) {
+ /*
+ * TODO: shutdown rndis device and the channel
+ */
+ }
+
+- memcpy(deviceInfo->mac_adr, rndisDevice->hw_mac_adr, ETH_ALEN);
++ memcpy(deviceInfo->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
+
+- rndis_filter_query_device_link_status(rndisDevice);
++ rndis_filter_query_device_link_status(rndis_device);
+
+- deviceInfo->link_state = rndisDevice->link_stat;
++ deviceInfo->link_state = rndis_device->link_stat;
+
+ dev_info(&dev->device, "Device MAC %pM link state %s",
+- rndisDevice->hw_mac_adr,
++ rndis_device->hw_mac_adr,
+ ((deviceInfo->link_state) ? ("down\n") : ("up\n")));
+
+ return ret;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0309-Staging-hv-netvsc-Rename-deviceInfo-as-device_inf.patch b/patches.suse/staging-hv-staging-next-20111001-0309-Staging-hv-netvsc-Rename-deviceInfo-as-device_inf.patch
new file mode 100644
index 0000000000..20f60b8c12
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0309-Staging-hv-netvsc-Rename-deviceInfo-as-device_inf.patch
@@ -0,0 +1,45 @@
+From 3c4debad4290a31d3537bf89837f49d5e48b8271 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 10:59:56 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: netvsc: Rename deviceInfo as device_info
+
+Rename deviceInfo as device_info.
+
+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 | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -691,7 +691,7 @@ int rndis_filter_device_add(struct hv_de
+ int ret;
+ struct netvsc_device *net_device;
+ struct rndis_device *rndis_device;
+- struct netvsc_device_info *deviceInfo = additional_info;
++ struct netvsc_device_info *device_info = additional_info;
+
+ rndis_device = get_rndis_device();
+ if (!rndis_device)
+@@ -732,15 +732,15 @@ int rndis_filter_device_add(struct hv_de
+ */
+ }
+
+- memcpy(deviceInfo->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
++ memcpy(device_info->mac_adr, rndis_device->hw_mac_adr, ETH_ALEN);
+
+ rndis_filter_query_device_link_status(rndis_device);
+
+- deviceInfo->link_state = rndis_device->link_stat;
++ device_info->link_state = rndis_device->link_stat;
+
+ dev_info(&dev->device, "Device MAC %pM link state %s",
+ rndis_device->hw_mac_adr,
+- ((deviceInfo->link_state) ? ("down\n") : ("up\n")));
++ ((device_info->link_state) ? ("down\n") : ("up\n")));
+
+ return ret;
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0310-Staging-hv-netvsc-Cleanup-the-name-and-type-of-li.patch b/patches.suse/staging-hv-staging-next-20111001-0310-Staging-hv-netvsc-Cleanup-the-name-and-type-of-li.patch
new file mode 100644
index 0000000000..77f88c3471
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0310-Staging-hv-netvsc-Cleanup-the-name-and-type-of-li.patch
@@ -0,0 +1,62 @@
+From 6f27457b50c0439388e34d528f0fc200ddedb9a4 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Tue, 13 Sep 2011 15:21:27 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: netvsc: Cleanup the name and type of link_stat variable
+
+Consistently name the variable tracking the link status. Use a consistent
+type for this variable and get rid of some unnecessary parentheses as well.
+I would like to thank Joe Perches <joe@perches.com> for suggesting these
+changes and patiently helping me get 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/rndis_filter.c | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+--- a/drivers/staging/hv/rndis_filter.c
++++ b/drivers/staging/hv/rndis_filter.c
+@@ -41,7 +41,7 @@ struct rndis_device {
+ struct netvsc_device *net_dev;
+
+ enum rndis_device_state state;
+- u32 link_stat;
++ bool link_state;
+ atomic_t new_req_id;
+
+ spinlock_t request_lock;
+@@ -511,10 +511,15 @@ static int rndis_filter_query_device_mac
+ static int rndis_filter_query_device_link_status(struct rndis_device *dev)
+ {
+ u32 size = sizeof(u32);
++ u32 link_status;
++ int ret;
+
+- return rndis_filter_query_device(dev,
++ ret = rndis_filter_query_device(dev,
+ RNDIS_OID_GEN_MEDIA_CONNECT_STATUS,
+- &dev->link_stat, &size);
++ &link_status, &size);
++ dev->link_state = (link_status != 0) ? true : false;
++
++ return ret;
+ }
+
+ static int rndis_filter_set_packet_filter(struct rndis_device *dev,
+@@ -736,11 +741,11 @@ int rndis_filter_device_add(struct hv_de
+
+ rndis_filter_query_device_link_status(rndis_device);
+
+- device_info->link_state = rndis_device->link_stat;
++ device_info->link_state = rndis_device->link_state;
+
+- dev_info(&dev->device, "Device MAC %pM link state %s",
++ dev_info(&dev->device, "Device MAC %pM link state %s\n",
+ rndis_device->hw_mac_adr,
+- ((device_info->link_state) ? ("down\n") : ("up\n")));
++ device_info->link_state ? "down" : "up");
+
+ return ret;
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0421-Staging-hv-util-Perform-some-service-specific-ini.patch b/patches.suse/staging-hv-staging-next-20111001-0421-Staging-hv-util-Perform-some-service-specific-ini.patch
new file mode 100644
index 0000000000..4a5bff70eb
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0421-Staging-hv-util-Perform-some-service-specific-ini.patch
@@ -0,0 +1,254 @@
+From a29b643c5767558956450b86d79eb66334704ac2 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sun, 18 Sep 2011 10:31:33 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: util: Perform some service specific init/deinit in probe/remove
+
+In preparation for modifying the util driver to fully conform to the
+Linux Driver Model, perform some service specific init and de-init
+operations in util_probe()/util_remove() as opposed to in
+init_hyperv_utils()/exit_hyperv_utils() as is currently done.
+
+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_kvp.c | 7 ---
+ drivers/staging/hv/hv_kvp.h | 2
+ drivers/staging/hv/hv_util.c | 91 +++++++++++++++++++++++++------------------
+ drivers/staging/hv/hyperv.h | 13 ++++++
+ 4 files changed, 71 insertions(+), 42 deletions(-)
+
+--- a/drivers/staging/hv/hv_kvp.c
++++ b/drivers/staging/hv/hv_kvp.c
+@@ -312,16 +312,14 @@ callback_done:
+ }
+
+ int
+-hv_kvp_init(void)
++hv_kvp_init(struct hv_util_service *srv)
+ {
+ int err;
+
+ err = cn_add_callback(&kvp_id, kvp_name, kvp_cn_callback);
+ if (err)
+ return err;
+- recv_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
+- if (!recv_buffer)
+- return -ENOMEM;
++ recv_buffer = srv->recv_buffer;
+
+ return 0;
+ }
+@@ -330,5 +328,4 @@ void hv_kvp_deinit(void)
+ {
+ cn_del_callback(&kvp_id);
+ cancel_delayed_work_sync(&kvp_work);
+- kfree(recv_buffer);
+ }
+--- a/drivers/staging/hv/hv_kvp.h
++++ b/drivers/staging/hv/hv_kvp.h
+@@ -175,7 +175,7 @@ struct hv_kvp_msg {
+ struct hv_kvp_msg_enumerate kvp_data;
+ };
+
+-int hv_kvp_init(void);
++int hv_kvp_init(struct hv_util_service *);
+ void hv_kvp_deinit(void);
+ void hv_kvp_onchannelcallback(void *);
+
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -30,9 +30,27 @@
+ #include "hyperv.h"
+ #include "hv_kvp.h"
+
+-static u8 *shut_txf_buf;
+-static u8 *time_txf_buf;
+-static u8 *hbeat_txf_buf;
++
++static void shutdown_onchannelcallback(void *context);
++static struct hv_util_service util_shutdown = {
++ .util_cb = shutdown_onchannelcallback,
++};
++
++static void timesync_onchannelcallback(void *context);
++static struct hv_util_service util_timesynch = {
++ .util_cb = timesync_onchannelcallback,
++};
++
++static void heartbeat_onchannelcallback(void *context);
++static struct hv_util_service util_heartbeat = {
++ .util_cb = heartbeat_onchannelcallback,
++};
++
++static struct hv_util_service util_kvp = {
++ .util_cb = hv_kvp_onchannelcallback,
++ .util_init = hv_kvp_init,
++ .util_deinit = hv_kvp_deinit,
++};
+
+ static void shutdown_onchannelcallback(void *context)
+ {
+@@ -40,6 +58,7 @@ static void shutdown_onchannelcallback(v
+ u32 recvlen;
+ u64 requestid;
+ u8 execute_shutdown = false;
++ u8 *shut_txf_buf = util_shutdown.recv_buffer;
+
+ struct shutdown_msg_data *shutdown_msg;
+
+@@ -169,6 +188,7 @@ static void timesync_onchannelcallback(v
+ u64 requestid;
+ struct icmsg_hdr *icmsghdrp;
+ struct ictimesync_data *timedatap;
++ u8 *time_txf_buf = util_timesynch.recv_buffer;
+
+ vmbus_recvpacket(channel, time_txf_buf,
+ PAGE_SIZE, &recvlen, &requestid);
+@@ -207,6 +227,7 @@ static void heartbeat_onchannelcallback(
+ u64 requestid;
+ struct icmsg_hdr *icmsghdrp;
+ struct heartbeat_msg_data *heartbeat_msg;
++ u8 *hbeat_txf_buf = util_heartbeat.recv_buffer;
+
+ vmbus_recvpacket(channel, hbeat_txf_buf,
+ PAGE_SIZE, &recvlen, &requestid);
+@@ -235,34 +256,56 @@ static void heartbeat_onchannelcallback(
+ }
+ }
+
+-/*
+- * The devices managed by the util driver don't need any additional
+- * setup.
+- */
+ static int util_probe(struct hv_device *dev,
+ const struct hv_vmbus_device_id *dev_id)
+ {
++ struct hv_util_service *srv =
++ (struct hv_util_service *)dev_id->driver_data;
++ int ret;
++
++ srv->recv_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL);
++ if (!srv->recv_buffer)
++ return -ENOMEM;
++ if (srv->util_init) {
++ ret = srv->util_init(srv);
++ if (ret) {
++ kfree(srv->recv_buffer);
++ return -ENODEV;
++ }
++ }
++
++ hv_set_drvdata(dev, srv);
+ return 0;
+ }
+
+ static int util_remove(struct hv_device *dev)
+ {
++ struct hv_util_service *srv = hv_get_drvdata(dev);
++
++ if (srv->util_deinit)
++ srv->util_deinit();
++ kfree(srv->recv_buffer);
++
+ return 0;
+ }
+
+ static const struct hv_vmbus_device_id id_table[] = {
+ /* Shutdown guid */
+ { VMBUS_DEVICE(0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
+- 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB) },
++ 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB)
++ .driver_data = (unsigned long)&util_shutdown },
+ /* Time synch guid */
+ { VMBUS_DEVICE(0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
+- 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf) },
++ 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf)
++ .driver_data = (unsigned long)&util_timesynch },
+ /* Heartbeat guid */
+ { VMBUS_DEVICE(0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
+- 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d) },
++ 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d)
++ .driver_data = (unsigned long)&util_heartbeat },
+ /* KVP guid */
+ { VMBUS_DEVICE(0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
+- 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6) },
++ 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6)
++ .driver_data = (unsigned long)&util_kvp },
+ { },
+ };
+
+@@ -281,24 +324,11 @@ static int __init init_hyperv_utils(void
+ int ret;
+ pr_info("Registering HyperV Utility Driver\n");
+
+- if (hv_kvp_init())
+- 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);
+-
+- if (!shut_txf_buf || !time_txf_buf || !hbeat_txf_buf) {
+- pr_info("Unable to allocate memory for receive buffer\n");
+- ret = -ENOMEM;
+- goto err;
+- }
+
+ ret = vmbus_driver_register(&util_drv);
+
+ if (ret != 0)
+- goto err;
++ return ret;
+
+ hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback;
+
+@@ -310,12 +340,6 @@ static int __init init_hyperv_utils(void
+
+ return 0;
+
+-err:
+- kfree(shut_txf_buf);
+- kfree(time_txf_buf);
+- kfree(hbeat_txf_buf);
+-
+- return ret;
+ }
+
+ static void exit_hyperv_utils(void)
+@@ -342,11 +366,6 @@ static void exit_hyperv_utils(void)
+ &chn_cb_negotiate;
+ hv_cb_utils[HV_KVP_MSG].callback = NULL;
+
+- hv_kvp_deinit();
+-
+- kfree(shut_txf_buf);
+- kfree(time_txf_buf);
+- kfree(hbeat_txf_buf);
+ vmbus_driver_unregister(&util_drv);
+ }
+
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -889,6 +889,19 @@ void vmbus_driver_unregister(struct hv_d
+ #define HV_ERROR_NOT_SUPPORTED 0x80070032
+ #define HV_ERROR_MACHINE_LOCKED 0x800704F7
+
++/*
++ * While we want to handle util services as regular devices,
++ * there is only one instance of each of these services; so
++ * we statically allocate the service specific state.
++ */
++
++struct hv_util_service {
++ u8 *recv_buffer;
++ void (*util_cb)(void *);
++ int (*util_init)(struct hv_util_service *);
++ void (*util_deinit)(void);
++};
++
+ struct vmbuspipe_hdr {
+ u32 flags;
+ u32 msgsize;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0422-Staging-hv-util-Properly-handle-util-services-in.patch b/patches.suse/staging-hv-staging-next-20111001-0422-Staging-hv-util-Properly-handle-util-services-in.patch
new file mode 100644
index 0000000000..5f70ec0a13
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0422-Staging-hv-util-Properly-handle-util-services-in.patch
@@ -0,0 +1,186 @@
+From 4e65f6e80593c316c5a65a71191fa480360f165d Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sun, 18 Sep 2011 10:31:34 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: util: Properly handle util services in the util driver
+
+Now, properly handle util services in the util driver and eliminate code
+that will not be necessary. In the current code, util services were
+all handled not as other vmbus devices (net, block) but rather through
+special handling (channel setup etc.). In this patch we handle all
+services using the standard Linux Driver Model.
+
+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_mgmt.c | 36 ------------------------
+ drivers/staging/hv/hv_kvp.c | 7 ++++
+ drivers/staging/hv/hv_util.c | 55 +++++++++++---------------------------
+ 3 files changed, 23 insertions(+), 75 deletions(-)
+
+--- a/drivers/staging/hv/channel_mgmt.c
++++ b/drivers/staging/hv/channel_mgmt.c
+@@ -181,24 +181,6 @@ void chn_cb_negotiate(void *context)
+ struct icmsg_hdr *icmsghdrp;
+ struct icmsg_negotiate *negop = NULL;
+
+- if (channel->util_index >= 0) {
+- /*
+- * This is a properly initialized util channel.
+- * Route this callback appropriately and setup state
+- * so that we don't need to reroute again.
+- */
+- if (hv_cb_utils[channel->util_index].callback != NULL) {
+- /*
+- * The util driver has established a handler for
+- * this service; do the magic.
+- */
+- channel->onchannel_callback =
+- hv_cb_utils[channel->util_index].callback;
+- (hv_cb_utils[channel->util_index].callback)(channel);
+- return;
+- }
+- }
+-
+ buflen = PAGE_SIZE;
+ buf = kmalloc(buflen, GFP_ATOMIC);
+
+@@ -348,7 +330,6 @@ static void vmbus_process_offer(struct w
+ struct vmbus_channel *channel;
+ bool fnew = true;
+ int ret;
+- int cnt;
+ unsigned long flags;
+
+ /* The next possible work is rescind handling */
+@@ -410,23 +391,6 @@ static void vmbus_process_offer(struct w
+ * can cleanup properly
+ */
+ newchannel->state = CHANNEL_OPEN_STATE;
+- newchannel->util_index = -1; /* Invalid index */
+-
+- /* Open IC channels */
+- for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) {
+- 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,
+- newchannel) == 0) {
+- hv_cb_utils[cnt].channel = newchannel;
+- newchannel->util_index = cnt;
+-
+- pr_info("%s\n", hv_cb_utils[cnt].log_msg);
+-
+- }
+- }
+ }
+ }
+
+--- a/drivers/staging/hv/hv_kvp.c
++++ b/drivers/staging/hv/hv_kvp.c
+@@ -177,6 +177,13 @@ kvp_respond_to_host(char *key, char *val
+ channel = kvp_transaction.recv_channel;
+ req_id = kvp_transaction.recv_req_id;
+
++ if (channel->onchannel_callback == NULL)
++ /*
++ * We have raced with util driver being unloaded;
++ * silently return.
++ */
++ return;
++
+ icmsghdrp = (struct icmsg_hdr *)
+ &recv_buffer[sizeof(struct vmbuspipe_hdr)];
+ kvp_msg = (struct hv_kvp_msg *)
+--- a/drivers/staging/hv/hv_util.c
++++ b/drivers/staging/hv/hv_util.c
+@@ -269,19 +269,32 @@ static int util_probe(struct hv_device *
+ if (srv->util_init) {
+ ret = srv->util_init(srv);
+ if (ret) {
+- kfree(srv->recv_buffer);
+- return -ENODEV;
++ ret = -ENODEV;
++ goto error1;
+ }
+ }
+
++ ret = vmbus_open(dev->channel, 2 * PAGE_SIZE, 2 * PAGE_SIZE, NULL, 0,
++ srv->util_cb, dev->channel);
++ if (ret)
++ goto error;
++
+ hv_set_drvdata(dev, srv);
+ return 0;
++
++error:
++ if (srv->util_deinit)
++ srv->util_deinit();
++error1:
++ kfree(srv->recv_buffer);
++ return ret;
+ }
+
+ static int util_remove(struct hv_device *dev)
+ {
+ struct hv_util_service *srv = hv_get_drvdata(dev);
+
++ vmbus_close(dev->channel);
+ if (srv->util_deinit)
+ srv->util_deinit();
+ kfree(srv->recv_buffer);
+@@ -321,51 +334,15 @@ static struct hv_driver util_drv = {
+
+ static int __init init_hyperv_utils(void)
+ {
+- int ret;
+ pr_info("Registering HyperV Utility Driver\n");
+
+-
+- ret = vmbus_driver_register(&util_drv);
+-
+- if (ret != 0)
+- return ret;
+-
+- hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback;
+-
+- hv_cb_utils[HV_TIMESYNC_MSG].callback = &timesync_onchannelcallback;
+-
+- hv_cb_utils[HV_HEARTBEAT_MSG].callback = &heartbeat_onchannelcallback;
+-
+- hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
+-
+- return 0;
+-
++ return vmbus_driver_register(&util_drv);
+ }
+
+ static void exit_hyperv_utils(void)
+ {
+ pr_info("De-Registered HyperV Utility Driver\n");
+
+- if (hv_cb_utils[HV_SHUTDOWN_MSG].channel != NULL)
+- hv_cb_utils[HV_SHUTDOWN_MSG].channel->onchannel_callback =
+- &chn_cb_negotiate;
+- hv_cb_utils[HV_SHUTDOWN_MSG].callback = NULL;
+-
+- if (hv_cb_utils[HV_TIMESYNC_MSG].channel != NULL)
+- hv_cb_utils[HV_TIMESYNC_MSG].channel->onchannel_callback =
+- &chn_cb_negotiate;
+- hv_cb_utils[HV_TIMESYNC_MSG].callback = NULL;
+-
+- if (hv_cb_utils[HV_HEARTBEAT_MSG].channel != NULL)
+- hv_cb_utils[HV_HEARTBEAT_MSG].channel->onchannel_callback =
+- &chn_cb_negotiate;
+- hv_cb_utils[HV_HEARTBEAT_MSG].callback = NULL;
+-
+- if (hv_cb_utils[HV_KVP_MSG].channel != NULL)
+- hv_cb_utils[HV_KVP_MSG].channel->onchannel_callback =
+- &chn_cb_negotiate;
+- hv_cb_utils[HV_KVP_MSG].callback = NULL;
+-
+ vmbus_driver_unregister(&util_drv);
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0423-Staging-hv-vmbus-Get-rid-of-hv_cb_utils-and-oth.patch b/patches.suse/staging-hv-staging-next-20111001-0423-Staging-hv-vmbus-Get-rid-of-hv_cb_utils-and-oth.patch
new file mode 100644
index 0000000000..a28e493db2
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0423-Staging-hv-vmbus-Get-rid-of-hv_cb_utils-and-oth.patch
@@ -0,0 +1,155 @@
+From e0f4c6742bdbb2792bd67b147af9c1fd9176b94a Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Sun, 18 Sep 2011 10:31:35 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: vmbus: Get rid of hv_cb_utils[] and other unneeded code
+
+Now that the transformation of the util driver is complete,
+get rid of hv_cb_utils[] and other unneeded 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/channel_mgmt.c | 94 --------------------------------------
+ drivers/staging/hv/hyperv.h | 13 -----
+ 2 files changed, 107 deletions(-)
+
+--- a/drivers/staging/hv/channel_mgmt.c
++++ b/drivers/staging/hv/channel_mgmt.c
+@@ -158,100 +158,6 @@ void prep_negotiate_resp(struct icmsg_hd
+ }
+ EXPORT_SYMBOL(prep_negotiate_resp);
+
+-/**
+- * chn_cb_negotiate() - Default handler for non IDE/SCSI/NETWORK
+- * Hyper-V requests
+- * @context: Pointer to argument structure.
+- *
+- * Set up the default handler for non device driver specific requests
+- * from Hyper-V. This stub responds to the default negotiate messages
+- * that come in for every non IDE/SCSI/Network request.
+- * This behavior is normally overwritten in the hv_utils driver. That
+- * driver handles requests like graceful shutdown, heartbeats etc.
+- *
+- * Mainly used by Hyper-V drivers.
+- */
+-void chn_cb_negotiate(void *context)
+-{
+- struct vmbus_channel *channel = context;
+- u8 *buf;
+- u32 buflen, recvlen;
+- u64 requestid;
+-
+- struct icmsg_hdr *icmsghdrp;
+- struct icmsg_negotiate *negop = NULL;
+-
+- buflen = PAGE_SIZE;
+- buf = kmalloc(buflen, GFP_ATOMIC);
+-
+- vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid);
+-
+- if (recvlen > 0) {
+- icmsghdrp = (struct icmsg_hdr *)&buf[
+- sizeof(struct vmbuspipe_hdr)];
+-
+- prep_negotiate_resp(icmsghdrp, negop, buf);
+-
+- icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
+- | ICMSGHDRFLAG_RESPONSE;
+-
+- vmbus_sendpacket(channel, buf,
+- recvlen, requestid,
+- VM_PKT_DATA_INBAND, 0);
+- }
+-
+- kfree(buf);
+-}
+-EXPORT_SYMBOL(chn_cb_negotiate);
+-
+-/*
+- * Function table used for message responses for non IDE/SCSI/Network type
+- * messages. (Such as KVP/Shutdown etc)
+- */
+-struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
+- /* 0E0B6031-5213-4934-818B-38D90CED39DB */
+- /* Shutdown */
+- {
+- .msg_type = HV_SHUTDOWN_MSG,
+- .data.b = {
+- 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
+- 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
+- },
+- .log_msg = "Shutdown channel functionality initialized"
+- },
+-
+- /* {9527E630-D0AE-497b-ADCE-E80AB0175CAF} */
+- /* TimeSync */
+- {
+- .msg_type = HV_TIMESYNC_MSG,
+- .data.b = {
+- 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
+- 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
+- },
+- .log_msg = "Timesync channel functionality initialized"
+- },
+- /* {57164f39-9115-4e78-ab55-382f3bd5422d} */
+- /* Heartbeat */
+- {
+- .msg_type = HV_HEARTBEAT_MSG,
+- .data.b = {
+- 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
+- 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
+- },
+- .log_msg = "Heartbeat channel functionality initialized"
+- },
+- /* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */
+- /* KVP */
+- {
+- .data.b = {
+- 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
+- 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
+- },
+- .log_msg = "KVP channel functionality initialized"
+- },
+-};
+-EXPORT_SYMBOL(hv_cb_utils);
+-
+ /*
+ * alloc_channel - Allocate and initialize a vmbus channel object
+ */
+--- a/drivers/staging/hv/hyperv.h
++++ b/drivers/staging/hv/hyperv.h
+@@ -581,11 +581,6 @@ struct vmbus_channel {
+ struct work_struct work;
+
+ enum vmbus_channel_state state;
+- /*
+- * For util channels, stash the
+- * the service index for easy access.
+- */
+- s8 util_index;
+
+ struct vmbus_channel_offer_channel offermsg;
+ /*
+@@ -960,12 +955,6 @@ struct ictimesync_data {
+ u8 flags;
+ } __packed;
+
+-/* Index for each IC struct in array hv_cb_utils[] */
+-#define HV_SHUTDOWN_MSG 0
+-#define HV_TIMESYNC_MSG 1
+-#define HV_HEARTBEAT_MSG 2
+-#define HV_KVP_MSG 3
+-
+ struct hyperv_service_callback {
+ u8 msg_type;
+ char *log_msg;
+@@ -976,7 +965,5 @@ struct hyperv_service_callback {
+
+ extern void prep_negotiate_resp(struct icmsg_hdr *,
+ struct icmsg_negotiate *, u8 *);
+-extern void chn_cb_negotiate(void *);
+-extern struct hyperv_service_callback hv_cb_utils[];
+
+ #endif /* _HYPERV_H */
diff --git a/patches.suse/staging-hv-staging-next-20111001-0476-Staging-hv-Update-the-TODO-file.patch b/patches.suse/staging-hv-staging-next-20111001-0476-Staging-hv-Update-the-TODO-file.patch
new file mode 100644
index 0000000000..b3af7209b2
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0476-Staging-hv-Update-the-TODO-file.patch
@@ -0,0 +1,25 @@
+From 6519ad6e6f92a4310fbaab50f074d5bbad27b329 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 22 Sep 2011 12:40:50 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: Update the TODO file
+
+Now that all vmbus audit related comments have been addressed,
+update the TODO file to reflect this.
+
+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/TODO | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- a/drivers/staging/hv/TODO
++++ b/drivers/staging/hv/TODO
+@@ -1,6 +1,4 @@
+ TODO:
+- - audit the vmbus to verify it is working properly with the
+- driver model
+ - audit the network driver
+ - checking for carrier inside open is wrong, network device API
+ confusion??
diff --git a/patches.suse/staging-hv-staging-next-20111001-0479-staging-hv-remove-the-carrier-status-check-from-ne.patch b/patches.suse/staging-hv-staging-next-20111001-0479-staging-hv-remove-the-carrier-status-check-from-ne.patch
new file mode 100644
index 0000000000..e93542e5f0
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0479-staging-hv-remove-the-carrier-status-check-from-ne.patch
@@ -0,0 +1,56 @@
+From d515d0ff36a7afd528f32e3511780ad8385d957e Mon Sep 17 00:00:00 2001
+From: Haiyang Zhang <haiyangz@microsoft.com>
+Date: Wed, 28 Sep 2011 13:24:15 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] staging: hv: remove the carrier status check from netvsc_open()
+
+Checking carrier status in netvsc_open() is not necessary.
+
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+---
+ drivers/staging/hv/TODO | 2 --
+ drivers/staging/hv/netvsc_drv.c | 19 +++++++------------
+ 2 files changed, 7 insertions(+), 14 deletions(-)
+
+--- a/drivers/staging/hv/TODO
++++ b/drivers/staging/hv/TODO
+@@ -1,7 +1,5 @@
+ TODO:
+ - audit the network driver
+- - checking for carrier inside open is wrong, network device API
+- confusion??
+ - audit the scsi driver
+
+ Please send patches for this code to Greg Kroah-Hartman <gregkh@suse.de>,
+--- a/drivers/staging/hv/netvsc_drv.c
++++ b/drivers/staging/hv/netvsc_drv.c
+@@ -69,20 +69,15 @@ static int netvsc_open(struct net_device
+ struct hv_device *device_obj = net_device_ctx->device_ctx;
+ int ret = 0;
+
+- if (netif_carrier_ok(net)) {
+- /* Open up the device */
+- ret = rndis_filter_open(device_obj);
+- if (ret != 0) {
+- netdev_err(net, "unable to open device (ret %d).\n",
+- ret);
+- return ret;
+- }
+-
+- netif_start_queue(net);
+- } else {
+- netdev_err(net, "unable to open device...link is down.\n");
++ /* Open up the device */
++ ret = rndis_filter_open(device_obj);
++ if (ret != 0) {
++ netdev_err(net, "unable to open device (ret %d).\n", ret);
++ return ret;
+ }
+
++ netif_start_queue(net);
++
+ return ret;
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0579-Staging-hv-mousevsc-Fixup-struct-hv_input_dev_inf.patch b/patches.suse/staging-hv-staging-next-20111001-0579-Staging-hv-mousevsc-Fixup-struct-hv_input_dev_inf.patch
new file mode 100644
index 0000000000..66e5171975
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0579-Staging-hv-mousevsc-Fixup-struct-hv_input_dev_inf.patch
@@ -0,0 +1,48 @@
+From 870e53adbd372cbeea15ed00e1d4423725f3cea0 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:41 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Fixup struct hv_input_dev_info
+
+This structure is protocol defined structure and must match the definition
+on the host side. Make appropriate 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/hv_mouse.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -30,10 +30,11 @@
+ * Data types
+ */
+ struct hv_input_dev_info {
++ unsigned int size;
+ unsigned short vendor;
+ unsigned short product;
+ unsigned short version;
+- char name[128];
++ unsigned short reserved[11];
+ };
+
+ /* The maximum size of a synthetic input message. */
+@@ -686,7 +687,7 @@ static void reportdesc_callback(struct h
+ hid_dev->dev = dev->device;
+
+ sprintf(hid_dev->name, "%s",
+- input_device_ctx->device_info.name);
++ "Microsoft Vmbus HID-compliant Mouse");
+
+ /*
+ * HJ Do we want to call it with a 0
+@@ -763,7 +764,6 @@ static int mousevsc_on_device_add(struct
+ dev_info.vendor = input_dev->hid_dev_info.vendor;
+ dev_info.product = input_dev->hid_dev_info.product;
+ dev_info.version = input_dev->hid_dev_info.version;
+- strcpy(dev_info.name, "Microsoft Vmbus HID-compliant Mouse");
+
+ /* Send the device info back up */
+ input_device_ctx = dev_get_drvdata(&device->device);
diff --git a/patches.suse/staging-hv-staging-next-20111001-0580-Staging-hv-mousevsc-Get-rid-of-the-struct-input_d.patch b/patches.suse/staging-hv-staging-next-20111001-0580-Staging-hv-mousevsc-Get-rid-of-the-struct-input_d.patch
new file mode 100644
index 0000000000..1207b19830
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0580-Staging-hv-mousevsc-Get-rid-of-the-struct-input_d.patch
@@ -0,0 +1,163 @@
+From 28e0d06655ddc6598155e2f71945f1abb00b398a Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:42 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of the struct input_device_context
+
+The state maintained in struct input_device_context can easily be included
+in the struct mousevsc_dev structure. Simplify the code by consolidating
+the state.
+
+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 | 53 +++++++++++-------------------------------
+ 1 file changed, 14 insertions(+), 39 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -172,15 +172,11 @@ struct mousevsc_dev {
+ unsigned char *report_desc;
+ u32 report_desc_size;
+ 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;
++ struct hid_device *hid_device;
+ };
+
++
+ static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
+ {
+ struct mousevsc_dev *input_dev;
+@@ -402,7 +398,6 @@ static void mousevsc_on_receive_input_re
+ 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 +406,8 @@ static void mousevsc_on_receive_input_re
+
+ input_drv = drv_to_hv_drv(input_device->device->device.driver);
+
+- input_dev_ctx = dev_get_drvdata(&input_device->device->device);
+
+- hid_input_report(input_dev_ctx->hid_device,
++ hid_input_report(input_device->hid_device,
+ HID_INPUT_REPORT, input_report->buffer, input_report->header.size, 1);
+
+ }
+@@ -662,9 +656,8 @@ static void mousevsc_hid_close(struct hi
+
+ 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;
++ struct mousevsc_dev *input_device = hv_get_drvdata(dev);
+
+ /* hid_debug = -1; */
+ hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);
+@@ -681,9 +674,9 @@ static void reportdesc_callback(struct h
+ 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->vendor = input_device->hid_dev_info.vendor;
++ hid_dev->product = input_device->hid_dev_info.product;
++ hid_dev->version = input_device->hid_dev_info.version;
+ hid_dev->dev = dev->device;
+
+ sprintf(hid_dev->name, "%s",
+@@ -695,7 +688,7 @@ static void reportdesc_callback(struct h
+ if (!hidinput_connect(hid_dev, 0)) {
+ hid_dev->claimed |= HID_CLAIMED_INPUT;
+
+- input_device_ctx->connected = 1;
++ input_device->connected = 1;
+
+ DPRINT_INFO(INPUTVSC_DRV,
+ "HID device claimed by input\n");
+@@ -707,7 +700,7 @@ static void reportdesc_callback(struct h
+ "input or hiddev\n");
+ }
+
+- input_device_ctx->hid_device = hid_dev;
++ input_device->hid_device = hid_dev;
+ }
+
+ kfree(hid_dev);
+@@ -719,8 +712,6 @@ static int mousevsc_on_device_add(struct
+ int ret = 0;
+ 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);
+
+@@ -761,14 +752,7 @@ static int mousevsc_on_device_add(struct
+
+ input_drv = drv_to_hv_drv(input_dev->device->device.driver);
+
+- dev_info.vendor = input_dev->hid_dev_info.vendor;
+- dev_info.product = input_dev->hid_dev_info.product;
+- dev_info.version = input_dev->hid_dev_info.version;
+-
+- /* Send the device info back up */
+- 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 */
+@@ -828,12 +812,6 @@ static int mousevsc_probe(struct hv_devi
+ {
+ int ret = 0;
+
+- struct input_device_context *input_dev_ctx;
+-
+- input_dev_ctx = kmalloc(sizeof(struct input_device_context),
+- GFP_KERNEL);
+-
+- dev_set_drvdata(&dev->device, input_dev_ctx);
+
+ /* Call to the vsc driver to add the device */
+ ret = mousevsc_on_device_add(dev, NULL);
+@@ -849,13 +827,12 @@ static int mousevsc_probe(struct hv_devi
+
+ static int mousevsc_remove(struct hv_device *dev)
+ {
+- struct input_device_context *input_dev_ctx;
++ struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
+ int ret;
+
+- 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;
++ if (input_dev->connected) {
++ hidinput_disconnect(input_dev->hid_device);
++ input_dev->connected = 0;
+ }
+
+ /*
+@@ -868,8 +845,6 @@ static int mousevsc_remove(struct hv_dev
+ "unable to remove vsc device (ret %d)", ret);
+ }
+
+- kfree(input_dev_ctx);
+-
+ return ret;
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0581-Staging-hv-mousevsc-Fixup-some-bogus-WARN_ON-ca.patch b/patches.suse/staging-hv-staging-next-20111001-0581-Staging-hv-mousevsc-Fixup-some-bogus-WARN_ON-ca.patch
new file mode 100644
index 0000000000..ec829ce595
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0581-Staging-hv-mousevsc-Fixup-some-bogus-WARN_ON-ca.patch
@@ -0,0 +1,44 @@
+From 7f2bad4bd0d22f4cdd876152f1eeb9a8cfdc8d9d Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:43 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Fixup some bogus WARN_ON() calls
+
+Fix the bogus WARN_ON() calls.
+
+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 | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -200,7 +200,7 @@ static struct mousevsc_dev *alloc_input_
+
+ static void free_input_device(struct mousevsc_dev *device)
+ {
+- WARN_ON(atomic_read(&device->ref_count) == 0);
++ WARN_ON(atomic_read(&device->ref_count) != 0);
+ kfree(device);
+ }
+
+@@ -327,7 +327,7 @@ static void mousevsc_on_receive_device_i
+
+ /* Save the hid desc */
+ desc = &device_info->hid_descriptor;
+- WARN_ON(desc->bLength > 0);
++ WARN_ON(desc->bLength == 0);
+
+ input_device->hid_desc = kzalloc(desc->bLength, GFP_KERNEL);
+
+@@ -447,7 +447,7 @@ static void mousevsc_on_receive(struct h
+ break;
+
+ case SynthHidInitialDeviceInfo:
+- WARN_ON(pipe_msg->size >= sizeof(struct hv_input_dev_info));
++ WARN_ON(pipe_msg->size < sizeof(struct hv_input_dev_info));
+
+ /*
+ * Parse out the device info into device attr,
diff --git a/patches.suse/staging-hv-staging-next-20111001-0582-Staging-hv-mousevsc-Change-the-allocation-flags-t.patch b/patches.suse/staging-hv-staging-next-20111001-0582-Staging-hv-mousevsc-Change-the-allocation-flags-t.patch
new file mode 100644
index 0000000000..18289b87b7
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0582-Staging-hv-mousevsc-Change-the-allocation-flags-t.patch
@@ -0,0 +1,44 @@
+From 01584892dbf915a3921c5fc2607363e07023ef5c Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:44 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Change the allocation flags to reflect interrupt context
+
+Change the allocation flags to reflect interrupt context.
+
+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 | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -329,7 +329,7 @@ static void mousevsc_on_receive_device_i
+ desc = &device_info->hid_descriptor;
+ WARN_ON(desc->bLength == 0);
+
+- input_device->hid_desc = kzalloc(desc->bLength, GFP_KERNEL);
++ input_device->hid_desc = kzalloc(desc->bLength, GFP_ATOMIC);
+
+ if (!input_device->hid_desc) {
+ pr_err("unable to allocate hid descriptor - size %d",
+@@ -342,7 +342,7 @@ static void mousevsc_on_receive_device_i
+ /* Save the report desc */
+ input_device->report_desc_size = desc->desc[0].wDescriptorLength;
+ input_device->report_desc = kzalloc(input_device->report_desc_size,
+- GFP_KERNEL);
++ GFP_ATOMIC);
+
+ if (!input_device->report_desc) {
+ pr_err("unable to allocate report descriptor - size %d",
+@@ -541,7 +541,7 @@ static void mousevsc_on_channel_callback
+ } else if (ret == -ENOBUFS) {
+ /* Handle large packet */
+ bufferlen = bytes_recvd;
+- buffer = kzalloc(bytes_recvd, GFP_KERNEL);
++ buffer = kzalloc(bytes_recvd, GFP_ATOMIC);
+
+ if (buffer == NULL) {
+ buffer = packet;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0583-Staging-hv-mousevsc-Handle-the-case-where-we-may.patch b/patches.suse/staging-hv-staging-next-20111001-0583-Staging-hv-mousevsc-Handle-the-case-where-we-may.patch
new file mode 100644
index 0000000000..c04b225f0a
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0583-Staging-hv-mousevsc-Handle-the-case-where-we-may.patch
@@ -0,0 +1,26 @@
+From 60e8615ad6e09f47b15c4d023f728c112b8f7294 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:45 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Handle the case where we may get bogus report desc size
+
+Handle the case where we may get bogus report desc size from the host.
+
+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 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -341,6 +341,8 @@ static void mousevsc_on_receive_device_i
+
+ /* Save the report desc */
+ input_device->report_desc_size = desc->desc[0].wDescriptorLength;
++ if (input_device->report_desc_size == 0)
++ goto cleanup;
+ input_device->report_desc = kzalloc(input_device->report_desc_size,
+ GFP_ATOMIC);
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0584-Staging-hv-mousevsc-Correctly-initialize-the-head.patch b/patches.suse/staging-hv-staging-next-20111001-0584-Staging-hv-mousevsc-Correctly-initialize-the-head.patch
new file mode 100644
index 0000000000..456937654d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0584-Staging-hv-mousevsc-Correctly-initialize-the-head.patch
@@ -0,0 +1,26 @@
+From 1738067e5d7009c9ce9ee11c7fe9f9156b191aa9 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:46 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Correctly initialize the header size
+
+Correctly initialize the header size.
+
+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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -590,7 +590,7 @@ static int mousevsc_connect_to_vsp(struc
+ request->size = sizeof(struct synthhid_protocol_request);
+
+ request->request.header.type = SynthHidProtocolRequest;
+- request->request.header.size = sizeof(unsigned long);
++ request->request.header.size = sizeof(unsigned int);
+ request->request.version_requested.version = SYNTHHID_INPUT_VERSION;
+
+ pr_info("synthhid protocol request...");
diff --git a/patches.suse/staging-hv-staging-next-20111001-0585-Staging-hv-mousevsc-Use-completion-primitive-to-s.patch b/patches.suse/staging-hv-staging-next-20111001-0585-Staging-hv-mousevsc-Use-completion-primitive-to-s.patch
new file mode 100644
index 0000000000..e3a91f75b4
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0585-Staging-hv-mousevsc-Use-completion-primitive-to-s.patch
@@ -0,0 +1,110 @@
+From 622a50dce08bd817d2f10c1bcf806ccb35643653 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:47 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Use completion primitive to synchronize
+
+Use completion primitive to synchronize.
+
+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 | 30 ++++++++++--------------------
+ 1 file changed, 10 insertions(+), 20 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -162,10 +162,7 @@ struct mousevsc_dev {
+ struct mousevsc_prt_msg protocol_req;
+ struct mousevsc_prt_msg protocol_resp;
+ /* Synchronize the request/response if needed */
+- wait_queue_head_t protocol_wait_event;
+- wait_queue_head_t dev_info_wait_event;
+- int protocol_wait_condition;
+- int device_wait_condition;
++ struct completion wait_event;
+ int dev_info_status;
+
+ struct hid_descriptor *hid_desc;
+@@ -194,6 +191,7 @@ static struct mousevsc_dev *alloc_input_
+
+ input_dev->device = device;
+ hv_set_drvdata(device, input_dev);
++ init_completion(&input_dev->wait_event);
+
+ return input_dev;
+ }
+@@ -379,8 +377,7 @@ static void mousevsc_on_receive_device_i
+ goto cleanup;
+ }
+
+- input_device->device_wait_condition = 1;
+- wake_up(&input_device->dev_info_wait_event);
++ complete(&input_device->wait_event);
+
+ return;
+
+@@ -392,8 +389,7 @@ cleanup:
+ input_device->report_desc = NULL;
+
+ input_device->dev_info_status = -1;
+- input_device->device_wait_condition = 1;
+- wake_up(&input_device->dev_info_wait_event);
++ complete(&input_device->wait_event);
+ }
+
+ static void mousevsc_on_receive_input_report(struct mousevsc_dev *input_device,
+@@ -444,8 +440,7 @@ static void mousevsc_on_receive(struct h
+ memcpy(&input_dev->protocol_resp, pipe_msg,
+ pipe_msg->size + sizeof(struct pipe_prt_msg) -
+ sizeof(unsigned char));
+- input_dev->protocol_wait_condition = 1;
+- wake_up(&input_dev->protocol_wait_event);
++ complete(&input_dev->wait_event);
+ break;
+
+ case SynthHidInitialDeviceInfo:
+@@ -565,6 +560,7 @@ static void mousevsc_on_channel_callback
+ static int mousevsc_connect_to_vsp(struct hv_device *device)
+ {
+ int ret = 0;
++ int t;
+ struct mousevsc_dev *input_dev;
+ struct mousevsc_prt_msg *request;
+ struct mousevsc_prt_msg *response;
+@@ -576,8 +572,6 @@ static int mousevsc_connect_to_vsp(struc
+ return -1;
+ }
+
+- init_waitqueue_head(&input_dev->protocol_wait_event);
+- init_waitqueue_head(&input_dev->dev_info_wait_event);
+
+ request = &input_dev->protocol_req;
+
+@@ -607,10 +601,8 @@ static int mousevsc_connect_to_vsp(struc
+ goto cleanup;
+ }
+
+- input_dev->protocol_wait_condition = 0;
+- wait_event_timeout(input_dev->protocol_wait_event,
+- input_dev->protocol_wait_condition, msecs_to_jiffies(1000));
+- if (input_dev->protocol_wait_condition == 0) {
++ t = wait_for_completion_timeout(&input_dev->wait_event, 5*HZ);
++ if (t == 0) {
+ ret = -ETIMEDOUT;
+ goto cleanup;
+ }
+@@ -624,10 +616,8 @@ static int mousevsc_connect_to_vsp(struc
+ goto cleanup;
+ }
+
+- input_dev->device_wait_condition = 0;
+- wait_event_timeout(input_dev->dev_info_wait_event,
+- input_dev->device_wait_condition, msecs_to_jiffies(1000));
+- if (input_dev->device_wait_condition == 0) {
++ t = wait_for_completion_timeout(&input_dev->wait_event, 5*HZ);
++ if (t == 0) {
+ ret = -ETIMEDOUT;
+ goto cleanup;
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0586-Staging-hv-mousevsc-Cleanup-and-properly-implemen.patch b/patches.suse/staging-hv-staging-next-20111001-0586-Staging-hv-mousevsc-Cleanup-and-properly-implemen.patch
new file mode 100644
index 0000000000..0a7f2a2eda
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0586-Staging-hv-mousevsc-Cleanup-and-properly-implemen.patch
@@ -0,0 +1,105 @@
+From da5969e4cce5cbb44ca4597c7ff60bf6517ba00b Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:48 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Cleanup and properly implement reportdesc_callback()
+
+Cleanup and properly implement reportdesc_callback(); properly allocate the
+hid_device and properly initialize the hid device structure.
+
+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 | 56 +++++++++++++++++-------------------------
+ 1 file changed, 23 insertions(+), 33 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -646,56 +646,45 @@ static void mousevsc_hid_close(struct hi
+ {
+ }
+
++static struct hid_ll_driver mousevsc_ll_driver = {
++ .open = mousevsc_hid_open,
++ .close = mousevsc_hid_close,
++};
++
++static struct hid_driver mousevsc_hid_driver;
++
+ static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
+ {
+ struct hid_device *hid_dev;
+ struct mousevsc_dev *input_device = hv_get_drvdata(dev);
+
+- /* hid_debug = -1; */
+- hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);
++ hid_dev = hid_allocate_device();
++ if (IS_ERR(hid_dev))
++ return;
++
++ hid_dev->ll_driver = &mousevsc_ll_driver;
++ hid_dev->driver = &mousevsc_hid_driver;
+
+ 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->hid_dev_info.vendor;
+- hid_dev->product = input_device->hid_dev_info.product;
+- hid_dev->version = input_device->hid_dev_info.version;
+- hid_dev->dev = dev->device;
+-
+- sprintf(hid_dev->name, "%s",
+- "Microsoft Vmbus HID-compliant Mouse");
+-
+- /*
+- * HJ Do we want to call it with a 0
+- */
+- if (!hidinput_connect(hid_dev, 0)) {
+- hid_dev->claimed |= HID_CLAIMED_INPUT;
++ hid_dev->bus = BUS_VIRTUAL;
++ hid_dev->vendor = input_device->hid_dev_info.vendor;
++ hid_dev->product = input_device->hid_dev_info.product;
++ hid_dev->version = input_device->hid_dev_info.version;
+
+- input_device->connected = 1;
++ sprintf(hid_dev->name, "%s", "Microsoft Vmbus HID-compliant Mouse");
+
+- DPRINT_INFO(INPUTVSC_DRV,
+- "HID device claimed by input\n");
+- }
++ if (!hidinput_connect(hid_dev, 0)) {
++ hid_dev->claimed |= HID_CLAIMED_INPUT;
+
+- if (!hid_dev->claimed) {
+- DPRINT_ERR(INPUTVSC_DRV,
+- "HID device not claimed by "
+- "input or hiddev\n");
+- }
++ input_device->connected = 1;
+
+- input_device->hid_device = hid_dev;
+ }
+
+- kfree(hid_dev);
++ input_device->hid_device = hid_dev;
+ }
+
+ static int mousevsc_on_device_add(struct hv_device *device,
+@@ -825,6 +814,7 @@ static int mousevsc_remove(struct hv_dev
+ if (input_dev->connected) {
+ hidinput_disconnect(input_dev->hid_device);
+ input_dev->connected = 0;
++ hid_destroy_device(input_dev->hid_device);
+ }
+
+ /*
diff --git a/patches.suse/staging-hv-staging-next-20111001-0587-Staging-hv-mousevsc-Get-rid-of-unnecessary-DPRINT.patch b/patches.suse/staging-hv-staging-next-20111001-0587-Staging-hv-mousevsc-Get-rid-of-unnecessary-DPRINT.patch
new file mode 100644
index 0000000000..dd8b435593
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0587-Staging-hv-mousevsc-Get-rid-of-unnecessary-DPRINT.patch
@@ -0,0 +1,65 @@
+From 0b1f0da005928c1cc761c320e6919b719a090a07 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:49 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of unnecessary DPRINT calls
+
+Get rid of unnecessary DPRINT calls.
+
+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 | 18 +++---------------
+ 1 file changed, 3 insertions(+), 15 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -665,10 +665,8 @@ static void reportdesc_callback(struct h
+ hid_dev->ll_driver = &mousevsc_ll_driver;
+ hid_dev->driver = &mousevsc_hid_driver;
+
+- if (hid_parse_report(hid_dev, packet, len)) {
+- DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
++ if (hid_parse_report(hid_dev, packet, len))
+ return;
+- }
+
+ hid_dev->bus = BUS_VIRTUAL;
+ hid_dev->vendor = input_device->hid_dev_info.vendor;
+@@ -797,11 +795,8 @@ static int mousevsc_probe(struct hv_devi
+ /* Call to the vsc driver to add the device */
+ ret = mousevsc_on_device_add(dev, NULL);
+
+- if (ret != 0) {
+- DPRINT_ERR(INPUTVSC_DRV, "unable to add input vsc device");
+-
++ if (ret != 0)
+ return -1;
+- }
+
+ return 0;
+ }
+@@ -809,7 +804,6 @@ static int mousevsc_probe(struct hv_devi
+ static int mousevsc_remove(struct hv_device *dev)
+ {
+ struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
+- int ret;
+
+ if (input_dev->connected) {
+ hidinput_disconnect(input_dev->hid_device);
+@@ -821,13 +815,7 @@ static int mousevsc_remove(struct hv_dev
+ * Call to the vsc driver to let it know that the device
+ * is being removed
+ */
+- ret = mousevsc_on_device_remove(dev);
+- if (ret != 0) {
+- DPRINT_ERR(INPUTVSC_DRV,
+- "unable to remove vsc device (ret %d)", ret);
+- }
+-
+- return ret;
++ return mousevsc_on_device_remove(dev);
+ }
+
+ static const struct hv_vmbus_device_id id_table[] = {
diff --git a/patches.suse/staging-hv-staging-next-20111001-0588-Staging-hv-mousevsc-Cleanup-error-handling.patch b/patches.suse/staging-hv-staging-next-20111001-0588-Staging-hv-mousevsc-Cleanup-error-handling.patch
new file mode 100644
index 0000000000..334ad5d370
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0588-Staging-hv-mousevsc-Cleanup-error-handling.patch
@@ -0,0 +1,92 @@
+From 5cd4d0302cc3a53b4fb48006d448f44f666f1569 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:50 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Cleanup error handling
+
+Cleanup error handling in this driver; 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_mouse.c | 23 +++++++----------------
+ 1 file changed, 7 insertions(+), 16 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -569,7 +569,7 @@ static int mousevsc_connect_to_vsp(struc
+
+ if (!input_dev) {
+ pr_err("unable to get input device...device being destroyed?");
+- return -1;
++ return -ENODEV;
+ }
+
+
+@@ -612,7 +612,7 @@ static int mousevsc_connect_to_vsp(struc
+ if (!response->response.approved) {
+ pr_err("synthhid protocol request failed (version %d)",
+ SYNTHHID_INPUT_VERSION);
+- ret = -1;
++ ret = -ENODEV;
+ goto cleanup;
+ }
+
+@@ -629,7 +629,7 @@ static int mousevsc_connect_to_vsp(struc
+ if (!input_dev->dev_info_status)
+ pr_info("**** input channel up and running!! ****");
+ else
+- ret = -1;
++ ret = -ENOMEM;
+
+ cleanup:
+ put_input_device(device);
+@@ -694,10 +694,8 @@ static int mousevsc_on_device_add(struct
+
+ input_dev = alloc_input_device(device);
+
+- if (!input_dev) {
+- ret = -1;
+- goto cleanup;
+- }
++ if (!input_dev)
++ return -ENOMEM;
+
+ input_dev->init_complete = false;
+
+@@ -714,7 +712,7 @@ static int mousevsc_on_device_add(struct
+ if (ret != 0) {
+ pr_err("unable to open channel: %d", ret);
+ free_input_device(input_dev);
+- return -1;
++ return ret;
+ }
+
+ pr_info("InputVsc channel open: %d", ret);
+@@ -743,7 +741,6 @@ static int mousevsc_on_device_add(struct
+
+ input_dev->init_complete = true;
+
+-cleanup:
+ return ret;
+ }
+
+@@ -789,16 +786,10 @@ static int mousevsc_on_device_remove(str
+ static int mousevsc_probe(struct hv_device *dev,
+ const struct hv_vmbus_device_id *dev_id)
+ {
+- int ret = 0;
+-
+
+ /* Call to the vsc driver to add the device */
+- ret = mousevsc_on_device_add(dev, NULL);
++ return mousevsc_on_device_add(dev, NULL);
+
+- if (ret != 0)
+- return -1;
+-
+- return 0;
+ }
+
+ static int mousevsc_remove(struct hv_device *dev)
diff --git a/patches.suse/staging-hv-staging-next-20111001-0589-Staging-hv-mousevsc-Get-rid-of-unnecessary-pr_-c.patch b/patches.suse/staging-hv-staging-next-20111001-0589-Staging-hv-mousevsc-Get-rid-of-unnecessary-pr_-c.patch
new file mode 100644
index 0000000000..8f1d5a6707
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0589-Staging-hv-mousevsc-Get-rid-of-unnecessary-pr_-c.patch
@@ -0,0 +1,212 @@
+From 61c4fb47cffa5cd6ff52fa1d3fca25547bcd76ad Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:51 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of unnecessary pr_* calls
+
+Get rid of unnecessary pr_* calls.
+
+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 | 64 +++++++-----------------------------------
+ 1 file changed, 11 insertions(+), 53 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -294,10 +294,8 @@ static void mousevsc_on_send_completion(
+ void *request;
+
+ input_dev = must_get_input_device(device);
+- if (!input_dev) {
+- pr_err("unable to get input device...device being destroyed?");
++ if (!input_dev)
+ return;
+- }
+
+ request = (void *)(unsigned long)packet->trans_id;
+
+@@ -329,11 +327,8 @@ static void mousevsc_on_receive_device_i
+
+ input_device->hid_desc = kzalloc(desc->bLength, GFP_ATOMIC);
+
+- if (!input_device->hid_desc) {
+- pr_err("unable to allocate hid descriptor - size %d",
+- desc->bLength);
++ if (!input_device->hid_desc)
+ goto cleanup;
+- }
+
+ memcpy(input_device->hid_desc, desc, desc->bLength);
+
+@@ -344,11 +339,8 @@ static void mousevsc_on_receive_device_i
+ input_device->report_desc = kzalloc(input_device->report_desc_size,
+ GFP_ATOMIC);
+
+- if (!input_device->report_desc) {
+- pr_err("unable to allocate report descriptor - size %d",
+- input_device->report_desc_size);
++ if (!input_device->report_desc)
+ goto cleanup;
+- }
+
+ memcpy(input_device->report_desc,
+ ((unsigned char *)desc) + desc->bLength,
+@@ -371,11 +363,8 @@ static void mousevsc_on_receive_device_i
+ (unsigned long)&ack,
+ VM_PKT_DATA_INBAND,
+ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+- if (ret != 0) {
+- pr_err("unable to send synthhid device info ack - ret %d",
+- ret);
++ if (ret != 0)
+ goto cleanup;
+- }
+
+ complete(&input_device->wait_event);
+
+@@ -397,10 +386,8 @@ static void mousevsc_on_receive_input_re
+ {
+ struct hv_driver *input_drv;
+
+- if (!input_device->init_complete) {
+- pr_info("Initialization incomplete...ignoring input_report msg");
++ if (!input_device->init_complete)
+ return;
+- }
+
+ input_drv = drv_to_hv_drv(input_device->device->device.driver);
+
+@@ -418,17 +405,13 @@ static void mousevsc_on_receive(struct h
+ struct mousevsc_dev *input_dev;
+
+ input_dev = must_get_input_device(device);
+- if (!input_dev) {
+- pr_err("unable to get input device...device being destroyed?");
++ if (!input_dev)
+ return;
+- }
+
+ pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
+ (packet->offset8 << 3));
+
+ if (pipe_msg->type != PipeMessageData) {
+- pr_err("unknown pipe msg type - type %d len %d",
+- pipe_msg->type, pipe_msg->size);
+ put_input_device(device);
+ return ;
+ }
+@@ -483,10 +466,8 @@ static void mousevsc_on_channel_callback
+
+ input_dev = must_get_input_device(device);
+
+- if (!input_dev) {
+- pr_err("unable to get input device...device being destroyed?");
++ if (!input_dev)
+ return;
+- }
+
+ do {
+ ret = vmbus_recvpacket_raw(device->channel, buffer,
+@@ -545,8 +526,6 @@ static void mousevsc_on_channel_callback
+ bufferlen = packetSize;
+
+ /* Try again next time around */
+- pr_err("unable to allocate buffer of size %d!",
+- bytes_recvd);
+ break;
+ }
+ }
+@@ -567,10 +546,8 @@ static int mousevsc_connect_to_vsp(struc
+
+ input_dev = get_input_device(device);
+
+- if (!input_dev) {
+- pr_err("unable to get input device...device being destroyed?");
++ if (!input_dev)
+ return -ENODEV;
+- }
+
+
+ request = &input_dev->protocol_req;
+@@ -587,7 +564,6 @@ static int mousevsc_connect_to_vsp(struc
+ request->request.header.size = sizeof(unsigned int);
+ request->request.version_requested.version = SYNTHHID_INPUT_VERSION;
+
+- pr_info("synthhid protocol request...");
+
+ ret = vmbus_sendpacket(device->channel, request,
+ sizeof(struct pipe_prt_msg) -
+@@ -596,10 +572,8 @@ static int mousevsc_connect_to_vsp(struc
+ (unsigned long)request,
+ VM_PKT_DATA_INBAND,
+ VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
+- if (ret != 0) {
+- pr_err("unable to send synthhid protocol request.");
++ if (ret != 0)
+ goto cleanup;
+- }
+
+ t = wait_for_completion_timeout(&input_dev->wait_event, 5*HZ);
+ if (t == 0) {
+@@ -626,9 +600,7 @@ static int mousevsc_connect_to_vsp(struc
+ * We should have gotten the device attr, hid desc and report
+ * desc at this point
+ */
+- if (!input_dev->dev_info_status)
+- pr_info("**** input channel up and running!! ****");
+- else
++ if (input_dev->dev_info_status)
+ ret = -ENOMEM;
+
+ cleanup:
+@@ -710,18 +682,14 @@ static int mousevsc_on_device_add(struct
+ );
+
+ if (ret != 0) {
+- pr_err("unable to open channel: %d", ret);
+ free_input_device(input_dev);
+ return ret;
+ }
+
+- pr_info("InputVsc channel open: %d", ret);
+
+ ret = mousevsc_connect_to_vsp(device);
+
+ if (ret != 0) {
+- pr_err("unable to connect channel: %d", ret);
+-
+ vmbus_close(device->channel);
+ free_input_device(input_dev);
+ return ret;
+@@ -749,8 +717,6 @@ static int mousevsc_on_device_remove(str
+ struct mousevsc_dev *input_dev;
+ int ret = 0;
+
+- pr_info("disabling input device (%p)...",
+- hv_get_drvdata(device));
+
+ input_dev = release_input_device(device);
+
+@@ -761,19 +727,11 @@ static int mousevsc_on_device_remove(str
+ *
+ * so that outstanding requests can be completed.
+ */
+- while (input_dev->num_outstanding_req) {
+- pr_info("waiting for %d requests to complete...",
+- input_dev->num_outstanding_req);
+-
++ while (input_dev->num_outstanding_req)
+ udelay(100);
+- }
+-
+- pr_info("removing input device (%p)...", hv_get_drvdata(device));
+
+ input_dev = final_release_input_device(device);
+
+- pr_info("input device (%p) safe to remove", input_dev);
+-
+ /* Close the channel */
+ vmbus_close(device->channel);
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0590-Staging-hv-mousevsc-Free-allocated-memory-in-free.patch b/patches.suse/staging-hv-staging-next-20111001-0590-Staging-hv-mousevsc-Free-allocated-memory-in-free.patch
new file mode 100644
index 0000000000..f55a74d161
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0590-Staging-hv-mousevsc-Free-allocated-memory-in-free.patch
@@ -0,0 +1,26 @@
+From ea8646b92feea6de86dae44a879364758b6a4dcb Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:52 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Free allocated memory in free_input_device()
+
+Free all allocated memory in free_input_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/hv_mouse.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -199,6 +199,8 @@ static struct mousevsc_dev *alloc_input_
+ static void free_input_device(struct mousevsc_dev *device)
+ {
+ WARN_ON(atomic_read(&device->ref_count) != 0);
++ kfree(device->hid_desc);
++ kfree(device->report_desc);
+ kfree(device);
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0591-Staging-hv-mousevsc-Get-rid-of-the-unused-state.patch b/patches.suse/staging-hv-staging-next-20111001-0591-Staging-hv-mousevsc-Get-rid-of-the-unused-state.patch
new file mode 100644
index 0000000000..4da456f145
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0591-Staging-hv-mousevsc-Get-rid-of-the-unused-state.patch
@@ -0,0 +1,34 @@
+From c5b71fc71fc7cdee68614d37826ed46db9be2006 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:53 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of the unused state: num_outstanding_req
+
+Get rid of the unused state: num_outstanding_req in struct mousevsc_dev.
+
+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 | 3 ---
+ 1 file changed, 3 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -157,7 +157,6 @@ struct mousevsc_dev {
+ struct hv_device *device;
+ /* 0 indicates the device is being destroyed */
+ atomic_t ref_count;
+- int num_outstanding_req;
+ unsigned char init_complete;
+ struct mousevsc_prt_msg protocol_req;
+ struct mousevsc_prt_msg protocol_resp;
+@@ -729,8 +728,6 @@ static int mousevsc_on_device_remove(str
+ *
+ * so that outstanding requests can be completed.
+ */
+- while (input_dev->num_outstanding_req)
+- udelay(100);
+
+ input_dev = final_release_input_device(device);
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0592-Staging-hv-mousevsc-Cleanup-alloc_input_device.patch b/patches.suse/staging-hv-staging-next-20111001-0592-Staging-hv-mousevsc-Cleanup-alloc_input_device.patch
new file mode 100644
index 0000000000..fc96fb950d
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0592-Staging-hv-mousevsc-Cleanup-alloc_input_device.patch
@@ -0,0 +1,26 @@
+From bdbbdb2d63fe340935ec6521da62fe9e73d8dc15 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:54 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Cleanup alloc_input_device()
+
+Cleanup alloc_input_device(); you can directly set the reference count.
+
+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 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -186,7 +186,7 @@ static struct mousevsc_dev *alloc_input_
+ * Set to 2 to allow both inbound and outbound traffics
+ * (ie get_input_device() and must_get_input_device()) to proceed.
+ */
+- atomic_cmpxchg(&input_dev->ref_count, 0, 2);
++ atomic_set(&input_dev->ref_count, 2);
+
+ input_dev->device = device;
+ hv_set_drvdata(device, input_dev);
diff --git a/patches.suse/staging-hv-staging-next-20111001-0593-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_send_c.patch b/patches.suse/staging-hv-staging-next-20111001-0593-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_send_c.patch
new file mode 100644
index 0000000000..b20a99ca69
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0593-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_send_c.patch
@@ -0,0 +1,53 @@
+From 1486dd0d0a95de1aaedd17ece19d9263ce7e5192 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:55 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of mousevsc_on_send_completion()
+
+We don't need to handle the "send complete" callback - nothing needs to be done
+here; get rid of 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/hv_mouse.c | 21 ---------------------
+ 1 file changed, 21 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -288,25 +288,6 @@ static struct mousevsc_dev *final_releas
+ return input_dev;
+ }
+
+-static void mousevsc_on_send_completion(struct hv_device *device,
+- struct vmpacket_descriptor *packet)
+-{
+- struct mousevsc_dev *input_dev;
+- void *request;
+-
+- input_dev = must_get_input_device(device);
+- if (!input_dev)
+- return;
+-
+- request = (void *)(unsigned long)packet->trans_id;
+-
+- if (request == &input_dev->protocol_req) {
+- /* FIXME */
+- /* Shouldn't we be doing something here? */
+- }
+-
+- put_input_device(device);
+-}
+
+ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+ struct synthhid_device_info *device_info)
+@@ -480,8 +461,6 @@ static void mousevsc_on_channel_callback
+
+ switch (desc->type) {
+ case VM_PKT_COMP:
+- mousevsc_on_send_completion(
+- device, desc);
+ break;
+
+ case VM_PKT_DATA_INBAND:
diff --git a/patches.suse/staging-hv-staging-next-20111001-0594-Staging-hv-mousevsc-Cleanup-mousevsc_connect_to_v.patch b/patches.suse/staging-hv-staging-next-20111001-0594-Staging-hv-mousevsc-Cleanup-mousevsc_connect_to_v.patch
new file mode 100644
index 0000000000..7d51720ec1
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0594-Staging-hv-mousevsc-Cleanup-mousevsc_connect_to_v.patch
@@ -0,0 +1,77 @@
+From 8660e38fab8b8a39ac828fb8a8579a9ad1b5d59d Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:56 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Cleanup mousevsc_connect_to_vsp()
+
+Cleanup mousevsc_connect_to_vsp(). There is no need to take reference on the
+mousevsc device object when we are setting up the device. As part of this
+cleanup get rid of get_input_device() as this function is only used 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/hv_mouse.c | 34 +---------------------------------
+ 1 file changed, 1 insertion(+), 33 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -204,32 +204,6 @@ static void free_input_device(struct mou
+ }
+
+ /*
+- * Get the inputdevice object if exists and its refcount > 1
+- */
+-static struct mousevsc_dev *get_input_device(struct hv_device *device)
+-{
+- struct mousevsc_dev *input_dev;
+-
+- input_dev = hv_get_drvdata(device);
+-
+-/*
+- * FIXME
+- * This sure isn't a valid thing to print for debugging, no matter
+- * what the intention is...
+- *
+- * printk(KERN_ERR "-------------------------> REFCOUNT = %d",
+- * input_dev->ref_count);
+- */
+-
+- if (input_dev && atomic_read(&input_dev->ref_count) > 1)
+- atomic_inc(&input_dev->ref_count);
+- else
+- input_dev = NULL;
+-
+- return input_dev;
+-}
+-
+-/*
+ * Get the inputdevice object iff exists and its refcount > 0
+ */
+ static struct mousevsc_dev *must_get_input_device(struct hv_device *device)
+@@ -520,15 +494,10 @@ static int mousevsc_connect_to_vsp(struc
+ {
+ int ret = 0;
+ int t;
+- struct mousevsc_dev *input_dev;
++ struct mousevsc_dev *input_dev = hv_get_drvdata(device);
+ struct mousevsc_prt_msg *request;
+ struct mousevsc_prt_msg *response;
+
+- input_dev = get_input_device(device);
+-
+- if (!input_dev)
+- return -ENODEV;
+-
+
+ request = &input_dev->protocol_req;
+
+@@ -584,7 +553,6 @@ static int mousevsc_connect_to_vsp(struc
+ ret = -ENOMEM;
+
+ cleanup:
+- put_input_device(device);
+
+ return ret;
+ }
diff --git a/patches.suse/staging-hv-staging-next-20111001-0595-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_device.patch b/patches.suse/staging-hv-staging-next-20111001-0595-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_device.patch
new file mode 100644
index 0000000000..e8bdcd9afe
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0595-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_device.patch
@@ -0,0 +1,80 @@
+From 8ec31f9385fdcd7c71fa0078deb0e84840f3cb49 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:57 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of mousevsc_on_device_remove() by inlining code
+
+Get rid of mousevsc_on_device_remove() 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/hv_mouse.c | 47 +++++++++++++++---------------------------
+ 1 file changed, 17 insertions(+), 30 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -660,33 +660,6 @@ static int mousevsc_on_device_add(struct
+ return ret;
+ }
+
+-static int mousevsc_on_device_remove(struct hv_device *device)
+-{
+- struct mousevsc_dev *input_dev;
+- int ret = 0;
+-
+-
+- input_dev = release_input_device(device);
+-
+-
+- /*
+- * At this point, all outbound traffic should be disable. We only
+- * allow inbound traffic (responses) to proceed
+- *
+- * so that outstanding requests can be completed.
+- */
+-
+- input_dev = final_release_input_device(device);
+-
+- /* Close the channel */
+- vmbus_close(device->channel);
+-
+- free_input_device(input_dev);
+-
+- return ret;
+-}
+-
+-
+ static int mousevsc_probe(struct hv_device *dev,
+ const struct hv_vmbus_device_id *dev_id)
+ {
+@@ -706,11 +679,25 @@ static int mousevsc_remove(struct hv_dev
+ hid_destroy_device(input_dev->hid_device);
+ }
+
++
++ release_input_device(dev);
++
++
+ /*
+- * Call to the vsc driver to let it know that the device
+- * is being removed
++ * At this point, all outbound traffic should be disable. We only
++ * allow inbound traffic (responses) to proceed
++ *
++ * so that outstanding requests can be completed.
+ */
+- return mousevsc_on_device_remove(dev);
++
++ input_dev = final_release_input_device(dev);
++
++ /* Close the channel */
++ vmbus_close(dev->channel);
++
++ free_input_device(input_dev);
++
++ return 0;
+ }
+
+ static const struct hv_vmbus_device_id id_table[] = {
diff --git a/patches.suse/staging-hv-staging-next-20111001-0596-Staging-hv-mousevsc-Now-cleanup-mousevsc_remove.patch b/patches.suse/staging-hv-staging-next-20111001-0596-Staging-hv-mousevsc-Now-cleanup-mousevsc_remove.patch
new file mode 100644
index 0000000000..43b9898148
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0596-Staging-hv-mousevsc-Now-cleanup-mousevsc_remove.patch
@@ -0,0 +1,103 @@
+From c411f17daf0942509f6db47b4a237e953f35611b Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:58 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Now cleanup mousevsc_remove()
+
+Now, cleanup mousevsc_remove(). The mouse driver once initialized only
+receives data from the host. So, by closing the channel first in the
+unload path, we can properly deal with inflight packets. So, we don't need
+the machinery for managing the life-cycle of the mousevsc_dev object.
+Get rid of the unnecessary 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/hv_mouse.c | 53 ++----------------------------------------
+ 1 file changed, 3 insertions(+), 50 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -197,9 +197,9 @@ static struct mousevsc_dev *alloc_input_
+
+ static void free_input_device(struct mousevsc_dev *device)
+ {
+- WARN_ON(atomic_read(&device->ref_count) != 0);
+ kfree(device->hid_desc);
+ kfree(device->report_desc);
++ hv_set_drvdata(device->device, NULL);
+ kfree(device);
+ }
+
+@@ -229,39 +229,6 @@ static void put_input_device(struct hv_d
+ atomic_dec(&input_dev->ref_count);
+ }
+
+-/*
+- * Drop ref count to 1 to effectively disable get_input_device()
+- */
+-static struct mousevsc_dev *release_input_device(struct hv_device *device)
+-{
+- struct mousevsc_dev *input_dev;
+-
+- input_dev = hv_get_drvdata(device);
+-
+- /* Busy wait until the ref drop to 2, then set it to 1 */
+- while (atomic_cmpxchg(&input_dev->ref_count, 2, 1) != 2)
+- udelay(100);
+-
+- return input_dev;
+-}
+-
+-/*
+- * Drop ref count to 0. No one can use input_device object.
+- */
+-static struct mousevsc_dev *final_release_input_device(struct hv_device *device)
+-{
+- struct mousevsc_dev *input_dev;
+-
+- input_dev = hv_get_drvdata(device);
+-
+- /* Busy wait until the ref drop to 1, then set it to 0 */
+- while (atomic_cmpxchg(&input_dev->ref_count, 1, 0) != 1)
+- udelay(100);
+-
+- hv_set_drvdata(device, NULL);
+- return input_dev;
+-}
+-
+
+ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+ struct synthhid_device_info *device_info)
+@@ -673,28 +640,14 @@ static int mousevsc_remove(struct hv_dev
+ {
+ struct mousevsc_dev *input_dev = hv_get_drvdata(dev);
+
++ vmbus_close(dev->channel);
++
+ if (input_dev->connected) {
+ hidinput_disconnect(input_dev->hid_device);
+ input_dev->connected = 0;
+ hid_destroy_device(input_dev->hid_device);
+ }
+
+-
+- release_input_device(dev);
+-
+-
+- /*
+- * At this point, all outbound traffic should be disable. We only
+- * allow inbound traffic (responses) to proceed
+- *
+- * so that outstanding requests can be completed.
+- */
+-
+- input_dev = final_release_input_device(dev);
+-
+- /* Close the channel */
+- vmbus_close(dev->channel);
+-
+ free_input_device(input_dev);
+
+ return 0;
diff --git a/patches.suse/staging-hv-staging-next-20111001-0597-Staging-hv-mousevsc-Get-rid-of-ref_count-state-in.patch b/patches.suse/staging-hv-staging-next-20111001-0597-Staging-hv-mousevsc-Get-rid-of-ref_count-state-in.patch
new file mode 100644
index 0000000000..a922b1d1e5
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0597-Staging-hv-mousevsc-Get-rid-of-ref_count-state-in.patch
@@ -0,0 +1,132 @@
+From ee2baa299ae11fec073c2b2aad7f6c571f71189e Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:54:59 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of ref_count state in struct mousevsc_dev
+
+Now get rid of the machinery for managing the life-cycle of the mousevsc_dev
+as this is not needed.
+
+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 | 54 ++----------------------------------------
+ 1 file changed, 3 insertions(+), 51 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -155,8 +155,6 @@ struct mousevsc_prt_msg {
+ */
+ struct mousevsc_dev {
+ struct hv_device *device;
+- /* 0 indicates the device is being destroyed */
+- atomic_t ref_count;
+ unsigned char init_complete;
+ struct mousevsc_prt_msg protocol_req;
+ struct mousevsc_prt_msg protocol_resp;
+@@ -182,12 +180,6 @@ static struct mousevsc_dev *alloc_input_
+ if (!input_dev)
+ return NULL;
+
+- /*
+- * Set to 2 to allow both inbound and outbound traffics
+- * (ie get_input_device() and must_get_input_device()) to proceed.
+- */
+- atomic_set(&input_dev->ref_count, 2);
+-
+ input_dev->device = device;
+ hv_set_drvdata(device, input_dev);
+ init_completion(&input_dev->wait_event);
+@@ -203,32 +195,6 @@ static void free_input_device(struct mou
+ kfree(device);
+ }
+
+-/*
+- * Get the inputdevice object iff exists and its refcount > 0
+- */
+-static struct mousevsc_dev *must_get_input_device(struct hv_device *device)
+-{
+- struct mousevsc_dev *input_dev;
+-
+- input_dev = hv_get_drvdata(device);
+-
+- if (input_dev && atomic_read(&input_dev->ref_count))
+- atomic_inc(&input_dev->ref_count);
+- else
+- input_dev = NULL;
+-
+- return input_dev;
+-}
+-
+-static void put_input_device(struct hv_device *device)
+-{
+- struct mousevsc_dev *input_dev;
+-
+- input_dev = hv_get_drvdata(device);
+-
+- atomic_dec(&input_dev->ref_count);
+-}
+-
+
+ static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
+ struct synthhid_device_info *device_info)
+@@ -325,19 +291,13 @@ static void mousevsc_on_receive(struct h
+ {
+ struct pipe_prt_msg *pipe_msg;
+ struct synthhid_msg *hid_msg;
+- struct mousevsc_dev *input_dev;
+-
+- input_dev = must_get_input_device(device);
+- if (!input_dev)
+- return;
++ struct mousevsc_dev *input_dev = hv_get_drvdata(device);
+
+ pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
+ (packet->offset8 << 3));
+
+- if (pipe_msg->type != PipeMessageData) {
+- put_input_device(device);
+- return ;
+- }
++ if (pipe_msg->type != PipeMessageData)
++ return;
+
+ hid_msg = (struct synthhid_msg *)&pipe_msg->data[0];
+
+@@ -370,7 +330,6 @@ static void mousevsc_on_receive(struct h
+ break;
+ }
+
+- put_input_device(device);
+ }
+
+ static void mousevsc_on_channel_callback(void *context)
+@@ -378,7 +337,6 @@ static void mousevsc_on_channel_callback
+ const int packetSize = 0x100;
+ int ret = 0;
+ struct hv_device *device = (struct hv_device *)context;
+- struct mousevsc_dev *input_dev;
+
+ u32 bytes_recvd;
+ u64 req_id;
+@@ -387,10 +345,6 @@ static void mousevsc_on_channel_callback
+ unsigned char *buffer = packet;
+ int bufferlen = packetSize;
+
+- input_dev = must_get_input_device(device);
+-
+- if (!input_dev)
+- return;
+
+ do {
+ ret = vmbus_recvpacket_raw(device->channel, buffer,
+@@ -452,8 +406,6 @@ static void mousevsc_on_channel_callback
+ }
+ } while (1);
+
+- put_input_device(device);
+-
+ return;
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0598-Staging-hv-mousevsc-Cleanup-camel-cased-enums.patch b/patches.suse/staging-hv-staging-next-20111001-0598-Staging-hv-mousevsc-Cleanup-camel-cased-enums.patch
new file mode 100644
index 0000000000..f8dee1b67e
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0598-Staging-hv-mousevsc-Cleanup-camel-cased-enums.patch
@@ -0,0 +1,108 @@
+From 517812b448e56d71185028445f8feb722bcd17a2 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:55:00 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Cleanup camel cased enums
+
+Cleanup all camel cased names.
+
+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 | 34 +++++++++++++++++-----------------
+ 1 file changed, 17 insertions(+), 17 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -58,12 +58,12 @@ struct hv_input_dev_info {
+ * Message types in the synthetic input protocol
+ */
+ enum synthhid_msg_type {
+- SynthHidProtocolRequest,
+- SynthHidProtocolResponse,
+- SynthHidInitialDeviceInfo,
+- SynthHidInitialDeviceInfoAck,
+- SynthHidInputReport,
+- SynthHidMax
++ SYNTH_HID_PROTOCOL_REQUEST,
++ SYNTH_HID_PROTOCOL_RESPONSE,
++ SYNTH_HID_INITIAL_DEVICE_INFO,
++ SYNTH_HID_INITIAL_DEVICE_INFO_ACK,
++ SYNTH_HID_INPUT_REPORT,
++ SYNTH_HID_MAX
+ };
+
+ /*
+@@ -125,9 +125,9 @@ struct synthhid_input_report {
+ #define NBITS(x) (((x)/BITS_PER_LONG)+1)
+
+ enum pipe_prot_msg_type {
+- PipeMessageInvalid = 0,
+- PipeMessageData,
+- PipeMessageMaximum
++ PIPE_MESSAGE_INVALID,
++ PIPE_MESSAGE_DATA,
++ PIPE_MESSAGE_MAXIMUM
+ };
+
+
+@@ -238,10 +238,10 @@ static void mousevsc_on_receive_device_i
+ /* Send the ack */
+ memset(&ack, 0, sizeof(struct mousevsc_prt_msg));
+
+- ack.type = PipeMessageData;
++ ack.type = PIPE_MESSAGE_DATA;
+ ack.size = sizeof(struct synthhid_device_info_ack);
+
+- ack.ack.header.type = SynthHidInitialDeviceInfoAck;
++ ack.ack.header.type = SYNTH_HID_INITIAL_DEVICE_INFO_ACK;
+ ack.ack.header.size = 1;
+ ack.ack.reserved = 0;
+
+@@ -296,20 +296,20 @@ static void mousevsc_on_receive(struct h
+ pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
+ (packet->offset8 << 3));
+
+- if (pipe_msg->type != PipeMessageData)
++ if (pipe_msg->type != PIPE_MESSAGE_DATA)
+ return;
+
+ hid_msg = (struct synthhid_msg *)&pipe_msg->data[0];
+
+ switch (hid_msg->header.type) {
+- case SynthHidProtocolResponse:
++ case SYNTH_HID_PROTOCOL_RESPONSE:
+ memcpy(&input_dev->protocol_resp, pipe_msg,
+ pipe_msg->size + sizeof(struct pipe_prt_msg) -
+ sizeof(unsigned char));
+ complete(&input_dev->wait_event);
+ break;
+
+- case SynthHidInitialDeviceInfo:
++ case SYNTH_HID_INITIAL_DEVICE_INFO:
+ WARN_ON(pipe_msg->size < sizeof(struct hv_input_dev_info));
+
+ /*
+@@ -319,7 +319,7 @@ static void mousevsc_on_receive(struct h
+ mousevsc_on_receive_device_info(input_dev,
+ (struct synthhid_device_info *)&pipe_msg->data[0]);
+ break;
+- case SynthHidInputReport:
++ case SYNTH_HID_INPUT_REPORT:
+ mousevsc_on_receive_input_report(input_dev,
+ (struct synthhid_input_report *)&pipe_msg->data[0]);
+
+@@ -425,10 +425,10 @@ static int mousevsc_connect_to_vsp(struc
+ */
+ memset(request, 0, sizeof(struct mousevsc_prt_msg));
+
+- request->type = PipeMessageData;
++ request->type = PIPE_MESSAGE_DATA;
+ request->size = sizeof(struct synthhid_protocol_request);
+
+- request->request.header.type = SynthHidProtocolRequest;
++ request->request.header.type = SYNTH_HID_PROTOCOL_REQUEST;
+ request->request.header.size = sizeof(unsigned int);
+ request->request.version_requested.version = SYNTHHID_INPUT_VERSION;
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0599-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_receiv.patch b/patches.suse/staging-hv-staging-next-20111001-0599-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_receiv.patch
new file mode 100644
index 0000000000..3a2f113fc6
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0599-Staging-hv-mousevsc-Get-rid-of-mousevsc_on_receiv.patch
@@ -0,0 +1,64 @@
+From 6e56f27c09ec695fd0091476772e38fe9ccaa5a9 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:55:01 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of mousevsc_on_receive_input_report() by inlining
+
+Get rid of mousevsc_on_receive_input_report() 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/hv_mouse.c | 27 ++++++++-------------------
+ 1 file changed, 8 insertions(+), 19 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -270,28 +270,13 @@ cleanup:
+ complete(&input_device->wait_event);
+ }
+
+-static void mousevsc_on_receive_input_report(struct mousevsc_dev *input_device,
+- struct synthhid_input_report *input_report)
+-{
+- struct hv_driver *input_drv;
+-
+- if (!input_device->init_complete)
+- return;
+-
+- input_drv = drv_to_hv_drv(input_device->device->device.driver);
+-
+-
+- hid_input_report(input_device->hid_device,
+- HID_INPUT_REPORT, input_report->buffer, input_report->header.size, 1);
+-
+-}
+-
+ static void mousevsc_on_receive(struct hv_device *device,
+ struct vmpacket_descriptor *packet)
+ {
+ struct pipe_prt_msg *pipe_msg;
+ struct synthhid_msg *hid_msg;
+ struct mousevsc_dev *input_dev = hv_get_drvdata(device);
++ struct synthhid_input_report *input_report;
+
+ pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
+ (packet->offset8 << 3));
+@@ -320,9 +305,13 @@ static void mousevsc_on_receive(struct h
+ (struct synthhid_device_info *)&pipe_msg->data[0]);
+ break;
+ case SYNTH_HID_INPUT_REPORT:
+- mousevsc_on_receive_input_report(input_dev,
+- (struct synthhid_input_report *)&pipe_msg->data[0]);
+-
++ input_report =
++ (struct synthhid_input_report *)&pipe_msg->data[0];
++ if (!input_dev->init_complete)
++ break;
++ hid_input_report(input_dev->hid_device,
++ HID_INPUT_REPORT, input_report->buffer,
++ input_report->header.size, 1);
+ break;
+ default:
+ pr_err("unsupported hid msg type - type %d len %d",
diff --git a/patches.suse/staging-hv-staging-next-20111001-0600-Staging-hv-mousevsc-Cleanup-mousevsc_on_device_ad.patch b/patches.suse/staging-hv-staging-next-20111001-0600-Staging-hv-mousevsc-Cleanup-mousevsc_on_device_ad.patch
new file mode 100644
index 0000000000..4b21af1224
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0600-Staging-hv-mousevsc-Cleanup-mousevsc_on_device_ad.patch
@@ -0,0 +1,50 @@
+From 929ad795f0a8d3419ea19c76d7c13ebb96c49286 Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:55:02 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Cleanup mousevsc_on_device_add()
+
+Cleanup mousevsc_on_device_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/hv_mouse.c | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -513,12 +513,10 @@ static void reportdesc_callback(struct h
+ input_device->hid_device = hid_dev;
+ }
+
+-static int mousevsc_on_device_add(struct hv_device *device,
+- void *additional_info)
++static int mousevsc_on_device_add(struct hv_device *device)
+ {
+ int ret = 0;
+ struct mousevsc_dev *input_dev;
+- struct hv_driver *input_drv;
+
+ input_dev = alloc_input_device(device);
+
+@@ -551,9 +549,6 @@ static int mousevsc_on_device_add(struct
+ return ret;
+ }
+
+- input_drv = drv_to_hv_drv(input_dev->device->device.driver);
+-
+-
+
+ /* Send the report desc back up */
+ /* workaround SA-167 */
+@@ -573,7 +568,7 @@ static int mousevsc_probe(struct hv_devi
+ {
+
+ /* Call to the vsc driver to add the device */
+- return mousevsc_on_device_add(dev, NULL);
++ return mousevsc_on_device_add(dev);
+
+ }
+
diff --git a/patches.suse/staging-hv-staging-next-20111001-0601-Staging-hv-mousevsc-Enable-autoloading-of-the-mou.patch b/patches.suse/staging-hv-staging-next-20111001-0601-Staging-hv-mousevsc-Enable-autoloading-of-the-mou.patch
new file mode 100644
index 0000000000..f802807e34
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0601-Staging-hv-mousevsc-Enable-autoloading-of-the-mou.patch
@@ -0,0 +1,29 @@
+From 1eadd8c286824ab50298bc6c828d4984bd297e9f Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:55:03 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Enable autoloading of the mouse driver
+
+Now that the mouse driver is functional, enable the auto-loading of the 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 | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -596,10 +596,7 @@ static const struct hv_vmbus_device_id i
+ { },
+ };
+
+-/*
+- * The mouse driver is not functional; do not auto-load it.
+- */
+-/* MODULE_DEVICE_TABLE(vmbus, id_table); */
++MODULE_DEVICE_TABLE(vmbus, id_table);
+
+ static struct hv_driver mousevsc_drv = {
+ .name = "mousevsc",
diff --git a/patches.suse/staging-hv-staging-next-20111001-0602-Staging-hv-mousevsc-Get-rid-of-unnecessary-commen.patch b/patches.suse/staging-hv-staging-next-20111001-0602-Staging-hv-mousevsc-Get-rid-of-unnecessary-commen.patch
new file mode 100644
index 0000000000..4146056b91
--- /dev/null
+++ b/patches.suse/staging-hv-staging-next-20111001-0602-Staging-hv-mousevsc-Get-rid-of-unnecessary-commen.patch
@@ -0,0 +1,111 @@
+From 41598a0b718d31db6782a87ac5049ccfb56121db Mon Sep 17 00:00:00 2001
+From: K. Y. Srinivasan <kys@microsoft.com>
+Date: Thu, 29 Sep 2011 11:55:04 -0700
+Patch-mainline: staging-next-20111001 ?
+Subject: [PATCH] Staging: hv: mousevsc: Get rid of unnecessary comments
+
+Get rid of 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/hv_mouse.c | 21 ---------------------
+ 1 file changed, 21 deletions(-)
+
+--- a/drivers/staging/hv/hv_mouse.c
++++ b/drivers/staging/hv/hv_mouse.c
+@@ -26,9 +26,6 @@
+ #include "hyperv.h"
+
+
+-/*
+- * Data types
+- */
+ struct hv_input_dev_info {
+ unsigned int size;
+ unsigned short vendor;
+@@ -137,9 +134,6 @@ struct pipe_prt_msg {
+ char data[1];
+ };
+
+-/*
+- * Data types
+- */
+ struct mousevsc_prt_msg {
+ enum pipe_prot_msg_type type;
+ u32 size;
+@@ -206,11 +200,9 @@ static void mousevsc_on_receive_device_i
+ /* Assume success for now */
+ input_device->dev_info_status = 0;
+
+- /* Save the device attr */
+ memcpy(&input_device->hid_dev_info, &device_info->hid_dev_info,
+ sizeof(struct hv_input_dev_info));
+
+- /* Save the hid desc */
+ desc = &device_info->hid_descriptor;
+ WARN_ON(desc->bLength == 0);
+
+@@ -221,7 +213,6 @@ static void mousevsc_on_receive_device_i
+
+ memcpy(input_device->hid_desc, desc, desc->bLength);
+
+- /* Save the report desc */
+ input_device->report_desc_size = desc->desc[0].wDescriptorLength;
+ if (input_device->report_desc_size == 0)
+ goto cleanup;
+@@ -368,10 +359,6 @@ static void mousevsc_on_channel_callback
+ bufferlen = packetSize;
+ }
+ } else {
+- /*
+- * pr_debug("nothing else to read...");
+- * reset
+- */
+ if (bufferlen > packetSize) {
+ kfree(buffer);
+
+@@ -388,8 +375,6 @@ static void mousevsc_on_channel_callback
+ if (buffer == NULL) {
+ buffer = packet;
+ bufferlen = packetSize;
+-
+- /* Try again next time around */
+ break;
+ }
+ }
+@@ -409,9 +394,6 @@ static int mousevsc_connect_to_vsp(struc
+
+ request = &input_dev->protocol_req;
+
+- /*
+- * Now, initiate the vsc/vsp initialization protocol on the open channel
+- */
+ memset(request, 0, sizeof(struct mousevsc_prt_msg));
+
+ request->type = PIPE_MESSAGE_DATA;
+@@ -525,7 +507,6 @@ static int mousevsc_on_device_add(struct
+
+ input_dev->init_complete = false;
+
+- /* Open the channel */
+ ret = vmbus_open(device->channel,
+ INPUTVSC_SEND_RING_BUFFER_SIZE,
+ INPUTVSC_RECV_RING_BUFFER_SIZE,
+@@ -550,7 +531,6 @@ static int mousevsc_on_device_add(struct
+ }
+
+
+- /* Send the report desc back up */
+ /* workaround SA-167 */
+ if (input_dev->report_desc[14] == 0x25)
+ input_dev->report_desc[14] = 0x29;
+@@ -567,7 +547,6 @@ static int mousevsc_probe(struct hv_devi
+ const struct hv_vmbus_device_id *dev_id)
+ {
+
+- /* Call to the vsc driver to add the device */
+ return mousevsc_on_device_add(dev);
+
+ }
diff --git a/patches.suse/staging-hv-storvsc-ignore-SET_WINDOW.patch b/patches.suse/staging-hv-storvsc-ignore-SET_WINDOW.patch
new file mode 100644
index 0000000000..6bde4d3fb3
--- /dev/null
+++ b/patches.suse/staging-hv-storvsc-ignore-SET_WINDOW.patch
@@ -0,0 +1,50 @@
+Subject: staging: hv: storvsc: ignore SET_WINDOWN scsi command
+References: bnc#722646
+From: <ohering@suse.de>
+Patch-mainline: obsolete
+
+commands sent by smartd will offline the device.
+
+
+Signed-off-by: Olaf Hering <olaf@aepfle.de>
+
+---
+ drivers/staging/hv/storvsc_drv.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1122,6 +1122,22 @@ static void storvsc_command_completion(s
+ kmem_cache_free(host_dev->request_pool, cmd_request);
+ }
+
++static bool storvsc_check_scsi_cmd(struct scsi_cmnd *scmnd)
++{
++ bool allowed = true;
++ u8 scsi_op = scmnd->cmnd[0];
++
++ switch (scsi_op) {
++ /* smartd sends this command, which will offline the device */
++ case SET_WINDOW:
++ scmnd->result = DID_ERROR << 16;
++ allowed = false;
++ break;
++ default:
++ break;
++ }
++ return allowed;
++}
+
+ /*
+ * storvsc_queuecommand - Initiate command processing
+@@ -1141,6 +1157,10 @@ static int storvsc_queuecommand_lck(stru
+ unsigned int sg_count = 0;
+ struct vmscsi_request *vm_srb;
+
++ if (storvsc_check_scsi_cmd(scmnd) == false) {
++ done(scmnd);
++ return 0;
++ }
+
+ /* If retrying, no need to prep the cmd */
+ if (scmnd->host_scribble) {
diff --git a/patches.suse/staging-hv-storvsc-module-name.patch b/patches.suse/staging-hv-storvsc-module-name.patch
new file mode 100644
index 0000000000..edf7bef9ff
--- /dev/null
+++ b/patches.suse/staging-hv-storvsc-module-name.patch
@@ -0,0 +1,40 @@
+From: <ohering@suse.de>
+Subject: staging/hv: advertise hv_storvsc instead of storvsc as sysfs driver name
+References: bnc#716708
+Patch-mainline: 3.4.2 ?
+
+---
+ drivers/staging/hv/storvsc_drv.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1105,7 +1105,7 @@ static void storvsc_command_completion(s
+ if (scmnd->result) {
+ if (scsi_normalize_sense(scmnd->sense_buffer,
+ SCSI_SENSE_BUFFERSIZE, &sense_hdr))
+- scsi_print_sense_hdr("storvsc", &sense_hdr);
++ scsi_print_sense_hdr(KBUILD_MODNAME, &sense_hdr);
+ }
+
+ scsi_set_resid(scmnd,
+@@ -1274,8 +1274,8 @@ static DEF_SCSI_QCMD(storvsc_queuecomman
+ /* Scsi driver */
+ static struct scsi_host_template scsi_driver = {
+ .module = THIS_MODULE,
+- .name = "hv_storvsc",
+- .proc_name = "hv_storvsc",
++ .name = KBUILD_MODNAME,
++ .proc_name = KBUILD_MODNAME,
+ .bios_param = storvsc_get_chs,
+ .queuecommand = storvsc_queuecommand,
+ .eh_host_reset_handler = storvsc_host_reset_handler,
+@@ -1419,7 +1419,7 @@ err_out:
+ /* The one and only one */
+
+ static struct hv_driver storvsc_drv = {
+- .name = "storvsc",
++ .name = KBUILD_MODNAME,
+ .id_table = id_table,
+ .probe = storvsc_probe,
+ .remove = storvsc_remove,
diff --git a/patches.suse/staging-hv-storvsc-scsi-proc_name.patch b/patches.suse/staging-hv-storvsc-scsi-proc_name.patch
new file mode 100644
index 0000000000..56ab18d43b
--- /dev/null
+++ b/patches.suse/staging-hv-storvsc-scsi-proc_name.patch
@@ -0,0 +1,26 @@
+Subject: staging/hv: fill scsi/proc_name for the sake of mkinitrd
+From: <ohering@suse.de>
+Patch-mainline: 3.4.2 ?
+References: bnc#716708
+
+mkinitrd relies on /sys/class/scsi_host/*/proc_name instead of
+/sys/block/sd*/device/../../../moalias to get the scsi driver module
+name.
+As a fallback the sysfs driver name could be used, which does not match
+the module name either ('storvsc' vs. 'hv_storvsc').
+---
+ drivers/staging/hv/storvsc_drv.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/hv/storvsc_drv.c
++++ b/drivers/staging/hv/storvsc_drv.c
+@@ -1274,7 +1274,8 @@ static DEF_SCSI_QCMD(storvsc_queuecomman
+ /* Scsi driver */
+ static struct scsi_host_template scsi_driver = {
+ .module = THIS_MODULE,
+- .name = "storvsc_host_t",
++ .name = "hv_storvsc",
++ .proc_name = "hv_storvsc",
+ .bios_param = storvsc_get_chs,
+ .queuecommand = storvsc_queuecommand,
+ .eh_host_reset_handler = storvsc_host_reset_handler,
diff --git a/patches.suse/staging-hv-util-fix-a-bug-in-kvp-implementation.patch b/patches.suse/staging-hv-util-fix-a-bug-in-kvp-implementation.patch
new file mode 100644
index 0000000000..37147c282f
--- /dev/null
+++ b/patches.suse/staging-hv-util-fix-a-bug-in-kvp-implementation.patch
@@ -0,0 +1,82 @@
+Subject: [PATCH 1/1] Staging: hv: util: Fix a bug in kvp implementation
+Message-Id: <1317762002-4351-1-git-send-email-kys@microsoft.com>
+From: <ohering@suse.de>
+Patch-mainline: Submitted staging-next 20111009
+
+The host gurantees that there can be only one kvp transaction active
+against the guest. So, the transaction active state is needed only to
+protect against spurious user level calls. The current code had a race
+condition where the guest could prematurely return because the previous
+transaction state was not cleared - this state was being cleared after
+sending the response to the host and there was a window where the host
+could notify the guest of a new transaction before the transaction active
+state was properly set.
+Also deal with the case when the user mode component
+does not respond in a timely fashion correctly.
+I would like to thank Long Li <longli@microsoft.com>
+for identifying the problem.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+Diagnosed-by: Long Li <longli@microsoft.com>
+---
+ drivers/staging/hv/hv_kvp.c | 13 +++++--------
+ 1 file changed, 5 insertions(+), 8 deletions(-)
+
+--- a/drivers/staging/hv/hv_kvp.c
++++ b/drivers/staging/hv/hv_kvp.c
+@@ -50,6 +50,8 @@ static struct {
+
+ static int kvp_send_key(int index);
+
++#define TIMEOUT_FIRED 1
++
+ static void kvp_respond_to_host(char *key, char *value, int error);
+ static void kvp_work_func(struct work_struct *dummy);
+ static void kvp_register(void);
+@@ -58,7 +60,6 @@ static DECLARE_DELAYED_WORK(kvp_work, kv
+
+ static struct cb_id kvp_id = { CN_KVP_IDX, CN_KVP_VAL };
+ static const char kvp_name[] = "kvp_kernel_module";
+-static int timeout_fired;
+ static u8 *recv_buffer;
+ /*
+ * Register the kernel component with the user-level daemon.
+@@ -90,8 +91,7 @@ kvp_work_func(struct work_struct *dummy)
+ * If the timer fires, the user-mode component has not responded;
+ * process the pending transaction.
+ */
+- kvp_respond_to_host("Unknown key", "Guest timed out", timeout_fired);
+- timeout_fired = 1;
++ kvp_respond_to_host("Unknown key", "Guest timed out", TIMEOUT_FIRED);
+ }
+
+ /*
+@@ -177,6 +177,8 @@ kvp_respond_to_host(char *key, char *val
+ channel = kvp_transaction.recv_channel;
+ req_id = kvp_transaction.recv_req_id;
+
++ kvp_transaction.active = false;
++
+ if (channel->onchannel_callback == NULL)
+ /*
+ * We have raced with util driver being unloaded;
+@@ -224,7 +226,6 @@ response_done:
+ vmbus_sendpacket(channel, recv_buffer, buf_len, req_id,
+ VM_PKT_DATA_INBAND, 0);
+
+- kvp_transaction.active = false;
+ }
+
+ /*
+@@ -250,10 +251,6 @@ void hv_kvp_onchannelcallback(void *cont
+ struct icmsg_negotiate *negop = NULL;
+
+
+- if (kvp_transaction.active)
+- return;
+-
+-
+ vmbus_recvpacket(channel, recv_buffer, PAGE_SIZE, &recvlen, &requestid);
+
+ if (recvlen > 0) {
diff --git a/patches.suse/staging-hv-util-invoke-cn_netlink_send-in-a-work-context.patch b/patches.suse/staging-hv-util-invoke-cn_netlink_send-in-a-work-context.patch
new file mode 100644
index 0000000000..53a56ef2e6
--- /dev/null
+++ b/patches.suse/staging-hv-util-invoke-cn_netlink_send-in-a-work-context.patch
@@ -0,0 +1,92 @@
+Subject: [PATCH 1/1] Staging: hv: util: Invoke cn_netlink_send() in a work context
+Message-Id: <1318214548-22572-1-git-send-email-kys@microsoft.com>
+From: <ohering@suse.de>
+Patch-mainline: Submitted staging-next 20111009
+
+Invoke cn_netlink_send() in a work context as opposed being called
+in the context of channel callback. On entry into the channel callback
+code the channel inbound spin lock is held and deferring to a work
+context avoids having to invoke cn_netlink_send() while holding
+the inbound lock. As part of this adjustment, also increase the
+timeout value for waiting for the user level component of KVP.
+
+Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
+Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
+---
+ drivers/staging/hv/hv_kvp.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+--- a/drivers/staging/hv/hv_kvp.c
++++ b/drivers/staging/hv/hv_kvp.c
+@@ -44,11 +44,12 @@
+ static struct {
+ bool active; /* transaction status - active or not */
+ int recv_len; /* number of bytes received. */
++ int index; /* current index */
+ struct vmbus_channel *recv_channel; /* chn we got the request */
+ u64 recv_req_id; /* request ID. */
+ } kvp_transaction;
+
+-static int kvp_send_key(int index);
++static void kvp_send_key(struct work_struct *dummy);
+
+ #define TIMEOUT_FIRED 1
+
+@@ -57,6 +58,7 @@ static void kvp_work_func(struct work_st
+ static void kvp_register(void);
+
+ static DECLARE_DELAYED_WORK(kvp_work, kvp_work_func);
++static DECLARE_WORK(kvp_sendkey_work, kvp_send_key);
+
+ static struct cb_id kvp_id = { CN_KVP_IDX, CN_KVP_VAL };
+ static const char kvp_name[] = "kvp_kernel_module";
+@@ -121,10 +123,11 @@ kvp_cn_callback(struct cn_msg *msg, stru
+ }
+ }
+
+-static int
+-kvp_send_key(int index)
++static void
++kvp_send_key(struct work_struct *dummy)
+ {
+ struct cn_msg *msg;
++ int index = kvp_transaction.index;
+
+ msg = kzalloc(sizeof(*msg) + sizeof(struct hv_kvp_msg) , GFP_ATOMIC);
+
+@@ -136,9 +139,8 @@ kvp_send_key(int index)
+ msg->len = sizeof(struct hv_ku_msg);
+ cn_netlink_send(msg, 0, GFP_ATOMIC);
+ kfree(msg);
+- return 0;
+ }
+- return 1;
++ return;
+ }
+
+ /*
+@@ -286,6 +288,7 @@ void hv_kvp_onchannelcallback(void *cont
+ kvp_transaction.recv_channel = channel;
+ kvp_transaction.recv_req_id = requestid;
+ kvp_transaction.active = true;
++ kvp_transaction.index = kvp_data->index;
+
+ /*
+ * Get the information from the
+@@ -296,8 +299,8 @@ void hv_kvp_onchannelcallback(void *cont
+ * Set a timeout to deal with
+ * user-mode not responding.
+ */
+- kvp_send_key(kvp_data->index);
+- schedule_delayed_work(&kvp_work, 100);
++ schedule_work(&kvp_sendkey_work);
++ schedule_delayed_work(&kvp_work, 5*HZ);
+
+ return;
+
+@@ -332,4 +335,5 @@ void hv_kvp_deinit(void)
+ {
+ cn_del_callback(&kvp_id);
+ cancel_delayed_work_sync(&kvp_work);
++ cancel_work_sync(&kvp_sendkey_work);
+ }
diff --git a/patches.xen/xen3-patch-2.6.32 b/patches.xen/xen3-patch-2.6.32
index 5df02442c0..703b9af2fe 100644
--- a/patches.xen/xen3-patch-2.6.32
+++ b/patches.xen/xen3-patch-2.6.32
@@ -6279,8 +6279,8 @@ Automatically created from "patches.kernel.org/patch-2.6.32" by xen-port-patches
@@ -1,6 +1,6 @@
config HYPERV
tristate "Microsoft Hyper-V client drivers"
-- depends on X86 && ACPI && PCI && m
-+ depends on X86 && ACPI && PCI && !XEN && m
+- depends on X86 && ACPI && PCI
++ depends on X86 && ACPI && PCI && !XEN
default n
help
Select this option to run Linux as a Hyper-V client operating
diff --git a/series.conf b/series.conf
index 9b9ce0705f..8ea7e53f96 100644
--- a/series.conf
+++ b/series.conf
@@ -550,8 +550,68 @@
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-vmbus-modalias-show.patch
+ patches.suse/staging-hv-staging-next-20111001-0051-Staging-hv-util-Deal-with-driver-register-failure.patch
+ patches.suse/staging-hv-staging-next-20111001-0052-Staging-hv-vmbus-Fix-a-bug-in-error-handling-in-v.patch
+ patches.suse/staging-hv-staging-next-20111001-0053-Staging-hv-vmbus-Check-for-events-before-messages.patch
+ patches.suse/staging-hv-staging-next-20111001-0054-Staging-hv-vmbus-Cleanup-the-code-in-process_chn_.patch
+ patches.suse/staging-hv-staging-next-20111001-0055-staging-hv-remove-unnecessary-includes-in-netvsc.patch
+ patches.suse/staging-hv-staging-next-20111001-0056-staging-hv-add-newline-to-log-messages-in-netvsc.patch
+ patches.suse/staging-hv-staging-next-20111001-0057-staging-hv-convert-dev_-loglevel-to-netdev_-logle.patch
+ patches.suse/staging-hv-staging-next-20111001-0058-staging-hv-fix-a-kernel-warning-in-netvsc_linkstat.patch
+ patches.suse/staging-hv-staging-next-20111001-0059-staging-hv-re-order-the-code-in-netvsc_probe.patch
+ patches.suse/staging-hv-staging-next-20111001-0060-staging-hv-fix-counting-of-outstanding-sends-in-f.patch
+ patches.suse/staging-hv-staging-next-20111001-0061-staging-hv-fix-counting-of-available-buffer-slots.patch
+ patches.suse/staging-hv-staging-next-20111001-0062-staging-hv-fix-the-return-status-of-netvsc_start_x.patch
+ patches.suse/staging-hv-staging-next-20111001-0063-staging-hv-fix-the-page-buffer-when-rndis-data-go.patch
+ patches.suse/staging-hv-staging-next-20111001-0064-staging-hv-fix-some-typos-in-netvsc.c.patch
+ patches.suse/staging-hv-staging-next-20111001-0065-Staging-hv-Update-TODO-file.patch
+ patches.suse/staging-hv-staging-next-20111001-0066-Staging-hv-vmbus-Show-the-modalias-in-sys-bus-vm.patch
+ patches.suse/staging-hv-staging-next-20111001-0129-Staging-hv-Add-support-for-2-TB-LUN-in-storage-dr.patch
+ patches.suse/staging-hv-staging-next-20111001-0243-Staging-hv-vmbus-Rename-vmbus_child_device_create.patch
+ patches.suse/staging-hv-staging-next-20111001-0244-Staging-hv-vmbus-Rename-vmbus_child_device_regist.patch
+ patches.suse/staging-hv-staging-next-20111001-0245-Staging-hv-vmbus-Rename-vmbus_child_device_unregi.patch
+ patches.suse/staging-hv-staging-next-20111001-0246-Staging-hv-vmbus-Cleanup-dated-comments-in-channe.patch
+ patches.suse/staging-hv-staging-next-20111001-0293-Staging-hv-vmbus-Introduce-a-utility-function-to.patch
+ patches.suse/staging-hv-staging-next-20111001-0294-Staging-hv-vmbus-Change-the-signature-of-struct-h.patch
+ patches.suse/staging-hv-staging-next-20111001-0295-Staging-hv-storvsc-Use-the-driver_data-to-identif.patch
+ patches.suse/staging-hv-staging-next-20111001-0296-Staging-hv-vmbus-Introduce-functions-for-setting.patch
+ patches.suse/staging-hv-staging-next-20111001-0297-Staging-hv-vmbus-Cleanup-vmbus_remove.patch
+ patches.suse/staging-hv-staging-next-20111001-0298-Staging-hv-storvsc-Get-rid-of-storvsc_dev_add-b.patch
+ patches.suse/staging-hv-staging-next-20111001-0299-Staging-hv-storvsc-Get-rid-of-alloc_stor_device.patch
+ patches.suse/staging-hv-staging-next-20111001-0300-Staging-hv-storvsc-Get-rid-of-some-unnecessary-st.patch
+ patches.suse/staging-hv-staging-next-20111001-0301-Staging-hv-storvsc-Eliminate-the-usage-of-ext-fie.patch
+ patches.suse/staging-hv-staging-next-20111001-0302-Staging-hv-netvsc-Get-rid-of-the-usage-of-the-ext.patch
+ patches.suse/staging-hv-staging-next-20111001-0303-Staging-hv-mousevsc-Get-rid-of-the-usage-of-the-e.patch
+ patches.suse/staging-hv-staging-next-20111001-0304-Staging-hv-vmbus-Get-rid-of-the-ext-field-in-stru.patch
+ patches.suse/staging-hv-staging-next-20111001-0305-Staging-hv-vmbus-Do-not-allocate-struct-hv_device.patch
+ patches.suse/staging-hv-staging-next-20111001-0306-Staging-hv-vmbus-Get-rid-of-the-module-dependency.patch
+ patches.suse/staging-hv-staging-next-20111001-0307-Staging-hv-netvsc-Rename-netDevice-as-net_device.patch
+ patches.suse/staging-hv-staging-next-20111001-0308-Staging-hv-netvsc-Rename-rndisDevice-to-rndis_dev.patch
+ patches.suse/staging-hv-staging-next-20111001-0309-Staging-hv-netvsc-Rename-deviceInfo-as-device_inf.patch
+ patches.suse/staging-hv-staging-next-20111001-0310-Staging-hv-netvsc-Cleanup-the-name-and-type-of-li.patch
+ patches.suse/staging-hv-staging-next-20111001-0421-Staging-hv-util-Perform-some-service-specific-ini.patch
+ patches.suse/staging-hv-staging-next-20111001-0422-Staging-hv-util-Properly-handle-util-services-in.patch
+ patches.suse/staging-hv-staging-next-20111001-0423-Staging-hv-vmbus-Get-rid-of-hv_cb_utils-and-oth.patch
+ patches.suse/staging-hv-staging-next-20111001-0476-Staging-hv-Update-the-TODO-file.patch
+ patches.suse/staging-hv-staging-next-20111001-0479-staging-hv-remove-the-carrier-status-check-from-ne.patch
+ patches.suse/staging-hv-staging-next-20111001-0579-Staging-hv-mousevsc-Fixup-struct-hv_input_dev_inf.patch
+ patches.suse/staging-hv-staging-next-20111001-0580-Staging-hv-mousevsc-Get-rid-of-the-struct-input_d.patch
+ patches.suse/staging-hv-staging-next-20111001-0581-Staging-hv-mousevsc-Fixup-some-bogus-WARN_ON-ca.patch
+ patches.suse/staging-hv-staging-next-20111001-0582-Staging-hv-mousevsc-Change-the-allocation-flags-t.patch
+ patches.suse/staging-hv-staging-next-20111001-0583-Staging-hv-mousevsc-Handle-the-case-where-we-may.patch
+ patches.suse/staging-hv-staging-next-20111001-0584-Staging-hv-mousevsc-Correctly-initialize-the-head.patch
+
+ patches.suse/staging-hv-util-fix-a-bug-in-kvp-implementation.patch
+ patches.suse/staging-hv-util-invoke-cn_netlink_send-in-a-work-context.patch
+ patches.suse/staging-hv-netvsc-rndis_filter_receive-dereferencing-issue.patch
+
+ patches.suse/staging-hv-storvsc-scsi-proc_name.patch
+ patches.suse/staging-hv-netvsc-module-name.patch
+ patches.suse/staging-hv-storvsc-module-name.patch
patches.suse/staging-hv-pata_piix-ignore-disks.patch
+ patches.suse/staging-hv-bind-hv_blkkvsc-to-hv_storvsc.patch
+ patches.suse/staging-hv-storvsc-ignore-SET_WINDOW.patch
+
patches.fixes/parport-mutex
patches.suse/no-partition-scan