/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "cfga_usb.h"
cfga_usb_ret_t usb_rcm_offline(const char *, char **, char *,
cfga_usb_ret_t usb_rcm_online(const char *, char **, char *,
cfga_usb_ret_t usb_rcm_remove(const char *, char **, char *,
uint_t *);
/*
* usb_rcm_offline:
* Offline USB resource consumers.
*/
{
int rret;
DPRINTF("usb_rcm_offline:\n");
CFGA_USB_OK) {
return (ret);
}
!= RCM_SUCCESS) {
DPRINTF("usb_rcm_offline: rcm_request_offline failed\n");
if (rinfo) {
}
if (rret == RCM_FAILURE) {
rsrc_fixed, flags);
}
}
return (ret);
}
/*
* usb_rcm_online:
* Online USB resource consumers that were previously offlined.
*/
{
DPRINTF("usb_rcm_online:\n");
return (ret);
}
DPRINTF("usb_rcm_online: rcm_notify_online failed\n");
}
return (ret);
}
/*
* usb_rcm_remove:
* Remove USB resource consumers after their kernel removal.
*/
{
DPRINTF("usb_rcm_remove:\n");
return (ret);
}
DPRINTF("usb_rcm_remove: rcm_notify_remove failed\n");
}
return (ret);
}
/*
* usb_rcm_init:
* Contains common initialization code for entering a usb_rcm_xx() routine.
*/
/* ARGSUSED */
static cfga_usb_ret_t
{
DPRINTF("usb_rcm_init:\n");
/* Validate the rsrc argument */
DPRINTF("usb_rcm_init: rsrc is NULL\n");
return (CFGA_USB_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) {
DPRINTF("usb_rcm_init: alloc_handle failed\n");
(void) mutex_unlock(&rcm_handle_lock);
return (CFGA_USB_RCM_HANDLE);
}
}
(void) mutex_unlock(&rcm_handle_lock);
return (CFGA_USB_OK);
}
/*
* usb_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_usb_ret_t
{
int i;
size_t w;
char *rsrc;
char *info;
char *newtable;
const char *infostr;
DPRINTF("usb_rcm_info_table:\n");
/* Protect against invalid arguments */
return (CFGA_USB_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) {
DPRINTF("usb_rcm_info_table: no tuples\n");
return (CFGA_USB_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 */
DPRINTF("usb_rcm_info_table: no table\n");
return (CFGA_USB_ALLOC_FAIL);
}
} else {
DPRINTF("usb_rcm_info_table: no new table\n");
return (CFGA_USB_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_USB_OK);
}