2014-04-23 105 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代碼描述了附加的感應數據,或者通常稱爲設備中發生某些情況的原因。