usr/src/lib/libraidcfg/common/raidcfg.h
author jc156560
Thu, 08 Feb 2007 18:32:09 -0800
changeset 3622 eed77e5fc4ad
parent 3457 usr/src/head/raidcfg.h@95f0a08d05e5
child 7233 ca680b47401f
permissions -rw-r--r--
6519009 libraidcfg's headers and lint library stub have issues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3457
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     1
/*
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     2
 * CDDL HEADER START
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     3
 *
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     5
 * Common Development and Distribution License (the "License").
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     6
 * You may not use this file except in compliance with the License.
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     7
 *
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    11
 * and limitations under the License.
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    12
 *
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    18
 *
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    19
 * CDDL HEADER END
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    20
 */
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    21
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    22
/*
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    23
 * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    24
 * Use is subject to license terms.
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    25
 */
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    26
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    27
#ifndef	_RAIDCFG_H
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    28
#define	_RAIDCFG_H
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    29
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    30
#pragma ident	"%Z%%M%	%I%	%E% SMI"
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    31
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    32
#include <sys/types.h>
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    33
#include <raidcfg_spi.h>
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    34
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    35
#ifdef	__cplusplus
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    36
extern "C" {
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    37
#endif
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    38
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    39
/*
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    40
 * Reserved Raid object IDs;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    41
 * ID 0 is reserved for root object;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    42
 * ID 0 also stands for NONE OBJECT.
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    43
 */
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    44
#define	OBJ_SYSTEM		0
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    45
#define	OBJ_NONE		0
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    46
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    47
typedef	int raid_obj_handle_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    48
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    49
/*
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    50
 * API data structure definition
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    51
 */
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    52
typedef	struct {
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    53
	int	array_handle;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    54
	int	disk_handle;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    55
} raidcfg_hsp_relation_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    56
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    57
typedef	controller_attr_t	raidcfg_controller_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    58
typedef	array_attr_t		raidcfg_array_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    59
typedef	disk_attr_t		raidcfg_disk_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    60
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    61
typedef struct {
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    62
	uint32_t	associated_id;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    63
	uint32_t	type;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    64
	array_tag_t	tag;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    65
} raidcfg_hsp_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    66
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    67
typedef	struct {
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    68
	uint32_t	disk_id;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    69
	uint32_t	state;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    70
	uint64_t	offset;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    71
	uint64_t	size;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    72
	disk_tag_t	tag;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    73
} raidcfg_arraypart_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    74
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    75
typedef	diskseg_attr_t		raidcfg_diskseg_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    76
typedef	task_attr_t		raidcfg_task_t;
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    77
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    78
/*
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    79
 * raidcfg common library APIs
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    80
 */
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    81
const char *raidcfg_errstr(int);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    82
int raidcfg_get_controller(uint32_t);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    83
int raidcfg_get_array(int, uint64_t, uint64_t);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    84
int raidcfg_get_disk(int, disk_tag_t);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    85
int raidcfg_open_controller(int, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    86
int raidcfg_close_controller(int, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    87
int raidcfg_get_type(int);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    88
int raidcfg_get_attr(int, void *);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    89
int raidcfg_get_container(int);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    90
int raidcfg_list_head(int, raid_obj_type_id_t);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    91
int raidcfg_list_next(int);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    92
int raidcfg_set_attr(int, uint32_t, void *, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    93
int raidcfg_set_hsp(int, raidcfg_hsp_relation_t *, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    94
int raidcfg_unset_hsp(int, raidcfg_hsp_relation_t *, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    95
int raidcfg_create_array(int, int *, uint32_t, uint64_t, uint32_t, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    96
int raidcfg_delete_array(int, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    97
int raidcfg_update_fw(int, char *, char **);
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    98
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
    99
#ifdef	__cplusplus
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
   100
}
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
   101
#endif
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
   102
95f0a08d05e5 PSARC 2005/204 RaidCfg project
jc156560
parents:
diff changeset
   103
#endif /* _RAIDCFG_H */