From b9c1ff2fb637531acea7cd6a3b550f16266210e1 Mon Sep 17 00:00:00 2001
From: Michael S. Tsirkin <mst@redhat.com>
Date: Wed, 7 Apr 2010 11:20:11 -0300
Subject: [PATCH 6/6] pcnet: make subsystem vendor id match hardware

RH-Author: Michael S. Tsirkin <mst@redhat.com>
Message-id: <patch-8412-clone-for-rhel6-rhel6>
Patchwork-id: 8420
O-Subject: [PATCHv2] pcnet: make subsystem vendor id match hardware
Bugzilla: 580140
RH-Acked-by: Juan Quintela <quintela@redhat.com>
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
RH-Acked-by: Markus Armbruster <armbru@redhat.com>

Real pcnet device (AT2450) apparently has subsystem
device and vendor id set to 0, this is out of spec
(which requires that vendor id is obtained from PCI SIG)
but windows xp driver seems to need this in order
to associate.

qemu sets pci subsystem id to qumranet/qemu
since d350d97d196a632b6c7493acf07a061017fc6f7d,
debian does not yet have this patch.

https://bugzilla.redhat.com/show_bug.cgi?id=521247

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
(cherry-picked from 7a7e5db99399dd5e17fc75036577f822a516b504)
---

Changes from v1: fix build errors reported by Kevin.

 qemu/hw/pcnet.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/pcnet.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/pcnet.c b/hw/pcnet.c
index 138fbc6..0afc46d 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -1991,6 +1991,9 @@ static int pci_pcnet_init(PCIDevice *pci_dev)
     *(uint32_t *)&pci_conf[0x10] = cpu_to_le32(0x00000001);
     *(uint32_t *)&pci_conf[0x14] = cpu_to_le32(0x00000000);
 
+    *(uint16_t *)&pci_conf[0x2c] = 0x0;
+    *(uint16_t *)&pci_conf[0x2e] = 0x0;
+
     pci_conf[0x3d] = 1; // interrupt pin 0
     pci_conf[0x3e] = 0x06;
     pci_conf[0x3f] = 0xff;
-- 
1.7.0.3

