ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * CDDL HEADER START
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * The contents of this file are subject to the terms of the
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * Common Development and Distribution License (the "License").
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * You may not use this file except in compliance with the License.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * See the License for the specific language governing permissions
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * and limitations under the License.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * When distributing Covered Code, include this CDDL HEADER in each
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * If applicable, add the following below this CDDL HEADER, with the
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * fields enclosed by brackets "[]" replaced with your own identifying
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * information: Portions Copyright [yyyy] [name of copyright owner]
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * CDDL HEADER END
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimdi_walk(di_node_t node, di_minor_t minor, void *arg)
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim if (scsi_wwnstr_to_wwn(wwn, &wp->addr) != DDI_SUCCESS)
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimstatic void *
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim if ((dp = smp_zalloc(sizeof (struct usmp_dev))) == NULL)
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim if ((dp->ud_dev = smp_strdup(target_name)) == NULL) {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim if ((dp->ud_fd = open(target_name, O_RDONLY)) < 0) {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim "failed to open %s for reading: %s",
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim "failed to stat %s: %s", target_name, strerror(errno));
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim if ((root = di_init("/", DINFOCACHE)) != DI_NODE_NIL) {
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim for (smp = di_drv_first_node("smp", root); smp != DI_NODE_NIL;
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim (void) di_walk_minor(smp, NULL, 0, &walk, di_walk);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim smp_action_get_response_frame(ap, &resp, &resplen);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim cmd.usmp_timeout = (int)smp_action_get_timeout(ap);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim return (smp_error(ESMP_BADFUNC, "internal usmp error"));
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim "insufficient privileges"));
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim return (smp_error(ESMP_SYS, "usmp ioctl failed: %s",
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * There is no way to determine the amount of data actually transferred
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * so we will just place the upper bound at the allocated size.
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim return (0);
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimusmp_target_name(void *private, char *buf, size_t len)