Skip to contentSkip to conversation

MODULE_VERSION for scsi drivers

DISCUSSION Matt Domsch 4 participants 6 messages Apr 27, 2004 SCSI

lore
Share & tools
lore
#0 lore raw

Now that the MODULE_VERSION() macro is in 2.6, I'd love to see all modules implement it. So before I go touch all the SCSI drivers, I thought I'd bounce this off the list.

There are a few drivers with version strings that look like this:
#define VERSION "1.10 (23/01/2003 2.5.57)"

In the new world order, I think they need to look more like this:
#define DRV_VERSION "2.5.57"
#define DRV_DATE "23/01/2003"
and print both strings if it's interesting to do so, but the date stays out of the MODULE_VERSION(DRV_VERSION).

Thoughts? Patch below against Linus's BK-cur covers a the a* drivers, plus a few I care specifically about.
-Matt

Signature · 299 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

===== drivers/scsi/a2091.c 1.13 vs edited =====
--- 1.13/drivers/scsi/a2091.c	Sat Sep 27 10:17:28 2003
+++ edited/drivers/scsi/a2091.c	Mon Apr 26 22:21:06 2004
@@ -258,3 +258,4 @@
 }
 
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/a3000.c 1.12 vs edited =====
--- 1.12/drivers/scsi/a3000.c	Thu Sep 25 18:33:56 2003
+++ edited/drivers/scsi/a3000.c	Mon Apr 26 22:22:03 2004
@@ -243,3 +243,4 @@
 }
 
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/advansys.c 1.38 vs edited =====
--- 1.38/drivers/scsi/advansys.c	Tue Feb  3 23:29:29 2004
+++ edited/drivers/scsi/advansys.c	Mon Apr 26 22:23:49 2004
@@ -18570,3 +18570,4 @@
     }
 }
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_VERSION(ASC_VERSION);
===== drivers/scsi/aha152x.c 1.43 vs edited =====
--- 1.43/drivers/scsi/aha152x.c	Mon Jan 26 11:51:08 2004
+++ edited/drivers/scsi/aha152x.c	Mon Apr 26 22:25:24 2004
@@ -351,6 +351,7 @@
 MODULE_AUTHOR("J�rgen Fischer");
 MODULE_DESCRIPTION(AHA152X_REVID);
 MODULE_LICENSE("GPL");
+MODULE_VERSION("2.7");
 
 #if !defined(PCMCIA)
 #if defined(MODULE)
===== drivers/scsi/aha1542.c 1.34 vs edited =====
--- 1.34/drivers/scsi/aha1542.c	Fri Jan 23 17:50:19 2004
+++ edited/drivers/scsi/aha1542.c	Mon Apr 26 22:28:09 2004
@@ -1809,7 +1809,7 @@
 	return 0;
 }
 MODULE_LICENSE("GPL");
-
+MODULE_VERSION("");
 
 static Scsi_Host_Template driver_template = {
 	.proc_name		= "aha1542",
===== drivers/scsi/aha1740.c 1.28 vs edited =====
--- 1.28/drivers/scsi/aha1740.c	Mon Oct 27 07:23:22 2003
+++ edited/drivers/scsi/aha1740.c	Mon Apr 26 22:30:13 2004
@@ -705,3 +705,4 @@
 module_exit (aha1740_exit);
 
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/aic7xxx_old.c 1.52 vs edited =====
--- 1.52/drivers/scsi/aic7xxx_old.c	Thu Mar 25 08:44:41 2004
+++ edited/drivers/scsi/aic7xxx_old.c	Mon Apr 26 22:19:44 2004
@@ -11138,7 +11138,7 @@
 #include "aic7xxx_old/aic7xxx_proc.c"
 
 MODULE_LICENSE("Dual BSD/GPL");
-
+MODULE_VERSION(AIC7XXX_C_VERSION);
 
 static Scsi_Host_Template driver_template = {
 	.proc_info		= aic7xxx_proc_info,
===== drivers/scsi/amiga7xx.c 1.9 vs edited =====
--- 1.9/drivers/scsi/amiga7xx.c	Sat Jan 10 20:18:15 2004
+++ edited/drivers/scsi/amiga7xx.c	Mon Apr 26 22:32:57 2004
@@ -29,6 +29,7 @@
 #include "53c7xx.h"
 #include "amiga7xx.h"
 
+MODULE_VERSION("");
 
 static int amiga7xx_register_one(Scsi_Host_Template *tpnt,
 				 unsigned long address)
===== drivers/scsi/ata_piix.c 1.15 vs edited =====
--- 1.15/drivers/scsi/ata_piix.c	Tue Mar 23 11:35:45 2004
+++ edited/drivers/scsi/ata_piix.c	Mon Apr 26 22:33:52 2004
@@ -204,6 +204,7 @@
 MODULE_DESCRIPTION("SCSI low-level driver for Intel PIIX/ICH ATA controllers");
 MODULE_LICENSE("GPL");
 MODULE_DEVICE_TABLE(pci, piix_pci_tbl);
+MODULE_VERSION(DRV_VERSION);
 
 /**
  *	piix_pata_cbl_detect - Probe host controller cable detect info
===== drivers/scsi/atari_scsi.c 1.10 vs edited =====
--- 1.10/drivers/scsi/atari_scsi.c	Fri May  2 14:49:04 2003
+++ edited/drivers/scsi/atari_scsi.c	Mon Apr 26 22:53:04 2004
@@ -1161,3 +1161,4 @@
 #include "scsi_module.c"
 
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/atp870u.c 1.29 vs edited =====
--- 1.29/drivers/scsi/atp870u.c	Tue Feb  3 23:29:29 2004
+++ edited/drivers/scsi/atp870u.c	Mon Apr 26 22:56:01 2004
@@ -37,6 +37,8 @@
 #include "hosts.h"
 #include "atp870u.h"
 
+#define DRV_VERSION "2.6-ac"
+
 /*
  *   static const char RCSid[] = "$Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/atp870u.c,v 1.0 1997/05/07 15:22:00 root Exp root $";
  */
@@ -2617,7 +2619,7 @@
 	if (offset == 0) {
 		memset(buff, 0, sizeof(buff));
 	}
-	size += sprintf(BLS, "ACARD AEC-671X Driver Version: 2.6+ac\n");
+	size += sprintf(BLS, "ACARD AEC-671X Driver Version: %s\n", DRV_VERSION);
 	len += size;
 	pos = begin + len;
 	size = 0;
@@ -2672,6 +2674,7 @@
 }
 
 MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);
 
 static Scsi_Host_Template atp870u_template = {
 	.module			= THIS_MODULE,
===== drivers/scsi/megaraid.c 1.62 vs edited =====
--- 1.62/drivers/scsi/megaraid.c	Thu Feb 19 18:32:21 2004
+++ edited/drivers/scsi/megaraid.c	Mon Apr 26 22:03:19 2004
@@ -56,6 +56,7 @@
 MODULE_AUTHOR ("LSI Logic Corporation");
 MODULE_DESCRIPTION ("LSI Logic MegaRAID driver");
 MODULE_LICENSE ("GPL");
+MODULE_VERSION("2.00.3");
 
 static unsigned int max_cmd_per_lun = DEF_CMD_PER_LUN;
 MODULE_PARM(max_cmd_per_lun, "i");
===== drivers/scsi/aacraid/linit.c 1.28 vs edited =====
--- 1.28/drivers/scsi/aacraid/linit.c	Tue Mar 16 02:57:16 2004
+++ edited/drivers/scsi/aacraid/linit.c	Mon Apr 26 22:05:04 2004
@@ -59,6 +59,7 @@
 		   "Adaptec Advanced Raid Products, "
 		   "and HP NetRAID-4M SCSI driver");
 MODULE_LICENSE("GPL");
+MODULE_VERSION(AAC_DRIVER_VERSION);
 
 
 int nondasd = -1;
===== drivers/scsi/aic7xxx/aic79xx_osm.c 1.52 vs edited =====
--- 1.52/drivers/scsi/aic7xxx/aic79xx_osm.c	Wed Feb 18 21:42:35 2004
+++ edited/drivers/scsi/aic7xxx/aic79xx_osm.c	Mon Apr 26 22:12:46 2004
@@ -429,6 +429,7 @@
 #ifdef MODULE_LICENSE
 MODULE_LICENSE("Dual BSD/GPL");
 #endif
+MODULE_VERSION(AIC79XX_DRIVER_VERSION);
 MODULE_PARM(aic79xx, "s");
 MODULE_PARM_DESC(aic79xx,
 "period delimited, options string.\n"
===== drivers/scsi/aic7xxx/aic7xxx_osm.c 1.49 vs edited =====
--- 1.49/drivers/scsi/aic7xxx/aic7xxx_osm.c	Wed Feb 18 21:42:35 2004
+++ edited/drivers/scsi/aic7xxx/aic7xxx_osm.c	Mon Apr 26 22:13:37 2004
@@ -450,6 +450,7 @@
 #ifdef MODULE_LICENSE
 MODULE_LICENSE("Dual BSD/GPL");
 #endif
+MODULE_VERSION(AIC7XXX_DRIVER_VERSION);
 MODULE_PARM(aic7xxx, "s");
 MODULE_PARM_DESC(aic7xxx,
 "period delimited, options string.\n"
===== drivers/scsi/arm/acornscsi.c 1.37 vs edited =====
--- 1.37/drivers/scsi/arm/acornscsi.c	Sun Feb  8 10:36:58 2004
+++ edited/drivers/scsi/arm/acornscsi.c	Mon Apr 26 22:37:33 2004
@@ -3128,3 +3128,4 @@
 MODULE_AUTHOR("Russell King");
 MODULE_DESCRIPTION("AcornSCSI driver");
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/arm/arxescsi.c 1.24 vs edited =====
--- 1.24/drivers/scsi/arm/arxescsi.c	Sun Feb  8 10:31:49 2004
+++ edited/drivers/scsi/arm/arxescsi.c	Mon Apr 26 22:43:13 2004
@@ -53,6 +53,7 @@
 #define CSTATUS_IRQ	(1 << 0)
 
 #define VERSION "1.10 (23/01/2003 2.5.57)"
+#define DRV_VERSION "2.5.57"
 
 /*
  * Function: int arxescsi_dma_setup(host, SCpnt, direction, min_type)
@@ -399,4 +400,4 @@
 MODULE_AUTHOR("Stefan Hanske");
 MODULE_DESCRIPTION("ARXESCSI driver for Acorn machines");
 MODULE_LICENSE("GPL");
-
+MODULE_VERSION(DRV_VERSION);
===== drivers/scsi/arm/cumana_1.c 1.21 vs edited =====
--- 1.21/drivers/scsi/arm/cumana_1.c	Fri Jul 18 09:43:19 2003
+++ edited/drivers/scsi/arm/cumana_1.c	Mon Apr 26 22:45:12 2004
@@ -354,3 +354,4 @@
 
 MODULE_DESCRIPTION("Cumana SCSI-1 driver for Acorn machines");
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/arm/cumana_2.c 1.31 vs edited =====
--- 1.31/drivers/scsi/arm/cumana_2.c	Sun Feb  8 10:31:49 2004
+++ edited/drivers/scsi/arm/cumana_2.c	Mon Apr 26 22:44:43 2004
@@ -67,6 +67,7 @@
  * Version
  */
 #define VERSION "1.00 (13/11/2002 2.5.47)"
+#define DRV_VERSION "2.5.47"
 
 /*
  * Use term=0,1,0,0,0 to turn terminators on/off
@@ -566,3 +567,4 @@
 MODULE_PARM(term, "1-8i");
 MODULE_PARM_DESC(term, "SCSI bus termination");
 MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);
===== drivers/scsi/arm/ecoscsi.c 1.21 vs edited =====
--- 1.21/drivers/scsi/arm/ecoscsi.c	Fri Jul 18 09:43:19 2003
+++ edited/drivers/scsi/arm/ecoscsi.c	Mon Apr 26 22:45:50 2004
@@ -235,4 +235,5 @@
 MODULE_AUTHOR("Russell King");
 MODULE_DESCRIPTION("Econet-SCSI driver for Acorn machines");
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
 
===== drivers/scsi/arm/eesox.c 1.32 vs edited =====
--- 1.32/drivers/scsi/arm/eesox.c	Sun Feb  8 10:31:49 2004
+++ edited/drivers/scsi/arm/eesox.c	Mon Apr 26 22:46:35 2004
@@ -62,6 +62,7 @@
 #define EESOX_DMADATA		0x3800
 
 #define VERSION "1.10 (17/01/2003 2.5.59)"
+#define DRV_VERSION "2.5.59"
 
 /*
  * Use term=0,1,0,0,0 to turn terminators on/off
@@ -676,4 +677,4 @@
 MODULE_PARM(term, "1-8i");
 MODULE_PARM_DESC(term, "SCSI bus termination");
 MODULE_LICENSE("GPL");
-
+MODULE_VERSION(DRV_VERSION);
===== drivers/scsi/arm/fas216.c 1.26 vs edited =====
--- 1.26/drivers/scsi/arm/fas216.c	Sat Sep 20 09:08:01 2003
+++ edited/drivers/scsi/arm/fas216.c	Mon Apr 26 22:47:26 2004
@@ -3047,3 +3047,4 @@
 MODULE_AUTHOR("Russell King");
 MODULE_DESCRIPTION("Generic FAS216/NCR53C9x driver core");
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/arm/msgqueue.c 1.5 vs edited =====
--- 1.5/drivers/scsi/arm/msgqueue.c	Thu May 15 19:33:17 2003
+++ edited/drivers/scsi/arm/msgqueue.c	Mon Apr 26 22:48:18 2004
@@ -169,3 +169,4 @@
 MODULE_AUTHOR("Russell King");
 MODULE_DESCRIPTION("SCSI message queue handling");
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/arm/oak.c 1.22 vs edited =====
--- 1.22/drivers/scsi/arm/oak.c	Fri Jul 18 09:43:19 2003
+++ edited/drivers/scsi/arm/oak.c	Mon Apr 26 22:49:04 2004
@@ -213,4 +213,4 @@
 MODULE_AUTHOR("Russell King");
 MODULE_DESCRIPTION("Oak SCSI driver");
 MODULE_LICENSE("GPL");
-
+MODULE_VERSION("");
===== drivers/scsi/arm/powertec.c 1.30 vs edited =====
--- 1.30/drivers/scsi/arm/powertec.c	Sun Feb  8 10:31:50 2004
+++ edited/drivers/scsi/arm/powertec.c	Mon Apr 26 22:49:47 2004
@@ -477,3 +477,4 @@
 MODULE_PARM(term, "1-8i");
 MODULE_PARM_DESC(term, "SCSI bus termination");
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/arm/queue.c 1.11 vs edited =====
--- 1.11/drivers/scsi/arm/queue.c	Tue May 27 14:47:20 2003
+++ edited/drivers/scsi/arm/queue.c	Mon Apr 26 22:50:25 2004
@@ -317,3 +317,4 @@
 MODULE_AUTHOR("Russell King");
 MODULE_DESCRIPTION("SCSI command queueing");
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");
===== drivers/scsi/qla2xxx/qla_os.c 1.16 vs edited =====
--- 1.16/drivers/scsi/qla2xxx/qla_os.c	Wed Apr 21 15:42:05 2004
+++ edited/drivers/scsi/qla2xxx/qla_os.c	Mon Apr 26 22:10:18 2004
@@ -4551,3 +4551,4 @@
 MODULE_AUTHOR("QLogic Corporation");
 MODULE_DESCRIPTION("QLogic Fibre Channel HBA Driver");
 MODULE_LICENSE("GPL");
+MODULE_VERSION(QLA2XXX_VERSION);
#1 lore raw
Quoted 7 lines

Now that the MODULE_VERSION() macro is in 2.6, I'd love to see all modules implement it. So before I go touch all the SCSI drivers, I thought I'd bounce this off the list.

There are a few drivers with version strings that look like this:
#define VERSION "1.10 (23/01/2003 2.5.57)"

Quoted 8 lines

In the new world order, I think they need to look more like this:
#define DRV_VERSION "2.5.57"
#define DRV_DATE "23/01/2003"
and print both strings if it's interesting to do so, but the date stays out of the MODULE_VERSION(DRV_VERSION).

Thoughts? Patch below against Linus's BK-cur covers a the a* drivers, plus a few I care specifically about.

What's the purpose of the
MODULE_VERSION(""):
instances? (e.g.:)

Review line 261

Quoted 8 lines

===== drivers/scsi/a2091.c 1.13 vs edited ====---
1.13/drivers/scsi/a2091.c Sat Sep 27 10:17:28 2003
+++ edited/drivers/scsi/a2091.c Mon Apr 26 22:21:06 2004

(quoted diff) +1 -0
@@ -258,3 +258,4 @@
 }
 
 MODULE_LICENSE("GPL");
+MODULE_VERSION("");

~Randy

#2 lore raw

On Mon, 2004-04-26 21:15:54 -0700, Randy.Dunlap <[email protected]> wrote in message <[email protected]>:

Quoted 4 lines

What's the purpose of the
MODULE_VERSION(""):
instances? (e.g.:)

"I'm that ol', I forgot my age..."

MfG, JBG

Signature · 4 lines
   Jan-Benedict Glaw       [email protected]    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));
#3 lore raw
In reply to Randy.Dunlap
Quoted 6 lines · Randy.Dunlap
Quoted 2 lines

Now that the MODULE_VERSION() macro is in 2.6, I'd love to see all modules implement it.

What's the purpose of the
MODULE_VERSION(""):
instances? (e.g.:)

Per include/linux/module.h:
Using this automatically adds a checksum of the .c files and the local headers to the end. Use MODULE_VERSION("") if you want just this. Macro includes room for this.

So for modules which don't appear to have their own versioning, we use the "" mechanism to simply generate the checksum for the file. This still allows tools (ala DKMS eventually) to note if something in the module changed even if the version string didn't.

Thanks,
Matt

Signature · 4 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com
#4 lore raw
Quoted 9 lines · Matt Domsch

Per include/linux/module.h:
Using this automatically adds a checksum of the .c files and the local headers to the end. Use MODULE_VERSION("") if you want just this. Macro includes room for this.

So for modules which don't appear to have their own versioning, we use the "" mechanism to simply generate the checksum for the file. This still allows tools (ala DKMS eventually) to note if something in the module changed even if the version string didn't.

That's totally braindead. If you want to use a scheme like that talk rusty into generating this without needing to add anything to the driver.

#5 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Matt Domsch

Per include/linux/module.h:
Using this automatically adds a checksum of the .c files and the local headers to the end. Use MODULE_VERSION("") if you want just this. Macro includes room for this.

Quoted 7 lines
Quoted 4 lines

So for modules which don't appear to have their own versioning, we use the "" mechanism to simply generate the checksum for the file. This still allows tools (ala DKMS eventually) to note if something in the module changed even if the version string didn't.

That's totally braindead. If you want to use a scheme like that talk rusty into generating this without needing to add anything to the driver.

Yeah, that thought crossed my mind at 4am too. I just pinged Rusty, and will see about doing such myself regardless.

Thanks,
Matt

Signature · 4 lines
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com