linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch for chassis_id exras module
@ 2004-06-05  1:06 Sabharwal, Atul
  2004-06-07 16:52 ` Sabharwal, Atul
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Sabharwal, Atul @ 2004-06-05  1:06 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

Hi Greg,

Please find attached a patch for the extras module chassis_id.  The
patch removes an
Extra field "host number" from the provisioning table. Also corrected
the license
Header and removed some dead code.

Please apply it to your distribution.

Thanks,

Atul



[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 6957 bytes --]

diff -Nur chassis_id.org/Makefile chassis_id.new/Makefile
--- chassis_id.org/Makefile	2004-04-21 14:39:10.000000000 -0700
+++ chassis_id.new/Makefile	2004-06-04 17:53:44.868933912 -0700
@@ -1,19 +1,26 @@
-#
-#   **
-#   ** (C) 2003 Intel Corporation
-#   **          Atul Sabharwal <atul.sabharwal@intel.com>
-#   **
-#   ** $Id: Makefile,v 1.3 2004/03/22 23:54:54 atul Exp $
-#   **
-#   ** Distributed under the terms of the GNU Public License, v2.0 or
-#   ** later.
-#   **
-#   ** Many parts heavily based on test-skeleton.c, by Ulrich Drepper;
-#   ** with his permission, they have been re-licensed GPL, and his
-#   ** copyright still applies on them. 
-#   **
-#   */
-#
+#  * 
+#  * Makefile
+#  *
+#  * Copyright (C) 2003, 2004 Intel Corporation.  All rights reserved.
+#  *
+#  * This program is free software; you can redistribute it and/or
+#  * modify it under the terms of the GNU General Public
+#  * License as published by the Free Software Foundation; either
+#  * version 2 of the License, or (at your option) any later version.
+#  *
+#  * This program is distributed in the hope that it will be useful,
+#  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  * General Public License for more details.
+#  *
+#  * You should have received a copy of the GNU General Public
+#  * License along with this program; if not, write to the
+#  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+#  * Boston, MA 021110-1307, USA.
+#  *
+#  * Authors: Atul Sabharwal
+#  *          
+
 CFLAGS = -g 
 TARGET = chassis_id
 
diff -Nur chassis_id.org/chassis_id.c chassis_id.new/chassis_id.c
--- chassis_id.org/chassis_id.c	2004-04-21 14:39:11.000000000 -0700
+++ chassis_id.new/chassis_id.c	2004-06-04 17:54:16.882067176 -0700
@@ -1,15 +1,25 @@
-/* -*-c-*-: 
- **
- ** (C) 2003 Intel Corporation
- **          Atul Sabharwal <atul.sabharwal@intel.com>
- **
- ** Distributed under the terms of the GNU Public License, v2.0 or
- ** later.
- **
- ** Many parts heavily based on test-skeleton.c, by Ulrich Drepper;
- ** with his permission, they have been re-licensed GPL, and his
- ** copyright still applies on them
- **
+/* 
+ * chassis_id.c
+ *
+ * Copyright (C) 2003, 2004 Intel Corporation.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ * Authors: Atul Sabharwal
+ *          
  */
 
 #include <stdio.h>
@@ -22,33 +32,13 @@
 
 int main(int argc, char **argv, char ** envp)
 {
-	int chassis_num, slot_num, retval, host_num;
+	int chassis_num, slot_num, retval;
 	char disk_snum[255], devpath[255];
 	char *ptr;
 	int disk_index;
 
 	syslog( LOG_PID| LOG_DAEMON| LOG_ERR, "\n%s", "starting chassis_id" );
 
-#if 0
-	ptr = getenv("CHASSIS");
-	if (ptr == NULL)
-		return -ERROR_NO_CHASSIS;
-
-	sscanf(ptr, "%d", &chassis_num);
-	#ifdef DEBUG
-	syslog(LOG_PID| LOG_DAEMON| LOG_ERR, "Chassis %d", chassis_num);
-	#endif
-
-
-	ptr = getenv("SLOT");
-	if (ptr== NULL)
-		return -ERROR_NO_SLOT;
-
-	sscanf(ptr, "%d", &slot_num);
-	#ifdef DEBUG
-	syslog( LOG_PID|LOG_DAEMON| LOG_ERR, "Slot %d", slot_num);
-	#endif
-#endif
 	ptr = getenv("DEVPATH");
 	if (ptr == NULL)
 		return -ERROR_NO_DEVPATH;
@@ -65,7 +55,7 @@
 	getserial_number(devpath, disk_snum);
 
 	/* Now we open the provisioning table t find actual entry for the serial number*/
-	disk_index =  table_find_disk(disk_snum, &host_num, &chassis_num, &slot_num);
+	disk_index =  table_find_disk(disk_snum, &chassis_num, &slot_num);
 	if ( disk_index == -1 ) {
 		// typical provisioning error
 		return -ERROR_NO_DISK;
diff -Nur chassis_id.org/table.c chassis_id.new/table.c
--- chassis_id.org/table.c	2004-04-21 14:39:11.000000000 -0700
+++ chassis_id.new/table.c	2004-06-04 17:55:00.737400152 -0700
@@ -1,17 +1,25 @@
-/* -*-c-*-: 
- **
- ** (C) 2003 Intel Corporation
- **          Atul Sabharwal <atul.sabharwal@intel.com>
- **
- ** $Id: table.c,v 1.4 2004/03/18 21:56:24 atul Exp $
- **
- ** Distributed under the terms of the GNU Public License, v2.0 or
- ** later.
- **
- ** Many parts heavily based on test-skeleton.c, by Ulrich Drepper;
- ** with his permission, they have been re-licensed GPL, and his
- ** copyright still applies on them. 
- **
+/* 
+ * table.c
+ *
+ * Copyright (C) 2003, 2004 Intel Corporation.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ * Authors: Atul Sabharwal
+ *          
  */
 
 #include <stdio.h>
@@ -22,7 +30,6 @@
 struct provision_record
 {
 	int  id;
-	int  host_num;          //port # or adaptor number
 	int  num_disks;
 	int  chassis_num;
 	int  slot_num;
@@ -51,7 +58,7 @@
 	while (!feof(fp)) {
 		fgets(ptr, 80, fp);	
 		sscanf(ptr, "%d %d %d %d %d %s %s", &ptable[i].id,
-			&ptable[i].host_num, &ptable[i].num_disks, 
+			&ptable[i].num_disks, 
 			&ptable[i].chassis_num, &ptable[i].slot_num,
 			ptable[i].serial_num, ptable[i].name);
 		i++;       
@@ -70,7 +77,6 @@
 
 	for (i = 0; i < ptable_size; i++) {
 		if (strcmp(ptable[i].serial_num, serialnumber) == 0) {
-			*host_num =  ptable[i].host_num;
 			*chassis_num =  ptable[i].chassis_num;
 			*slot_num = ptable[i].slot_num;
 			break;
@@ -91,7 +97,6 @@
 {
 	printf("%d ", ptable[diskindex].chassis_num);
 	printf("%d ", ptable[diskindex].slot_num);
-	printf("%d ", ptable[diskindex].host_num);
 	printf("%s ", ptable[diskindex].name);
 }
 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-26  0:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-05  1:06 Patch for chassis_id exras module Sabharwal, Atul
2004-06-07 16:52 ` Sabharwal, Atul
2004-06-07 23:08 ` Greg KH
2004-06-08  1:36 ` Sabharwal, Atul
2004-06-17 19:26 ` Martin Hicks
2004-06-17 19:53 ` Sabharwal, Atul
2004-06-26  0:30 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).