x86_adm.c revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <hbaapi.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "common.h"
#include "errorcodes.h"
#include <locale.h>
/* The i18n catalog */
void
i18n_catopen() {
static int fileopen = 0;
"Cannot operate in the locale requested. "
"Continuing in the default C locale\n");
}
if (!fileopen) {
return;
}
fileopen = 1;
}
return;
}
/*
* Given an error number, this functions
* calls the get_errString() to print a
* corresponding error message to the stderr.
* get_errString() always returns an error
* message, even in case of undefined error number.
* So, there is no need to check for a NULL pointer
* while printing the error message to the stdout.
*
* RETURNS: N/A
*
*/
void
{
char *errStr;
"%s \n\n", errStr);
} else {
}
/* free the allocated memory for error string */
}
static void terminate() {
exit(1);
}
/*ARGSUSED*/
int adm_display_config(char **a) {
terminate();
return (1);
}
/*ARGSUSED*/
void adm_download(char **a, char *b) {
terminate();
}
/*ARGSUSED*/
void up_encl_name(char **a, int b) {
terminate();
}
void adm_failover(char **argv) {
char path_class[MAXNAMELEN];
char client_path[MAXPATHLEN];
exit(-1);
}
exit(-1);
}
exit(-1);
}
/* Now chop off the trailing ":xxx" portion if present */
trailingMinor[0] = '\0';
}
switch (errno) {
case EALREADY:
break;
case ENXIO:
break;
case EIO:
break;
case ENOTSUP:
break;
case EBUSY:
break;
case EFAULT:
default:
}
}
if (err != 0) {
exit(-1);
}
}
}
/*ARGSUSED*/
int adm_inquiry(char **a) {
terminate();
return (1);
}
/*ARGSUSED*/
void pho_probe() {
terminate();
}
/*ARGSUSED*/
void non_encl_probe() {
terminate();
}
/*ARGSUSED*/
void adm_led(char **a, int b) {
terminate();
}
/*ARGSUSED*/
void up_password(char **a) {
terminate();
}
/*ARGSUSED*/
int adm_reserve(char *path) {
terminate();
return (1);
}
/*ARGSUSED*/
int adm_release(char *path) {
terminate();
return (1);
}
/*ARGSUSED*/
int adm_start(char **a) {
terminate();
return (1);
}
/*ARGSUSED*/
int adm_stop(char **a) {
terminate();
return (1);
}
/*ARGSUSED*/
int adm_power_off(char **a, int b) {
terminate();
return (1);
}
int
adm_forcelip(char **argv)
{
int path_index = 0, fd;
char name[256];
if ((status = loadLibrary())) {
/* loadLibrary print out error msg */
return (ret++);
}
wwnCompare = 1;
ret++;
continue;
}
if (!wwnCompare) {
/* Convert the paths to phsyical paths */
if (!physical) {
ret++;
continue;
}
}
count = getNumberOfAdapters();
matched = 0;
if (status != HBA_STATUS_OK) {
/* May have been DR'd */
continue;
}
if (handle == 0) {
/* May have been DR'd */
continue;
}
/* Should never happen */
continue;
}
/* Loop over all HBA Ports */
portIndex++) {
&portAttrs)) {
continue;
}
matched = 0;
if (wwn == wwnConversion(
wwn == wwnConversion(
matched = 1;
}
} else {
if (!slash_OSDeviceName) {
continue;
} else {
== 0) {
matched = 1;
}
}
}
if (!matched) {
/*
* matchr_mapping checks the arg
* so we pass argv here.
*/
if (mapIndex >= 0) {
matched = 1;
}
} else {
continue;
}
}
if (matched) {
return (ret++);
}
/*
* Reset the local loop here (fcio_ibuf = 0).
* Reset a remote loop on the Fabric by
* passing its node wwn (fcio_len = sizeof(nwwn)
* and fcio_ibuf = (caddr_t)&nwwn) to the port driver.
*/
errno = 0;
/*
* When port is offlined, qlc
* returns the FC_OFFLINE error and errno
* is set to EIO.
* We do want to ignore this error,
* especially when an enclosure is
* removed from the loop.
*/
break;
/* wait WAIT_FCIO_IOCTL */
(void) usleep(WAIT_FCIO_IOCTL);
continue;
}
I_DPRINTF("FCIO ioctl failed.\n"
"Error: %s. fc_error = %d (0x%x)\n",
return (ret++);
} else {
break; /* ioctl succeeds. */
}
}
if (ntries == RETRY_FCIO_IOCTL) {
return (ret++);
}
}
if (matched)
break; /* for HBA port for loop */
}
if (matched) /* HBA adapter for loop */
break;
}
if (!matched) {
ret++;
}
}
return (ret);
}
/*ARGSUSED*/
terminate();
}
/*ARGSUSED*/
int adm_port_offline_online(char **a, int b) {
terminate();
return (1);
}
/*ARGSUSED*/
void display_link_status(char **a) {
terminate();
}
/*ARGSUSED*/
terminate();
}
/*ARGSUSED*/
int adm_display_port(int a) {
terminate();
return (1);
}
/*ARGSUSED*/
int adm_port_loopback(char *a, int b) {
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
return (1);
}
/*ARGSUSED*/
int
{
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
return (1);
}
/*ARGSUSED*/
int emulex_update(char *file) {
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
return (1);
}
/*ARGSUSED*/
terminate();
}
/*ARGSUSED*/
int h_insertSena_fcdev() {
terminate();
return (1);
}