public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrey Panin <pazke@donpac.ru>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.7-rc2-mm2
Date: Mon, 7 Jun 2004 16:41:25 +0400	[thread overview]
Message-ID: <20040607124125.GT3776@pazke> (raw)
In-Reply-To: <20040603015356.709813e9.akpm@osdl.org>


[-- Attachment #1.1: Type: text/plain, Size: 622 bytes --]

On 155, 06 03, 2004 at 01:53:56AM -0700, Andrew Morton wrote:
> 
> - As soon as I merged Andrey's big dmi cleanup patches everyone started
>   madly patching dmi_scan.c.  The subsequent reject storm forced me to drop
>   them.

Could you apply attached patch (only exports DMI check functions) instead of them ?
With this patch applied these "mad patchers" will have an alternative
to pushing their crap^H^H^Hhanges into dmi_scan.c

I tried to make this patch as nonintrusive as possible.

Best regards.

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke@donpac.ru		| PGP key: wwwkeys.pgp.net

[-- Attachment #1.2: patch-dmi-api --]
[-- Type: text/plain, Size: 4667 bytes --]

diff -urpN -X /usr/share/dontdiff linux-2.6.7-rc1-mm1.vanilla/arch/i386/kernel/dmi_scan.c linux-2.6.7-rc1-mm1/arch/i386/kernel/dmi_scan.c
--- linux-2.6.7-rc1-mm1.vanilla/arch/i386/kernel/dmi_scan.c	Fri May  7 22:56:24 2004
+++ linux-2.6.7-rc1-mm1/arch/i386/kernel/dmi_scan.c	Fri May  7 23:14:09 2004
@@ -10,6 +10,7 @@
 #include <asm/io.h>
 #include <linux/pm.h>
 #include <asm/system.h>
+#include <linux/dmi.h>
 #include <linux/bootmem.h>
 
 unsigned long dmi_broken;
@@ -139,21 +140,6 @@ static int __init dmi_iterate(void (*dec
 	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];
 
 /*
@@ -176,26 +162,11 @@ static void __init dmi_save_ident(struct
 }
 
 /*
- *	DMI callbacks for problem boards
+ * Ugly compatibility crap.
  */
-
-struct dmi_strmatch
-{
-	u8 slot;
-	char *substr;
-};
-
-#define NONE	255
-
-struct dmi_blacklist
-{
-	int (*callback)(struct dmi_blacklist *);
-	char *ident;
-	struct dmi_strmatch matches[4];
-};
-
-#define NO_MATCH	{ NONE, NULL}
-#define MATCH(a,b)	{ a, b }
+#define dmi_blacklist	dmi_system_id
+#define NO_MATCH	{ DMI_NONE, NULL}
+#define MATCH		DMI_MATCH
 
 /* 
  * Reboot options and system auto-detection code provided by
@@ -1072,9 +1043,6 @@ static __initdata struct dmi_blacklist d
 
 static __init void dmi_check_blacklist(void)
 {
-	struct dmi_blacklist *d;
-	int i;
-		
 #ifdef	CONFIG_ACPI_BOOT
 #define	ACPI_BLACKLIST_CUTOFF_YEAR	2001
 
@@ -1096,25 +1064,7 @@ static __init void dmi_check_blacklist(v
 		}
 	}
 #endif
-
-	d=&dmi_blacklist[0];
-	while(d->callback)
-	{
-		for(i=0;i<4;i++)
-		{
-			int s = d->matches[i].slot;
-			if(s==NONE)
-				continue;
-			if(dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr))
-				continue;
-			/* No match */
-			goto fail;
-		}
-		if(d->callback(d))
-			return;
-fail:			
-		d++;
-	}
+ 	dmi_check_system(dmi_blacklist);
 }
 
 	
@@ -1181,3 +1131,52 @@ void __init dmi_scan_machine(void)
 }
 
 EXPORT_SYMBOL(is_unsafe_smbus);
+
+
+/**
+ *	dmi_check_system - check system DMI data
+ *	@list: array of dmi_system_id structures to match against
+ *
+ *	Walk the blacklist table running matching functions until someone
+ *	returns non zero or we hit the end. Callback function is called for
+ *	each successfull match. Returns the number of matches.
+ */
+int dmi_check_system(struct dmi_system_id *list)
+{
+	int i, count = 0;
+	struct dmi_system_id *d = list;
+
+	while (d->ident) {
+		for (i = 0; i < ARRAY_SIZE(d->matches); i++) {
+			int s = d->matches[i].slot;
+			if (s == DMI_NONE)
+				continue;
+			if (dmi_ident[s] && strstr(dmi_ident[s], d->matches[i].substr))
+				continue;
+			/* No match */
+			goto fail;
+		}
+		if (d->callback && d->callback(d))
+			break;
+		count++;
+fail:		d++;
+	}
+
+	return count;
+}
+
+EXPORT_SYMBOL(dmi_check_system);
+
+/**
+ *	dmi_get_system_info - return DMI data value
+ *	@field: data index (see enum dmi_filed)
+ *
+ *	Returns one DMI data value, can be used to perform
+ *	complex DMI data checks.
+ */
+char * dmi_get_system_info(int field)
+{
+	return dmi_ident[field];
+}
+
+EXPORT_SYMBOL(dmi_get_system_info);
diff -urpN -X /usr/share/dontdiff linux-2.6.7-rc1-mm1.vanilla/include/linux/dmi.h linux-2.6.7-rc1-mm1/include/linux/dmi.h
--- linux-2.6.7-rc1-mm1.vanilla/include/linux/dmi.h	Thu Jan  1 03:00:00 1970
+++ linux-2.6.7-rc1-mm1/include/linux/dmi.h	Fri May  7 23:28:38 2004
@@ -0,0 +1,47 @@
+#ifndef __DMI_H__
+#define __DMI_H__
+
+enum dmi_field {
+	DMI_NONE,
+	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,
+};
+
+/*
+ *	DMI callbacks for problem boards
+ */
+struct dmi_strmatch {
+	u8 slot;
+	char *substr;
+};
+
+struct dmi_system_id {
+	int (*callback)(struct dmi_system_id *);
+	char *ident;
+	struct dmi_strmatch matches[4];
+	void *driver_data;
+};
+
+#define DMI_MATCH(a,b)	{ a, b }
+
+#if defined(CONFIG_X86) && !defined(CONFIG_X86_64)
+
+extern int dmi_check_system(struct dmi_system_id *list);
+extern char * dmi_get_system_info(int field);
+
+#else
+
+static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
+static inline char * dmi_get_system_info(int field) { return NULL; }
+
+#endif
+
+#endif	/* __DMI_H__ */

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2004-06-07 12:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-03  8:53 2.6.7-rc2-mm2 Andrew Morton
2004-06-03 12:48 ` 2.6.7-rc2-mm2 - hpet-dont-use-new-major borked Paul Jackson
2004-06-03 14:21 ` 2.6.7-rc2-mm2 (compile stats) John Cherry
2004-06-03 15:03 ` 2.6.7-rc2-mm2 AKIYAMA Nobuyuki
2004-06-03 15:03 ` 2.6.7-rc2-mm2 Dominik Karall
2004-06-03 23:18   ` 2.6.7-rc2-mm2 Andrew Morton
2004-06-03 23:53     ` 2.6.7-rc2-mm2 Alexander Nyberg
2004-06-04  8:17     ` 2.6.7-rc2-mm2 Dominik Karall
2004-06-04 10:34       ` 2.6.7-rc2-mm2 Lenar Lõhmus
2004-06-04 10:40     ` 2.6.7-rc2-mm2 Ralf Hildebrandt
2004-06-04 13:53   ` 2.6.7-rc2-mm2 Denis Vlasenko
2004-06-03 15:20 ` 2.6.7-rc2-mm2 Jens Axboe
2004-06-11  2:40   ` 2.6.7-rc2-mm2 Len Brown
2004-06-15  6:37     ` 2.6.7-rc2-mm2 Jens Axboe
2004-06-03 16:39 ` 2.6.7-rc2-mm2 Tim Schmielau
2004-06-04 15:05 ` 2.6.7-rc2-mm2: compile error with VIDEO_CX88=y and gcc 2.95 Adrian Bunk
2004-06-07 12:41 ` Andrey Panin [this message]
     [not found]   ` <20040607220157.1e67ec39.akpm@osdl.org>
2004-06-08  5:18     ` 2.6.7-rc2-mm2 Andrey Panin
     [not found]       ` <20040607222513.6bebcbb6.akpm@osdl.org>
2004-06-08  6:34         ` 2.6.7-rc2-mm2 Andrey Panin
2004-06-08  6:42           ` 2.6.7-rc2-mm2 Andrew Morton
2004-06-08  7:18             ` 2.6.7-rc2-mm2 Andrey Panin
     [not found]               ` <20040608002245.04a3de55.akpm@osdl.org>
2004-06-08  8:04                 ` 2.6.7-rc2-mm2 Andrey Panin
  -- strict thread matches above, loose matches on Subject: below --
2004-06-03 22:15 2.6.7-rc2-mm2 Mario ''Jorge'' Di Nitto
     [not found] <Pine.LNX.4.44L0.0406041047080.2279-100000@ida.rowland.org>
2004-06-04 15:46 ` 2.6.7-rc2-mm2 Dominik Karall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040607124125.GT3776@pazke \
    --to=pazke@donpac.ru \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox