disks_private.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _DISKS_PRIVATE_H
#define _DISKS_PRIVATE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <libdevinfo.h>
#include <devid.h>
#define DM_DEBUG "DM_LIBDISKMGT_DEBUG"
extern int dm_debug;
#define NVATTRS_STAT 0x0
typedef struct slice_info {
char *devpath;
int slice_num;
struct slice_info *next;
} slice_t;
typedef struct alias_info {
char *kstat_name;
char *alias;
char *wwn;
int cluster;
int lun;
int target;
struct alias_info *next;
} alias_t;
typedef struct path {
char *name;
char *ctype;
int *states;
char **wwns;
struct controller_info *controller;
} path_t;
typedef struct bus_info {
char *name;
char *kstat_name;
char *btype;
char *pname;
int freq;
struct controller_info **controllers;
} bus_t;
typedef struct controller_info {
char *name;
char *kstat_name;
char *ctype;
int freq;
struct controller_info *next;
int multiplex;
int scsi_options;
} controller_t;
typedef struct disk {
char *device_id; /* string encoded device id */
char *kernel_name; /* handles drives w/ no devlinks */
char *volm_path;
char *product_id;
char *vendor_id;
int drv_type;
int removable;
int sync_speed;
int rpm;
int wide;
int cd_rom;
int volm_path_set;
} disk_t;
typedef struct descriptor {
union {
void *generic;
} p;
char *name;
char *secondary_name;
struct descriptor *next;
struct descriptor *prev;
int refcnt;
} descriptor_t;
struct search_args {
int dev_walk_status;
};
typedef enum {
DM_EV_DISK_ADD = 0,
/* private internal functions */
int alias_make_descriptors();
int *errp);
int bus_make_descriptors();
int *errp);
int controller_make_descriptors();
int drive_make_descriptors();
int media_make_descriptors();
int path_make_descriptors();
int slice_make_descriptors();
/* cache.c */
char *secondary_name, int *errp);
int cache_is_valid_desc(descriptor_t *d);
char *secondary_name, int *errp);
void cache_rlock();
void cache_unlock();
void cache_wlock();
/* findevs.c */
/* events.c */
int events_start_event_watcher();
/* entry.c */
int *errp);
void libdiskmgt_init_debug();
/* in-use detectors */
#ifdef __cplusplus
}
#endif
#endif /* _DISKS_PRIVATE_H */