Mon Mar 5 16:53:59 2012 UTC ()
As per xpci_conf_read, use size argument in xpci_conf_write.


(jakllsch)
diff -r1.10 -r1.11 src/sys/arch/xen/xen/xpci_xenbus.c

cvs diff -r1.10 -r1.11 src/sys/arch/xen/xen/xpci_xenbus.c (expand / switch to unified diff)

--- src/sys/arch/xen/xen/xpci_xenbus.c 2012/02/02 19:43:01 1.10
+++ src/sys/arch/xen/xen/xpci_xenbus.c 2012/03/05 16:53:59 1.11
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: xpci_xenbus.c,v 1.10 2012/02/02 19:43:01 tls Exp $ */ 1/* $NetBSD: xpci_xenbus.c,v 1.11 2012/03/05 16:53:59 jakllsch Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2009 Manuel Bouyer. 4 * Copyright (c) 2009 Manuel Bouyer.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -16,27 +16,27 @@ @@ -16,27 +16,27 @@
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 * 25 *
26 */ 26 */
27 27
28#include <sys/cdefs.h> 28#include <sys/cdefs.h>
29__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.10 2012/02/02 19:43:01 tls Exp $"); 29__KERNEL_RCSID(0, "$NetBSD: xpci_xenbus.c,v 1.11 2012/03/05 16:53:59 jakllsch Exp $");
30 30
31#include "opt_xen.h" 31#include "opt_xen.h"
32 32
33 33
34#include <sys/types.h> 34#include <sys/types.h>
35#include <sys/param.h> 35#include <sys/param.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37#include <sys/errno.h> 37#include <sys/errno.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/kernel.h> 39#include <sys/kernel.h>
40#include <sys/bus.h> 40#include <sys/bus.h>
41 41
42#include <uvm/uvm_extern.h> 42#include <uvm/uvm_extern.h>
@@ -489,27 +489,27 @@ static int @@ -489,27 +489,27 @@ static int
489xpci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, int size, 489xpci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, int size,
490 pcireg_t data) 490 pcireg_t data)
491{ 491{
492 int bus, dev, func; 492 int bus, dev, func;
493 struct xen_pci_op op = { 493 struct xen_pci_op op = {
494 .cmd = XEN_PCI_OP_conf_write, 494 .cmd = XEN_PCI_OP_conf_write,
495 .domain = 0, /* XXX */ 495 .domain = 0, /* XXX */
496 }; 496 };
497 pci_decompose_tag(pc, tag, &bus, &dev, &func); 497 pci_decompose_tag(pc, tag, &bus, &dev, &func);
498 DPRINTF(("pci_conf_write %d:%d:%d reg 0x%x val 0x%x", bus, dev, func, reg, data)); 498 DPRINTF(("pci_conf_write %d:%d:%d reg 0x%x val 0x%x", bus, dev, func, reg, data));
499 op.bus = bus; 499 op.bus = bus;
500 op.devfn = (dev << 3) | func; 500 op.devfn = (dev << 3) | func;
501 op.offset = reg; 501 op.offset = reg;
502 op.size = 4; 502 op.size = size;
503 op.value = data; 503 op.value = data;
504 xpci_do_op(&op); 504 xpci_do_op(&op);
505 DPRINTF((" err %d\n", op.err)); 505 DPRINTF((" err %d\n", op.err));
506 return op.err; 506 return op.err;
507} 507}
508 508
509void 509void
510pci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t data) 510pci_conf_write(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t data)
511{ 511{
512 /* as for read we have to work around linux limitations */ 512 /* as for read we have to work around linux limitations */
513 switch (reg) { 513 switch (reg) {
514#if 0 514#if 0
515 case 0x0004: 515 case 0x0004: