_ndversion -- declare driver version


   #include <sys/types.h>
   #include <sys/stream.h>
   #include <sys/stropt.h>
   #include <sys/mdi.h>
   #include <sys/ddi.h>

static char _ndversion[]="<your_driver_version>";


_ndversion is a static character pointer variable that should be defined for every &geminiREL7; MDI driver. This variable is stored in the symbol table for the Driver.o file and is read by netcfg to display the driver's version to the user Using the _ndversion symbol is a powerful way to identify the release of the driver to the user before loading it or turning the Driver.o module into a dynamically-linked kernel module. The version information is embedded in the Driver.o so it is not removed by strip or mcs.

The _ndversion variable must be defined as a static or ndcfg will not allow the driver to be configured into the system. The text is free form. Driver writers should use a string that uniquely and succinctly identifies the driver's version to the user when multiple drivers that support the hardware are installed on the system and this string should be reasonably short. The word ``version'' must not be used in the text of the _ndversion value even in an abbreviated form.

Each revision of the driver should change the value of the _ndversion variable so that users can easily determine the release of the driver.

The _ndversion variable must point to a null terminated string.


Usage of the _ndversion variable is strongly encouraged but is not required. Later versions should have larger numbers, but otherwise there are no rules about the scheme used for versioning the driver.

If you use SCCS as a source control system, you can use the following syntax:

   static char _ndversion[]="%I%";
This will automatically update the text displayed to the user when the file is updated. See get for more information about keyword expansion.

While similar, the following syntax does not work:

   static char *_ndversion="%I%";
The code will compile successfully but the version text will not appear in netcfg.

If the _ndversion string is used in your driver, you should use it when calling the mdi_printcfg(D3mdi) function.

Hardware applicability


Version applicability

mdi: 2, 2.1

Differences between versions

_ndversion is not supported in MDI on SCO OpenServer 5 systems.

Future directions

The proper definition of _ndversion should be:
   static char const * const _ndversion="<some text>";
However, the SVR5 version of ndcfg does not support the const keyword and so is unable to read the version string in the Driver.o file from this definition. This will be fixed in a future release.


mdi_printcfg(D3mdi), netcfg, ndcfg, idinstall, mcs, what, get, nm, dump.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005