Annotation of kernel/kernserv/insertmsg.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: 
                     25: /*     @(#)insertmsg.h 2.0     02/14/90        (c) 1990 NeXT   
                     26:  *
                     27:  * insertmsg.h -- Structs used for "Disk Inserted" messages. 
                     28:  *
                     29:  * HISTORY
                     30:  * 01-Oct-90   Doug Mitchell
                     31:  *     Added in_flags, IND_FLAGS_REMOVABLE
                     32:  * 23-Apr-90   Doug Mitchell
                     33:  *     Added oid_dev_str to of_insert_notify_dev
                     34:  * 14-Feb-90   Doug Mitchell at NeXT
                     35:  *     Created.
                     36:  *
                     37:  */
                     38: 
                     39: #ifndef        _INSERTMSG_
                     40: #define _INSERTMSG_
                     41: 
                     42: #import <sys/types.h>
                     43: #import <mach/message.h>
                     44: 
                     45: #define SUPPORT_PORT_DEVICE    0
                     46: 
                     47: /*
                     48:  * msg_id's for messages used by vol driver.
                     49:  */
                     50: #define VOL_MSG_ID             0x355
                     51: #define VOL_CHECK_MSG_ID       (VOL_MSG_ID+0)  /* new disk insert */
                     52: #define VOL_PANEL_REQ          (VOL_MSG_ID+1)  /* panel request */
                     53: #define VOL_PANEL_RESP         (VOL_MSG_ID+2)  /* panel response */
                     54: #define VOL_PANEL_CANCEL       (VOL_MSG_ID+3)  /* panel cancel */
                     55: 
                     56: #define FORM_TYPE_LENGTH       64
                     57: 
                     58: /*
                     59:  * New disk insertion notification (msg_id == VOL_CHECK_MSG_ID).
                     60:  */
                     61: struct insert_notify {
                     62:        msg_header_t            in_header;
                     63:        msg_type_t              in_vd_type;
                     64:        int                     in_vol_state;   /* IND_VS_xxx */
                     65:        int                     in_dev_desc;    /* IND_DD_xxx */
                     66:        msg_type_t              in_flags_type;
                     67:        int                     in_flags;       /* IND_FLAGS_xxx */
                     68:        msg_type_t              in_ft_type;
                     69:        /*
                     70:         * in_form_type contains the legal densities with with the 
                     71:         * given media can be formatted, sprintf'd as decimal numbers
                     72:         * of KBytes and separated by spaces. String is empty if disk
                     73:         * if formatted.
                     74:         */
                     75:        char                    in_form_type[FORM_TYPE_LENGTH];
                     76:        /*
                     77:         * dev_t or port follows...
                     78:         */
                     79: };
                     80: 
                     81: /*
                     82:  * This struct will be used by fd, od, and SCSI drivers.
                     83:  */
                     84: #define OID_DEVSTR_LEN         16
                     85: 
                     86: struct of_insert_notify_dev {
                     87:        struct insert_notify    oid_header;
                     88:        msg_type_t              oid_dev_type;
                     89:        dev_t                   oid_bdev_t;     /* block device */
                     90:        dev_t                   oid_cdev_t;     /* raw device */
                     91:        msg_type_t              oid_ds_type;
                     92:        char                    oid_dev_str[OID_DEVSTR_LEN];
                     93:                                                /* e.g., "fd0", "fd1" */
                     94: };
                     95: 
                     96: #if    SUPPORT_PORT_DEVICE
                     97: 
                     98: /*
                     99:  * For loadable drivers.
                    100:  */
                    101: struct of_insert_notify_port {
                    102:        struct insert_notify    oip_header;
                    103:        msg_type_t              oip_p_type;
                    104:        port_t                  oip_port;       /* describes other devices */
                    105: };
                    106: 
                    107: #endif /* SUPPORT_PORT_DEVICE */
                    108: 
                    109: /*
                    110:  * in_vol_state values
                    111:  */
                    112: #define IND_VS_LABEL           0x00            /* volume contains valid Mach
                    113:                                                 * label */
                    114: #define IND_VS_FORMATTED       0x01            /* volume is formatted but
                    115:                                                 * contains no label */
                    116: #define IND_VS_UNFORMATTED     0x02            /* unformatted */
                    117: 
                    118: /*
                    119:  * in_dev_desc values
                    120:  */
                    121: #define IND_DD_DEV             0x00            /* oin_dev_t contains a dev_t
                    122:                                                 * for a device in /dev */
                    123: #define IND_DD_PORT            0x01            /* oin_port contains a port
                    124:                                                 * for a loadable server */
                    125: 
                    126: /*
                    127:  * in_flags values
                    128:  */
                    129: #define IND_FLAGS_REMOVABLE    0x00000001      /* 1 = removable; 0 = fixed */
                    130: #define IND_FLAGS_FIXED                0x00000000
                    131: #define IND_FLAGS_WP           0x00000002      /* 1 = write protected */
                    132: 
                    133: /*
                    134:  * Panel request (msg_id == VOL_PANEL_REQ)
                    135:  */
                    136: #define VP_STRING_LEN          40
                    137: 
                    138: struct vol_panel_req {
                    139:        msg_header_t            pr_header;
                    140:        msg_type_t              pr_int_desc;    /* describes following 7
                    141:                                                 * fields */
                    142:        int                     pr_panel_type;  /* PR_PT_xxx */
                    143:        int                     pr_resp_type;   /* PR_RT_xxx */
                    144:        int                     pr_tag;         /* identifies this panel */
                    145:        /*
                    146:         * meanings of these parameters vary per pr_panel_type.
                    147:         */
                    148:        int                     pr_p1;
                    149:        int                     pr_p2;
                    150:        int                     pr_p3;
                    151:        int                     pr_p4;
                    152:        msg_type_t              pr_string_desc; /* describes following 2
                    153:                                                 * fields */
                    154:        char                    pr_string1[VP_STRING_LEN];
                    155:        char                    pr_string2[VP_STRING_LEN];
                    156: };
                    157: 
                    158: /*
                    159:  * pr_panel_type values
                    160:  */
                    161: #define PR_PT_DISK_NUM         0       /* insert disk <p1> in 
                    162:                                         * <p2>(scsi|floppy|optical) drive <p3>
                    163:                                         */
                    164: #define PR_PT_DISK_LABEL       1       /* insert disk <string1> in 
                    165:                                         * <p2>(scsi|floppy|optical) drive <p3>
                    166:                                         */
                    167: #define PR_PT_DISK_NUM_W       2       /* wrong disk - insert disk <p1> in 
                    168:                                         * <p2>(scsi|floppy|optical) drive <p3>
                    169:                                         */
                    170: #define PR_PT_DISK_LABEL_W     3       /* wrong disk - insert disk <string1>
                    171:                                         * in <p2>(scsi|floppy|optical) drive 
                    172:                                         * <p3>
                    173:                                         */
                    174: #define PR_PT_SWAPDEV_FULL     4       /* swap device full */
                    175: #define PR_PT_FILESYS_FULL     5       /* file system <string1> full */
                    176: #define PR_RT_EJECT_REQ                6       /* eject disk in <p2> drive <p3> */
                    177: 
                    178: /*
                    179:  * p2 values for PR_PT_DISK_NUM / PR_PT_DISK_LABEL
                    180:  */
                    181: #define PR_DRIVE_FLOPPY                0       /* floppy disk */
                    182: #define PR_DRIVE_OPTICAL       1       /* OMD-1 (5.25") optical */
                    183: #define PR_DRIVE_SCSI          2       /* removable SCSI disk */
                    184: 
                    185: /*
                    186:  * pr_response_type values. Describes both format of panel and expected 
                    187:  * response by Workspace Manager.
                    188:  */
                    189: #define PR_RT_NONE             0       /* no acknowledgement expected, no
                    190:                                         * cancel necesary */
                    191: #define PR_RT_CANCEL           1       /* no ack; leave panel up until 
                    192:                                         * vol_panel_cancel message */
                    193: #define PR_RT_ACK              2       /* just "OK" ack */
                    194: #define PR_RT_INT              3       /* integer value expected */
                    195: 
                    196: /*
                    197:  * Examples: 
                    198:  *   'Insert floppy disk 3 in drive 0'
                    199:  *     pr_panel_type    = PR_PT_DISK_NUM
                    200:  *     p1               = 3
                    201:  *     p2               = PR_DRIVE_FLOPPY
                    202:  *     p3               = 0
                    203:  *     pr_response_type = PR_RT_ACK (acknowledgement means "disk not 
                    204:  *                        avaliable")
                    205:  *
                    206:  *   'Insert Optical disk "MyDisk" in drive 1'
                    207:  *     pr_panel_type    = PR_PT_DISK_LABEL
                    208:  *     string1          = "MyDisk"
                    209:  *     p2               = PR_DRIVE_OPTICAL
                    210:  *     p3               = 1
                    211:  *     pr_response_type = PR_RT_ACK (acknowledgement means "disk not 
                    212:  *                        avaliable")
                    213:  *
                    214:  *   'Swap Device Full'
                    215:  *     pr_panel_type    = PR_PT_SWAPDEV_FULL
                    216:  *     pr_response_type = PR_RT_ACK (acknowledgement means "OK to send more
                    217:  *                        of these messages") 
                    218:  */
                    219: 
                    220: /*
                    221:  * Panel response (msg_id == VOL_PANEL_RESP). Sent by Workspace Manager to 
                    222:  * vol driver when use responds to panels with pr_response_type of PR_RT_ACK
                    223:  * and PR_RT_INT.
                    224:  */
                    225: struct vol_panel_resp {
                    226:        msg_header_t            ps_header;
                    227:        msg_type_t              ps_int_desc;    /* describes following 2
                    228:                                                 * fields */
                    229:        int                     ps_tag;         /* identifies panel request */
                    230:        int                     ps_value;       /* n/u for PR_RT_ACK requests;
                    231:                                                 * integer for PR_RT_INT */
                    232: };
                    233: 
                    234: /*
                    235:  * Panel cancel request (msg_id == VOL_PANEL_CANCEL). Sent by vol driver to
                    236:  * remove existing panel.
                    237:  */
                    238: struct vol_panel_cancel {
                    239:        msg_header_t            pc_header;
                    240:        msg_type_t              pc_int_desc;    /* describes following field */
                    241:        int                     pc_tag;         /* identifies panel request */
                    242: };
                    243: 
                    244: #endif /* _INSERTMSG_ */

unix.superglobalmegacorp.com

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