lm_acs_common.c revision d1d2228c6cf3ec632d28262810ab7902932a5d33
/*
* 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 "lm_acs.h"
int
{
return (LM_ERROR);
}
return (LM_ERROR);
}
return (LM_OK);
}
/*
* lm_handle_acs_cmd_error()
*
* Parameters:
* - status The status that was returned from ACSLS for the
* the acsls command.
* - cmd The LMPM command that is being processed.
* - tid The task id of the LMPM command that is responsible for
* the acsls command being executed.
* - msg Contains the error response that is generated.
*
* Description:
* This function is called when a ACSLS command returns something
* other than STATUS_SUCCESS. The possible return status for
* ACSLS commands are the following:
* - STATUS_IPC_FAILURE
* There was a fatal communications failure in the IPC layer.
* Most likely two internal components were unable to
* communicate. Another possible cause could be that SSI
* has failed.
* - STATUS_PROCESS_FAILURE
* The ACSLM was not able to spawn the request or the ACSLM
* received a process failure from a spawned task.
* If a status other than those above is returned, this function
* returns the error code of MMS_LM_E_INTERNAL to indicate that
* there is an internal processing error.
*
* For a STATUS_IPC_FAILURE, this routine will send a "alert" message
* to the operator interface to notify the operator that the LM has
* encountered a communication problem with ACSLS. It also will send
* a "ready disconnected" to MM, as well as set the internal state of
* the LM to "disconnected".
*
* Return Values:
* None
*
*/
void
{
int class = MMS_INTERNAL;
int code;
char msg_str[1024];
if (status == STATUS_IPC_FAILURE) {
/* Change state of LM to "disconnected" */
"encountered while issueing ready disconnect "
"command to MM.");
/* Send message to operator indicating issue */
/* No need to check return status */
/* Create error message for LMPM command */
NULL);
} else if (status == STATUS_PROCESS_FAILURE) {
NULL);
} else {
NULL);
}
}
/*
* lm_handle_acsls_rsp_error()
*
* Parameters:
* - status The status that was returned from acs_response().
* - acsls The acsls command the response was for.
* - cmd The LMPM command that is being processed.
* - tid The task id of the LMPM command that is responsible for
* the acsls command being executed.
* - msg Contains the error response that is generated.
*
*
* Description:
* This function is called when acs_response() returns something
* other than STATUS_SUCCESS. The possible return status for
* acs_response are the following:
* - STATUS_IPC_FAILURE
* There was a fatal communications failure in the IPC layer.
* Most likely two internal components were unable to
* communicate.
* - STATUS_PENDING
* The ACS response will return this status when there is no
* input from the SSI.
* - STATUS_PROCESS_FAILURE
* The ACSLM was not able to spawn the request or the ACSLM
* received a process failure from a spawned task.
* If a status other than those above is returned, this function
* returns the error code of MMS_LM_E_INTERNAL to indicate that
* there is an internal processing error.
*
* For STATUS_IPC_FAILURE and STATUS_PENDING, this routine will send
* a "alert" message to the operator interface to notify the operator
* that the LM has encountered a communication problem with ACSLS. It
* also will send a "ready disconnected" to MM, as well as set the
* internal state of the LM to "disconnected".
*
* Return Values:
* None
*/
void
char *msg)
{
int class = MMS_INTERNAL;
int code;
char msg_str[1024];
/* Change state of LM to "disconnected" */
"encountered while issueing ready disconnect "
"command to MM.");
/* Send message to operator indicating issue */
/* No need to check return status */
/* Create error message for LMPM command */
} else if (status == STATUS_PROCESS_FAILURE) {
} else {
}
}
/*
* lm_handle_acsls_status_error()
*
* Parameters:
* - class The class of error used in error response.
* - code The code of error used in error response.
* - status The ACSLS error status being handled.
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is one of the status that are not usually seen. This set of error
* status should not be seen and if seen, possible changes to this
* code may be needed in order to handle the error status in a
* more approiate manner. This function purpose is to log these
* response and generate an error response for the LMPM command.
*
* Return Value:
* None
*
*/
static void
{
char msg_str[1024];
}
/*
* lm_handle_drive_offline_error()
*
* Parameters:
* - drive The name of the drive in the LMPM command
* - geometry The geometry of the drive in the ACSLS library
* - cart If the LMPM command is a unmount, it contains the
* cartridge barcode. If the LMPM command is mount, it
* contains an empty string.
* - panel The ACSLS panel number of the drive.
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is STATUS_DRIVE_OFFLINE.
*
* Return Value:
* None
*
*/
static void
{
int rc;
int lmpl_tid;
char msg_str[1024];
char drive_spec[1024];
/* Send alert message to operator indicating */
/* that a drive was found to be offline in */
/* ACSLS library */
/* Generate LMPL config drive command to update */
/* state of drive to not accessible in MM's database */
"lm_obtain_task_id failed trying to generate LMPL config "
"drive command");
} else {
"config task[\"%d\"] scope[partial]"
" drive [\"%s\" \"%s\" \"panel %d\" \"none\" false "
else
"config task[\"%d\"] scope[partial]"
" drive [\"%s\" \"%s\" \"panel %d\" \"%s\" true "
"false];",
"DRIVE_SPEC:\n%s", drive_spec);
"Internal processing error encountered while "
"processing LMPL config drive command");
} else if (rc != LMPL_FINAL_OK) {
"not receive a success response for LMPL config "
"drive command");
} else {
"Got successful response for LMPL config drive "
"command");
}
}
/* Generate error response for LMPM command */
}
/*
* lm_handle_drive_not_in_lib_error()
*
* Parameters:
* - drive The name of the drive in the LMPM command
* - geometry The geometry of the drive in the ACSLS library
* - cart If the LMPM command is a unmount, it contains the
* cartridge barcode. If the LMPM command is mount, it
* contains an empty string.
* - panel The ACSLS panel number of the drive.
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is STATUS_DRIVE_NOT_IN_LIBRARY.
*
* Return Value:
* None
*
*/
static void
{
int rc;
int lmpl_tid;
char msg_str[1024];
char drive_spec[1024];
/* Send alert message to operator indicating */
/* that a drive was not found in ACSLS library */
/* Generate LMPL config drive command to update */
/* state of drive to not accessible in MM's database */
"lm_obtain_task_id failed trying to generate LMPL config "
"drive command");
} else {
"config task[\"%d\"] scope[partial]"
" drive [\"%s\" \"%s\" \"panel %d\" \"none\" false "
else
"config task[\"%d\"] scope[partial]"
" drive [\"%s\" \"%s\" \"panel %d\" \"%s\" true "
"false];",
"DRIVE_SPEC:\n%s", drive_spec);
"Internal processing error encountered while "
"processing LMPL config drive command");
} else if (rc != LMPL_FINAL_OK) {
"Did not receive a success response for LMPL "
"config drive command");
} else {
"lm_handle_drive_not_in_lib_error: "
"Got successful response for LMPL config drive "
"command");
}
}
/* Generate error response for LMPM command */
}
/*
* lm_handle_drive_available_error()
*
* Parameters:
* - drive The name of the drive in the LMPM command
* - geometry The geometry of the drive in the ACSLS library
* - cart The cartridge name that was suppose to be in drive.
* - panel The ACSLS panel number of the drive.
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is STATUS_DRIVE_AVAILABLE.
*
* Return Value:
* None
*
*/
static void
/* LINTED argument unused in function: acsls */
{
int rc;
int lmpl_tid;
char msg_str[1024];
char drive_spec[1024];
/* Send alert message to operator indicating */
/* that a drive was found to be empty in the */
/* ACSLS library */
/* Generate LMPL config drive command to update */
/* state of drive to accessible in MM's database */
/* as well as delete the SLOT for the cartridge */
/* that was suppose to be in drive */
"lm_obtain_task_id failed trying to generate LMPL config "
"drive and delslot command");
} else {
"config task[\"%d\"] scope[partial] drive "
"[\"%s\" \"%s\" \"panel %d\" \"none\" false true] delslots "
"DRIVE_SPEC:\n%s", drive_spec);
"Internal processing error encountered while "
"processing LMPL config drive and delslot "
"command");
} else if (rc != LMPL_FINAL_OK) {
"Did not receive a success response for LMPL "
"config drive and delslot command");
} else {
"lm_handle_drive_available_error: Got "
"successful response for LMPL config drive "
"and delslot command");
}
}
}
/*
* lm_handle_lsm_offline()
*
* Parameters:
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is STATUS_LSM_OFFLINE.
*
* Return Value:
* None
*
*/
static void
{
char msg_str[1024];
char buf[30];
/* If only one lsm in library set state of */
/* library to broken */
"Failure while issueing ready command to MM. "
"Unable to set state of LM to broken in MM's "
"database.");
}
}
/* Send alert message to operator indicating */
/* that the lsm is set to offline on the */
/* ACSLS server */
}
/*
* lm_handle_database_error()
*
* Parameters:
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is STATUS_DATABASE_ERROR.
*
* Return Value:
* None
*
*/
static void
{
char msg_str[1024];
/* Switch state of library to broken */
"issueing ready command to MM. Unable to set "
"state of LM to broken in MM's database.");
}
/* Send alert message to operator indicating */
/* that the ACSLS database is generating an error */
/* Create error response for LMPM command */
}
/*
* lm_handle_configuration_error()
*
* Parameters:
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is STATUS_CONFIGURATION_ERROR.
*
* Return Value:
* None
*
*/
static void
{
char msg_str[1024];
/* Switch state of library to broken */
"lm_handle_configuration_error: Failure while "
"issueing ready command to MM. Unable to set "
"state of LM to broken in MM's database.");
}
/* Send alert message to operator indicating */
/* that the ACSLS server has a configuration */
/* issue */
/* Create error response for LMPM command */
}
/*
* lm_handle_library_not_available()
*
* Parameters:
* - acsls The ACSLS command that returned this error.
* - cmd The LMPM command being processed.
* - tid The task id of the LMPM command.
* - msg Will contain the error response for the LMPM command.
*
* Description:
* This function is invoked when the response status to an ACSLS command
* is STATUS_LIBRARY_NOT_AVAILABLE.
*
* Return Value:
* None
*
*/
static void
{
char msg_str[1024];
"while issueing ready command to MM. Unable to set "
"state of LM to broken in MM's database.");
}
/* Obtain the state of the ACSLS server */
/* Send alert message to operator with */
/* state of server */
NULL);
/* Create error response with state of server */
} else {
/* Send alert message to operator without */
/* state of server */
LM_7206_MSG, NULL);
/* Create error response without the state */
/* of the server */
}
} else {
}
}
void
char *msg)
{
char msg_str[1024];
}
void
{
int class;
int code;
char msg_str[512];
switch (status) {
case STATUS_AUDIT_IN_PROGRESS:
return;
"acsls", "acs_query_volume",
NULL);
return;
case STATUS_DATABASE_ERROR:
msg);
return;
lm_handle_library_not_available("acs_query_volume",
return;
case STATUS_PROCESS_FAILURE:
break;
/* Non of the following status should be returned */
/* as a response for a query_volume */
case STATUS_CANCELLED:
case STATUS_COUNT_TOO_LARGE:
case STATUS_COUNT_TOO_SMALL:
case STATUS_INVALID_OPTION:
case STATUS_INVALID_TYPE:
case STATUS_INVALID_VERSION:
case STATUS_LOCKID_NOT_FOUND:
case STATUS_MESSAGE_TOO_LARGE:
case STATUS_MESSAGE_TOO_SMALL:
case STATUS_MISSING_OPTION:
case STATUS_UNSUPPORTED_TYPE:
default:
break;
}
}
void
{
int class;
int code;
char msg_str[512];
switch (status) {
case STATUS_AUDIT_IN_PROGRESS:
return;
"acsls", "acs_query_mount",
NULL);
return;
case STATUS_DATABASE_ERROR:
msg);
return;
lm_handle_library_not_available("acs_query_mount",
return;
case STATUS_PROCESS_FAILURE:
break;
/* Non of the following status should be returned */
/* as a response for a query_volume */
case STATUS_CANCELLED:
case STATUS_COUNT_TOO_LARGE:
case STATUS_COUNT_TOO_SMALL:
case STATUS_INVALID_OPTION:
case STATUS_INVALID_TYPE:
case STATUS_INVALID_VERSION:
case STATUS_LOCKID_NOT_FOUND:
case STATUS_MESSAGE_TOO_LARGE:
case STATUS_MESSAGE_TOO_SMALL:
case STATUS_MISSING_OPTION:
case STATUS_UNSUPPORTED_TYPE:
default:
break;
}
}
void
{
int class;
int code;
char msg_str[512];
char nbuf[20];
switch (status) {
case STATUS_AUDIT_IN_PROGRESS:
return;
return;
case STATUS_DATABASE_ERROR:
msg);
return;
lm_handle_library_not_available("acs_mount",
return;
case STATUS_LIBRARY_BUSY:
case STATUS_PROCESS_FAILURE:
break;
return;
return;
case STATUS_LSM_OFFLINE:
return;
case STATUS_DRIVE_OFFLINE:
return;
case STATUS_DRIVE_IN_USE:
break;
return;
class = MMS_INVALID;
break;
case STATUS_LIBRARY_FAILURE:
break;
case STATUS_VOLUME_IN_DRIVE:
break;
case STATUS_VOLUME_MISSING:
case STATUS_VOLUME_ABSENT:
break;
/* Non of the following status should be returned */
/* as a response for a mount */
case STATUS_CANCELLED:
case STATUS_COUNT_TOO_LARGE:
case STATUS_COUNT_TOO_SMALL:
case STATUS_INVALID_ACS:
case STATUS_INVALID_DRIVE:
case STATUS_INVALID_LSM:
case STATUS_INVALID_OPTION:
case STATUS_INVALID_TYPE:
case STATUS_INVALID_VERSION:
case STATUS_LOCKID_NOT_FOUND:
case STATUS_MESSAGE_TOO_LARGE:
case STATUS_MESSAGE_TOO_SMALL:
case STATUS_MISPLACED_TAPE:
case STATUS_MISSING_OPTION:
case STATUS_NOT_IN_SAME_ACS:
case STATUS_UNSUPPORTED_TYPE:
default:
break;
}
}
void
{
int class;
int code;
char msg_str[512];
char nbuf[20];
switch (status) {
case STATUS_AUDIT_IN_PROGRESS:
return;
"acsls", "acs_dismount",
NULL);
return;
case STATUS_ACS_FULL:
return;
case STATUS_DRIVE_AVAILABLE:
return;
case STATUS_DATABASE_ERROR:
msg);
return;
lm_handle_library_not_available("acs_dismount",
return;
case STATUS_LIBRARY_BUSY:
case STATUS_PROCESS_FAILURE:
break;
return;
return;
case STATUS_LSM_OFFLINE:
msg);
return;
case STATUS_DRIVE_OFFLINE:
return;
case STATUS_DRIVE_IN_USE:
break;
return;
case STATUS_LIBRARY_FAILURE:
break;
class = MMS_INVALID;
code = MMS_LM_E_PCL;
break;
break;
break;
case STATUS_UNREADABLE_LABEL:
class = MMS_INVALID;
break;
/* Non of the following status should be returned */
/* as a response for a dismount */
case STATUS_CANCELLED:
case STATUS_COUNT_TOO_LARGE:
case STATUS_COUNT_TOO_SMALL:
case STATUS_INVALID_ACS:
case STATUS_INVALID_DRIVE:
case STATUS_INVALID_LSM:
case STATUS_INVALID_OPTION:
case STATUS_INVALID_VERSION:
case STATUS_INVALID_VOLUME:
case STATUS_LOCKID_NOT_FOUND:
case STATUS_MESSAGE_TOO_LARGE:
case STATUS_MESSAGE_TOO_SMALL:
case STATUS_MISPLACED_TAPE:
default:
break;
}
}
void
char *msg)
{
int class;
int code;
char msg_str[512];
char nbuf[20];
switch (status) {
case STATUS_CAP_IN_USE:
return;
return;
case STATUS_CAP_OFFLINE:
return;
return;
NULL);
return;
case STATUS_DATABASE_ERROR:
msg);
return;
return;
lm_handle_library_not_available("acs_enter",
return;
case STATUS_LIBRARY_BUSY:
case STATUS_PROCESS_FAILURE:
break;
return;
return;
case STATUS_LIBRARY_FAILURE:
break;
case STATUS_LSM_OFFLINE:
return;
/* Non of the following status should be returned */
/* as a response for a enter */
case STATUS_CANCELLED:
case STATUS_COUNT_TOO_LARGE:
case STATUS_COUNT_TOO_SMALL:
case STATUS_INVALID_ACS:
case STATUS_INVALID_CAP:
case STATUS_INVALID_LSM:
case STATUS_INVALID_OPTION:
case STATUS_INVALID_VERSION:
case STATUS_LOCKID_NOT_FOUND:
case STATUS_MESSAGE_TOO_LARGE:
case STATUS_MESSAGE_TOO_SMALL:
default:
break;
}
}
void
char *msg)
{
int class;
int code;
char msg_str[512];
char nbuf[20];
switch (status) {
case STATUS_CAP_IN_USE:
return;
return;
case STATUS_CAP_OFFLINE:
return;
NULL);
return;
case STATUS_DATABASE_ERROR:
msg);
return;
return;
lm_handle_library_not_available("acs_eject",
return;
case STATUS_LIBRARY_BUSY:
case STATUS_PROCESS_FAILURE:
break;
return;
return;
case STATUS_LIBRARY_FAILURE:
break;
case STATUS_LSM_OFFLINE:
return;
/* Non of the following status should be returned */
/* as a response for a eject */
case STATUS_CANCELLED:
case STATUS_COUNT_TOO_LARGE:
case STATUS_COUNT_TOO_SMALL:
case STATUS_INVALID_ACS:
case STATUS_INVALID_CAP:
case STATUS_INVALID_LSM:
case STATUS_INVALID_OPTION:
case STATUS_INVALID_RANGE:
case STATUS_INVALID_VERSION:
case STATUS_LOCKID_NOT_FOUND:
case STATUS_MESSAGE_TOO_LARGE:
case STATUS_MESSAGE_TOO_SMALL:
default:
break;
}
}
void
{
int class;
int code;
char msg_str[1024];
}
{
int rc;
int not_timeout;
int acs_bad_pkt = 0;
char msg_str[1024];
/* Lock acs response queue */
"response queue's mutex failed with errno "
return (NULL);
}
while (!lm_internal_error) {
/* Go through queue to see if a response for seq */
/* already exists */
"ele->acs_seq_nmbr: Thread "
"found a acs response for itself, seq "
"number - %d", seq);
/* Found a reponse, remove from list */
/* Unlock response queue */
if ((rc = pthread_mutex_unlock(
"lm_obtain_acs_response: "
"Unlock of acs response "
"queue's mutex failed with "
"errno - %s",
return (NULL);
}
/* Return response */
return (ele);
}
}
/* Did not find a response for thread */
"lm_obtain_acs_response: acs_rsp.acs_reading - "
if (acs_rsp.acs_reading) {
"lm_obtain_acs_response: Reader thread "
"already exists, going into wait, seq number "
"- %d", seq);
not_timeout = 1;
while (not_timeout) {
if (!lm_internal_error)
continue;
else
break;
else if (rc != 0) {
"lm_obtain_acs_response: "
"Unable to wait on acs response "
"queue's condition variable, "
(void) pthread_mutex_unlock(
return (NULL);
}
not_timeout = 0;
}
"lm_obtain_acs_response: Thread woke up "
"by broadcast from reader thread, seq number - "
"%d", seq);
} else {
/* No acs reader, become reader */
break;
}
}
if (lm_internal_error)
return (NULL);
"lm_obtain_acs_response: Thread becoming acs_response "
"reader, seq number - %d", seq);
while (!lm_internal_error) {
/* Unlock acs's response mutex so other threads */
/* can look at response queue, Need to relock it */
/* when a acs response is obtained */
"lm_obtain_acs_response: Unlock of acs "
"response queue's mutex failed with errno "
return (NULL);
}
/* Obtain next response from acsls ssi */
== NULL) {
"malloc space for new acs response, seq num "
return (NULL);
}
/* XXX NEED TO CHANGE THIS TO DO A TIMEOUT */
/* CURRENTLY BLOCK FOR EVER, MAKE SURE CHECK */
/* STATUS FOR PENDING */
"lm_obtain_acs_response: Read next response from "
"acsls server, seq number - %d", seq);
/* This is done so that if type is not set */
/* by acsls code below is insured to work */
/*
* new_rsp->acs_type = RT_NONE;
*/
do {
"acs_response() returned a RT_NONE "
"response, status - %s",
"lm_obtain_acs_response: "
"lost connection to the CSI "
"on the ACSLS server");
"lm_obtain_acs_response: "
"Failure encountered while "
"issueing ready disconnect "
"command to MM.");
/* Send message to operator */
/* indicating issue */
(void) mms_buf_msgcl(msg_str,
sizeof (msg_str),
LM_7203_MSG, "status",
NULL);
/* No need to check return */
/* status */
msg_str);
/* Create error message for */
/* LMPM command */
(void) mms_buf_msgcl(msg_str,
sizeof (msg_str),
NULL);
return (NULL);
}
if (++acs_bad_pkt > MAX_BAD_ACS_PKT) {
/* XXX ADDITIONAL CHECKS CAN */
/* BE DONE TO VERIFY THAT THE */
/* LIBRARY IS STILL ACTIVE */
"lm_obtain_acs_response: "
"acsls returned multiple "
"RT_NONE response packets that "
"exceed threshold");
/*
* LEAVING FOR WHEN RECOVERY IS ADDED TO
* CHECK FOR LIBRARY. WHEN DONE LM WILL
* SWITCH LIBRARY TO BROKEN STATE
* *class = MMS_INTERNAL;
* *code = MMS_LM_E_LIBRARY;
* sprintf(msg_str, LM_7231_MSG);
* free(new_rsp);
*/
return (NULL);
}
}
acs_bad_pkt = 0;
/* Lock acs's response mutex */
"response queue's mutex failed with errno "
return (NULL);
}
/* See if response is for this thread or another */
"lm_obtain_acs_response: Reader thread "
"found a response for itself, seq number - %d"
acs_rsp.acs_reading = 0;
/* Wake up any other threads waiting for a */
/* acs_response so one of them can take over */
/* as the reader */
!= 0) {
"broadcast to wake up threads waiting "
"for a acs_response failed with errno "
return (NULL);
}
!= 0) {
"lm_obtain_acs_response: Unlock "
"of acs response queue's mutex failed "
return (NULL);
}
return (new_rsp);
}
"lm_obtain_acs_response: Reader thread received "
"a acs response that does not belong to it, seq "
/* Add new response to acs response queue */
/* Broadcast to other threads waiting on responses */
"lm_obtain_acs_response: broadcast to "
"wake up threads waiting for a acs_response "
return (NULL);
}
}
/* If we get here then LM has detected an internal processing */
/* error and all threads should exit as quickly as possible */
return (NULL);
}
int
char *ret_msg)
{
char msg_str[256];
SEQ_NO s;
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
return (LM_ERROR);
}
"Received acknowledge response for "
"acs_enter while processing inject commad");
"for acs_enter() while processing %s cmd, "
"type - %s", cmd,
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
!= STATUS_SUCCESS) {
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
return (LM_ERROR);
}
"Received acknowledge response for "
"acs_eject while processing eject command");
"for acs_eject() while processing %s cmd, "
"type - %s", cmd,
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
!= STATUS_SUCCESS) {
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
"Received acknowledge response for "
"acs_mount while processing %s command", cmd);
"for acs_mount() while processing %s cmd, type "
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
!= STATUS_SUCCESS) {
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
"Received acknowledge response for "
"acs_dismount while processing %s command", cmd);
"for acs_dismount() while processing %s cmd, type "
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
!= STATUS_SUCCESS) {
"lm_acs_query_drive() failed while processing "
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"acs_response() for acs_query_drive() "
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
/* Query drives < MAX_ID should never get an */
/* intermidate response */
"acs_query_drive while processing %s "
"command", cmd);
"for acs_query_drive() while processing %s "
"command, type - %s", cmd,
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
!= STATUS_SUCCESS) {
"lm_acs_query_mount() failed while processing "
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"acs_response() for acs_query_mount() "
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
"acs_query_mount while processing %s "
"command", cmd);
continue;
"acs_query_mount while processing %s command",
cmd);
} else {
"for acs_query_mount() while processing %s "
"command, type - %s", cmd,
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
!= STATUS_SUCCESS) {
"lm_acs_query_volume() failed while processing "
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"acs_response() for acs_query_volume() "
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
/* Query volumes < MAX_ID should never get an */
/* intermidate response */
"acs_query_volume while processing %s "
"command", cmd);
"for acs_query_volume() while processing %s "
"command, type - %s", cmd,
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
unsigned short count = 0;
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"acs_response() for acs_query_cap() "
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
/* Query cap should never get an */
/* intermidate response */
"Received acknowledge response for"
"acs_query_cap while processing %s "
"command", cmd);
"for acs_query_cap() while processing %s "
"command, type - %s", cmd,
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}
int
char *ret_msg)
{
SEQ_NO s;
"processing %s command, status - %s",
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"for acs_query_server() "
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
/* Query server should never get an */
/* intermidate response */
"for acs_query_server while processing %s "
"command", cmd);
"for acs_query_server() while processing %s "
return (LM_ERROR);
}
return (LM_OK);
}
int
{
char msg_str[256];
SEQ_NO s;
!= STATUS_SUCCESS) {
"processing %s command, status - %s", cmd,
acs_status(status));
return (LM_ERROR);
}
do {
== NULL)
/* Internal error encountered */
return (LM_ERROR);
"failed while processing %s cmd, status - %s",
return (LM_ERROR);
}
/* Query one volume should never get an */
/* intermidate response */
"acs_display while processing %s "
"command", cmd);
"for acs_dispaly while processing %s commmand",
cmd);
"for acs_display() while processing %s "
"command, type - %s", cmd,
NULL);
msg_str);
return (LM_ERROR);
}
return (LM_OK);
}