patch-2.3.15 linux/drivers/pci/compat.c

Next file: linux/drivers/pci/names.c
Previous file: linux/drivers/pci/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.14/linux/drivers/pci/compat.c linux/drivers/pci/compat.c
@@ -3,7 +3,7 @@
  *
  *	PCI Bus Services -- Function For Backward Compatibility
  *
- *	Copyright 1998 Martin Mares
+ *	Copyright 1998, 1999 Martin Mares <mj@ucw.cz>
  */
 
 #include <linux/types.h>
@@ -11,6 +11,12 @@
 #include <linux/pci.h>
 
 int
+pcibios_present(void)
+{
+	return !!pci_devices;
+}
+
+int
 pcibios_find_class(unsigned int class, unsigned short index, unsigned char *bus, unsigned char *devfn)
 {
 	struct pci_dev *dev = NULL;
@@ -41,3 +47,19 @@
 		}
 	return PCIBIOS_DEVICE_NOT_FOUND;
 }
+
+#define PCI_OP(rw,size,type)							\
+int pcibios_##rw##_config_##size (unsigned char bus, unsigned char dev_fn,	\
+				  unsigned char where, unsigned type val)	\
+{										\
+	struct pci_dev *dev = pci_find_slot(bus, dev_fn);			\
+	if (!dev) return PCIBIOS_DEVICE_NOT_FOUND;				\
+	return pci_##rw##_config_##size(dev, where, val);			\
+}
+
+PCI_OP(read, byte, char *)
+PCI_OP(read, word, short *)
+PCI_OP(read, dword, int *)
+PCI_OP(write, byte, char)
+PCI_OP(write, word, short)
+PCI_OP(write, dword, int)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)