fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "Trace.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "Exceptions.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "Handle.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "HBA.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "HBAPort.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "sun_fc.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/types.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/stat.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <fcntl.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <sys/mkdev.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <unistd.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <errno.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @memo Sets the RNID for the HBA
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @return HBA_STATUS_OK if the set operation completed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param handle The HBA to operate on
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param info The RNID information to set on the HBA
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn ForteHBA_STATUS Sun_fcSetRNIDMgmtInfo(HBA_HANDLE handle,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA_MGMTINFO info) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Trace log("Sun_fcSetRNIDMgmtInfo");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte try {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte Handle *myHandle = Handle::findHandle(handle);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte HBA *hba = myHandle->getHBA();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte hba->setRNID(info);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (HBA_STATUS_OK);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } catch (HBAException &e) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (e.getErrorCode());
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte } catch (...) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte log.internalError(
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte "Uncaught exception");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return (HBA_STATUS_ERROR);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte }
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif