13e4f2897Sjc156560 /* 23e4f2897Sjc156560 * CDDL HEADER START 33e4f2897Sjc156560 * 43e4f2897Sjc156560 * The contents of this file are subject to the terms of the 53e4f2897Sjc156560 * Common Development and Distribution License (the "License"). 63e4f2897Sjc156560 * You may not use this file except in compliance with the License. 73e4f2897Sjc156560 * 83e4f2897Sjc156560 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 93e4f2897Sjc156560 * or http://www.opensolaris.org/os/licensing. 103e4f2897Sjc156560 * See the License for the specific language governing permissions 113e4f2897Sjc156560 * and limitations under the License. 123e4f2897Sjc156560 * 133e4f2897Sjc156560 * When distributing Covered Code, include this CDDL HEADER in each 143e4f2897Sjc156560 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 153e4f2897Sjc156560 * If applicable, add the following below this CDDL HEADER, with the 163e4f2897Sjc156560 * fields enclosed by brackets "[]" replaced with your own identifying 173e4f2897Sjc156560 * information: Portions Copyright [yyyy] [name of copyright owner] 183e4f2897Sjc156560 * 193e4f2897Sjc156560 * CDDL HEADER END 203e4f2897Sjc156560 */ 213e4f2897Sjc156560 223e4f2897Sjc156560 /* 23b449fa8aSyw161884 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 243e4f2897Sjc156560 * Use is subject to license terms. 253e4f2897Sjc156560 */ 263e4f2897Sjc156560 273e4f2897Sjc156560 #ifndef _RAIDCFG_H 283e4f2897Sjc156560 #define _RAIDCFG_H 293e4f2897Sjc156560 303e4f2897Sjc156560 #include <sys/types.h> 313e4f2897Sjc156560 #include <raidcfg_spi.h> 323e4f2897Sjc156560 333e4f2897Sjc156560 #ifdef __cplusplus 343e4f2897Sjc156560 extern "C" { 353e4f2897Sjc156560 #endif 363e4f2897Sjc156560 373e4f2897Sjc156560 /* 383e4f2897Sjc156560 * Reserved Raid object IDs; 393e4f2897Sjc156560 * ID 0 is reserved for root object; 403e4f2897Sjc156560 * ID 0 also stands for NONE OBJECT. 413e4f2897Sjc156560 */ 423e4f2897Sjc156560 #define OBJ_SYSTEM 0 433e4f2897Sjc156560 #define OBJ_NONE 0 443e4f2897Sjc156560 453e4f2897Sjc156560 typedef int raid_obj_handle_t; 463e4f2897Sjc156560 473e4f2897Sjc156560 /* 483e4f2897Sjc156560 * API data structure definition 493e4f2897Sjc156560 */ 503e4f2897Sjc156560 typedef struct { 513e4f2897Sjc156560 int array_handle; 523e4f2897Sjc156560 int disk_handle; 533e4f2897Sjc156560 } raidcfg_hsp_relation_t; 543e4f2897Sjc156560 553e4f2897Sjc156560 typedef controller_attr_t raidcfg_controller_t; 563e4f2897Sjc156560 typedef array_attr_t raidcfg_array_t; 573e4f2897Sjc156560 typedef disk_attr_t raidcfg_disk_t; 583e4f2897Sjc156560 593e4f2897Sjc156560 typedef struct { 603e4f2897Sjc156560 uint32_t associated_id; 613e4f2897Sjc156560 uint32_t type; 623e4f2897Sjc156560 array_tag_t tag; 633e4f2897Sjc156560 } raidcfg_hsp_t; 643e4f2897Sjc156560 653e4f2897Sjc156560 typedef struct { 663e4f2897Sjc156560 uint32_t disk_id; 673e4f2897Sjc156560 uint32_t state; 683e4f2897Sjc156560 uint64_t offset; 693e4f2897Sjc156560 uint64_t size; 703e4f2897Sjc156560 disk_tag_t tag; 713e4f2897Sjc156560 } raidcfg_arraypart_t; 723e4f2897Sjc156560 733e4f2897Sjc156560 typedef diskseg_attr_t raidcfg_diskseg_t; 743e4f2897Sjc156560 typedef task_attr_t raidcfg_task_t; 75b449fa8aSyw161884 typedef property_attr_t raidcfg_prop_t; 763e4f2897Sjc156560 773e4f2897Sjc156560 /* 783e4f2897Sjc156560 * raidcfg common library APIs 793e4f2897Sjc156560 */ 803e4f2897Sjc156560 const char *raidcfg_errstr(int); 813e4f2897Sjc156560 int raidcfg_get_controller(uint32_t); 823e4f2897Sjc156560 int raidcfg_get_array(int, uint64_t, uint64_t); 833e4f2897Sjc156560 int raidcfg_get_disk(int, disk_tag_t); 843e4f2897Sjc156560 int raidcfg_open_controller(int, char **); 853e4f2897Sjc156560 int raidcfg_close_controller(int, char **); 863e4f2897Sjc156560 int raidcfg_get_type(int); 873e4f2897Sjc156560 int raidcfg_get_attr(int, void *); 883e4f2897Sjc156560 int raidcfg_get_container(int); 893e4f2897Sjc156560 int raidcfg_list_head(int, raid_obj_type_id_t); 903e4f2897Sjc156560 int raidcfg_list_next(int); 913e4f2897Sjc156560 int raidcfg_set_attr(int, uint32_t, void *, char **); 92*5c9d25d2SYu-Bo Ryan Wang int raidcfg_set_hsp(raidcfg_hsp_relation_t *, char **); 93*5c9d25d2SYu-Bo Ryan Wang int raidcfg_unset_hsp(raidcfg_hsp_relation_t *, char **); 943e4f2897Sjc156560 int raidcfg_create_array(int, int *, uint32_t, uint64_t, uint32_t, char **); 953e4f2897Sjc156560 int raidcfg_delete_array(int, char **); 963e4f2897Sjc156560 int raidcfg_update_fw(int, char *, char **); 973e4f2897Sjc156560 983e4f2897Sjc156560 #ifdef __cplusplus 993e4f2897Sjc156560 } 1003e4f2897Sjc156560 #endif 1013e4f2897Sjc156560 1023e4f2897Sjc156560 #endif /* _RAIDCFG_H */ 103