Skip to content
Browse files

wlcore/wl18xx/wl12xx: add version and timestamp strings (INTERNAL)

In order to allow better version control, add version
and timestamp strings into the wl12xx module.

These strings will be printed on driver load, and when
reading the driver_state.

(this is not going to work well in compat, because it
copies all the files instead of compiling them in the
original tree, so the version of the compat tree will
appear as the driver version. we can workaround it
with the additional makefile hacks...)

NOTE: I couldn't find how to make one module recompile
when the .h file of another module was changed, so i
just duplicated it for now.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information...
1 parent 1284976 commit 99567189b5d9d33c84e0ff36cadd5cd34747b519 @elp elp committed with ariknem
View
9 drivers/net/wireless/ti/wl12xx/Makefile
@@ -1,3 +1,12 @@
wl12xx-objs = main.o cmd.o acx.o debugfs.o
+define filechk_version.h
+ (echo 'static const char *wl12xx_git_head = "$(shell git describe)";')
+endef
+
+$(obj)/version.h: .git/HEAD .git/index
+ @$(call filechk,version.h)
+
+$(obj)/main.c: $(src)/version.h
+
obj-$(CONFIG_WL12XX) += wl12xx.o
View
3 drivers/net/wireless/ti/wl12xx/main.c
@@ -40,6 +40,7 @@
#include "cmd.h"
#include "acx.h"
#include "debugfs.h"
+#include "version.h"
static char *fref_param;
static char *tcxo_param;
@@ -1694,7 +1695,7 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
else
wl1271_error("Invalid tcxo parameter %s", tcxo_param);
}
-
+ wl1271_info("wl12xx driver version: %s", wl12xx_git_head);
return wlcore_probe(wl, pdev);
}
View
9 drivers/net/wireless/ti/wl18xx/Makefile
@@ -1,3 +1,12 @@
wl18xx-objs = main.o acx.o tx.o io.o debugfs.o
+define filechk_version.h
+ (echo 'static const char *wl18xx_git_head = "$(shell git describe)";')
+endef
+
+$(obj)/version.h: .git/HEAD .git/index
+ @$(call filechk,version.h)
+
+$(obj)/main.c: $(src)/version.h
+
obj-$(CONFIG_WL18XX) += wl18xx.o
View
2 drivers/net/wireless/ti/wl18xx/main.c
@@ -40,6 +40,7 @@
#include "wl18xx.h"
#include "io.h"
#include "debugfs.h"
+#include "version.h"
#define WL18XX_RX_CHECKSUM_MASK 0x40
@@ -1526,6 +1527,7 @@ static int __devinit wl18xx_probe(struct platform_device *pdev)
wl->enable_11a = enable_11a_param;
+ wl1271_info("wl18xx driver version: %s", wl18xx_git_head);
return wlcore_probe(wl, pdev);
out_free:
View
10 drivers/net/wireless/ti/wlcore/Makefile
@@ -1,6 +1,16 @@
wlcore-objs = main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \
boot.o init.o debugfs.o scan.o
+define filechk_version.h
+ (echo 'static const char *wlcore_timestamp = "$(shell date)";'; \
+ echo 'static const char *wlcore_git_head = "$(shell git describe)";')
+endef
+
+$(obj)/version.h: .git/HEAD .git/index
+ @$(call filechk,version.h)
+
+$(obj)/main.c: $(src)/version.h
+
wlcore_spi-objs = spi.o
wlcore_sdio-objs = sdio.o
View
8 drivers/net/wireless/ti/wlcore/debugfs.c
@@ -34,6 +34,7 @@
#include "io.h"
#include "tx.h"
#include "hw_ops.h"
+#include "version.h"
/* ms */
#define WL1271_DEBUGFS_STATS_LIFETIME 1000
@@ -447,12 +448,19 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
(res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\
#x " = " fmt "\n", wl->x))
+#define DRIVER_STATE_PRINT_GENERIC(x, fmt, args...) \
+ (res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,\
+ #x " = " fmt "\n", args))
+
#define DRIVER_STATE_PRINT_LONG(x) DRIVER_STATE_PRINT(x, "%ld")
#define DRIVER_STATE_PRINT_INT(x) DRIVER_STATE_PRINT(x, "%d")
#define DRIVER_STATE_PRINT_STR(x) DRIVER_STATE_PRINT(x, "%s")
#define DRIVER_STATE_PRINT_LHEX(x) DRIVER_STATE_PRINT(x, "0x%lx")
#define DRIVER_STATE_PRINT_HEX(x) DRIVER_STATE_PRINT(x, "0x%x")
+ DRIVER_STATE_PRINT_GENERIC(version, "%s", wlcore_git_head);
+ DRIVER_STATE_PRINT_GENERIC(timestamp, "%s", wlcore_timestamp);
+
DRIVER_STATE_PRINT_INT(tx_blocks_available);
DRIVER_STATE_PRINT_INT(tx_allocated_blocks);
DRIVER_STATE_PRINT_INT(tx_allocated_pkts[0]);
View
3 drivers/net/wireless/ti/wlcore/main.c
@@ -50,6 +50,7 @@
#include "testmode.h"
#include "scan.h"
#include "hw_ops.h"
+#include "version.h"
#define WL1271_BOOT_RETRIES 3
@@ -5656,6 +5657,8 @@ int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
goto out_hw_pg_ver;
}
+ wl1271_info("driver version: %s", wlcore_git_head);
+ wl1271_info("compilation time: %s", wlcore_timestamp);
goto out;
out_hw_pg_ver:

0 comments on commit 9956718

Please sign in to comment.
Something went wrong with that request. Please try again.