dev.h revision 18c2aff776a775d34a4c9893a4c72e0434d68e36
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef __DEV_H
#define __DEV_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <synch.h>
#include "medium.h"
/*
* Header file for device maniplulation.
*/
struct devsw {
/* begin using a device */
/* deal with an error on a device */
/* build devmap */
/* special eject support */
/* find a missing volume */
/* check to see if new media has arrived */
char *d_mtype; /* type of media this device handles */
char *d_dtype; /* type of device */
/*
* Find the new default file descriptor for a medium
* after it has been repartitioned
*/
struct q d_pathl; /* for reconfig stuff */
};
typedef struct dp_vol_lock {
/*
* d_flags
*/
typedef struct vendor_info {
struct devs {
struct q q; /* hash queue */
int dp_ndev; /* number of managed devices */
/* all devid which has been managed */
char *dp_path; /* path to this device */
void *dp_priv; /* driver private info */
char *dp_symname; /* symbolic name for this dev */
int dp_ndgrp; /* number of devices in group */
};
/*
* Mapping of volume dev_t to device dev_t.
*/
typedef struct devmap {
char *dm_path; /* to (path of device media is in */
int dm_flag;
} devmap_t;
/* dev prototypes */
extern void dev_insert(dev_t);
extern void dev_devmap(struct vol *);
extern int dev_type(char *);
extern char *dev_ident(int);
extern int dev_nastask(void);
extern void dev_freedp(struct devs *);
extern struct vvnode *dev_dirpath(char *);
extern char *dev_makepath(dev_t);
extern void dev_unhangvol(struct devs *);
struct label *);
extern char *dev_symname(dev_t);
extern void dev_create_ctldev(struct devs *);
extern void dev_remove_ctldev(struct devs *);
#define DEV_SYM "dev_init"
#ifdef __cplusplus
}
#endif
#endif /* __DEV_H */