error handling - Sense Key for ASC/ASCQ Numbers -
in scsi interface errors recognized concatenation of 3 numbers: sensekey + asc + ascq. asc/ascq pair description describes meaning of errors based on asc/ascq values. not asc/ascq pairs have meaning sense keys. how should know sense key returned each asc/ascq pair?
asc/ascq not tied sense key.
sense key main error code. asc , ascq additional sense code , qualifier. it's little tip answer wrong in i_t_l_q nexus.
so answer question - there no way know sense key returned each asc/ascq pair in general.
but there known "sense key" + asc + ascq combinations, because of operating systems implement error handling small subset of errors. unfortunately, can find subset inspecting source codes.
for example, in mac os x darwin kernel can additional_sense_code
in ioscsiarchitecturemodelfamily. here example ioscsiblockcommands/ioscsiblockcommandsdevicepm.cpp
, line 659:
// check sense key see if error group know how handle if ( ( ( sensebuffer.sense_key & ksense_key_mask ) == ksense_key_not_ready ) || ( ( sensebuffer.sense_key & ksense_key_mask ) == ksense_key_medium_error ) ) { // sensekey 02 ( not ready ) or 03 ( medium error ). check see // if can if ( ( sensebuffer.additional_sense_code == 0x04 ) && ( sensebuffer.additional_sense_code_qualifier == 0x02 ) ) { // device requires start command before can tell if media there if ( start_stop_unit ( request, 0x00, 0x00, 0x00, 0x01, 0x00 ) == true ) { status_log ( ( "sending start_stop_unit.\n" ) ); serviceresponse = sendcommand ( request, 0 ); } status_log ( ( "%s::drive not ready\n", getname ( ) ) ); iosleep ( 200 ); continue; } else if ( ( sensebuffer.additional_sense_code == 0x3a ) && ( sensebuffer.additional_sense_code_qualifier == 0x00 ) ) { status_log ( ( "no media.\n" ) ); // no media present, return false driveready = true; mediapresent = false; } else { status_log ( ( "%s::drive not ready\n", getname ( ) ) ); iosleep ( 200 ); continue; } }
used sk+asc+ascq tupes:
0x02/0x03, 0x04, 0x02
- not ready/medium error, logical unit not ready, initializing command required;0x02/0x03, 0x3a, 0x00
- not ready/medium error, medium not present.
as can see here asc/ascq pair used either 0x02 or 0x03 sense keys, , action take determined on asc/ascq pair, doesn't matter how asc/ascq pairs divided between sense keys.
Comments
Post a Comment