Annotation of Net2/arch/hp300/dev/hilioctl.h, revision 1.1.1.2

1.1       root        1: /*
                      2:  * Copyright (c) 1988 University of Utah.
                      3:  * Copyright (c) 1990 The Regents of the University of California.
                      4:  * All rights reserved.
                      5:  *
                      6:  * This code is derived from software contributed to Berkeley by
                      7:  * the Systems Programming Group of the University of Utah Computer
                      8:  * Science Department.
                      9:  *
                     10:  * Redistribution and use in source and binary forms, with or without
                     11:  * modification, are permitted provided that the following conditions
                     12:  * are met:
                     13:  * 1. Redistributions of source code must retain the above copyright
                     14:  *    notice, this list of conditions and the following disclaimer.
                     15:  * 2. Redistributions in binary form must reproduce the above copyright
                     16:  *    notice, this list of conditions and the following disclaimer in the
                     17:  *    documentation and/or other materials provided with the distribution.
                     18:  * 3. All advertising materials mentioning features or use of this software
                     19:  *    must display the following acknowledgement:
                     20:  *     This product includes software developed by the University of
                     21:  *     California, Berkeley and its contributors.
                     22:  * 4. Neither the name of the University nor the names of its contributors
                     23:  *    may be used to endorse or promote products derived from this software
                     24:  *    without specific prior written permission.
                     25:  *
                     26:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     27:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     28:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     29:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     30:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     31:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     32:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     33:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     34:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     35:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     36:  * SUCH DAMAGE.
                     37:  *
                     38:  * from: Utah $Hdr: hilioctl.h 1.1 90/07/09$
                     39:  *
1.1.1.2 ! root       40:  *     from: @(#)hilioctl.h    7.2 (Berkeley) 11/4/90
        !            41:  *     hilioctl.h,v 1.2 1993/05/22 07:56:18 cgd Exp
1.1       root       42:  */
                     43: 
                     44: struct _hilbell {
                     45:        u_char  duration;
                     46:        u_char  frequency;
                     47: };
                     48: 
                     49: struct _hilbuf16 {
                     50:        u_char  string[16];
                     51: };
                     52: 
                     53: struct _hilbuf11 {
                     54:        u_char  string[11];
                     55: };
                     56: 
                     57: struct _hilbuf5 {
                     58:        u_char  string[5];
                     59: };
                     60: 
                     61: struct _hilbuf4 {
                     62:        u_char  string[4];
                     63: };
                     64: 
                     65: struct _hilbuf2 {
                     66:        u_char  string[2];
                     67: };
                     68: 
                     69: struct hilqinfo {
                     70:        int     qid;
                     71:        char    *addr;
                     72: };
                     73: 
                     74: /*
                     75:  * HPUX ioctls (here for the benefit of the HIL driver).
                     76:  * Named as they are under HPUX.
                     77:  * The first set are loop device ioctls.
                     78:  * The second set are ioctls for the 8042.
                     79:  * Note that some are not defined as in HPUX
                     80:  * due to the difference in the definitions of IOC_VOID.
                     81:  */
                     82: #define _IOHpux(x,y)   (IOC_IN|((x)<<8)|y)     /* IOC_IN is IOC_VOID */
                     83: 
                     84: #define HILID  _IOR('h',0x03, struct _hilbuf11) /* Identify & describe */
                     85: #define HILSC  _IOR('h',0x33, struct _hilbuf16) /* Security code */
                     86: #define HILRN  _IOR('h',0x30, struct _hilbuf16) /* Report name */
                     87: #define HILRS  _IOR('h',0x31, struct _hilbuf16) /* Report status */
                     88: #define HILED  _IOR('h',0x32, struct _hilbuf16) /* Extended describe*/
                     89: #define HILDKR  _IOHpux('h',0x3D)              /* Disable autorepeat */
                     90: #define HILER1  _IOHpux('h',0x3E)              /* Autorepeat 1/30 */
                     91: #define HILER2  _IOHpux('h',0x3F)              /* Autorepeat 1/60 */
                     92: #define HILP1  _IOHpux('h',0x40)               /* Prompt 1 */
                     93: #define HILP2  _IOHpux('h',0x41)               /* Prompt 2 */
                     94: #define HILP3  _IOHpux('h',0x42)               /* Prompt 3 */
                     95: #define HILP4  _IOHpux('h',0x43)               /* Prompt 4 */
                     96: #define HILP5  _IOHpux('h',0x44)               /* Prompt 5 */
                     97: #define HILP6  _IOHpux('h',0x45)               /* Prompt 6 */
                     98: #define HILP7  _IOHpux('h',0x46)               /* Prompt 7 */
                     99: #define HILP   _IOHpux('h',0x47)               /* Prompt */
                    100: #define HILA1  _IOHpux('h',0x48)               /* Acknowledge 1 */
                    101: #define HILA2  _IOHpux('h',0x49)               /* Acknowledge 2 */
                    102: #define HILA3  _IOHpux('h',0x4A)               /* Acknowledge 3 */
                    103: #define HILA4  _IOHpux('h',0x4B)               /* Acknowledge 4 */
                    104: #define HILA5  _IOHpux('h',0x4C)               /* Acknowledge 5 */
                    105: #define HILA6  _IOHpux('h',0x4D)               /* Acknowledge 6 */
                    106: #define HILA7  _IOHpux('h',0x4E)               /* Acknowledge 7 */
                    107: #define HILA   _IOHpux('h',0x4F)               /* Acknowledge */
                    108: 
                    109: #define EFTSRD  _IOW('H',0xa0,char)            /* Set the repeat delay. */
                    110: #define EFTSRR  _IOW('H',0xa2,char)            /* Set the repeat rate. */
                    111: #define EFTSRPG _IOW('H',0xa6,char)            /* Set RPG interrupt rate. */
                    112: #define EFTSBP  _IOW('H',0xc4,struct _hilbuf4) /* Send data to the beeper. */
                    113: #define EFTRLC  _IOR('H',0x12,char)            /* Read the language code. */
                    114: #define EFTRCC  _IOR('H',0x11,char)            /* Read configuration code. */
                    115: #define EFTRRT  _IOR('H',0x31,struct _hilbuf5) /* Read the real time. */
                    116: #define EFTRT   _IOR('H',0xf4,struct _hilbuf4) /* Read the timers for the
                    117:                                                      four voices. */
                    118: #define EFTSBI  _IOW('H',0xa3,struct _hilbuf2) /* Set the bell information. */
                    119: 
                    120: /*
                    121:  * BSD ioctls.
                    122:  * Mostly the same as the HPUX versions except for shared-queue ioctls.
                    123:  */
                    124: #define HILIOCID       _IOR('h',0x03, struct _hilbuf11)
                    125: #define HILIOCSC       _IOR('h',0x33, struct _hilbuf16)
                    126: #define HILIOCRN       _IOR('h',0x30, struct _hilbuf16)
                    127: #define HILIOCRS       _IOR('h',0x31, struct _hilbuf16)
                    128: #define HILIOCED       _IOR('h',0x32, struct _hilbuf16)
                    129: #define HILIOCAROFF    _IO('h',0x3D)
                    130: #define HILIOCAR1      _IO('h',0x3E)
                    131: #define HILIOCAR2      _IO('h',0x3F)
                    132: #define HILIOCSBP      _IOW('H',0xc4,struct _hilbuf4)
                    133: #define HILIOCRRT      _IOR('H',0x31,struct _hilbuf5)
                    134: #define HILIOCRT       _IOR('H',0xf4,struct _hilbuf4)
                    135: #define HILIOCBEEP     _IOW('H',0xA3,struct _hilbell)
                    136: #      define  BELLDUR         80      /* tone duration in msec (10 - 2560) */
                    137: #      define  BELLFREQ        8       /* tone frequency (0 - 63) */
                    138: 
                    139: #define HILIOCALLOCQ   _IOWR('H',0x72, struct hilqinfo)        /* allocate queue */
                    140: #define HILIOCFREEQ    _IOW('H',0x73, struct hilqinfo) /* deallocate queue */
                    141: #define HILIOCMAPQ     _IOW('H',0x74, int)     /* map device to queue */
                    142: #define HILIOCUNMAPQ   _IOW('H',0x75, int)     /* unmap device from dev */
                    143: #define HILIOCTEST      _IOW('H',0x76, int)    /* Toggle debugging mode */
                    144: #define HILIOCHPUX     _IO('H',0x77)           /* use HPUX (read) semantics */
                    145: #define HILIOCRESET    _IO('H',0x78)           /* Reset the HIL loop. */
                    146: 
                    147: /*
                    148:  * HIL input queue.
                    149:  * This is the circular queue (allocated by HILIOCALLOC) shared by kernel
                    150:  * and user.  It consists of a sixteen byte header followed by space for
                    151:  * 255 input data packets (a total of 4096 bytes).  The kernel adds packets
                    152:  * at tail.  The user is expected to remove packets from head.  This is the
                    153:  * only field in the header that the user should modify.
                    154:  */
                    155: typedef struct hil_packet {
                    156:        u_char  size;           /* total packet size */
                    157:        u_char  dev;            /* loop device packet was generated by */
                    158:        long    tstamp;         /* time stamp */
                    159:        u_char  data[10];       /* device data */
                    160: } hil_packet;
                    161: 
                    162: typedef struct hil_eventqueue {
                    163:        int     size;
                    164:        int     head;
                    165:        int     tail;
                    166:        int     pad;
                    167: } hil_eventqueue;
                    168: 
                    169: typedef union hilqueue {
                    170:        char    hqu_size[0x1000];
                    171:        struct  q_data {
                    172:                hil_eventqueue  h_eventqueue;
                    173:                hil_packet      h_event[1];
                    174:        } q_data;
                    175: #define hil_evqueue    q_data.h_eventqueue
                    176: #define hil_event      q_data.h_event
                    177: } HILQ;
                    178: 
                    179: #define HEVQSIZE       \
                    180:        ((sizeof(HILQ) - sizeof(struct q_data)) / sizeof(hil_packet) + 1)

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.