2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * Offline FP resource consumers. 2N/A * Online FP resource consumers that were previously offlined. 2N/A * Remove FP resource consumers after their kernel removal. 2N/A * Suspend FP resource consumers before a bus quiesce. 2N/A /* If a filter is provided, ensure that it makes sense */ 2N/A * If no filter is specified: attempt a suspension on the resource, 2N/A * If a filter is specified: open the resource with libdevinfo, walk 2N/A * through its nodes, and attempt a suspension of each node that 2N/A * mismatches the filter. 2N/A /* Chop off the filter's minor name */ 2N/A /* get a libdevinfo snapshot of the resource's subtree */ 2N/A /* apply the filter, and suspend all resources not filtered out */ 2N/A * Resume FP resource consumers after a bus has been unquiesced. 2N/A /* If a filter is provided, ensure that it makes sense */ 2N/A * If no filter is specified: resume the resource directly. 2N/A * If a filter is specified: open the resource with libdevinfo, walk 2N/A * through its nodes, and resume each of its nodes that mismatches 2N/A /* Chop off the filter's minor name */ 2N/A /* get a libdevinfo snapshot of the resource's subtree */ 2N/A /* apply the filter, and resume all resources not filtered out */ 2N/A * Queries RCM information for resources, and formats it into a table. 2N/A * The table is appended to the info argument. If the info argument is a 2N/A * null pointer, then a new string is malloc'ed. If the info argument is 2N/A * not a null pointer, then it is realloc'ed to the required size. 2N/A * Contains common initialization code for entering a fp_rcm_xx() 2N/A /* Validate the rsrc argument */ 2N/A /* Translate the cfgadm flags to RCM flags */ 2N/A /* Get a handle for the RCM operations */ 2N/A /* Chop off the rsrc's minor, if it has one */ 2N/A * fp_rcm_process_node 2N/A * Helper routine for fp_rcm_{suspend,resume}. This is a di_walk_node() 2N/A * callback that will apply a filter to every node it sees, and either suspend 2N/A * or resume it if it doesn't match the filter. 2N/A /* Guard against bad arguments */ 2N/A /* If the node has no minors, then skip it */ 2N/A /* Construct the devices path */ 2N/A * If the node does not correspond to the targeted FP bus or the 2N/A /* Stop the walk early if the above operation failed */ 2N/A * Takes an opaque rcm_info_t pointer and a character pointer, and appends 2N/A * the rcm_info_t data in the form of a table to the given character pointer. 2N/A /* Protect against invalid arguments */ 2N/A /* Set localized table header strings */ 2N/A /* A first pass, to size up the RCM information */ 2N/A /* If nothing was sized up above, stop early */ 2N/A /* Adjust column widths for column headings */ 2N/A * Compute the total line width of each line, 2N/A * accounting for intercolumn spacing. 2N/A /* Allocate space for the table */ 2N/A /* Place a table header into the string */ 2N/A /* The resource header */ 2N/A /* The information header */ 2N/A /* Underline the headers */ 2N/A /* Construct the format string */ 2N/A /* Add the tuples to the table string */ 2N/A * Chops off the minor name portion of a resource. Allocates storage for 2N/A * the returned string. Caller must free the storage if return is non-NULL.