sg_io_linux.c (sdparm-1.11.tgz) | : | sg_io_linux.c (sdparm-1.12.tgz) | ||
---|---|---|---|---|
/* | /* | |||
* Copyright (c) 1999-2018 Douglas Gilbert. | * Copyright (c) 1999-2020 Douglas Gilbert. | |||
* All rights reserved. | * All rights reserved. | |||
* Use of this source code is governed by a BSD-style | * Use of this source code is governed by a BSD-style | |||
* license that can be found in the BSD_LICENSE file. | * license that can be found in the BSD_LICENSE file. | |||
* | * | |||
* SPDX-License-Identifier: BSD-2-Clause | * SPDX-License-Identifier: BSD-2-Clause | |||
*/ | */ | |||
#include <stdio.h> | #include <stdio.h> | |||
#include <stdlib.h> | #include <stdlib.h> | |||
#include <stdarg.h> | #include <stdarg.h> | |||
skipping to change at line 26 | skipping to change at line 26 | |||
#ifdef HAVE_CONFIG_H | #ifdef HAVE_CONFIG_H | |||
#include "config.h" | #include "config.h" | |||
#endif | #endif | |||
#ifdef SG_LIB_LINUX | #ifdef SG_LIB_LINUX | |||
#include "sg_io_linux.h" | #include "sg_io_linux.h" | |||
#include "sg_pr2serr.h" | #include "sg_pr2serr.h" | |||
/* Version 1.10 20180613 */ | /* Version 1.11 20200401 */ | |||
void | void | |||
sg_print_masked_status(int masked_status) | sg_print_masked_status(int masked_status) | |||
{ | { | |||
int scsi_status = (masked_status << 1) & 0x7e; | int scsi_status = (masked_status << 1) & 0x7e; | |||
sg_print_scsi_status(scsi_status); | sg_print_scsi_status(scsi_status); | |||
} | } | |||
/* host_bytes: DID_* are Linux SCSI result (a 32 bit variable) bits 16:23 */ | /* host_bytes: DID_* are Linux SCSI result (a 32 bit variable) bits 16:23 */ | |||
skipping to change at line 63 | skipping to change at line 63 | |||
pr2ws("is invalid "); | pr2ws("is invalid "); | |||
else | else | |||
pr2ws("[%s] ", linux_host_bytes[host_status]); | pr2ws("[%s] ", linux_host_bytes[host_status]); | |||
} | } | |||
/* DRIVER_* are Linux SCSI result (a 32 bit variable) bits 24:27 */ | /* DRIVER_* are Linux SCSI result (a 32 bit variable) bits 24:27 */ | |||
static const char * linux_driver_bytes[] = { | static const char * linux_driver_bytes[] = { | |||
"DRIVER_OK", "DRIVER_BUSY", "DRIVER_SOFT", "DRIVER_MEDIA", | "DRIVER_OK", "DRIVER_BUSY", "DRIVER_SOFT", "DRIVER_MEDIA", | |||
"DRIVER_ERROR", "DRIVER_INVALID", "DRIVER_TIMEOUT", "DRIVER_HARD", | "DRIVER_ERROR", "DRIVER_INVALID", "DRIVER_TIMEOUT", "DRIVER_HARD", | |||
"DRIVER_SENSE" | "DRIVER_SENSE", | |||
}; | }; | |||
#if 0 | #if 0 | |||
/* SUGGEST_* are Linux SCSI result (a 32 bit variable) bits 28:31 */ | /* SUGGEST_* are Linux SCSI result (a 32 bit variable) bits 28:31 */ | |||
static const char * linux_driver_suggests[] = { | static const char * linux_driver_suggests[] = { | |||
"SUGGEST_OK", "SUGGEST_RETRY", "SUGGEST_ABORT", "SUGGEST_REMAP", | "SUGGEST_OK", "SUGGEST_RETRY", "SUGGEST_ABORT", "SUGGEST_REMAP", | |||
"SUGGEST_DIE", "UNKNOWN","UNKNOWN","UNKNOWN", | "SUGGEST_DIE", "UNKNOWN","UNKNOWN","UNKNOWN", | |||
"SUGGEST_SENSE" | "SUGGEST_SENSE", | |||
}; | }; | |||
#endif | #endif | |||
void | void | |||
sg_print_driver_status(int driver_status) | sg_print_driver_status(int driver_status) | |||
{ | { | |||
int driv; | int driv; | |||
const char * driv_cp = "invalid"; | const char * driv_cp = "invalid"; | |||
driv = driver_status & SG_LIB_DRIVER_MASK; | driv = driver_status & SG_LIB_DRIVER_MASK; | |||
End of changes. 4 change blocks. | ||||
4 lines changed or deleted | 4 lines changed or added |