PATCH: PCI Device list made optional

Martin Mares (mj@suse.cz)
Sat, 4 Dec 1999 15:12:38 +0100


Hi Linus!

Here I send a patch for 2.3.30-pre5 which makes the device ID database
optional. I know it's a controversial issue, but many people making
boot disks or using Linux in embedded environments have asked me to do it
since 80K increase of kernel image size (or ~30K in the compressed
version) makes a large difference for them, no matter what gets freed
after system bootup. The option defaults to On, of course.

Martin

--- drivers/pci/Config.in.mj Sat Dec 4 14:22:47 1999
+++ drivers/pci/Config.in Sat Dec 4 14:26:42 1999
@@ -0,0 +1,7 @@
+#
+# PCI configuration
+#
+
+if [ "$CONFIG_PCI" = "y" ]; then
+ bool 'PCI device name database' CONFIG_PCI_NAMES
+fi
--- drivers/pci/names.c.mj Sat Dec 4 14:32:39 1999
+++ drivers/pci/names.c Sat Dec 4 14:32:39 1999
@@ -10,6 +10,8 @@
#include <linux/pci.h>
#include <linux/init.h>

+#ifdef CONFIG_PCI_NAMES
+
struct pci_device_info {
unsigned short device;
unsigned short seen;
@@ -115,3 +117,18 @@
return pci_class_names[i];
return NULL;
}
+
+#else
+
+void __init pci_name_device(struct pci_dev *dev)
+{
+ sprintf(dev->name, "PCI device %04x:%04x", dev->vendor, dev->device);
+}
+
+char *
+pci_class_name(u32 class)
+{
+ return NULL;
+}
+
+#endif
--- arch/i386/defconfig.mj Sat Dec 4 14:21:04 1999
+++ arch/i386/defconfig Sat Dec 4 14:21:04 1999
@@ -51,6 +51,7 @@
CONFIG_PCI_GOANY=y
CONFIG_PCI_BIOS=y
CONFIG_PCI_DIRECT=y
+CONFIG_PCI_NAMES=y
# CONFIG_MCA is not set

#
--- arch/i386/config.in.mj Sat Dec 4 14:17:07 1999
+++ arch/i386/config.in Sat Dec 4 14:26:17 1999
@@ -95,8 +95,12 @@
define_bool CONFIG_PCI_DIRECT y
fi
fi
- bool 'MCA support' CONFIG_MCA
+fi
+
+source drivers/pci/Config.in

+if [ "$CONFIG_VISWS" != "y" ]; then
+ bool 'MCA support' CONFIG_MCA
fi

source drivers/pcmcia/Config.in
--- arch/alpha/config.in.mj Sat Dec 4 14:18:02 1999
+++ arch/alpha/config.in Sat Dec 4 14:18:02 1999
@@ -178,6 +178,8 @@
bool 'Symmetric multi-processing support' CONFIG_SMP
fi

+source drivers/pci/Config.in
+
bool 'Networking support' CONFIG_NET
bool 'System V IPC' CONFIG_SYSVIPC
bool 'BSD Process Accounting' CONFIG_BSD_PROCESS_ACCT
--- arch/alpha/defconfig.mj Sat Dec 4 14:21:27 1999
+++ arch/alpha/defconfig Sat Dec 4 14:21:27 1999
@@ -44,6 +44,7 @@
# CONFIG_ALPHA_SABLE is not set
# CONFIG_ALPHA_TAKARA is not set
CONFIG_PCI=y
+CONFIG_PCI_NAMES=y
# CONFIG_SMP is not set
CONFIG_NET=y
CONFIG_SYSVIPC=y
--- arch/sparc/config.in.mj Sat Dec 4 14:20:36 1999
+++ arch/sparc/config.in Sat Dec 4 14:20:36 1999
@@ -29,6 +29,7 @@
bool 'Support for SUN4 machines (disables SUN4[CDM] support)' CONFIG_SUN4
if [ "$CONFIG_SUN4" != "y" ]; then
bool ' Support for PCI and PS/2 keyboard/mouse' CONFIG_PCI
+ source drivers/pci/Config.in
fi

mainmenu_option next_comment
--- arch/sparc/defconfig.mj Sat Dec 4 14:22:25 1999
+++ arch/sparc/defconfig Sat Dec 4 14:22:25 1999
@@ -23,6 +23,7 @@
# CONFIG_SMP is not set
# CONFIG_SUN4 is not set
# CONFIG_PCI is not set
+# CONFIG_PCI_NAMES is not set

#
# Console drivers
--- arch/mips/config.in.mj Sat Dec 4 14:19:31 1999
+++ arch/mips/config.in Sat Dec 4 14:19:31 1999
@@ -100,6 +100,8 @@
bool ' Kernel module loader' CONFIG_KMOD
fi

+source drivers/pci/Config.in
+
endmenu

if [ "$CONFIG_DECSTATION" = "y" ]; then
--- arch/mips/defconfig.mj Sat Dec 4 14:21:57 1999
+++ arch/mips/defconfig Sat Dec 4 14:21:57 1999
@@ -16,6 +16,7 @@
# CONFIG_SGI is not set
CONFIG_SNI_RM200_PCI=y
CONFIG_PCI=y
+CONFIG_PCI_NAMES=y

#
# CPU selection
--- arch/ppc/defconfig.mj Sat Dec 4 14:22:13 1999
+++ arch/ppc/defconfig Sat Dec 4 14:22:13 1999
@@ -35,8 +35,8 @@
#
# General setup
#
-# CONFIG_PCI is not set
CONFIG_PCI=y
+CONFIG_PCI_NAMES=y
CONFIG_NET=y
CONFIG_SYSCTL=y
CONFIG_SYSVIPC=y
--- arch/ppc/config.in.mj Sat Dec 4 14:20:08 1999
+++ arch/ppc/config.in Sat Dec 4 14:20:08 1999
@@ -106,6 +106,8 @@
define_bool CONFIG_KERNEL_ELF y
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC

+source drivers/pci/Config.in
+
source drivers/pcmcia/Config.in

source drivers/parport/Config.in
--- arch/m68k/config.in.mj Sat Dec 4 14:18:59 1999
+++ arch/m68k/config.in Sat Dec 4 14:19:01 1999
@@ -124,6 +124,7 @@
fi
fi

+source drivers/pci/Config.in

endmenu

--- arch/sparc64/config.in.mj Sat Dec 4 14:20:48 1999
+++ arch/sparc64/config.in Sat Dec 4 14:20:48 1999
@@ -37,6 +37,7 @@
define_bool CONFIG_SUN_AUXIO y
define_bool CONFIG_SUN_IO y
bool 'PCI support' CONFIG_PCI
+source drivers/pci/Config.in
source drivers/sbus/char/Config.in
source drivers/sbus/audio/Config.in

--- arch/sparc64/defconfig.mj Sat Dec 4 14:22:34 1999
+++ arch/sparc64/defconfig Sat Dec 4 14:22:34 1999
@@ -60,6 +60,7 @@
CONFIG_SUN_AUXIO=y
CONFIG_SUN_IO=y
CONFIG_PCI=y
+CONFIG_PCI_NAMES=y

#
# Misc Linux/SPARC drivers
--- arch/arm/config.in.mj Sat Dec 4 14:18:28 1999
+++ arch/arm/config.in Sat Dec 4 14:18:28 1999
@@ -110,6 +110,7 @@
if [ "$CONFIG_ARCH_NEXUSPCI" = "y" -o \
"$CONFIG_HOST_FOOTBRIDGE" = "y" ]; then
define_bool CONFIG_PCI y
+ source drivers/pci/Config.h
fi

#
--- arch/arm/defconfig.mj Sat Dec 4 14:21:35 1999
+++ arch/arm/defconfig Sat Dec 4 14:21:35 1999
@@ -18,6 +18,7 @@
CONFIG_ARCH_NETWINDER=y
# CONFIG_ARCH_ACORN is not set
CONFIG_PCI=y
+CONFIG_PCI_NAMES=y
CONFIG_ISA_DMA=y
CONFIG_CPU_32=y
# CONFIG_CPU_26 is not set
--- Documentation/Configure.help.mj Sat Dec 4 14:31:28 1999
+++ Documentation/Configure.help Sat Dec 4 14:31:28 1999
@@ -1720,6 +1720,19 @@
kernel will try the direct access method and falls back to the BIOS
if that doesn't work. If unsure, go with the default.

+PCI device name database
+CONFIG_PCI_NAMES
+ By default, the kernel contains a database of all known PCI device
+ names to make the information in /proc/pci, /proc/ioports and similar
+ files comprehensible to the user. This database increases size of
+ the kernel image by about 80KB, but it gets freed after the system
+ boots up, so it doesn't take up kernel memory. Anyway, if you are
+ building an installation floppy or kernel for an embedded system
+ where kernel image size really matters, you can disable this feature
+ and you'll get device ID numbers instead of names.
+
+ When in doubt, say Y.
+
MCA support
CONFIG_MCA
MicroChannel Architecture is found in some IBM PS/2 machines and

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/