/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "cfga_scsi.h"
/*
* scsi_rcm_offline()
*
* Offline SCSI resource consumers.
*/
{
int rret;
return (ret);
!= SCFGA_OK)
return (ret);
if (flags & CFGA_FLAG_FORCE)
&rinfo)) != RCM_SUCCESS) {
} else {
}
if (rinfo) {
}
if (rret == RCM_FAILURE)
ret = SCFGA_BUSY;
}
(void) rcm_free_handle(rcm_handle);
return (ret);
}
/*
* scsi_rcm_online()
*
* Online SCSI resource consumers that were previously offlined.
*/
/*ARGSUSED2*/
{
return (ret);
!= SCFGA_OK)
return (ret);
!= RCM_SUCCESS) {
}
ret = SCFGA_BUSY;
}
(void) rcm_free_handle(rcm_handle);
return (ret);
}
/*
* scsi_rcm_remove()
*
* Remove SCSI resource consumers after their kernel removal.
*/
/*ARGSUSED2*/
{
return (ret);
!= SCFGA_OK)
return (ret);
!= RCM_SUCCESS) {
if (rinfo) {
}
ret = SCFGA_BUSY;
}
(void) rcm_free_handle(rcm_handle);
return (ret);
}
/*
* scsi_rcm_suspend()
*
* Suspend SCSI resource consumers before a bus quiesce.
*/
int pflag)
{
int rret;
return (ret);
!= SCFGA_OK)
return (ret);
if (flags & CFGA_FLAG_FORCE)
/*
* attempt a suspension on a list of resources
*/
if (rinfo) {
}
if (rret == RCM_FAILURE)
ret = SCFGA_BUSY;
}
(void) rcm_free_handle(rcm_handle);
return (ret);
}
/*
* scsi_rcm_resume()
*
* Resume SCSI resource consumers after a bus has been unquiesced.
*/
/*ARGSUSED2*/
int pflag)
{
return (ret);
!= SCFGA_OK)
return (ret);
/*
* resume the resource list.
*/
!= RCM_SUCCESS) {
}
ret = SCFGA_BUSY;
}
(void) rcm_free_handle(rcm_handle);
return (ret);
}
/*
* scsi_rcm_init()
*
* Contains common initialization code for entering a scsi_rcm_xx()
* routine.
*/
static scfga_ret_t
{
/* Get a handle for the RCM operations */
return (SCFGA_LIB_ERR);
}
return (SCFGA_OK);
}
/*
* scsi_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 scfga_ret_t
{
int i;
size_t w;
char *rsrc;
char *info;
char *newtable;
const char *infostr;
/* Protect against invalid arguments */
return (SCFGA_ERR);
/* 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 (SCFGA_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 (SCFGA_ERR);
} else {
return (SCFGA_ERR);
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 */
infostr);
}
}
return (SCFGA_OK);
}