patch-2.4.0-prerelease linux/arch/sparc64/kernel/pci.c

Next file: linux/arch/sparc64/kernel/sys_sparc32.c
Previous file: linux/arch/sparc64/kernel/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test12/linux/arch/sparc64/kernel/pci.c linux/arch/sparc64/kernel/pci.c
@@ -1,4 +1,4 @@
-/* $Id: pci.c,v 1.19 2000/11/08 04:49:17 davem Exp $
+/* $Id: pci.c,v 1.20 2000/12/14 22:57:25 davem Exp $
  * pci.c: UltraSparc PCI controller support.
  *
  * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com)
@@ -227,118 +227,6 @@
 		return NULL;
 	}
 	return str;
-}
-
-asmlinkage int sys_pciconfig_read(unsigned long bus,
-				  unsigned long dfn,
-				  unsigned long off,
-				  unsigned long len,
-				  unsigned char *buf)
-{
-	struct pci_dev *dev;
-	u8 byte;
-	u16 word;
-	u32 dword;
-	int err = 0;
-
-	if(!capable(CAP_SYS_ADMIN))
-		return -EPERM;
-
-	dev = pci_find_slot(bus, dfn);
-	if (!dev) {
-		/* Xfree86 is such a turd, it does not check the
-		 * return value and just relies on the buffer being
-		 * set to all 1's to mean "device not present".
-		 */
-		switch(len) {
-		case 1:
-			put_user(0xff, (unsigned char *)buf);
-			break;
-		case 2:
-			put_user(0xffff, (unsigned short *)buf);
-			break;
-		case 4:
-			put_user(0xffffffff, (unsigned int *)buf);
-			break;
-		default:
-			err = -EINVAL;
-			break;
-		};
-		goto out;
-	}
-
-	switch(len) {
-	case 1:
-		pci_read_config_byte(dev, off, &byte);
-		put_user(byte, (unsigned char *)buf);
-		break;
-	case 2:
-		pci_read_config_word(dev, off, &word);
-		put_user(word, (unsigned short *)buf);
-		break;
-	case 4:
-		pci_read_config_dword(dev, off, &dword);
-		put_user(dword, (unsigned int *)buf);
-		break;
-
-	default:
-		err = -EINVAL;
-		break;
-	};
-out:
-	return err;
-}
-
-asmlinkage int sys_pciconfig_write(unsigned long bus,
-				   unsigned long dfn,
-				   unsigned long off,
-				   unsigned long len,
-				   unsigned char *buf)
-{
-	struct pci_dev *dev;
-	u8 byte;
-	u16 word;
-	u32 dword;
-	int err = 0;
-
-	if(!capable(CAP_SYS_ADMIN))
-		return -EPERM;
-	dev = pci_find_slot(bus, dfn);
-	if (!dev) {
-		/* See commentary above about Xfree86 */
-		goto out;
-	}
-
-	switch(len) {
-	case 1:
-		err = get_user(byte, (u8 *)buf);
-		if(err)
-			break;
-		pci_write_config_byte(dev, off, byte);
-		break;
-
-	case 2:
-		err = get_user(word, (u16 *)buf);
-		if(err)
-			break;
-		pci_write_config_byte(dev, off, word);
-		break;
-
-	case 4:
-		err = get_user(dword, (u32 *)buf);
-		if(err)
-			break;
-		pci_write_config_byte(dev, off, dword);
-		break;
-
-	default:
-		err = -EINVAL;
-		break;
-
-	};
-
-out:
-	return err;
 }
 
 #endif /* !(CONFIG_PCI) */

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