DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

drv_gethardware(D3)


drv_gethardware -- retrieve hardware information

Synopsis (Not in current DDI version)

   #include <sys/types.h>
   #include <sys/ddi.h>
   #include <sys/ddi_i386at.h>
   

int drv_gethardware(ulong_t parm, void *value_p);

Description

drv_gethardware returns the value of the parameter specified by parm in the location pointed to by value_p.

Arguments


parm
The hardware information to be obtained.

value_p
A pointer to the data space into which the value of the parameter specified by parm is to be copied.

Return values

On success, drv_gethardware returns 0. On failure, drv_gethardware returns -1 to indicate that parm specified an invalid parameter.

Usage

It is the responsibility of the driver to correctly declare the data space needed to hold the information returned.

Valid values for parm are:


PROC_INFO
Retrieve processor identification information. value_p should point to a structure of type struct cpuparms. The cpuparms structure is defined as:
   struct cpuparms {
   	ulong_t cpu_id;          /* CPU identification */
   	ulong_t cpu_step;        /* Step (revision) number */
   	ulong_t cpu_resrvd[2];   /* RESERVED for future expansion */
   };

/* Valid values for cpu_id */

#define CPU_UNK 0 #define CPU_i386 1 #define CPU_i486 2 #define CPU_i586 3 #define CPU_i686 4 #define CPU_i786 5

/* Valid values for cpu_step */

#define STEP_UNK 0 #define STEP_B1 1 /* if cpu_id == CPU_i386 */


IOBUS_TYPE
Retrieve the bus type. Valid values are BUS_ISA, BUS_EISA, and BUS_MCA.

EISA_BRDID
Retrieve the EISA board ID for a controller in a given EISA slot. This function takes a pointer to a long variable, which should contain the EISA slot number when upon entry, and which will contain the EISA board ID when the function exits. If the slot number is invalid or the system does not have an EISA bus, -1 is returned. If the board ID cannot be determined, -1 is placed in the parameter variable.

TOTAL_MEM
Retrieve the size of memory (in bytes).

DMA_SIZE
Retrieve the number of bits available for DMA addressing.

BOOT_DEV
Retrieve which device the system was booted from. value_p should point to a structure of type struct bootdev. The bootdev structure is defined as:
   struct bootdev {
   	ulong_t   bdv_type;        /* Type of the boot device */
   	ulong_t   bdv_unit;        /* Unit number of the boot device */
   	ulong_t   bdv_resrvd[2];   /* RESERVED for future expansion */
   };

/* Valid values for bdv_type */

#define BOOT_FLOPPY 1 #define BOOT_DISK 2 #define BOOT_CDROM 3 #define BOOT_NETWORK 4


HD_PARMS
Retrieve a pointer to the parameters for a specified hard disk. value_p should point to a structure of type struct hdparms. The driver must specify the hard disk by setting the ``hp_unit'' field of the hdparms structure pointed to by value_p to the unit number of the hard disk prior to calling drv_gethardware. The hdparms structure is defined as:
   struct hdparms {
   	ulong_t   hp_unit;         /* Hard disk unit number */
   	ulong_t   hp_ncyls;        /* Number of cylinders (0 == no disk) */
   	ulong_t   hp_nheads;       /* Number of heads */
   	ulong_t   hp_nsects;       /* Number of sectors per track */
   	ushort_t  hp_precomp;      /* Write precompensation cylinder */
   	ushort_t  hp_lz;           /* Landing zone cylinder number */
   	ulong_t   hp_resrvd[2];    /* RESERVED for future expansion */
   };

Context and synchronization

All contexts.

Hardware applicability

All

Hardware applicability

AT-compatible architectures

Version applicability

ddi: 4, 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp

Differences between versions

This function is not supported in DDI 8. Similar functionality is implemented through the parameters listed on the cm_params(D5) manual page and the system interface in HDK Technical Reference.
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005