Skip to contentSkip to conversation

2.4.20 ARCH=i386 create dmi_scan.h and move decl from dmi_scan.c

PATCH In review Albert Cranford 2 participants 2 messages Aug 13, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.20 ARCH=i386 create dmi_scan.h and move decl from dmi_scan.c

Hello Marcelo,
Could you apply the following patch against 2.4.20-pre2. Alan C. thought this would be OK to support i2c/sensors. Thanks,
Albert

arch/i386/kernel/dmi_scan.c 2002-07-31 23:13:52.000000000 -0400 renamed from arch/i386/kernel/dmi_scan.c.orig 2002-07-31 23:10:21.000000000 -0400 +2 -16
@@ -9,6 +9,7 @@
 #include <linux/pm.h>
 #include <asm/keyboard.h>
 #include <asm/system.h>
+#include <asm/dmi_scan.h>
 #include <linux/bootmem.h>
 
 unsigned long dmi_broken;
@@ -127,22 +128,7 @@
        return -1;
 }
 
-
-enum
-{
-       DMI_BIOS_VENDOR,
-       DMI_BIOS_VERSION,
-       DMI_BIOS_DATE,
-       DMI_SYS_VENDOR,
-       DMI_PRODUCT_NAME,
-       DMI_PRODUCT_VERSION,
-       DMI_BOARD_VENDOR,
-       DMI_BOARD_NAME,
-       DMI_BOARD_VERSION,
-       DMI_STRING_MAX
-};
-
-static char *dmi_ident[DMI_STRING_MAX];
+char *dmi_ident[DMI_STRING_MAX];
 
 /*
  *     Save a DMI string
include/asm-i386/dmi_scan.h 2002-07-31 23:12:49.000000000 -0400 renamed from dev/null 1994-07-17 19:46:18.000000000 -0400 +19 -0
@@ -0,0 +1,19 @@
+#ifndef __i386_DMI_SCAN_H
+#define __i386_DMI_SCAN_H
+enum
+{
+       DMI_BIOS_VENDOR,
+       DMI_BIOS_VERSION,
+       DMI_BIOS_DATE,
+       DMI_SYS_VENDOR,
+       DMI_PRODUCT_NAME,
+       DMI_PRODUCT_VERSION,
+       DMI_BOARD_VENDOR,
+       DMI_BOARD_NAME,
+       DMI_BOARD_VERSION,
+       DMI_STRING_MAX
+};
+
+extern char *dmi_ident[DMI_STRING_MAX];
+
+#endif
Quoted 8 lines · Albert Cranford

Hello Linus,
Alan suggested that sensors group use a dmi scanner to manage allow/blacklist products. In order to do this we need to use arch/i386/kernel/dmi_scan.c components.

Could you apply the following patch to facilitate this? Its been tested in linux-2.5.30 with no negative impact on kernel and may be useful for others.

Ok by me

#1 lore raw

arch/i386/kernel/dmi_scan.c 2002-07-31 23:13:52.000000000 -0400 line 131

Quoted 3 lines · Albert Cranford
arch/i386/kernel/dmi_scan.c 2002-07-31 23:13:52.000000000 -0400 renamed from arch/i386/kernel/dmi_scan.c.orig 2002-07-31 23:10:21.000000000 -0400 +1 -2
-
-static char *dmi_ident[DMI_STRING_MAX];
+char *dmi_ident[DMI_STRING_MAX];

Be very careful with this change btw. The dmi_ident strings are unmapped at the point dmi_table() returns. That means you can only use them in the decode callback, and so it seems odd to export them. It certainly wants clear documentation if you are doing it that way.

What you probably should do is create some flag bits for i2c/smbus and set those then export the flag data (we do the same for APM), rather than export them as globals