Ticket #149: megaraid.patch

File megaraid.patch, 1.3 KB (added by Christian Franke, 9 years ago)

Proposed patch

  • os_linux.cpp

     
    10461046        pout("%s", buff);
    10471047  }
    10481048
    1049   /* Controller rejects Enable SMART and Test Unit Ready */
     1049  // Controller rejects Test Unit Ready
    10501050  if (iop->cmnd[0] == 0x00)
    10511051    return true;
    1052   if (iop->cmnd[0] == 0x85 && iop->cmnd[1] == 0x06) {
    1053     if(report > 0)
    1054       pout("Rejecting SMART/ATA command to controller\n");
    1055     // Emulate SMART STATUS CHECK drive reply
    1056     // smartctl fail to work without this
    1057     if(iop->cmnd[2]==0x2c) {
    1058       iop->resp_sense_len=22; // copied from real response
    1059       iop->sensep[0]=0x72; // descriptor format
    1060       iop->sensep[7]=0x0e; // additional length
    1061       iop->sensep[8]=0x09; // description pointer
    1062       iop->sensep[17]=0x4f; // low cylinder GOOD smart status
    1063       iop->sensep[19]=0xc2; // high cylinder GOOD smart status
    1064     }
    1065     return true;
     1052
     1053  if (iop->cmnd[0] == 0xa1 || iop->cmnd[0] == 0x85) { // SAT_ATA_PASSTHROUGH_12/16
     1054    // Controller does not return ATA output registers in SAT sense data
     1055    if (iop->cmnd[2] & (1 << 5)) // chk_cond
     1056      return set_err(ENOSYS, "ATA output registers not supported");
     1057    // TODO: Controller rejects Enable SMART
    10661058  }
    10671059
    10681060  if (pt_cmd == NULL)