2 ** Copyright 2002/03, Thomas Kurschel. All rights reserved.
3 ** Distributed under the terms of the OpenBeOS License.
7 Part of Open IDE bus manager
9 Interface between ide and scsi bus manager
17 #include <sys/cdefs.h>
19 #include "scsi_cmds.h"
22 extern scsi_for_sim_interface
*scsi
;
23 extern scsi_sim_interface ide_sim_module
;
25 // set sense of current request
27 set_sense(ide_device_info
*device
, int sense_key
, int sense_asc
)
29 device
->new_combined_sense
= (sense_key
<< 16) | sense_asc
;
32 // retrieve key from combined sense
34 decode_sense_key(uint32 combined_sense
)
36 return (combined_sense
>> 16) & 0xff;
39 // retrieve asc from combined sense
41 decode_sense_asc(uint32 combined_sense
)
43 return (combined_sense
>> 8) & 0xff;
46 // retrieve ascq from combined sense
48 decode_sense_ascq(uint32 combined_sense
)
50 return combined_sense
& 0xff;
53 // retrieve asc and ascq from combined sense
55 decode_sense_asc_ascq(uint32 combined_sense
)
57 return combined_sense
& 0xffff;
60 void finish_request(ide_qrequest
*qrequest
, bool resubmit
);
61 void finish_reset_queue(ide_qrequest
*qrequest
);
62 void finish_retry(ide_qrequest
*qrequest
);
63 void finish_all_requests(ide_device_info
*device
, ide_qrequest
*ignore
,
64 int subsys_status
, bool resubmit
);
65 void finish_checksense(ide_qrequest
*qrequest
);
68 // start request by resetting sense
70 start_request(ide_device_info
*device
, ide_qrequest
*qrequest
)
72 device
->new_combined_sense
= 0;
73 device
->subsys_status
= SCSI_REQ_CMP
;
74 qrequest
->request
->device_status
= SCSI_STATUS_GOOD
;
80 void create_sense(ide_device_info
*device
, scsi_sense
*sense
);