1 // SPDX-License-Identifier: CDDL-1.0 2 /* 3 * CDDL HEADER START 4 * 5 * The contents of this file are subject to the terms of the 6 * Common Development and Distribution License (the "License"). 7 * You may not use this file except in compliance with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or https://opensource.org/licenses/CDDL-1.0. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SYS_SYSEVENT_DEV_H 28 #define _SYS_SYSEVENT_DEV_H 29 30 #include <sys/sysevent/eventdefs.h> 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 /* 37 * Event schema for EC_DEV_ADD/ESC_DISK 38 * 39 * Event Class - EC_DEV_ADD 40 * Event Sub-Class - ESC_DISK 41 * 42 * Attribute Name - EV_VERSION 43 * Attribute Type - DATA_TYPE_INT32 44 * Attribute Value - event version number 45 * 46 * Attribute Name - DEV_NAME 47 * Attribute Type - DATA_TYPE_STRING 48 * Attribute Value - /dev name to the raw device. 49 * The name does not include the slice number component. 50 * 51 * Attribute Name - DEV_PHYS_PATH 52 * Attribute Type - DATA_TYPE_STRING 53 * Attribute Value - physical path of the device without the "/devices" 54 * prefix. 55 * 56 * Attribute Name - DEV_DRIVER_NAME 57 * Attribute Type - DATA_TYPE_STRING 58 * Attribute Value - driver name 59 * 60 * Attribute Name - DEV_INSTANCE 61 * Attribute Type - DATA_TYPE_INT32 62 * Attribute Value - driver instance number 63 * 64 * Attribute Name - DEV_PROP_PREFIX<devinfo_node_property> 65 * Attribute Type - data type of the devinfo_node_property 66 * Attribute Value - value of the devinfo_node_property 67 * 68 * 69 * Event schema for EC_DEV_ADD/ESC_NETWORK 70 * 71 * Event Class - EC_DEV_ADD 72 * Event Sub-Class - ESC_NETWORK 73 * 74 * Attribute Name - EV_VERSION 75 * Attribute Type - DATA_TYPE_INT32 76 * Attribute Value - event version number 77 * 78 * Attribute Name - DEV_NAME 79 * Attribute Type - DATA_TYPE_STRING 80 * Attribute Value - /dev name associated with the device if exists. 81 * /dev name associated with the driver for DLPI 82 * Style-2 only drivers. 83 * 84 * Attribute Name - DEV_PHYS_PATH 85 * Attribute Type - DATA_TYPE_STRING 86 * Attribute Value - physical path of the device without the "/devices" 87 * prefix. 88 * 89 * Attribute Name - DEV_DRIVER_NAME 90 * Attribute Type - DATA_TYPE_STRING 91 * Attribute Value - driver name 92 * 93 * Attribute Name - DEV_INSTANCE 94 * Attribute Type - DATA_TYPE_INT32 95 * Attribute Value - driver instance number 96 * 97 * Attribute Name - DEV_PROP_PREFIX<devinfo_node_property> 98 * Attribute Type - data type of the devinfo_node_property 99 * Attribute Value - value of the devinfo_node_property 100 * 101 * 102 * Event schema for EC_DEV_ADD/ESC_PRINTER 103 * 104 * Event Class - EC_DEV_ADD 105 * Event Sub-Class - ESC_PRINTER 106 * 107 * Attribute Name - EV_VERSION 108 * Attribute Type - DATA_TYPE_INT32 109 * Attribute Value - event version number 110 * 111 * Attribute Name - DEV_NAME 112 * Attribute Type - DATA_TYPE_STRING 113 * Attribute Value - /dev/printers name associated with the device 114 * if exists. 115 * /dev name associated with the device if it exists 116 * 117 * Attribute Name - DEV_PHYS_PATH 118 * Attribute Type - DATA_TYPE_STRING 119 * Attribute Value - physical path of the device without the "/devices" 120 * prefix. 121 * 122 * Attribute Name - DEV_DRIVER_NAME 123 * Attribute Type - DATA_TYPE_STRING 124 * Attribute Value - driver name 125 * 126 * Attribute Name - DEV_INSTANCE 127 * Attribute Type - DATA_TYPE_INT32 128 * Attribute Value - driver instance number 129 * 130 * Attribute Name - DEV_PROP_PREFIX<devinfo_node_property> 131 * Attribute Type - data type of the devinfo_node_property 132 * Attribute Value - value of the devinfo_node_property 133 * 134 * 135 * Event schema for EC_DEV_REMOVE/ESC_DISK 136 * 137 * Event Class - EC_DEV_REMOVE 138 * Event Sub-Class - ESC_DISK 139 * 140 * Attribute Name - EV_VERSION 141 * Attribute Type - DATA_TYPE_INT32 142 * Attribute Value - event version number 143 * 144 * Attribute Name - DEV_NAME 145 * Attribute Type - DATA_TYPE_STRING 146 * Attribute Value - /dev name to the raw device. 147 * The name does not include the slice number component. 148 * 149 * Attribute Name - DEV_PHYS_PATH 150 * Attribute Type - DATA_TYPE_STRING 151 * Attribute Value - physical path of the device without the "/devices" 152 * prefix. 153 * 154 * Attribute Name - DEV_DRIVER_NAME 155 * Attribute Type - DATA_TYPE_STRING 156 * Attribute Value - driver name 157 * 158 * Attribute Name - DEV_INSTANCE 159 * Attribute Type - DATA_TYPE_INT32 160 * Attribute Value - driver instance number 161 * 162 * 163 * Event schema for EC_DEV_REMOVE/ESC_NETWORK 164 * 165 * Event Class - EC_DEV_REMOVE 166 * Event Sub-Class - ESC_NETWORK 167 * 168 * Attribute Name - EV_VERSION 169 * Attribute Type - DATA_TYPE_INT32 170 * Attribute Value - event version number 171 * 172 * Attribute Name - DEV_NAME 173 * Attribute Type - DATA_TYPE_STRING 174 * Attribute Value - /dev name associated with the device if exists. 175 * /dev name associated with the driver for DLPI 176 * Style-2 only drivers. 177 * 178 * Attribute Name - DEV_PHYS_PATH 179 * Attribute Type - DATA_TYPE_STRING 180 * Attribute Value - physical path of the device without the "/devices" 181 * prefix. 182 * 183 * Attribute Name - DEV_DRIVER_NAME 184 * Attribute Type - DATA_TYPE_STRING 185 * Attribute Value - driver name 186 * 187 * Attribute Name - DEV_INSTANCE 188 * Attribute Type - DATA_TYPE_INT32 189 * Attribute Value - driver instance number 190 * 191 * 192 * Event schema for EC_DEV_REMOVE/ESC_PRINTER 193 * 194 * Event Class - EC_DEV_REMOVE 195 * Event Sub-Class - ESC_PRINTER 196 * 197 * Attribute Name - EV_VERSION 198 * Attribute Type - DATA_TYPE_INT32 199 * Attribute Value - event version number 200 * 201 * Attribute Name - DEV_NAME 202 * Attribute Type - DATA_TYPE_STRING 203 * Attribute Value - /dev/printers name associated with the device 204 * if exists. 205 * /dev name associated with the device if it exists 206 * 207 * Attribute Name - DEV_PHYS_PATH 208 * Attribute Type - DATA_TYPE_STRING 209 * Attribute Value - physical path of the device without the "/devices" 210 * prefix. 211 * 212 * Attribute Name - DEV_DRIVER_NAME 213 * Attribute Type - DATA_TYPE_STRING 214 * Attribute Value - driver name 215 * 216 * Attribute Name - DEV_INSTANCE 217 * Attribute Type - DATA_TYPE_INT32 218 * Attribute Value - driver instance number 219 * 220 * 221 * Event schema for EC_DEV_BRANCH/ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE 222 * 223 * Event Class - EC_DEV_BRANCH 224 * Event Sub-Class - ESC_DEV_BRANCH_ADD or ESC_DEV_BRANCH_REMOVE 225 * 226 * Attribute Name - EV_VERSION 227 * Attribute Type - DATA_TYPE_INT32 228 * Attribute Value - event version number 229 * 230 * Attribute Name - DEV_PHYS_PATH 231 * Attribute Type - DATA_TYPE_STRING 232 * Attribute Value - physical path to the root node of the device subtree 233 * without the "/devices" prefix. 234 */ 235 236 #define EV_VERSION "version" 237 #define DEV_PHYS_PATH "phys_path" 238 #define DEV_NAME "dev_name" 239 #define DEV_DRIVER_NAME "driver_name" 240 #define DEV_INSTANCE "instance" 241 #define DEV_PROP_PREFIX "prop-" 242 243 #ifdef __linux__ 244 #define DEV_IDENTIFIER "devid" 245 #define DEV_PATH "path" 246 #define DEV_IS_PART "is_slice" 247 #define DEV_SIZE "dev_size" 248 249 /* Size of the whole parent block device (if dev is a partition) */ 250 #define DEV_PARENT_SIZE "dev_parent_size" 251 #endif /* __linux__ */ 252 253 #define EV_V1 1 254 255 /* maximum number of devinfo node properties added to the event */ 256 #define MAX_PROP_COUNT 100 257 258 /* only properties with size less than PROP_LEN_LIMIT are added to the event */ 259 #define PROP_LEN_LIMIT 1024 260 261 #ifdef __cplusplus 262 } 263 #endif 264 265 #endif /* _SYS_SYSEVENT_DEV_H */ 266