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

This commit is contained in:
Thomas Schmitt 2010-03-25 11:36:55 +00:00
parent 8874436e6e
commit 9b8782b374
3 changed files with 12 additions and 4 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2010.03.17.185222"
#define Cdrskin_timestamP "2010.03.25.113536"

View File

@ -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;}

View File

@ -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",