Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ioctlx, ioctl, gtty, stty

fd

hd



DEVINFO(5,F)                AIX Technical Reference                DEVINFO(5,F)



-------------------------------------------------------------------------------
devinfo



PURPOSE

Contains device characteristics.

SYNOPSIS

#include <sys/devinfo.h>

DESCRIPTION

The devinfo structure is defined for each device.  The IOCINFO operation of the
ioctl system call fills in this structure.  The information returned by a
device varies.  Most devices, other than disk devices, return a devtype value
and the remainder of this structure contains zeros.  This structure provides
information about the capabilities of a device, rather than its current status
or settings.  For example, types of information provided are the number of
characters a printer handles per line or the diskette capacity in number of
blocks.

     struct devinfo
     {  char devtype;
        char flags;
        union
        { struct        /* for disks */
          {short  bytpsec;             /* bytes per sector */
              short  secptrk;          /* sectors per track */
              short  trkpcyl;          /* tracks per cylinder */
              long   numblks;          /* blocks this partition */
             } dk;
             struct     /* for memory mapped displays */
           { char  capab;              /* capabilities */
              char  mode;              /* current mode */
              short  hres;             /* horizontal resolution */
              short  vres;             /* vertical resolution */
           } tt;
           struct       /* for ethernet interfaces */
           {  unsigned short capab;    /* capabilities */
              char haddr[6];           /* hardware address */
           } en;
           struct       /* for block i/o device */
           {
             struct
              {
               char  type;          /* hardware type: ethernet or token ring */
               char  if_flags;         /* up/down  1=ATTACHED
                                                   2=RUNNING
                                                   3=PRIMARY INTERFACE */



Processed November 7, 1990       DEVINFO(5,F)                                 1





DEVINFO(5,F)                AIX Technical Reference                DEVINFO(5,F)



               char  haddr[6];   /* hardware address: ethernet or token ring */
               long  mymach;           /* local IP address */
               long  subnet_mask;      /* subnet mask */
               int   mtu;              /* maximum transmission unit */
               char  if_name[IFNAMSIZ];/* name of interface */
              } lan[MAXIFS];
          } bio;
          struct        /* for magnetic tapes */

          { short       type;          /* what flavor of tape */
                                       /* defined below */
          } mt;
          struct        /* for mouse */
          {    short      m_xres;      /* best x resolution (points/cm) */
               short      m_yres;      /* best y resolution (points/cm) */
               short      pad;         /* make it for both 286 & 386 procs */
         } mo;
        } un;
    };

The following flags specify some generic capabilities (See DD_DISK) :

Constant    Value   Function
DF_FIXED    01      Non-removable
DF_RAND     02      Random access possible
DF_FAST     04      A relative term

The following flags are System/370 only:

Constant    Value   Function
DF_FBA      0x80    Fixed-block-architecture disk (3310/3370)
DF_CKD      0x40    Count-key-data disk (3310/3350/3375/3380)
DF_BLKIO    0xc0    Bulk-I/O disk
DF_MASK     0xc0    Mask for disk type

The following flags are 386-only:

Constant    Value   Function
DF_ESDI     0x20    Enhanced small device interface
DF_ST506    0x10    Seagate Technology 506 interface
DF_I386_MASK0x30    Mask for disk type

The devinfo structures are defined for the following devices (specified in the
devtype file) :

DD_DISK       Indicates a disk. This devtype is R.  The driver determines the
              value. The fixed disk has flags DF_RAND|DF_FIXED|DF_FAST, while
              the diskette has flag DF_RAND (see "fd" and "hd").

              The number of the bytes per sector, sectors per track, and tracks
              per cylinder for the fixed disk are predetermined.  The minidisk
              table determines the number of blocks. For the diskette, the



Processed November 7, 1990       DEVINFO(5,F)                                 2





DEVINFO(5,F)                AIX Technical Reference                DEVINFO(5,F)



              minor device driver or the physical media determines this
              information when the device is opened.

DD_LP         Indicates a line printer.  The devtype is 1.  This fills in the
              devtype field and returns zeros for the rest of the structure.

DD_PSEU       Indicates a pseudo-device. The devtype is Z.

DD_TAPE       Indicates a magnetic tape. The devtype is M.

DD_TTY        Indicates a terminal. This returns a devtype of t and zeros for
              the rest of the structure.

DD_PUN        Indicates a card punch. The devtype is p.

DD_RDR        Indicates a card reader. The devtype is r.

DD_NET        Indicates a network. The devtype is N.

DD_EN         Indicates an Ethernet interface. The devtype is E.

DD_EM78       Indicates a 3278/79 emulator. The devtype is e.

DD_TR         Indicates a Token Ring interface. The devtype is t.

DD_BIO        Indicates a block I/O device. The devtype is B.

DD_MOUS       Indicates a mouse. The devtype is m.

DD_OSM        Indicates an OSM. The devtype is o.

DD_VM         Indicates a virtual machine command interface. The devtype is o.

DD_MEM        Indicates an interface to kernel memory. The devtype is k.

DT_STREAM     Indicates a streaming tape drive. The devtype is l.

DT_STRTSTP    Indicates a start-stop tape drive. The devtype is 2.

RELATED INFORMATION

In this book:  "ioctlx, ioctl, gtty, stty," "fd," and  "hd."













Processed November 7, 1990       DEVINFO(5,F)                                 3



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026