On Sun, 2006-01-08 at 13:47 +0100, Herbert Valerio Riedel wrote:
> On Sun, 2006-01-08 at 03:32 -0500, Nix N. Nix wrote:
> > Please find attached a Makefile patch that appends the SVN revision to
> > BCM43xx_DRIVER_NAME.
> btw, why not simply use the utility "svnversion" for detecting the
> checked out revision number? :-)
Because I was unaware of its existence ;o)

Please find attached the modified patch that uses "svnversion" :o)

diff -Nru trunk.orig/driver/Makefile trunk/driver/Makefile
--- trunk.orig/driver/Makefile	2006-01-08 02:20:04.000000000 -0500
+++ trunk/driver/Makefile	2006-01-08 02:22:03.000000000 -0500
@@ -11,6 +11,7 @@
 KDIR		?= /lib/modules/$(KVER)/build
 PWD		:= $(shell pwd)
 MODPATH		:= $(DESTDIR)/lib/modules/$(KVER)/kernel/drivers/net/bcm43xx
+REVISION	:= $(shell svnversion .)
 
 # Comment/uncomment to enable/disable debugging
 DEBUG = y
@@ -24,7 +25,7 @@
 CFLAGS += -O2
 endif
 
-CFLAGS += -DBCM43xx_VERSION=$(VERSION) -I/lib/modules/$(KVER)/include
+CFLAGS += -DBCM43xx_VERSION=$(VERSION) -I/lib/modules/$(KVER)/include -DBCM43xx_REVISION=$(REVISION)
 ifneq ($(SOFTMAC_DIR),)
 CFLAGS += -I$(SOFTMAC_DIR)
 endif
@@ -43,7 +44,7 @@
 default: modules
 
 modules:
-	$(MAKE) -C $(KDIR) M=$(PWD) modules
+	$(MAKE) -C $(KDIR) M=$(PWD) CFLAGS="$(CFLAGS)" modules
 
 install: bcm43xx.ko
 	install -d $(MODPATH)
diff -Nru trunk.orig/driver/bcm43xx.h trunk/driver/bcm43xx.h
--- trunk.orig/driver/bcm43xx.h	2006-01-08 02:20:04.000000000 -0500
+++ trunk/driver/bcm43xx.h	2006-01-08 02:23:03.000000000 -0500
@@ -18,7 +18,8 @@
 
 #define DRV_NAME			__stringify(KBUILD_MODNAME)
 #define DRV_VERSION			__stringify(BCM43xx_VERSION)
-#define BCM43xx_DRIVER_NAME		DRV_NAME " driver " DRV_VERSION
+#define DRV_REVISION			__stringify(BCM43xx_REVISION)
+#define BCM43xx_DRIVER_NAME		DRV_NAME " driver " DRV_VERSION " revision " DRV_REVISION
 #define PFX				DRV_NAME ": "
 
 #define BCM43xx_SWITCH_CORE_MAX_RETRIES	10

Reply via email to