summaryrefslogtreecommitdiff
path: root/util/superiotool/pci.c
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2010-01-24 01:47:58 +0000
committerUwe Hermann <uwe@hermann-uwe.de>2010-01-24 01:47:58 +0000
commit622fb793e543eeb1f66bb60b56d43b6ba1cb3f4c (patch)
tree39d2e173b1889253896b7d8435b831d1338bab9f /util/superiotool/pci.c
parentbb38f3213b6889db9fcdab79086bb860f3a32547 (diff)
downloadcoreboot-622fb793e543eeb1f66bb60b56d43b6ba1cb3f4c.tar.xz
Add missing files from the last commit (trivial).
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5048 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/superiotool/pci.c')
-rw-r--r--util/superiotool/pci.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/util/superiotool/pci.c b/util/superiotool/pci.c
new file mode 100644
index 0000000000..0548bc7ce0
--- /dev/null
+++ b/util/superiotool/pci.c
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the superiotool project.
+ *
+ * Copyright (C) 2010 Uwe Hermann <uwe@hermann-uwe.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "superiotool.h"
+
+struct pci_access *pacc;
+
+struct pci_dev *pci_dev_find(uint16_t vendor, uint16_t device)
+{
+ struct pci_dev *temp;
+ struct pci_filter filter;
+
+ pci_filter_init(NULL, &filter);
+ filter.vendor = vendor;
+ filter.device = device;
+
+ for (temp = pacc->devices; temp; temp = temp->next)
+ if (pci_filter_match(&filter, temp))
+ return temp;
+
+ return NULL;
+}