/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "cfga_sata.h"
cfga_sata_ret_t sata_rcm_offline(const char *, char **, char *,
cfga_sata_ret_t sata_rcm_online(const char *, char **, char *,
cfga_sata_ret_t sata_rcm_remove(const char *, char **, char *,
uint_t *);
/*
* sata_rcm_offline:
* Offline SATA resource consumers.
*/
{
int rret;
CFGA_SATA_OK) {
return (ret);
}
&rinfo)) != RCM_SUCCESS) {
if (rinfo) {
}
if (rret == RCM_FAILURE) {
rsrc_fixed, flags);
}
}
return (ret);
}
/*
* sata_rcm_online:
* Online SATA resource consumers that were previously offlined.
*/
{
CFGA_SATA_OK) {
return (ret);
}
}
return (ret);
}
/*
* sata_rcm_remove:
* Remove SATA resource consumers after their kernel removal.
*/
{
CFGA_SATA_OK) {
return (ret);
}
}
return (ret);
}
/*
* sata_rcm_init:
* Contains common initialization code for entering a sata_rcm_xx() routine.
*/
/* ARGSUSED */
static cfga_sata_ret_t
{
/* Validate the rsrc argument */
return (CFGA_SATA_INTERNAL_ERROR);
}
/* Translate the cfgadm flags to RCM flags */
}
/* Get a handle for the RCM operations */
(void) mutex_lock(&rcm_handle_lock);
if (rcm_handle == NULL) {
RCM_SUCCESS) {
(void) mutex_unlock(&rcm_handle_lock);
return (CFGA_SATA_RCM_HANDLE);
}
}
(void) mutex_unlock(&rcm_handle_lock);
return (CFGA_SATA_OK);
}
/*
* sata_rcm_info_table:
* Takes an opaque rcm_info_t pointer and a character pointer,
* and appends the rcm_info_t data in the form of a table to the
* given character pointer.
*/
static cfga_sata_ret_t
{
int i;
size_t w;
char *rsrc;
char *info;
char *newtable;
const char *infostr;
/* Protect against invalid arguments */
return (CFGA_SATA_INTERNAL_ERROR);
}
/* Set localized table header strings */
/* A first pass, to size up the RCM information */
tuples++;
w_rsrc = w;
w_info = w;
}
}
/* If nothing was sized up above, stop early */
if (tuples == 0) {
return (CFGA_SATA_OK);
}
/* Adjust column widths for column headings */
w_rsrc = w;
} else if ((w_rsrc - w) % 2) {
w_rsrc++;
}
w_info = w;
} else if ((w_info - w) % 2) {
w_info++;
}
/*
* Compute the total line width of each line,
* accounting for intercolumn spacing.
*/
/* Allocate space for the table */
/* zero fill for the strcat() call below */
return (CFGA_SATA_ALLOC_FAIL);
}
} else {
return (CFGA_SATA_ALLOC_FAIL);
} else {
}
}
/* Place a table header into the string */
/* The resource header */
for (i = 0; i < ((w_rsrc - w) / 2); i++) {
}
for (i = 0; i < ((w_rsrc - w) / 2); i++) {
}
/* The information header */
for (i = 0; i < ((w_info - w) / 2); i++) {
}
for (i = 0; i < ((w_info - w) / 2); i++) {
}
/* Underline the headers */
for (i = 0; i < w_rsrc; i++) {
}
for (i = 0; i < w_info; i++) {
}
/* Construct the format string */
/* Add the tuples to the table string */
}
}
return (CFGA_SATA_OK);
}