Sun_fcGetPortNPIVAttributes.cc revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
2033N/A/*
2033N/A * CDDL HEADER START
2033N/A *
2033N/A * The contents of this file are subject to the terms of the
2033N/A * Common Development and Distribution License (the "License").
2033N/A * You may not use this file except in compliance with the License.
2033N/A *
2033N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2033N/A * or http://www.opensolaris.org/os/licensing.
2033N/A * See the License for the specific language governing permissions
2033N/A * and limitations under the License.
2033N/A *
2033N/A * When distributing Covered Code, include this CDDL HEADER in each
2033N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2033N/A * If applicable, add the following below this CDDL HEADER, with the
2033N/A * fields enclosed by brackets "[]" replaced with your own identifying
2033N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2033N/A *
2033N/A * CDDL HEADER END
2033N/A */
2033N/A/*
2033N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2033N/A * Use is subject to license terms.
2033N/A */
2033N/A
2033N/A
2033N/A#include "Trace.h"
2033N/A#include "Exceptions.h"
2033N/A#include "sun_fc.h"
2110N/A
2110N/A#ifdef __cplusplus
2033N/Aextern "C" {
2033N/A#endif
2033N/A
2033N/AHBA_STATUS Sun_fcGetPortNPIVAttributes(HBA_HANDLE handle,
2033N/A HBA_UINT32 port, PHBA_PORTNPIVATTRIBUTES attributes) {
2033N/A
2033N/A Trace log("Sun_fcGetPortNPIVAttributes");
2033N/A if (attributes == NULL) {
2033N/A log.userError(
2033N/A "NULL attributes pointer");
2033N/A return (HBA_STATUS_ERROR_ARG);
2033N/A }
2033N/A
2033N/A try {
2033N/A Handle *myHandle = Handle::findHandle(handle);
2033N/A HandlePort *myPort = myHandle->getHandlePortByIndex(port);
2033N/A *attributes = myPort->getPortNPIVAttributes();
2033N/A return (HBA_STATUS_OK);
2033N/A } catch (HBAException &e) {
2110N/A return (e.getErrorCode());
2110N/A } catch (...) {
2110N/A log.internalError(
2110N/A "Uncaught exception");
2110N/A return (HBA_STATUS_ERROR);
2110N/A }
2110N/A}
2110N/A
2033N/A#ifdef __cplusplus
2033N/A}
2033N/A#endif
2033N/A
2033N/A