Commit 0e777ec6 authored by Thomas Schmitt's avatar Thomas Schmitt

Had to make ahci change conditional for now: -DLibburn_for_freebsd_ahcI

parent 8dcdb5a8
#define Cdrskin_timestamP "2010.03.25.113536" #define Cdrskin_timestamP "2010.03.26.083158"
...@@ -729,7 +729,7 @@ int sg_release(struct burn_drive *d) ...@@ -729,7 +729,7 @@ int sg_release(struct burn_drive *d)
int sg_issue_command(struct burn_drive *d, struct command *c) int sg_issue_command(struct burn_drive *d, struct command *c)
{ {
int done = 0, err, sense_len, ret; int done = 0, err, sense_len = 0, ret;
union ccb *ccb; union ccb *ccb;
char buf[161]; char buf[161];
static FILE *fp = NULL; static FILE *fp = NULL;
...@@ -776,8 +776,16 @@ int sg_issue_command(struct burn_drive *d, struct command *c) ...@@ -776,8 +776,16 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
ccb->csio.ccb_h.flags |= CAM_DIR_NONE; ccb->csio.ccb_h.flags |= CAM_DIR_NONE;
break; break;
} }
/* B00325 : Advise by Alexander Motin */
#ifdef Libburn_for_freebsd_ahcI
/* ts B00325 : Advise by Alexander Motin */
/* Runs well on 8-STABLE (23 Mar 2003)
But on 8-RELEASE cam_send_ccb() returns non-zero with errno 6
on eject. Long lasting TEST UNIT READY cycles break with
errno 16.
*/
ccb->ccb_h.flags|= CAM_PASS_ERR_RECOVER; ccb->ccb_h.flags|= CAM_PASS_ERR_RECOVER;
#endif /* Libburn_for_freebsd_ahcI */
ccb->csio.cdb_len = c->oplen; ccb->csio.cdb_len = c->oplen;
memcpy(&ccb->csio.cdb_io.cdb_bytes, &c->opcode, c->oplen); memcpy(&ccb->csio.cdb_io.cdb_bytes, &c->opcode, c->oplen);
...@@ -809,6 +817,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c) ...@@ -809,6 +817,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
} }
do { do {
memset(c->sense, 0, sizeof(c->sense));
err = cam_send_ccb(d->cam, ccb); err = cam_send_ccb(d->cam, ccb);
if (err == -1) { if (err == -1) {
libdax_msgs_submit(libdax_messenger, libdax_msgs_submit(libdax_messenger,
...@@ -824,19 +833,23 @@ int sg_issue_command(struct burn_drive *d, struct command *c) ...@@ -824,19 +833,23 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
} }
/* XXX */ /* XXX */
/* ts B00110 */ /* ts B00325 : Advise by Alexander Motin */
/* Better curb sense_len */ if (ccb->ccb_h.status & CAM_AUTOSNS_VALID) {
sense_len = ccb->csio.sense_len; /* ts B00110 */
if (sense_len > sizeof(c->sense)) /* Better curb sense_len */
sense_len = sizeof(c->sense); sense_len = ccb->csio.sense_len;
memcpy(c->sense, &ccb->csio.sense_data, sense_len); if (sense_len > sizeof(c->sense))
sense_len = sizeof(c->sense);
memcpy(c->sense, &ccb->csio.sense_data, sense_len);
}
/* <<< was:
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
*/ if (sense_len < 14) {
/* ts B00324 : Advise by Alexander Motin */ /*LOGICAL UNIT NOT READY,CAUSE NOT REPORTABLE*/
if (ccb->ccb_h.status & CAM_AUTOSNS_VALID) { c->sense[2] = 0x02;
c->sense[12] = 0x04;
c->sense[13] = 0x00;
}
if (!c->retry) { if (!c->retry) {
c->error = 1; c->error = 1;
{ret = 1; goto ex;} {ret = 1; goto ex;}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment