Commit 8dcdb5a8 authored by Thomas Schmitt's avatar Thomas Schmitt

Changed sg-freebsd.c to work with ahci, advise by Alexander Motin

parent 4f372c00
#define Cdrskin_timestamP "2010.03.17.185222"
#define Cdrskin_timestamP "2010.03.25.113536"
......@@ -776,6 +776,8 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
ccb->csio.ccb_h.flags |= CAM_DIR_NONE;
break;
}
/* B00325 : Advise by Alexander Motin */
ccb->ccb_h.flags|= CAM_PASS_ERR_RECOVER;
ccb->csio.cdb_len = c->oplen;
memcpy(&ccb->csio.cdb_io.cdb_bytes, &c->opcode, c->oplen);
......@@ -827,8 +829,14 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
sense_len = ccb->csio.sense_len;
if (sense_len > sizeof(c->sense))
sense_len = sizeof(c->sense);
memcpy(c->sense, &ccb->csio.sense_data, ccb->csio.sense_len);
memcpy(c->sense, &ccb->csio.sense_data, sense_len);
/* <<< was:
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
*/
/* ts B00324 : Advise by Alexander Motin */
if (ccb->ccb_h.status & CAM_AUTOSNS_VALID) {
if (!c->retry) {
c->error = 1;
{ret = 1; goto ex;}
......
......@@ -961,13 +961,13 @@ enum response scsi_error_msg(struct burn_drive *d, unsigned char *sense,
*key= *asc= *ascq= -1;
if (senselen<=0 || senselen>2)
*key = sense[2];
*key = sense[2] & 0x0f;
if (senselen<=0 || senselen>12)
*asc = sense[12];
if (senselen<=0 || senselen>13)
*ascq = sense[13];
sprintf(msg, "[%X %2.2X %2.2X] ", (*key) & 0xf, *asc, *ascq);
sprintf(msg, "[%X %2.2X %2.2X] ", *key, *asc, *ascq);
msg= msg + strlen(msg);
burn_print(12, "CONDITION: 0x%x 0x%x 0x%x on %s %s\n",
......
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