[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tyndur-devel] [PATCH] pci: Klasse und Revision richtig einlesen
! pci: Richtigen Offset fuer Klasse eingetragen, dann funktioniert das
auch wie erwartet.
! pci: Klasse und Revision sind jeweils nur ein Word und kein DWord
---
src/modules/pci/include/pcihw.h | 37 ++++++++++++++++++++++++++++++++++++-
src/modules/pci/pcihw.c | 6 +++---
2 files changed, 39 insertions(+), 4 deletions(-)
diff --git a/src/modules/pci/include/pcihw.h b/src/modules/pci/include/pcihw.h
index b2579ad..1cfa3ce 100644
--- a/src/modules/pci/include/pcihw.h
+++ b/src/modules/pci/include/pcihw.h
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 2007-2009 The tyndur Project. All rights reserved.
+ *
+ * This code is derived from software contributed to the tyndur Project
+ * by Kevin Wolf.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the tyndur Project
+ * and its contributors.
+ * 4. Neither the name of the tyndur Project nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
#ifndef _PCI_HW_
#define _PCI_HW_
@@ -9,7 +44,7 @@
#define PCI_COMMAND 0x04
#define PCI_STATUS 0x06
#define PCI_REVISION 0x08
-#define PCI_CLASS 0x09
+#define PCI_CLASS 0x0A
#define PCI_HEADERTYPE 0x0E
#define PCI_BAR0 0x10
#define PCI_INTERRUPT 0x3C
diff --git a/src/modules/pci/pcihw.c b/src/modules/pci/pcihw.c
index 4013617..05189e9 100644
--- a/src/modules/pci/pcihw.c
+++ b/src/modules/pci/pcihw.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2007 The tyndur Project. All rights reserved.
+ * Copyright (c) 2007-2009 The tyndur Project. All rights reserved.
*
* This code is derived from software contributed to the tyndur Project
* by Kevin Wolf.
@@ -213,8 +213,8 @@ struct pci_device pci_get_device(dword bus, dword device, dword func)
.vendor_id = pci_config_read_word(bus, device, func, PCI_VENDOR_ID),
.device_id = pci_config_read_word(bus, device, func, PCI_DEVICE_ID),
- .class_id = pci_config_read_dword(bus, device, func, PCI_CLASS),
- .rev_id = pci_config_read_dword(bus, device, func, PCI_REVISION),
+ .class_id = pci_config_read_word(bus, device, func, PCI_CLASS),
+ .rev_id = pci_config_read_word(bus, device, func, PCI_REVISION),
.irq = pci_config_read_byte(bus, device, func, PCI_INTERRUPT),
.resources = NULL
--
1.6.0.6