2014-04-23 169 views
3

我正在开发一个SCSI目标软件(我是SCSI新手),并且我需要返回正确的sense数据以告诉启动程序,它的请求没有通过,因为数据被写保护。我期待在从T10.org那块表,描述这些代码:SCSI额外的感觉代码的含义?

 
ASC/ . . . . . 
ASCQ DTLPWROMAEBKVF Description 
27/00 DT WRO BK WRITE PROTECTED 
27/01 DT WRO BK HARDWARE WRITE PROTECTED 
27/02 DT WRO BK LOGICAL UNIT SOFTWARE WRITE PROTECTED 
27/03 T R   ASSOCIATED WRITE PROTECT 
27/04 T R   PERSISTENT WRITE PROTECT 
27/05 T R   PERMANENT WRITE PROTECT 
27/06  R  F CONDITIONAL WRITE PROTECT 
27/07 D   B  SPACE ALLOCATION FAILED WRITE PROTECT 

什么是这些不同ASCQ代码的含义?我无法在任何地方找到任何解释。像“PERSISTENT WRITE PROTECT”这样的三个或四个单词是我能找到的最大值。我想知道类似“如果您遇到类似这个的情况,那么您需要使用ASCQ = ”。

回答

1

在T10.org网站上有一个这些代码的列表,其标题为:SCSI ASC/ASCQ Assignments

本页还介绍了它们的用途,标题为:SCSI Additional Sense Data

SCSI Additional Sense Data takes the form of two value encoded bytes in the sense data, typically returned by the REQUEST SENSE command. The additional sense code (ASC) byte indicates information about the error exception reported in the sense key field. The additional sense code qualifier (ASCQ) indicates detailed information related to the additional sense code. See the clause describing the REQUEST SENSE command in the SCSI Primary Commands - 4 (SPC-4) draft standard (or later) for more information about sense data.

Descriptions of the assigned ASC and ASCQ values and their coded meanings are organized in tables that are sorted numerically based on the ASC/ASCQ values or alphabetically based on the text describing the error or exception indicated by the ASC/ASCQ pair. An explanation of the ASC/ASCQ table format is available if you are unfamiliar with these tables.

此外,我想看看标题为维基百科页面话题:Key Code Qualifier,它是这样说的这些代码。

Key Code Qualifier is an error-code returned by a SCSI device. When a SCSI target device returns a check condition in response to a command, the initiator usually then issues a SCSI Request Sense command. This process is part of a SCSI protocol called Contingent Allegiance Condition. The target will respond to the Request Sense command with a set of SCSI sense data which includes three fields giving increasing levels of detail about the error:

  • K - sense key - 4 bits, (byte 2 of Fixed sense data format)
  • C - additional sense code (ASC) - 8 bits, (byte 12 of Fixed sense data format)
  • Q - additional sense code qualifier (ASCQ) - 8 bits, (byte 13 of Fixed sense data format)

The initiator can take action based on just the K field which indicates if the error is minor or major. However all three fields are usually logically combined into a 20 bit field called Key Code Qualifier or KCQ. The specification for the target device will define the list of possible KCQ values. In practice there are many KCQ values which are common between different SCSI device types and different SCSI device vendors. Common values are listed below, you should consult your hardware specific documentation as well.

+0

对不起,这些网页每个ASC/ASCQ只包含三个或四个单词,但我需要更详细的解释(实际上我从T10.org复制了一部分网页到我的问题)。 – HEKTO

+0

@AlekseyYakovlev - 看到更新,并让我知道,如果编辑帮助。 – slm

2

有在这方面没有对与错,还有,您可以通过看到的ASC/ASCQ代码与普通硬盘不同的感觉键返回搜集一些基本准则。日立公司最擅长在公开文档中记录这些信息。

真正重要的唯一一件事就是Sense Key,ASC/ASCQ很好,但它唯一的重要性在于你。当客户打电话给你,并告诉你“我做了这件事,并得到了错误代码,这是什么意思?”你需要能够帮助他。这是这些代码唯一真正的重要性。

+0

Baruch有最好的答案。 ASC/ASCQ可以以编程方式进入的一个领域是确定是否媒体被弹出或未被格式化,并可能作用于该媒体。但是,即使在好日子里,不同的供应商也不会真正同意何时返回这些内容,而只会得到一个NOT READY或MEDIUM ERROR感应键。大多数情况下,ASC/ASCQ的使用都贯穿整个规范。你一次只能找到一个。 :) –

0

简而言之,ASCQ代码通常出现在来自SCSI目标设备的响应帧中。 ASCQ代码描述了附加的感应数据,或者通常称为设备中发生某些情况的原因。