summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2015-03-25 13:44:01 +0000
committerarybchik <arybchik@FreeBSD.org>2015-03-25 13:44:01 +0000
commit71c9b1feb3cf571e1936bc7c66e56de952abdbd9 (patch)
treedadfa360557e76969717571989c0d1e540de10a4
parent323881a00032fd6557c99f2053689044308f289b (diff)
downloadFreeBSD-src-71c9b1feb3cf571e1936bc7c66e56de952abdbd9.zip
FreeBSD-src-71c9b1feb3cf571e1936bc7c66e56de952abdbd9.tar.gz
MFC: 280162
sfxge: adding version info to device description The information is required for NIC update and config tools. Submitted by: Artem V. Andreev <Artem.Andreev at oktetlabs.ru> Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
-rw-r--r--sys/dev/sfxge/sfxge.c7
-rw-r--r--sys/dev/sfxge/sfxge_version.h37
-rw-r--r--sys/modules/sfxge/Makefile2
3 files changed, 45 insertions, 1 deletions
diff --git a/sys/dev/sfxge/sfxge.c b/sys/dev/sfxge/sfxge.c
index 624276f..ab8416f 100644
--- a/sys/dev/sfxge/sfxge.c
+++ b/sys/dev/sfxge/sfxge.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include "sfxge.h"
#include "sfxge_rx.h"
+#include "sfxge_version.h"
#define SFXGE_CAP (IFCAP_VLAN_MTU | \
IFCAP_HWCSUM | IFCAP_VLAN_HWCSUM | IFCAP_TSO | \
@@ -472,6 +473,12 @@ sfxge_create(struct sfxge_softc *sc)
if ((error = efx_nic_probe(enp)) != 0)
goto fail5;
+ SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+ OID_AUTO, "version", CTLFLAG_RD,
+ SFXGE_VERSION_STRING, 0,
+ "Driver version");
+
/* Initialize the NVRAM. */
if ((error = efx_nvram_init(enp)) != 0)
goto fail6;
diff --git a/sys/dev/sfxge/sfxge_version.h b/sys/dev/sfxge/sfxge_version.h
new file mode 100644
index 0000000..e23ce14
--- /dev/null
+++ b/sys/dev/sfxge/sfxge_version.h
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2015 Solarflare Communications, Inc.
+ * All rights reserved.
+ *
+ * This software was developed in part by OKTET Labs under contract for
+ * Solarflare Communications, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SFXGE_VERSION_H
+#define _SFXGE_VERSION_H
+
+#define SFXGE_VERSION_STRING "v3.3.4.6363"
+
+#endif /* _SFXGE_DRIVER_VERSION_H */
diff --git a/sys/modules/sfxge/Makefile b/sys/modules/sfxge/Makefile
index 75a1ba0..d5ab71e 100644
--- a/sys/modules/sfxge/Makefile
+++ b/sys/modules/sfxge/Makefile
@@ -11,7 +11,7 @@ SRCS+= opt_inet.h opt_sched.h
SRCS+= sfxge.c sfxge_dma.c sfxge_ev.c
SRCS+= sfxge_intr.c sfxge_mcdi.c
SRCS+= sfxge_port.c sfxge_rx.c sfxge_tx.c
-SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h
+SRCS+= sfxge.h sfxge_rx.h sfxge_tx.h sfxge_version.h
.PATH: ${.CURDIR}/../../dev/sfxge/common
SRCS+= efx_ev.c efx_intr.c efx_mac.c efx_mcdi.c efx_nic.c
OpenPOWER on IntegriCloud