From 622fb793e543eeb1f66bb60b56d43b6ba1cb3f4c Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sun, 24 Jan 2010 01:47:58 +0000 Subject: Add missing files from the last commit (trivial). Signed-off-by: Uwe Hermann Acked-by: Uwe Hermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5048 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/superiotool/pci.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 util/superiotool/pci.c (limited to 'util/superiotool/pci.c') 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 + * + * 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; +} -- cgit v1.2.3