Lines Matching +full:fis +full:- +full:based
2 *Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
73 oneDeviceData->satDeviceType = DeviceType; in smRegisterDevice()
118 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smIOAbort()
119 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smIOAbort()
144 agRoot = smAllShared->agRoot; in smIOAbort()
145 smIORequestBody = (smIORequestBody_t *)tasktag->smData; in smIOAbort()
154 satIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smIOAbort()
155 satIntIo = satIOContext->satIntIoContext; in smIOAbort()
159 agIORequest = &(smIORequestBody->agIORequest); in smIOAbort()
164 smIONewRequestBody = (smIORequestBody_t *)satIntIo->satIntRequestBody; in smIOAbort()
165 agIORequest = &(smIONewRequestBody->agIORequest); in smIOAbort()
201 smAbortIORequestBody->IOType.InitiatorTMIO.osMemHandle = osMemHandle; in smIOAbort()
202 satAbortIOContext = &(smAbortIORequestBody->transport.SATA.satIOContext); in smIOAbort()
203 satAbortIOContext->smRequestBody = smAbortIORequestBody; in smIOAbort()
205 smAbortIORequestBody->smDevHandle = smIORequestBody->smDevHandle; in smIOAbort()
208 agAbortIORequest = &(smAbortIORequestBody->agIORequest); in smIOAbort()
209 agAbortIORequest->osData = (void *) smAbortIORequestBody; in smIOAbort()
210 agAbortIORequest->sdkData = agNULL; /* LL takes care of this */ in smIOAbort()
213 smAbortIORequestBody->smIOToBeAbortedRequest = tasktag; in smIOAbort()
230 smAbortIORequestBody->IOType.InitiatorTMIO.osMemHandle, in smIOAbort()
243 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smIOAbortAll()
244 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smIOAbortAll()
261 agRoot = smAllShared->agRoot; in smIOAbortAll()
269 oneDeviceData = (smDeviceData_t *)smDeviceHandle->smData; in smIOAbortAll()
275 if (oneDeviceData->valid == agFALSE) in smIOAbortAll()
277 SM_DBG1(("smIOAbortAll: oneDeviceData is not valid, did %d !!!\n", oneDeviceData->id)); in smIOAbortAll()
281 agDevHandle = oneDeviceData->agDevHandle; in smIOAbortAll()
323 smAbortIORequestBody->IOType.InitiatorTMIO.osMemHandle = osMemHandle; in smIOAbortAll()
325 satAbortIOContext = &(smAbortIORequestBody->transport.SATA.satIOContext); in smIOAbortAll()
326 satAbortIOContext->smRequestBody = smAbortIORequestBody; in smIOAbortAll()
327 smAbortIORequestBody->smDevHandle = smDeviceHandle; in smIOAbortAll()
330 agAbortIORequest = &(smAbortIORequestBody->agIORequest); in smIOAbortAll()
331 agAbortIORequest->osData = (void *) smAbortIORequestBody; in smIOAbortAll()
332 agAbortIORequest->sdkData = agNULL; /* LL takes care of this */ in smIOAbortAll()
334 oneDeviceData->OSAbortAll = agTRUE; in smIOAbortAll()
341 smAbortIORequestBody->IOType.InitiatorTMIO.osMemHandle, in smIOAbortAll()
367 oneDeviceData = (smDeviceData_t *)smDeviceHandle->smData; in smSuperIOStart()
373 if (oneDeviceData->valid == agFALSE) in smSuperIOStart()
375 SM_DBG1(("smSuperIOStart: oneDeviceData is not valid, did %d !!!\n", oneDeviceData->id)); in smSuperIOStart()
378 smIORequestBody = (smIORequestBody_t*)smIORequest->smData;//smDequeueIO(smRoot); in smSuperIOStart()
388 SM_DBG3(("smSuperIOStart: io ID %d!!!\n", smIORequestBody->id )); in smSuperIOStart()
390 oneDeviceData->sasAddressHi = AddrHi; in smSuperIOStart()
391 oneDeviceData->sasAddressLo = AddrLo; in smSuperIOStart()
393 smIORequestBody->smIORequest = smIORequest; in smSuperIOStart()
394 smIORequestBody->smDevHandle = smDeviceHandle; in smSuperIOStart()
396 satIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smSuperIOStart()
402 smIORequestBody->transport.SATA.smSenseData.senseData = agNULL; in smSuperIOStart()
403 smIORequestBody->transport.SATA.smSenseData.senseLen = 0; in smSuperIOStart()
404 satIOContext->pSatDevData = oneDeviceData; in smSuperIOStart()
405 satIOContext->pFis = in smSuperIOStart()
406 &smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHostToDev; in smSuperIOStart()
407 satIOContext->pScsiCmnd = &smSCSIRequest->scsiCmnd; in smSuperIOStart()
408 satIOContext->pSense = &smIORequestBody->transport.SATA.sensePayload; in smSuperIOStart()
409 satIOContext->pSmSenseData = &smIORequestBody->transport.SATA.smSenseData; in smSuperIOStart()
410 satIOContext->pSmSenseData->senseData = satIOContext->pSense; in smSuperIOStart()
411 /* satIOContext->pSense = (scsiRspSense_t *)satIOContext->pSmSenseData->senseData; */ in smSuperIOStart()
412 satIOContext->smRequestBody = smIORequestBody; in smSuperIOStart()
413 satIOContext->interruptContext = interruptContext; in smSuperIOStart()
414 satIOContext->psmDeviceHandle = smDeviceHandle; in smSuperIOStart()
415 satIOContext->smScsiXchg = smSCSIRequest; in smSuperIOStart()
416 satIOContext->superIOFlag = agTRUE; in smSuperIOStart()
417 // satIOContext->superIOFlag = agFALSE; in smSuperIOStart()
419 satIOContext->satIntIoContext = agNULL; in smSuperIOStart()
420 satIOContext->satOrgIOContext = agNULL; in smSuperIOStart()
421 /* satIOContext->tiIORequest = tiIORequest; */ in smSuperIOStart()
424 /*smIORequest->smData = smIORequestBody;*/ in smSuperIOStart()
427 satIOContext->currentLBA = 0; in smSuperIOStart()
428 satIOContext->OrgTL = 0; in smSuperIOStart()
480 oneDeviceData = (smDeviceData_t *)smDeviceHandle->smData; in smIOStart()
486 if (oneDeviceData->valid == agFALSE) in smIOStart()
488 SM_DBG1(("smIOStart: oneDeviceData is not valid, did %d !!!\n", oneDeviceData->id)); in smIOStart()
491 smIORequestBody = (smIORequestBody_t*)smIORequest->smData;//smDequeueIO(smRoot); in smIOStart()
501 SM_DBG3(("smIOStart: io ID %d!!!\n", smIORequestBody->id )); in smIOStart()
503 smIORequestBody->smIORequest = smIORequest; in smIOStart()
504 smIORequestBody->smDevHandle = smDeviceHandle; in smIOStart()
506 satIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smIOStart()
512 smIORequestBody->transport.SATA.smSenseData.senseData = agNULL; in smIOStart()
513 smIORequestBody->transport.SATA.smSenseData.senseLen = 0; in smIOStart()
514 satIOContext->pSatDevData = oneDeviceData; in smIOStart()
515 satIOContext->pFis = in smIOStart()
516 &smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHostToDev; in smIOStart()
517 satIOContext->pScsiCmnd = &smSCSIRequest->scsiCmnd; in smIOStart()
518 satIOContext->pSense = &smIORequestBody->transport.SATA.sensePayload; in smIOStart()
519 satIOContext->pSmSenseData = &smIORequestBody->transport.SATA.smSenseData; in smIOStart()
520 satIOContext->pSmSenseData->senseData = satIOContext->pSense; in smIOStart()
521 /* satIOContext->pSense = (scsiRspSense_t *)satIOContext->pSmSenseData->senseData; */ in smIOStart()
522 satIOContext->smRequestBody = smIORequestBody; in smIOStart()
523 satIOContext->interruptContext = interruptContext; in smIOStart()
524 satIOContext->psmDeviceHandle = smDeviceHandle; in smIOStart()
525 satIOContext->smScsiXchg = smSCSIRequest; in smIOStart()
526 satIOContext->superIOFlag = agFALSE; in smIOStart()
528 satIOContext->satIntIoContext = agNULL; in smIOStart()
529 satIOContext->satOrgIOContext = agNULL; in smIOStart()
530 satIOContext->currentLBA = 0; in smIOStart()
531 satIOContext->OrgTL = 0; in smIOStart()
551 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smTaskManagement()
552 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smTaskManagement()
553 agsaRoot_t *agRoot = smAllShared->agRoot; in smTaskManagement()
561 oneDeviceData = (smDeviceData_t *)smDeviceHandle->smData; in smTaskManagement()
567 if ( (lun->lun[0] | lun->lun[1] | lun->lun[2] | lun->lun[3] | in smTaskManagement()
568 lun->lun[4] | lun->lun[5] | lun->lun[6] | lun->lun[7] ) != 0 ) in smTaskManagement()
571 oneDeviceData->id)); in smTaskManagement()
576 oneDeviceData->satDriveState = SAT_DEV_STATE_IN_RECOVERY; in smTaskManagement()
577 oneDeviceData->satAbortAfterReset = agFALSE; in smTaskManagement()
582 oneDeviceData->agDevHandle, in smTaskManagement()
586 if (oneDeviceData->directlyAttached == agFALSE) in smTaskManagement()
602 smIORequestBody = (smIORequestBody_t*)currentTaskTag->smData;//smDequeueIO(smRoot); in smTaskManagement()
612 satIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smTaskManagement()
613 satIOContext->smRequestBody = smIORequestBody; in smTaskManagement()
614 smIORequestBody->smDevHandle = smDeviceHandle; in smTaskManagement()
616 agContext = &(oneDeviceData->agDeviceResetContext); in smTaskManagement()
617 agContext->osData = currentTaskTag; in smTaskManagement()
622 oneDeviceData->phyID, in smTaskManagement()
649 smIORequestBody = (smIORequestBody_t*)currentTaskTag->smData;//smDequeueIO(smRoot); in smTaskManagement()
658 /*currentTaskTag->smData = smIORequestBody;*/ in smTaskManagement()
684 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smDequeueIO()
685 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smDequeueIO()
692 if (SMLIST_EMPTY(&(smAllShared->freeIOList))) in smDequeueIO()
699 SMLIST_DEQUEUE_FROM_HEAD(&IOListList, &(smAllShared->freeIOList)); in smDequeueIO()
701 SMLIST_DEQUEUE_THIS(&(smIORequestBody->satIoBodyLink)); in smDequeueIO()
702 SMLIST_ENQUEUE_AT_TAIL(&(smIORequestBody->satIoBodyLink), &(smAllShared->mainIOList)); in smDequeueIO()
705 if (smIORequestBody->InUse == agTRUE) in smDequeueIO()
707 SM_DBG1(("smDequeueIO: wrong. already in USE ID %d!!!!\n", smIORequestBody->id)); in smDequeueIO()
712 SM_DBG2(("smDequeueIO: io ID %d!\n", smIORequestBody->id)); in smDequeueIO()
715 if (smIORequestBody->satIoBodyLink.flink == agNULL) in smDequeueIO()
717 SM_DBG1(("smDequeueIO: io ID %d, flink is NULL!!!\n", smIORequestBody->id)); in smDequeueIO()
719 if (smIORequestBody->satIoBodyLink.blink == agNULL) in smDequeueIO()
721 SM_DBG1(("smDequeueIO: io ID %d, blink is NULL!!!\n", smIORequestBody->id)); in smDequeueIO()
756 smToBeAbortedIORequestBody = (smIORequestBody_t *)satIOContext->smRequestBody; in smsatAbort()
757 agToBeAbortedIORequest = (agsaIORequest_t *)&(smToBeAbortedIORequestBody->agIORequest); in smsatAbort()
793 smIORequestBody->IOType.InitiatorTMIO.osMemHandle = osMemHandle; in smsatAbort()
794 smIORequestBody->smDevHandle = smToBeAbortedIORequestBody->smDevHandle; in smsatAbort()
796 satAbortIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smsatAbort()
797 satAbortIOContext->smRequestBody = smIORequestBody; in smsatAbort()
799 agAbortIORequest = &(smIORequestBody->agIORequest); in smsatAbort()
800 agAbortIORequest->osData = (void *) smIORequestBody; in smsatAbort()
801 agAbortIORequest->sdkData = agNULL; /* LL takes care of this */ in smsatAbort()
830 oneDeviceData = satIOContext->pSatDevData; in smsatStartCheckPowerMode()
834 /* allocate any fis for seting SRT bit in device control */ in smsatStartCheckPowerMode()
858 SM_DBG6(("smsatStartCheckPowerMode: TD smScsiXchg %p \n", satIOContext->smScsiXchg)); in smsatStartCheckPowerMode()
859 SM_DBG6(("smsatStartCheckPowerMode: SM smScsiXchg %p \n", satNewIOContext->smScsiXchg)); in smsatStartCheckPowerMode()
866 &satIntIo->satIntSmIORequest, /* New smIORequest */ in smsatStartCheckPowerMode()
868 … satNewIOContext->smScsiXchg, /* New tiScsiInitiatorRequest_t *smScsiRequest, */ in smsatStartCheckPowerMode()
906 oneDeviceData = satIOContext->pSatDevData; in smsatStartResetDevice()
910 /* allocate any fis for seting SRT bit in device control */ in smsatStartResetDevice()
934 SM_DBG6(("smsatStartResetDevice: TD smScsiXchg %p \n", satIOContext->smScsiXchg)); in smsatStartResetDevice()
935 SM_DBG6(("smsatStartResetDevice: SM smScsiXchg %p \n", satNewIOContext->smScsiXchg)); in smsatStartResetDevice()
941 if (oneDeviceData->satDeviceType == SATA_ATAPI_DEVICE) in smsatStartResetDevice()
945 &satIntIo->satIntSmIORequest, /* New smIORequest */ in smsatStartResetDevice()
947 … satNewIOContext->smScsiXchg, /* New smScsiInitiatorRequest_t *smScsiRequest, NULL */ in smsatStartResetDevice()
953 &satIntIo->satIntSmIORequest, /* New smIORequest */ in smsatStartResetDevice()
955 … satNewIOContext->smScsiXchg, /* New smScsiInitiatorRequest_t *smScsiRequest, NULL */ in smsatStartResetDevice()
997 oneDeviceData = (smDeviceData_t *)smDeviceHandle->smData; in smsatTmAbortTask()
1004 elementHdr = oneDeviceData->satIoLinkList.flink; in smsatTmAbortTask()
1006 while (elementHdr != &oneDeviceData->satIoLinkList) in smsatTmAbortTask()
1014 smIORequestBody = (smIORequestBody_t *) satTempIOContext->smRequestBody; in smsatTmAbortTask()
1015 smIOReq = smIORequestBody->smIORequest; in smsatTmAbortTask()
1018 elementHdr = elementHdr->flink; /* for the next while loop */ in smsatTmAbortTask()
1026 satIOContext->satToBeAbortedIOContext = satTempIOContext; in smsatTmAbortTask()
1045 if (smIORequestBody->IOType.InitiatorTMIO.osMemHandle != agNULL) in smsatTmAbortTask()
1049 smIORequestBody->IOType.InitiatorTMIO.osMemHandle, in smsatTmAbortTask()
1072 oneDeviceData->satTmTaskTag = currentTaskTag; in smsatTmAbortTask()
1077 oneDeviceData->satDriveState = SAT_DEV_STATE_IN_RECOVERY; in smsatTmAbortTask()
1085 oneDeviceData->satAbortAfterReset = agTRUE; in smsatTmAbortTask()
1087 if ( (satTempIOContext->reqType == AGSA_SATA_PROTOCOL_FPDMA_WRITE) || in smsatTmAbortTask()
1088 (satTempIOContext->reqType == AGSA_SATA_PROTOCOL_FPDMA_READ) in smsatTmAbortTask()
1133 oneDeviceData = (smDeviceData_t *)smDeviceHandle->smData; in smsatTaskManagement()
1135 satIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smsatTaskManagement()
1137 satIOContext->pSatDevData = oneDeviceData; in smsatTaskManagement()
1138 satIOContext->pFis = in smsatTaskManagement()
1139 &(smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHostToDev); in smsatTaskManagement()
1142 satIOContext->smRequestBody = smIORequestBody; in smsatTaskManagement()
1143 satIOContext->psmDeviceHandle = smDeviceHandle; in smsatTaskManagement()
1144 satIOContext->satIntIoContext = agNULL; in smsatTaskManagement()
1145 satIOContext->satOrgIOContext = agNULL; in smsatTaskManagement()
1148 satIOContext->currentLBA = 0; in smsatTaskManagement()
1149 satIOContext->OrgTL = 0; in smsatTaskManagement()
1152 satIOContext->TMF = task; in smsatTaskManagement()
1154 satIOContext->satToBeAbortedIOContext = agNULL; in smsatTaskManagement()
1189 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smPhyControlSend()
1190 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smPhyControlSend()
1191 agsaRoot_t *agRoot = smAllShared->agRoot; in smPhyControlSend()
1212 agExpDevHandle = oneDeviceData->agExpDevHandle; in smPhyControlSend()
1220 SM_DBG5(("smPhyControlSend: phyID %d\n", oneDeviceData->phyID)); in smPhyControlSend()
1225 smpPhyControlReq.phyIdentifier = (bit8)oneDeviceData->phyID; in smPhyControlSend()
1253 smSMPRequestBody->osMemHandle = osMemHandle; in smPhyControlSend()
1256 smSMPRequestBody->smDeviceData = oneDeviceData; /* sata disk */ in smPhyControlSend()
1259 smSMPRequestBody->smDevHandle = oneDeviceData->smDevHandle; in smPhyControlSend()
1261 // agDevHandle = oneDeviceData->agDevHandle; in smPhyControlSend()
1264 smSMPRequestBody->SMPCompletionFunc = smSMPCompleted; /* in satcb.c */ in smPhyControlSend()
1267 smSMPRequestBody->CurrentTaskTag = CurrentTaskTag; in smPhyControlSend()
1271 CurrentTaskTag->smData = smSMPRequestBody; in smPhyControlSend()
1275 smSMPRequestBody->retries = 0; in smPhyControlSend()
1279 SM_DBG4(("smPhyControlSend: callback fn %p\n", smSMPRequestBody->SMPCompletionFunc)); in smPhyControlSend()
1282 agIORequest = &(smSMPRequestBody->agIORequest); in smPhyControlSend()
1283 agIORequest->osData = (void *) smSMPRequestBody; in smPhyControlSend()
1284 agIORequest->sdkData = agNULL; /* SALL takes care of this */ in smPhyControlSend()
1287 agSASRequestBody = &(smSMPRequestBody->agSASRequestBody); in smPhyControlSend()
1288 agSMPFrame = &(agSASRequestBody->smpFrame); in smPhyControlSend()
1305 sm_memset(smSMPRequestBody->smpPayload, 0, SMP_DIRECT_PAYLOAD_LIMIT); in smPhyControlSend()
1313 sm_memcpy(smSMPRequestBody->smpPayload, &smSMPFrameHeader, 4); in smPhyControlSend()
1314 sm_memcpy((smSMPRequestBody->smpPayload)+4, pSmpBody, smpBodySize); in smPhyControlSend()
1317 agSMPFrame->outFrameBuf = smSMPRequestBody->smpPayload; in smPhyControlSend()
1318 agSMPFrame->outFrameLen = smpBodySize + 4; /* without last 4 byte crc */ in smPhyControlSend()
1320 agSMPFrame->inFrameLen = 0; in smPhyControlSend()
1325 agSMPFrame->expectedRespLen = 0; in smPhyControlSend()
1327 agSMPFrame->expectedRespLen = expectedRspLen; in smPhyControlSend()
1329 // smhexdump("smPhyControlSend", (bit8*)agSMPFrame->outFrameBuf, agSMPFrame->outFrameLen); in smPhyControlSend()
1330 …// smhexdump("smPhyControlSend new", (bit8*)smSMPRequestBody->smpPayload, agSMPFrame->outFrameL… in smPhyControlSend()
1331 …// smhexdump("smPhyControlSend - smSMPRequestBody", (bit8*)smSMPRequestBody, sizeof(smSMPReques… in smPhyControlSend()
1349 agSMPFrame->flag = 0; in smPhyControlSend()
1351 sm_memset(smSMPRequestBody->smpPayload, 0, SMP_DIRECT_PAYLOAD_LIMIT); in smPhyControlSend()
1359 sm_memcpy(smSMPRequestBody->smpPayload, &smSMPFrameHeader, 4); in smPhyControlSend()
1360 sm_memcpy((smSMPRequestBody->smpPayload)+4, pSmpBody, smpBodySize); in smPhyControlSend()
1363 agSMPFrame->outFrameBuf = smSMPRequestBody->smpPayload; in smPhyControlSend()
1364 agSMPFrame->outFrameLen = smpBodySize + 4; /* without last 4 byte crc */ in smPhyControlSend()
1366 agSMPFrame->inFrameLen = 0; in smPhyControlSend()
1371 agSMPFrame->expectedRespLen = 0; in smPhyControlSend()
1373 agSMPFrame->expectedRespLen = expectedRspLen; in smPhyControlSend()
1375 // smhexdump("smPhyControlSend", (bit8*)agSMPFrame->outFrameBuf, agSMPFrame->outFrameLen); in smPhyControlSend()
1376 // smhexdump("smPhyControlSend new", (bit8*)smSMPRequestBody->smpPayload, agSMPFrame->outFrameLe… in smPhyControlSend()
1377 // smhexdump("smPhyControlSend - smSMPRequestBody", (bit8*)smSMPRequestBody, sizeof(smSMPRequest… in smPhyControlSend()
1434 smIORequestBody = (smIORequestBody_t *)satIOContext->smRequestBody; in smEnqueueIO()
1435 smIntRoot = (smIntRoot_t *)smRoot->smData; in smEnqueueIO()
1436 smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smEnqueueIO()
1438 /* enque back to smAllShared->freeIOList */ in smEnqueueIO()
1439 if (satIOContext->satIntIoContext == agNULL) in smEnqueueIO()
1441 SM_DBG2(("smEnqueueIO: external command!!!, io ID %d!!!\n", smIORequestBody->id)); in smEnqueueIO()
1443 if (smIORequestBody->satIoBodyLink.flink == agNULL) in smEnqueueIO()
1445 … SM_DBG1(("smEnqueueIO: external command!!!, io ID %d, flink is NULL!!!\n", smIORequestBody->id)); in smEnqueueIO()
1447 if (smIORequestBody->satIoBodyLink.blink == agNULL) in smEnqueueIO()
1449 … SM_DBG1(("smEnqueueIO: external command!!!, io ID %d, blink is NULL!!!\n", smIORequestBody->id)); in smEnqueueIO()
1454 SM_DBG2(("smEnqueueIO: internal command!!!, io ID %d!!!\n", smIORequestBody->id)); in smEnqueueIO()
1456 if (smIORequestBody->satIoBodyLink.flink == agNULL) in smEnqueueIO()
1458 … SM_DBG1(("smEnqueueIO: internal command!!!, io ID %d, flink is NULL!!!\n", smIORequestBody->id)); in smEnqueueIO()
1460 if (smIORequestBody->satIoBodyLink.blink == agNULL) in smEnqueueIO()
1462 … SM_DBG1(("smEnqueueIO: internal command!!!, io ID %d, blink is NULL!!!\n", smIORequestBody->id)); in smEnqueueIO()
1466 if (smIORequestBody->smIORequest == agNULL) in smEnqueueIO()
1468 SM_DBG1(("smEnqueueIO: smIORequest is NULL, io ID %d!!!\n", smIORequestBody->id)); in smEnqueueIO()
1471 if (smIORequestBody->InUse == agTRUE) in smEnqueueIO()
1473 smIORequestBody->InUse = agFALSE; in smEnqueueIO()
1475 SMLIST_DEQUEUE_THIS(&(smIORequestBody->satIoBodyLink)); in smEnqueueIO()
1476 SMLIST_ENQUEUE_AT_TAIL(&(smIORequestBody->satIoBodyLink), &(smAllShared->freeIOList)); in smEnqueueIO()
1481 SM_DBG2(("smEnqueueIO: check!!!, io ID %d!!!\n", smIORequestBody->id)); in smEnqueueIO()
1504 satIntIo->satOrgSmIORequest = agNULL; in smsatFreeIntIoResource()
1509 if (satIntIo->satIntSmScsiXchg.scsiCmnd.expDataLength != 0) in smsatFreeIntIoResource()
1511 SM_DBG3(("smsatFreeIntIoResource: DMA len %d\n", satIntIo->satIntDmaMem.totalLength)); in smsatFreeIntIoResource()
1512 SM_DBG3(("smsatFreeIntIoResource: pointer %p\n", satIntIo->satIntDmaMem.osHandle)); in smsatFreeIntIoResource()
1515 satIntIo->satIntDmaMem.osHandle, in smsatFreeIntIoResource()
1516 satIntIo->satIntDmaMem.totalLength); in smsatFreeIntIoResource()
1517 satIntIo->satIntSmScsiXchg.scsiCmnd.expDataLength = 0; in smsatFreeIntIoResource()
1520 if (satIntIo->satIntReqBodyMem.totalLength != 0) in smsatFreeIntIoResource()
1522 SM_DBG3(("smsatFreeIntIoResource: req body len %d\n", satIntIo->satIntReqBodyMem.totalLength)); in smsatFreeIntIoResource()
1527 satIntIo->satIntReqBodyMem.osHandle, in smsatFreeIntIoResource()
1528 satIntIo->satIntReqBodyMem.totalLength); in smsatFreeIntIoResource()
1530 satIntIo->satIntReqBodyMem.totalLength = 0; in smsatFreeIntIoResource()
1533 SM_DBG3(("smsatFreeIntIoResource: satDevData %p satIntIo id %d\n", satDevData, satIntIo->id)); in smsatFreeIntIoResource()
1538 SMLIST_DEQUEUE_THIS (&(satIntIo->satIntIoLink)); in smsatFreeIntIoResource()
1539 SMLIST_ENQUEUE_AT_TAIL (&(satIntIo->satIntIoLink), &(satDevData->satFreeIntIoLinkList)); in smsatFreeIntIoResource()
1565 if (!SMLIST_EMPTY(&(satDevData->satFreeIntIoLinkList))) in smsatAllocIntIoResource()
1567 SMLIST_DEQUEUE_FROM_HEAD(&smList, &(satDevData->satFreeIntIoLinkList)); in smsatAllocIntIoResource()
1584 SM_DBG3(("smsatAllocIntIoResource: satDevData %p satIntIo id %d\n", satDevData, satIntIo->id)); in smsatAllocIntIoResource()
1587 SMLIST_DEQUEUE_THIS (&(satIntIo->satIntIoLink)); in smsatAllocIntIoResource()
1588 SMLIST_ENQUEUE_AT_TAIL (&(satIntIo->satIntIoLink), &(satDevData->satActiveIntIoLinkList)); in smsatAllocIntIoResource()
1595 SMLIST_ENQUEUE_AT_TAIL (smList, &(satDevData->satActiveIntIoLinkList)); in smsatAllocIntIoResource()
1599 SM_DBG3(("smsatAllocIntIoResource: satDevData %p satIntIo id %d\n", satDevData, satIntIo->id)); in smsatAllocIntIoResource()
1618 satIntIo->satIntReqBodyMem.totalLength = sizeof(smIORequestBody_t); in smsatAllocIntIoResource()
1621 &satIntIo->satIntReqBodyMem.osHandle, in smsatAllocIntIoResource()
1622 (void **)&satIntIo->satIntRequestBody, in smsatAllocIntIoResource()
1623 &satIntIo->satIntReqBodyMem.physAddrUpper, in smsatAllocIntIoResource()
1624 &satIntIo->satIntReqBodyMem.physAddrLower, in smsatAllocIntIoResource()
1626 satIntIo->satIntReqBodyMem.totalLength, in smsatAllocIntIoResource()
1636 SMLIST_DEQUEUE_THIS (&satIntIo->satIntIoLink); in smsatAllocIntIoResource()
1637 SMLIST_ENQUEUE_AT_HEAD(&satIntIo->satIntIoLink, &satDevData->satFreeIntIoLinkList); in smsatAllocIntIoResource()
1648 satIntIo->satIntDmaMem.totalLength = dmaAllocLength; in smsatAllocIntIoResource()
1651 &satIntIo->satIntDmaMem.osHandle, in smsatAllocIntIoResource()
1652 (void **)&satIntIo->satIntDmaMem.virtPtr, in smsatAllocIntIoResource()
1653 &satIntIo->satIntDmaMem.physAddrUpper, in smsatAllocIntIoResource()
1654 &satIntIo->satIntDmaMem.physAddrLower, in smsatAllocIntIoResource()
1656 satIntIo->satIntDmaMem.totalLength, in smsatAllocIntIoResource()
1658 SM_DBG3(("smsatAllocIntIoResource: len %d \n", satIntIo->satIntDmaMem.totalLength)); in smsatAllocIntIoResource()
1659 SM_DBG3(("smsatAllocIntIoResource: pointer %p \n", satIntIo->satIntDmaMem.osHandle)); in smsatAllocIntIoResource()
1668 SMLIST_DEQUEUE_THIS (&satIntIo->satIntIoLink); in smsatAllocIntIoResource()
1669 SMLIST_ENQUEUE_AT_HEAD(&satIntIo->satIntIoLink, &satDevData->satFreeIntIoLinkList); in smsatAllocIntIoResource()
1676 satIntIo->satIntReqBodyMem.osHandle, in smsatAllocIntIoResource()
1677 satIntIo->satIntReqBodyMem.totalLength); in smsatAllocIntIoResource()
1699 satIntIo->satIntSmIORequest.tdData = agNULL; /* Not used for internal SAT I/O */ in smsatAllocIntIoResource()
1700 satIntIo->satIntSmIORequest.smData = satIntIo->satIntRequestBody; in smsatAllocIntIoResource()
1705 satIntIo->satOrgSmIORequest = smIORequest; in smsatAllocIntIoResource()
1730 * - sglVirtualAddr if DMA transfer is involved in smsatAllocIntIoResource()
1731 * - agSgl1 if DMA transfer is involved in smsatAllocIntIoResource()
1732 * - expDataLength in scsiCmnd since this field is read by smsataLLIOStart() in smsatAllocIntIoResource()
1736 satIntIo->satIntSmScsiXchg.sglVirtualAddr = satIntIo->satIntDmaMem.virtPtr; in smsatAllocIntIoResource()
1738 OSSA_WRITE_LE_32(agNULL, &satIntIo->satIntSmScsiXchg.smSgl1.len, 0, in smsatAllocIntIoResource()
1739 satIntIo->satIntDmaMem.totalLength); in smsatAllocIntIoResource()
1740 satIntIo->satIntSmScsiXchg.smSgl1.lower = satIntIo->satIntDmaMem.physAddrLower; in smsatAllocIntIoResource()
1741 satIntIo->satIntSmScsiXchg.smSgl1.upper = satIntIo->satIntDmaMem.physAddrUpper; in smsatAllocIntIoResource()
1742 satIntIo->satIntSmScsiXchg.smSgl1.type = tiSgl; in smsatAllocIntIoResource()
1744 satIntIo->satIntSmScsiXchg.scsiCmnd.expDataLength = satIntIo->satIntDmaMem.totalLength; in smsatAllocIntIoResource()
1748 satIntIo->satIntSmScsiXchg.sglVirtualAddr = agNULL; in smsatAllocIntIoResource()
1750 satIntIo->satIntSmScsiXchg.smSgl1.len = 0; in smsatAllocIntIoResource()
1751 satIntIo->satIntSmScsiXchg.smSgl1.lower = 0; in smsatAllocIntIoResource()
1752 satIntIo->satIntSmScsiXchg.smSgl1.upper = 0; in smsatAllocIntIoResource()
1753 satIntIo->satIntSmScsiXchg.smSgl1.type = tiSgl; in smsatAllocIntIoResource()
1755 satIntIo->satIntSmScsiXchg.scsiCmnd.expDataLength = 0; in smsatAllocIntIoResource()
1758 …SM_DBG5(("smsatAllocIntIoResource: satIntIo->satIntSmScsiXchg.agSgl1.len %d\n", satIntIo->satIntSm… in smsatAllocIntIoResource()
1760 …SM_DBG5(("smsatAllocIntIoResource: satIntIo->satIntSmScsiXchg.agSgl1.upper %d\n", satIntIo->satInt… in smsatAllocIntIoResource()
1762 …SM_DBG5(("smsatAllocIntIoResource: satIntIo->satIntSmScsiXchg.agSgl1.lower %d\n", satIntIo->satInt… in smsatAllocIntIoResource()
1764 …SM_DBG5(("smsatAllocIntIoResource: satIntIo->satIntSmScsiXchg.agSgl1.type %d\n", satIntIo->satIntS… in smsatAllocIntIoResource()
1778 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smAddToSharedcontext()
1779 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smAddToSharedcontext()
1787 DeviceListList = smAllShared->MainDeviceList.flink; in smAddToSharedcontext()
1788 while (DeviceListList != &(smAllShared->MainDeviceList)) in smAddToSharedcontext()
1796 if (oneDeviceData->agDevHandle == agDevHandle) in smAddToSharedcontext()
1798 SM_DBG2(("smAddToSharedcontext: did %d\n", oneDeviceData->id)); in smAddToSharedcontext()
1802 DeviceListList = DeviceListList->flink; in smAddToSharedcontext()
1810 if (SMLIST_EMPTY(&(smAllShared->FreeDeviceList))) in smAddToSharedcontext()
1814 smDeviceHandle->smData = agNULL; in smAddToSharedcontext()
1818 SMLIST_DEQUEUE_FROM_HEAD(&DeviceListList, &(smAllShared->FreeDeviceList)); in smAddToSharedcontext()
1821 oneDeviceData->smRoot = smRoot; in smAddToSharedcontext()
1822 oneDeviceData->agDevHandle = agDevHandle; in smAddToSharedcontext()
1823 oneDeviceData->valid = agTRUE; in smAddToSharedcontext()
1824 smDeviceHandle->smData = oneDeviceData; in smAddToSharedcontext()
1825 oneDeviceData->smDevHandle = smDeviceHandle; in smAddToSharedcontext()
1828 oneDeviceData->directlyAttached = agTRUE; in smAddToSharedcontext()
1832 oneDeviceData->directlyAttached = agFALSE; in smAddToSharedcontext()
1834 oneDeviceData->agExpDevHandle = agExpDevHandle; in smAddToSharedcontext()
1835 oneDeviceData->phyID = phyID; in smAddToSharedcontext()
1836 oneDeviceData->satPendingIO = 0; in smAddToSharedcontext()
1837 oneDeviceData->satPendingNCQIO = 0; in smAddToSharedcontext()
1838 oneDeviceData->satPendingNONNCQIO = 0; in smAddToSharedcontext()
1841 SMLIST_ENQUEUE_AT_TAIL(&(oneDeviceData->MainLink), &(smAllShared->MainDeviceList)); in smAddToSharedcontext()
1843 SM_DBG2(("smAddToSharedcontext: new case did %d\n", oneDeviceData->id)); in smAddToSharedcontext()
1848 oneDeviceData->smRoot = smRoot; in smAddToSharedcontext()
1849 oneDeviceData->agDevHandle = agDevHandle; in smAddToSharedcontext()
1850 oneDeviceData->valid = agTRUE; in smAddToSharedcontext()
1851 smDeviceHandle->smData = oneDeviceData; in smAddToSharedcontext()
1852 oneDeviceData->smDevHandle = smDeviceHandle; in smAddToSharedcontext()
1855 oneDeviceData->directlyAttached = agTRUE; in smAddToSharedcontext()
1859 oneDeviceData->directlyAttached = agFALSE; in smAddToSharedcontext()
1861 oneDeviceData->agExpDevHandle = agExpDevHandle; in smAddToSharedcontext()
1862 oneDeviceData->phyID = phyID; in smAddToSharedcontext()
1863 oneDeviceData->satPendingIO = 0; in smAddToSharedcontext()
1864 oneDeviceData->satPendingNCQIO = 0; in smAddToSharedcontext()
1865 oneDeviceData->satPendingNONNCQIO = 0; in smAddToSharedcontext()
1866 SM_DBG2(("smAddToSharedcontext: old case did %d\n", oneDeviceData->id)); in smAddToSharedcontext()
1879 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smRemoveFromSharedcontext()
1880 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smRemoveFromSharedcontext()
1886 //smDeviceHandle->smData = agNULL; in smRemoveFromSharedcontext()
1897 if (oneDeviceData->valid == agTRUE) in smRemoveFromSharedcontext()
1901 SMLIST_DEQUEUE_THIS(&(oneDeviceData->MainLink)); in smRemoveFromSharedcontext()
1902 SMLIST_ENQUEUE_AT_TAIL(&(oneDeviceData->FreeLink), &(smAllShared->FreeDeviceList)); in smRemoveFromSharedcontext()
1908 SM_DBG1(("smRemoveFromSharedcontext: did %d bad case!!!\n", oneDeviceData->id)); in smRemoveFromSharedcontext()
1921 smIntRoot_t *smIntRoot = (smIntRoot_t *)smRoot->smData; in smFindInSharedcontext()
1922 smIntContext_t *smAllShared = (smIntContext_t *)&smIntRoot->smAllShared; in smFindInSharedcontext()
1929 if (SMLIST_EMPTY(&(smAllShared->MainDeviceList))) in smFindInSharedcontext()
1940 DeviceListList = smAllShared->MainDeviceList.flink; in smFindInSharedcontext()
1941 while (DeviceListList != &(smAllShared->MainDeviceList)) in smFindInSharedcontext()
1949 if ((oneDeviceData->agDevHandle == agDevHandle) && in smFindInSharedcontext()
1950 (oneDeviceData->valid == agTRUE) in smFindInSharedcontext()
1953 SM_DBG2(("smFindInSharedcontext: found, did %d\n", oneDeviceData->id)); in smFindInSharedcontext()
1956 DeviceListList = DeviceListList->flink; in smFindInSharedcontext()
1977 satNewIntIo->satOrgSmIORequest = smOrgIORequest; /* this is already done in in smsatPrepareNewIO()
1980 smNewIORequestBody = (smIORequestBody_t *)satNewIntIo->satIntRequestBody; in smsatPrepareNewIO()
1981 satNewIOContext = &(smNewIORequestBody->transport.SATA.satIOContext); in smsatPrepareNewIO()
1983 satNewIOContext->pSatDevData = satDevData; in smsatPrepareNewIO()
1984 …satNewIOContext->pFis = &(smNewIORequestBody->transport.SATA.agSATARequestBody.fis.fisReg… in smsatPrepareNewIO()
1985 satNewIOContext->pScsiCmnd = &(satNewIntIo->satIntSmScsiXchg.scsiCmnd); in smsatPrepareNewIO()
1989 sm_memcpy(satNewIOContext->pScsiCmnd->cdb, scsiCmnd->cdb, 16); in smsatPrepareNewIO()
1991 satNewIOContext->pSense = &(smNewIORequestBody->transport.SATA.sensePayload); in smsatPrepareNewIO()
1992 satNewIOContext->pSmSenseData = &(smNewIORequestBody->transport.SATA.smSenseData); in smsatPrepareNewIO()
1993 satNewIOContext->pSmSenseData->senseData = satNewIOContext->pSense; in smsatPrepareNewIO()
1994 satNewIOContext->smRequestBody = satNewIntIo->satIntRequestBody; in smsatPrepareNewIO()
1995 satNewIOContext->interruptContext = satNewIOContext->interruptContext; in smsatPrepareNewIO()
1996 satNewIOContext->satIntIoContext = satNewIntIo; in smsatPrepareNewIO()
1997 satNewIOContext->psmDeviceHandle = satOrgIOContext->psmDeviceHandle; in smsatPrepareNewIO()
1998 satNewIOContext->satOrgIOContext = satOrgIOContext; in smsatPrepareNewIO()
2000 satNewIOContext->smScsiXchg = satOrgIOContext->smScsiXchg; in smsatPrepareNewIO()
2014 oneDeviceData->satDriveState = SAT_DEV_STATE_NORMAL; in smsatSetDevInfo()
2015 oneDeviceData->satFormatState = agFALSE; in smsatSetDevInfo()
2016 oneDeviceData->satDeviceFaultState = agFALSE; in smsatSetDevInfo()
2017 oneDeviceData->satTmTaskTag = agNULL; in smsatSetDevInfo()
2018 oneDeviceData->satAbortAfterReset = agFALSE; in smsatSetDevInfo()
2019 oneDeviceData->satAbortCalled = agFALSE; in smsatSetDevInfo()
2020 oneDeviceData->satSectorDone = 0; in smsatSetDevInfo()
2023 oneDeviceData->satNCQMaxIO = SATAIdData->queueDepth + 1; in smsatSetDevInfo()
2024 SM_DBG3(("smsatSetDevInfo: max queue depth %d\n",oneDeviceData->satNCQMaxIO)); in smsatSetDevInfo()
2027 if (SATAIdData->sataCapabilities & 0x100) in smsatSetDevInfo()
2030 oneDeviceData->satNCQ = agTRUE; in smsatSetDevInfo()
2035 oneDeviceData->satNCQ = agFALSE; in smsatSetDevInfo()
2039 if ((SATAIdData->commandSetSupported1 & 0x400) && in smsatSetDevInfo()
2040 (SATAIdData->commandSetFeatureEnabled1 & 0x400) ) in smsatSetDevInfo()
2043 oneDeviceData->sat48BitSupport = agTRUE; in smsatSetDevInfo()
2048 oneDeviceData->sat48BitSupport = agFALSE; in smsatSetDevInfo()
2052 if (SATAIdData->commandSetFeatureSupportedExt & 0x02) in smsatSetDevInfo()
2054 SM_DBG3(("smsatSetDevInfo: SMART self-test supported \n")); in smsatSetDevInfo()
2055 oneDeviceData->satSMARTSelfTest = agTRUE; in smsatSetDevInfo()
2059 SM_DBG3(("smsatSetDevInfo: no SMART self-test suppored\n")); in smsatSetDevInfo()
2060 oneDeviceData->satSMARTSelfTest = agFALSE; in smsatSetDevInfo()
2064 if (SATAIdData->commandSetSupported & 0x01) in smsatSetDevInfo()
2067 oneDeviceData->satSMARTFeatureSet = agTRUE; in smsatSetDevInfo()
2072 oneDeviceData->satSMARTFeatureSet = agFALSE; in smsatSetDevInfo()
2076 if (SATAIdData->commandSetFeatureEnabled & 0x01) in smsatSetDevInfo()
2079 oneDeviceData->satSMARTEnabled = agTRUE; in smsatSetDevInfo()
2084 oneDeviceData->satSMARTEnabled = agFALSE; in smsatSetDevInfo()
2087 oneDeviceData->satVerifyState = 0; in smsatSetDevInfo()
2090 if (SATAIdData->commandSetSupported & 0x4) in smsatSetDevInfo()
2093 oneDeviceData->satRemovableMedia = agTRUE; in smsatSetDevInfo()
2098 oneDeviceData->satRemovableMedia = agFALSE; in smsatSetDevInfo()
2102 if (SATAIdData->commandSetFeatureEnabled & 0x4) in smsatSetDevInfo()
2105 oneDeviceData->satRemovableMediaEnabled = agTRUE; in smsatSetDevInfo()
2110 oneDeviceData->satRemovableMediaEnabled = agFALSE; in smsatSetDevInfo()
2114 if (SATAIdData->dma_lba_iod_ios_stimer & 0x100) in smsatSetDevInfo()
2117 oneDeviceData->satDMASupport = agTRUE; in smsatSetDevInfo()
2122 oneDeviceData->satDMASupport = agFALSE; in smsatSetDevInfo()
2126 if (SATAIdData->word62_74[0] & 0x8000) in smsatSetDevInfo()
2129 oneDeviceData->satDMADIRSupport = agTRUE; in smsatSetDevInfo()
2134 oneDeviceData->satDMADIRSupport = agFALSE; in smsatSetDevInfo()
2137 /* DMA Enabled, word88 bit0-6, bit8-14*/ in smsatSetDevInfo()
2139 if (SATAIdData->ultraDMAModes & 0x7F7F) in smsatSetDevInfo()
2142 oneDeviceData->satDMAEnabled = agTRUE; in smsatSetDevInfo()
2143 if (SATAIdData->ultraDMAModes & 0x40) in smsatSetDevInfo()
2145 oneDeviceData->satUltraDMAMode = 6; in smsatSetDevInfo()
2147 else if (SATAIdData->ultraDMAModes & 0x20) in smsatSetDevInfo()
2149 oneDeviceData->satUltraDMAMode = 5; in smsatSetDevInfo()
2151 else if (SATAIdData->ultraDMAModes & 0x10) in smsatSetDevInfo()
2153 oneDeviceData->satUltraDMAMode = 4; in smsatSetDevInfo()
2155 else if (SATAIdData->ultraDMAModes & 0x08) in smsatSetDevInfo()
2157 oneDeviceData->satUltraDMAMode = 3; in smsatSetDevInfo()
2159 else if (SATAIdData->ultraDMAModes & 0x04) in smsatSetDevInfo()
2161 oneDeviceData->satUltraDMAMode = 2; in smsatSetDevInfo()
2163 else if (SATAIdData->ultraDMAModes & 0x01) in smsatSetDevInfo()
2165 oneDeviceData->satUltraDMAMode = 1; in smsatSetDevInfo()
2171 oneDeviceData->satDMAEnabled = agFALSE; in smsatSetDevInfo()
2172 oneDeviceData->satUltraDMAMode = 0; in smsatSetDevInfo()
2177 word60 - 61, should be 0x 0F FF FF FF in smsatSetDevInfo()
2179 oneDeviceData->satMaxUserAddrSectors in smsatSetDevInfo()
2180 = (SATAIdData->numOfUserAddressableSectorsHi << (8*2) ) in smsatSetDevInfo()
2181 + SATAIdData->numOfUserAddressableSectorsLo; in smsatSetDevInfo()
2182 …nfo: MaxUserAddrSectors 0x%x decimal %d\n", oneDeviceData->satMaxUserAddrSectors, oneDeviceData->s… in smsatSetDevInfo()
2184 /* Read Look-ahead is supported */ in smsatSetDevInfo()
2185 if (SATAIdData->commandSetSupported & 0x40) in smsatSetDevInfo()
2187 SM_DBG3(("smsatSetDevInfo: Read Look-ahead is supported\n")); in smsatSetDevInfo()
2188 oneDeviceData->satReadLookAheadSupport= agTRUE; in smsatSetDevInfo()
2192 SM_DBG3(("smsatSetDevInfo: Read Look-ahead is not supported\n")); in smsatSetDevInfo()
2193 oneDeviceData->satReadLookAheadSupport= agFALSE; in smsatSetDevInfo()
2197 if (SATAIdData->commandSetSupported & 0x20) in smsatSetDevInfo()
2200 oneDeviceData->satVolatileWriteCacheSupport = agTRUE; in smsatSetDevInfo()
2205 oneDeviceData->satVolatileWriteCacheSupport = agFALSE; in smsatSetDevInfo()
2209 if (SATAIdData->commandSetFeatureEnabled & 0x20) in smsatSetDevInfo()
2212 oneDeviceData->satWriteCacheEnabled = agTRUE; in smsatSetDevInfo()
2217 oneDeviceData->satWriteCacheEnabled = agFALSE; in smsatSetDevInfo()
2221 if (SATAIdData->commandSetFeatureEnabled & 0x40) in smsatSetDevInfo()
2224 oneDeviceData->satLookAheadEnabled = agTRUE; in smsatSetDevInfo()
2229 oneDeviceData->satLookAheadEnabled = agFALSE; in smsatSetDevInfo()
2233 if (SATAIdData->commandSetFeatureDefault & 0x100) in smsatSetDevInfo()
2236 oneDeviceData->satWWNSupport = agTRUE; in smsatSetDevInfo()
2241 oneDeviceData->satWWNSupport = agFALSE; in smsatSetDevInfo()
2244 /* Support DMA Setup Auto-Activate, if Word 78 bit 2 is set */ in smsatSetDevInfo()
2245 if (SATAIdData->sataFeaturesSupported & 0x4) in smsatSetDevInfo()
2247 SM_DBG3(("smsatSetDevInfo: device supports DMA Setup Auto-Activate\n")); in smsatSetDevInfo()
2248 oneDeviceData->satDMASetupAA = agTRUE; in smsatSetDevInfo()
2252 SM_DBG3(("smsatSetDevInfo: no DMA Setup Auto-Activate\n")); in smsatSetDevInfo()
2253 oneDeviceData->satDMASetupAA = agFALSE; in smsatSetDevInfo()
2257 if (SATAIdData->word77 & 0x10) in smsatSetDevInfo()
2260 oneDeviceData->satNCQQMgntCmd = agTRUE; in smsatSetDevInfo()
2265 oneDeviceData->satNCQQMgntCmd = agFALSE; in smsatSetDevInfo()
2279 pLun = &scsiCmnd->lun; in smsatInquiryStandard()
2283 -> BQUE 1 and CMDQUE 0, SPC-4, Table96, p147 in smsatInquiryStandard()
2286 See SPC-4, 6.4.2, p 143 in smsatInquiryStandard()
2303 if ( ((pLun->lun[0] | pLun->lun[1] | pLun->lun[2] | pLun->lun[3] | in smsatInquiryStandard()
2304 pLun->lun[4] | pLun->lun[5] | pLun->lun[6] | pLun->lun[7] ) != 0) ) in smsatInquiryStandard()
2315 if (pSATAIdData->rm_ataDevice & ATA_REMOVABLE_MEDIA_DEVICE_MASK ) in smsatInquiryStandard()
2323 pInquiry[2] = 0x05; /* SPC-3 */ in smsatInquiryStandard()
2325 pInquiry[4] = 0x1F; /* 35 - 4 = 31; Additional length */ in smsatInquiryStandard()
2328 if (pSATAIdData->sataCapabilities & 0x100) in smsatInquiryStandard()
2348 pInquiry[16] = pSATAIdData->modelNumber[1]; in smsatInquiryStandard()
2349 pInquiry[17] = pSATAIdData->modelNumber[0]; in smsatInquiryStandard()
2350 pInquiry[18] = pSATAIdData->modelNumber[3]; in smsatInquiryStandard()
2351 pInquiry[19] = pSATAIdData->modelNumber[2]; in smsatInquiryStandard()
2352 pInquiry[20] = pSATAIdData->modelNumber[5]; in smsatInquiryStandard()
2353 pInquiry[21] = pSATAIdData->modelNumber[4]; in smsatInquiryStandard()
2354 pInquiry[22] = pSATAIdData->modelNumber[7]; in smsatInquiryStandard()
2355 pInquiry[23] = pSATAIdData->modelNumber[6]; in smsatInquiryStandard()
2356 pInquiry[24] = pSATAIdData->modelNumber[9]; in smsatInquiryStandard()
2357 pInquiry[25] = pSATAIdData->modelNumber[8]; in smsatInquiryStandard()
2358 pInquiry[26] = pSATAIdData->modelNumber[11]; in smsatInquiryStandard()
2359 pInquiry[27] = pSATAIdData->modelNumber[10]; in smsatInquiryStandard()
2360 pInquiry[28] = pSATAIdData->modelNumber[13]; in smsatInquiryStandard()
2361 pInquiry[29] = pSATAIdData->modelNumber[12]; in smsatInquiryStandard()
2362 pInquiry[30] = pSATAIdData->modelNumber[15]; in smsatInquiryStandard()
2363 pInquiry[31] = pSATAIdData->modelNumber[14]; in smsatInquiryStandard()
2374 if ( (pSATAIdData->firmwareVersion[4] == 0x20 ) && in smsatInquiryStandard()
2375 (pSATAIdData->firmwareVersion[5] == 0x20 ) && in smsatInquiryStandard()
2376 (pSATAIdData->firmwareVersion[6] == 0x20 ) && in smsatInquiryStandard()
2377 (pSATAIdData->firmwareVersion[7] == 0x20 ) in smsatInquiryStandard()
2380 pInquiry[32] = pSATAIdData->firmwareVersion[1]; in smsatInquiryStandard()
2381 pInquiry[33] = pSATAIdData->firmwareVersion[0]; in smsatInquiryStandard()
2382 pInquiry[34] = pSATAIdData->firmwareVersion[3]; in smsatInquiryStandard()
2383 pInquiry[35] = pSATAIdData->firmwareVersion[2]; in smsatInquiryStandard()
2387 pInquiry[32] = pSATAIdData->firmwareVersion[5]; in smsatInquiryStandard()
2388 pInquiry[33] = pSATAIdData->firmwareVersion[4]; in smsatInquiryStandard()
2389 pInquiry[34] = pSATAIdData->firmwareVersion[7]; in smsatInquiryStandard()
2390 pInquiry[35] = pSATAIdData->firmwareVersion[6]; in smsatInquiryStandard()
2399 pInquiry[16] = pSATAIdData->modelNumber[0]; in smsatInquiryStandard()
2400 pInquiry[17] = pSATAIdData->modelNumber[1]; in smsatInquiryStandard()
2401 pInquiry[18] = pSATAIdData->modelNumber[2]; in smsatInquiryStandard()
2402 pInquiry[19] = pSATAIdData->modelNumber[3]; in smsatInquiryStandard()
2403 pInquiry[20] = pSATAIdData->modelNumber[4]; in smsatInquiryStandard()
2404 pInquiry[21] = pSATAIdData->modelNumber[5]; in smsatInquiryStandard()
2405 pInquiry[22] = pSATAIdData->modelNumber[6]; in smsatInquiryStandard()
2406 pInquiry[23] = pSATAIdData->modelNumber[7]; in smsatInquiryStandard()
2407 pInquiry[24] = pSATAIdData->modelNumber[8]; in smsatInquiryStandard()
2408 pInquiry[25] = pSATAIdData->modelNumber[9]; in smsatInquiryStandard()
2409 pInquiry[26] = pSATAIdData->modelNumber[10]; in smsatInquiryStandard()
2410 pInquiry[27] = pSATAIdData->modelNumber[11]; in smsatInquiryStandard()
2411 pInquiry[28] = pSATAIdData->modelNumber[12]; in smsatInquiryStandard()
2412 pInquiry[29] = pSATAIdData->modelNumber[13]; in smsatInquiryStandard()
2413 pInquiry[30] = pSATAIdData->modelNumber[14]; in smsatInquiryStandard()
2414 pInquiry[31] = pSATAIdData->modelNumber[15]; in smsatInquiryStandard()
2425 if ( (pSATAIdData->firmwareVersion[4] == 0x20 ) && in smsatInquiryStandard()
2426 (pSATAIdData->firmwareVersion[5] == 0x20 ) && in smsatInquiryStandard()
2427 (pSATAIdData->firmwareVersion[6] == 0x20 ) && in smsatInquiryStandard()
2428 (pSATAIdData->firmwareVersion[7] == 0x20 ) in smsatInquiryStandard()
2431 pInquiry[32] = pSATAIdData->firmwareVersion[0]; in smsatInquiryStandard()
2432 pInquiry[33] = pSATAIdData->firmwareVersion[1]; in smsatInquiryStandard()
2433 pInquiry[34] = pSATAIdData->firmwareVersion[2]; in smsatInquiryStandard()
2434 pInquiry[35] = pSATAIdData->firmwareVersion[3]; in smsatInquiryStandard()
2438 pInquiry[32] = pSATAIdData->firmwareVersion[4]; in smsatInquiryStandard()
2439 pInquiry[33] = pSATAIdData->firmwareVersion[5]; in smsatInquiryStandard()
2440 pInquiry[34] = pSATAIdData->firmwareVersion[6]; in smsatInquiryStandard()
2441 pInquiry[35] = pSATAIdData->firmwareVersion[7]; in smsatInquiryStandard()
2459 See SPC-4, 7.6.9, p 345 in smsatInquiryPage0()
2465 pInquiry[3] = 8 - 3; /* last index(in this case, 6) - 3; page length */ in smsatInquiryPage0()
2501 * (i.e., words 108-111), the SATL shall include an identification descriptor in smsatInquiryPage83()
2504 if ( oneDeviceData->satWWNSupport) in smsatInquiryPage83()
2511 pInquiry[3] = 12; /* 15-3; page length, no addition ID descriptor assumed*/ in smsatInquiryPage83()
2521 /* Bit 4-7 NAA field, bit 0-3 MSB of IEEE Company ID */ in smsatInquiryPage83()
2522 pInquiry[8] = (bit8)((pSATAIdData->namingAuthority) >> 8); in smsatInquiryPage83()
2523 pInquiry[9] = (bit8)((pSATAIdData->namingAuthority) & 0xFF); /* IEEE Company ID */ in smsatInquiryPage83()
2524 pInquiry[10] = (bit8)((pSATAIdData->namingAuthority1) >> 8); /* IEEE Company ID */ in smsatInquiryPage83()
2525 /* Bit 4-7 LSB of IEEE Company ID, bit 0-3 MSB of Vendor Specific ID */ in smsatInquiryPage83()
2526 pInquiry[11] = (bit8)((pSATAIdData->namingAuthority1) & 0xFF); in smsatInquiryPage83()
2527 pInquiry[12] = (bit8)((pSATAIdData->uniqueID_bit16_31) >> 8); /* Vendor Specific ID */ in smsatInquiryPage83()
2528 pInquiry[13] = (bit8)((pSATAIdData->uniqueID_bit16_31) & 0xFF); /* Vendor Specific ID */ in smsatInquiryPage83()
2529 pInquiry[14] = (bit8)((pSATAIdData->uniqueID_bit0_15) >> 8); /* Vendor Specific ID */ in smsatInquiryPage83()
2530 pInquiry[15] = (bit8)((pSATAIdData->uniqueID_bit0_15) & 0xFF); /* Vendor Specific ID */ in smsatInquiryPage83()
2540 pInquiry[3] = 24; /* 35-3; page length, no addition ID descriptor assumed*/ in smsatInquiryPage83()
2549 /* Bit 4-7 NAA field, bit 0-3 MSB of IEEE Company ID */ in smsatInquiryPage83()
2550 pInquiry[8] = (bit8)((pSATAIdData->namingAuthority) >> 8); in smsatInquiryPage83()
2551 pInquiry[9] = (bit8)((pSATAIdData->namingAuthority) & 0xFF); /* IEEE Company ID */ in smsatInquiryPage83()
2552 pInquiry[10] = (bit8)((pSATAIdData->namingAuthority1) >> 8); /* IEEE Company ID */ in smsatInquiryPage83()
2553 /* Bit 4-7 LSB of IEEE Company ID, bit 0-3 MSB of Vendor Specific ID */ in smsatInquiryPage83()
2554 pInquiry[11] = (bit8)((pSATAIdData->namingAuthority1) & 0xFF); in smsatInquiryPage83()
2555 pInquiry[12] = (bit8)((pSATAIdData->uniqueID_bit16_31) >> 8); /* Vendor Specific ID */ in smsatInquiryPage83()
2556 pInquiry[13] = (bit8)((pSATAIdData->uniqueID_bit16_31) & 0xFF); /* Vendor Specific ID */ in smsatInquiryPage83()
2557 pInquiry[14] = (bit8)((pSATAIdData->uniqueID_bit0_15) >> 8); /* Vendor Specific ID */ in smsatInquiryPage83()
2558 pInquiry[15] = (bit8)((pSATAIdData->uniqueID_bit0_15) & 0xFF); /* Vendor Specific ID */ in smsatInquiryPage83()
2565 SM_DBG5(("smsatInquiryPage83: sasAddressHi 0x%08x\n", oneDeviceData->sasAddressHi)); in smsatInquiryPage83()
2566 SM_DBG5(("smsatInquiryPage83: sasAddressLo 0x%08x\n", oneDeviceData->sasAddressLo)); in smsatInquiryPage83()
2569 pInquiry[20] = ((oneDeviceData->sasAddressHi) & 0xFF000000 ) >> 24; in smsatInquiryPage83()
2570 pInquiry[21] = ((oneDeviceData->sasAddressHi) & 0xFF0000 ) >> 16; in smsatInquiryPage83()
2571 pInquiry[22] = ((oneDeviceData->sasAddressHi) & 0xFF00 ) >> 8; in smsatInquiryPage83()
2572 pInquiry[23] = (oneDeviceData->sasAddressHi) & 0xFF; in smsatInquiryPage83()
2573 pInquiry[24] = ((oneDeviceData->sasAddressLo) & 0xFF000000 ) >> 24; in smsatInquiryPage83()
2574 pInquiry[25] = ((oneDeviceData->sasAddressLo) & 0xFF0000 ) >> 16; in smsatInquiryPage83()
2575 pInquiry[26] = ((oneDeviceData->sasAddressLo) & 0xFF00 ) >> 8; in smsatInquiryPage83()
2576 pInquiry[27] = (oneDeviceData->sasAddressLo) & 0xFF; in smsatInquiryPage83()
2586 pInquiry[3] = 72; /* 75 - 3; page length */ in smsatInquiryPage83()
2592 pInquiry[5] = 0x01; /* Identifier type : T10 vendor ID based */ in smsatInquiryPage83()
2603 pInquiry[16] = (bit8)((pSimpleData->word[27]) >> 8); in smsatInquiryPage83()
2604 pInquiry[17] = (bit8)((pSimpleData->word[27]) & 0x00ff); in smsatInquiryPage83()
2605 pInquiry[18] = (bit8)((pSimpleData->word[28]) >> 8); in smsatInquiryPage83()
2606 pInquiry[19] = (bit8)((pSimpleData->word[28]) & 0x00ff); in smsatInquiryPage83()
2607 pInquiry[20] = (bit8)((pSimpleData->word[29]) >> 8); in smsatInquiryPage83()
2608 pInquiry[21] = (bit8)((pSimpleData->word[29]) & 0x00ff); in smsatInquiryPage83()
2609 pInquiry[22] = (bit8)((pSimpleData->word[30]) >> 8); in smsatInquiryPage83()
2610 pInquiry[23] = (bit8)((pSimpleData->word[30]) & 0x00ff); in smsatInquiryPage83()
2611 pInquiry[24] = (bit8)((pSimpleData->word[31]) >> 8); in smsatInquiryPage83()
2612 pInquiry[25] = (bit8)((pSimpleData->word[31]) & 0x00ff); in smsatInquiryPage83()
2613 pInquiry[26] = (bit8)((pSimpleData->word[32]) >> 8); in smsatInquiryPage83()
2614 pInquiry[27] = (bit8)((pSimpleData->word[32]) & 0x00ff); in smsatInquiryPage83()
2615 pInquiry[28] = (bit8)((pSimpleData->word[33]) >> 8); in smsatInquiryPage83()
2616 pInquiry[29] = (bit8)((pSimpleData->word[33]) & 0x00ff); in smsatInquiryPage83()
2617 pInquiry[30] = (bit8)((pSimpleData->word[34]) >> 8); in smsatInquiryPage83()
2618 pInquiry[31] = (bit8)((pSimpleData->word[34]) & 0x00ff); in smsatInquiryPage83()
2619 pInquiry[32] = (bit8)((pSimpleData->word[35]) >> 8); in smsatInquiryPage83()
2620 pInquiry[33] = (bit8)((pSimpleData->word[35]) & 0x00ff); in smsatInquiryPage83()
2621 pInquiry[34] = (bit8)((pSimpleData->word[36]) >> 8); in smsatInquiryPage83()
2622 pInquiry[35] = (bit8)((pSimpleData->word[36]) & 0x00ff); in smsatInquiryPage83()
2623 pInquiry[36] = (bit8)((pSimpleData->word[37]) >> 8); in smsatInquiryPage83()
2624 pInquiry[37] = (bit8)((pSimpleData->word[37]) & 0x00ff); in smsatInquiryPage83()
2625 pInquiry[38] = (bit8)((pSimpleData->word[38]) >> 8); in smsatInquiryPage83()
2626 pInquiry[39] = (bit8)((pSimpleData->word[38]) & 0x00ff); in smsatInquiryPage83()
2627 pInquiry[40] = (bit8)((pSimpleData->word[39]) >> 8); in smsatInquiryPage83()
2628 pInquiry[41] = (bit8)((pSimpleData->word[39]) & 0x00ff); in smsatInquiryPage83()
2629 pInquiry[42] = (bit8)((pSimpleData->word[40]) >> 8); in smsatInquiryPage83()
2630 pInquiry[43] = (bit8)((pSimpleData->word[40]) & 0x00ff); in smsatInquiryPage83()
2631 pInquiry[44] = (bit8)((pSimpleData->word[41]) >> 8); in smsatInquiryPage83()
2632 pInquiry[45] = (bit8)((pSimpleData->word[41]) & 0x00ff); in smsatInquiryPage83()
2633 pInquiry[46] = (bit8)((pSimpleData->word[42]) >> 8); in smsatInquiryPage83()
2634 pInquiry[47] = (bit8)((pSimpleData->word[42]) & 0x00ff); in smsatInquiryPage83()
2635 pInquiry[48] = (bit8)((pSimpleData->word[43]) >> 8); in smsatInquiryPage83()
2636 pInquiry[49] = (bit8)((pSimpleData->word[43]) & 0x00ff); in smsatInquiryPage83()
2637 pInquiry[50] = (bit8)((pSimpleData->word[44]) >> 8); in smsatInquiryPage83()
2638 pInquiry[51] = (bit8)((pSimpleData->word[44]) & 0x00ff); in smsatInquiryPage83()
2639 pInquiry[52] = (bit8)((pSimpleData->word[45]) >> 8); in smsatInquiryPage83()
2640 pInquiry[53] = (bit8)((pSimpleData->word[45]) & 0x00ff); in smsatInquiryPage83()
2641 pInquiry[54] = (bit8)((pSimpleData->word[46]) >> 8); in smsatInquiryPage83()
2642 pInquiry[55] = (bit8)((pSimpleData->word[46]) & 0x00ff); in smsatInquiryPage83()
2644 pInquiry[56] = (bit8)((pSimpleData->word[10]) >> 8); in smsatInquiryPage83()
2645 pInquiry[57] = (bit8)((pSimpleData->word[10]) & 0x00ff); in smsatInquiryPage83()
2646 pInquiry[58] = (bit8)((pSimpleData->word[11]) >> 8); in smsatInquiryPage83()
2647 pInquiry[59] = (bit8)((pSimpleData->word[11]) & 0x00ff); in smsatInquiryPage83()
2648 pInquiry[60] = (bit8)((pSimpleData->word[12]) >> 8); in smsatInquiryPage83()
2649 pInquiry[61] = (bit8)((pSimpleData->word[12]) & 0x00ff); in smsatInquiryPage83()
2650 pInquiry[62] = (bit8)((pSimpleData->word[13]) >> 8); in smsatInquiryPage83()
2651 pInquiry[63] = (bit8)((pSimpleData->word[13]) & 0x00ff); in smsatInquiryPage83()
2652 pInquiry[64] = (bit8)((pSimpleData->word[14]) >> 8); in smsatInquiryPage83()
2653 pInquiry[65] = (bit8)((pSimpleData->word[14]) & 0x00ff); in smsatInquiryPage83()
2654 pInquiry[66] = (bit8)((pSimpleData->word[15]) >> 8); in smsatInquiryPage83()
2655 pInquiry[67] = (bit8)((pSimpleData->word[15]) & 0x00ff); in smsatInquiryPage83()
2656 pInquiry[68] = (bit8)((pSimpleData->word[16]) >> 8); in smsatInquiryPage83()
2657 pInquiry[69] = (bit8)((pSimpleData->word[16]) & 0x00ff); in smsatInquiryPage83()
2658 pInquiry[70] = (bit8)((pSimpleData->word[17]) >> 8); in smsatInquiryPage83()
2659 pInquiry[71] = (bit8)((pSimpleData->word[17]) & 0x00ff); in smsatInquiryPage83()
2660 pInquiry[72] = (bit8)((pSimpleData->word[18]) >> 8); in smsatInquiryPage83()
2661 pInquiry[73] = (bit8)((pSimpleData->word[18]) & 0x00ff); in smsatInquiryPage83()
2662 pInquiry[74] = (bit8)((pSimpleData->word[19]) >> 8); in smsatInquiryPage83()
2663 pInquiry[75] = (bit8)((pSimpleData->word[19]) & 0x00ff); in smsatInquiryPage83()
2670 pInquiry[3] = 84; /* 87 - 3; page length */ in smsatInquiryPage83()
2676 pInquiry[5] = 0x01; /* Identifier type : T10 vendor ID based */ in smsatInquiryPage83()
2687 pInquiry[16] = (bit8)((pSimpleData->word[27]) >> 8); in smsatInquiryPage83()
2688 pInquiry[17] = (bit8)((pSimpleData->word[27]) & 0x00ff); in smsatInquiryPage83()
2689 pInquiry[18] = (bit8)((pSimpleData->word[28]) >> 8); in smsatInquiryPage83()
2690 pInquiry[19] = (bit8)((pSimpleData->word[28]) & 0x00ff); in smsatInquiryPage83()
2691 pInquiry[20] = (bit8)((pSimpleData->word[29]) >> 8); in smsatInquiryPage83()
2692 pInquiry[21] = (bit8)((pSimpleData->word[29]) & 0x00ff); in smsatInquiryPage83()
2693 pInquiry[22] = (bit8)((pSimpleData->word[30]) >> 8); in smsatInquiryPage83()
2694 pInquiry[23] = (bit8)((pSimpleData->word[30]) & 0x00ff); in smsatInquiryPage83()
2695 pInquiry[24] = (bit8)((pSimpleData->word[31]) >> 8); in smsatInquiryPage83()
2696 pInquiry[25] = (bit8)((pSimpleData->word[31]) & 0x00ff); in smsatInquiryPage83()
2697 pInquiry[26] = (bit8)((pSimpleData->word[32]) >> 8); in smsatInquiryPage83()
2698 pInquiry[27] = (bit8)((pSimpleData->word[32]) & 0x00ff); in smsatInquiryPage83()
2699 pInquiry[28] = (bit8)((pSimpleData->word[33]) >> 8); in smsatInquiryPage83()
2700 pInquiry[29] = (bit8)((pSimpleData->word[33]) & 0x00ff); in smsatInquiryPage83()
2701 pInquiry[30] = (bit8)((pSimpleData->word[34]) >> 8); in smsatInquiryPage83()
2702 pInquiry[31] = (bit8)((pSimpleData->word[34]) & 0x00ff); in smsatInquiryPage83()
2703 pInquiry[32] = (bit8)((pSimpleData->word[35]) >> 8); in smsatInquiryPage83()
2704 pInquiry[33] = (bit8)((pSimpleData->word[35]) & 0x00ff); in smsatInquiryPage83()
2705 pInquiry[34] = (bit8)((pSimpleData->word[36]) >> 8); in smsatInquiryPage83()
2706 pInquiry[35] = (bit8)((pSimpleData->word[36]) & 0x00ff); in smsatInquiryPage83()
2707 pInquiry[36] = (bit8)((pSimpleData->word[37]) >> 8); in smsatInquiryPage83()
2708 pInquiry[37] = (bit8)((pSimpleData->word[37]) & 0x00ff); in smsatInquiryPage83()
2709 pInquiry[38] = (bit8)((pSimpleData->word[38]) >> 8); in smsatInquiryPage83()
2710 pInquiry[39] = (bit8)((pSimpleData->word[38]) & 0x00ff); in smsatInquiryPage83()
2711 pInquiry[40] = (bit8)((pSimpleData->word[39]) >> 8); in smsatInquiryPage83()
2712 pInquiry[41] = (bit8)((pSimpleData->word[39]) & 0x00ff); in smsatInquiryPage83()
2713 pInquiry[42] = (bit8)((pSimpleData->word[40]) >> 8); in smsatInquiryPage83()
2714 pInquiry[43] = (bit8)((pSimpleData->word[40]) & 0x00ff); in smsatInquiryPage83()
2715 pInquiry[44] = (bit8)((pSimpleData->word[41]) >> 8); in smsatInquiryPage83()
2716 pInquiry[45] = (bit8)((pSimpleData->word[41]) & 0x00ff); in smsatInquiryPage83()
2717 pInquiry[46] = (bit8)((pSimpleData->word[42]) >> 8); in smsatInquiryPage83()
2718 pInquiry[47] = (bit8)((pSimpleData->word[42]) & 0x00ff); in smsatInquiryPage83()
2719 pInquiry[48] = (bit8)((pSimpleData->word[43]) >> 8); in smsatInquiryPage83()
2720 pInquiry[49] = (bit8)((pSimpleData->word[43]) & 0x00ff); in smsatInquiryPage83()
2721 pInquiry[50] = (bit8)((pSimpleData->word[44]) >> 8); in smsatInquiryPage83()
2722 pInquiry[51] = (bit8)((pSimpleData->word[44]) & 0x00ff); in smsatInquiryPage83()
2723 pInquiry[52] = (bit8)((pSimpleData->word[45]) >> 8); in smsatInquiryPage83()
2724 pInquiry[53] = (bit8)((pSimpleData->word[45]) & 0x00ff); in smsatInquiryPage83()
2725 pInquiry[54] = (bit8)((pSimpleData->word[46]) >> 8); in smsatInquiryPage83()
2726 pInquiry[55] = (bit8)((pSimpleData->word[46]) & 0x00ff); in smsatInquiryPage83()
2728 pInquiry[56] = (bit8)((pSimpleData->word[10]) >> 8); in smsatInquiryPage83()
2729 pInquiry[57] = (bit8)((pSimpleData->word[10]) & 0x00ff); in smsatInquiryPage83()
2730 pInquiry[58] = (bit8)((pSimpleData->word[11]) >> 8); in smsatInquiryPage83()
2731 pInquiry[59] = (bit8)((pSimpleData->word[11]) & 0x00ff); in smsatInquiryPage83()
2732 pInquiry[60] = (bit8)((pSimpleData->word[12]) >> 8); in smsatInquiryPage83()
2733 pInquiry[61] = (bit8)((pSimpleData->word[12]) & 0x00ff); in smsatInquiryPage83()
2734 pInquiry[62] = (bit8)((pSimpleData->word[13]) >> 8); in smsatInquiryPage83()
2735 pInquiry[63] = (bit8)((pSimpleData->word[13]) & 0x00ff); in smsatInquiryPage83()
2736 pInquiry[64] = (bit8)((pSimpleData->word[14]) >> 8); in smsatInquiryPage83()
2737 pInquiry[65] = (bit8)((pSimpleData->word[14]) & 0x00ff); in smsatInquiryPage83()
2738 pInquiry[66] = (bit8)((pSimpleData->word[15]) >> 8); in smsatInquiryPage83()
2739 pInquiry[67] = (bit8)((pSimpleData->word[15]) & 0x00ff); in smsatInquiryPage83()
2740 pInquiry[68] = (bit8)((pSimpleData->word[16]) >> 8); in smsatInquiryPage83()
2741 pInquiry[69] = (bit8)((pSimpleData->word[16]) & 0x00ff); in smsatInquiryPage83()
2742 pInquiry[70] = (bit8)((pSimpleData->word[17]) >> 8); in smsatInquiryPage83()
2743 pInquiry[71] = (bit8)((pSimpleData->word[17]) & 0x00ff); in smsatInquiryPage83()
2744 pInquiry[72] = (bit8)((pSimpleData->word[18]) >> 8); in smsatInquiryPage83()
2745 pInquiry[73] = (bit8)((pSimpleData->word[18]) & 0x00ff); in smsatInquiryPage83()
2746 pInquiry[74] = (bit8)((pSimpleData->word[19]) >> 8); in smsatInquiryPage83()
2747 pInquiry[75] = (bit8)((pSimpleData->word[19]) & 0x00ff); in smsatInquiryPage83()
2754 SM_DBG5(("smsatInquiryPage83: NO WWN sasAddressHi 0x%08x\n", oneDeviceData->sasAddressHi)); in smsatInquiryPage83()
2755 SM_DBG5(("smsatInquiryPage83: No WWN sasAddressLo 0x%08x\n", oneDeviceData->sasAddressLo)); in smsatInquiryPage83()
2758 pInquiry[80] = ((oneDeviceData->sasAddressHi) & 0xFF000000 ) >> 24; in smsatInquiryPage83()
2759 pInquiry[81] = ((oneDeviceData->sasAddressHi) & 0xFF0000 ) >> 16; in smsatInquiryPage83()
2760 pInquiry[82] = ((oneDeviceData->sasAddressHi) & 0xFF00 ) >> 8; in smsatInquiryPage83()
2761 pInquiry[83] = (oneDeviceData->sasAddressHi) & 0xFF; in smsatInquiryPage83()
2762 pInquiry[84] = ((oneDeviceData->sasAddressLo) & 0xFF000000 ) >> 24; in smsatInquiryPage83()
2763 pInquiry[85] = ((oneDeviceData->sasAddressLo) & 0xFF0000 ) >> 16; in smsatInquiryPage83()
2764 pInquiry[86] = ((oneDeviceData->sasAddressLo) & 0xFF00 ) >> 8; in smsatInquiryPage83()
2765 pInquiry[87] = (oneDeviceData->sasAddressLo) & 0xFF; in smsatInquiryPage83()
2808 sm_strncpy((char*)&pInquiry[8], "PMC-SIERRA", 8); /* 8 bytes */ in smsatInquiryPage89()
2811 sm_strncpy((char*)&pInquiry[16], "Tachyon-SPC ", 16); /* 16 bytes */ in smsatInquiryPage89()
2819 pInquiry[36] = 0x34; /* FIS type */ in smsatInquiryPage89()
2820 if (oneDeviceData->satDeviceType == SATA_ATA_DEVICE) in smsatInquiryPage89()
2823 pInquiry[37] = (bit8)((oneDeviceData->satPMField) >> (4 * 7)); /* first four bits of PM field */ in smsatInquiryPage89()
2828 …pInquiry[37] = (bit8)(0x40 + (bit8)(((oneDeviceData->satPMField) >> (4 * 7)))); /* first four bits… in smsatInquiryPage89()
2833 if (oneDeviceData->satDeviceType == SATA_ATA_DEVICE) in smsatInquiryPage89()
2869 if (oneDeviceData->satDeviceType == SATA_ATA_DEVICE) in smsatInquiryPage89()
2886 sm_memcpy(&pInquiry[60], pSimpleData, MIN((len - 60), sizeof(satSimpleSATAIdentifyData_t))); in smsatInquiryPage89()
2905 See SPC-4, 7.6.9, p 345 in smsatInquiryPage80()
2914 pInquiry[4] = pSATAIdData->serialNumber[1]; in smsatInquiryPage80()
2915 pInquiry[5] = pSATAIdData->serialNumber[0]; in smsatInquiryPage80()
2916 pInquiry[6] = pSATAIdData->serialNumber[3]; in smsatInquiryPage80()
2917 pInquiry[7] = pSATAIdData->serialNumber[2]; in smsatInquiryPage80()
2918 pInquiry[8] = pSATAIdData->serialNumber[5]; in smsatInquiryPage80()
2919 pInquiry[9] = pSATAIdData->serialNumber[4]; in smsatInquiryPage80()
2920 pInquiry[10] = pSATAIdData->serialNumber[7]; in smsatInquiryPage80()
2921 pInquiry[11] = pSATAIdData->serialNumber[6]; in smsatInquiryPage80()
2922 pInquiry[12] = pSATAIdData->serialNumber[9]; in smsatInquiryPage80()
2923 pInquiry[13] = pSATAIdData->serialNumber[8]; in smsatInquiryPage80()
2924 pInquiry[14] = pSATAIdData->serialNumber[11]; in smsatInquiryPage80()
2925 pInquiry[15] = pSATAIdData->serialNumber[10]; in smsatInquiryPage80()
2926 pInquiry[16] = pSATAIdData->serialNumber[13]; in smsatInquiryPage80()
2927 pInquiry[17] = pSATAIdData->serialNumber[12]; in smsatInquiryPage80()
2928 pInquiry[18] = pSATAIdData->serialNumber[15]; in smsatInquiryPage80()
2929 pInquiry[19] = pSATAIdData->serialNumber[14]; in smsatInquiryPage80()
2930 pInquiry[20] = pSATAIdData->serialNumber[17]; in smsatInquiryPage80()
2931 pInquiry[21] = pSATAIdData->serialNumber[16]; in smsatInquiryPage80()
2932 pInquiry[22] = pSATAIdData->serialNumber[19]; in smsatInquiryPage80()
2933 pInquiry[23] = pSATAIdData->serialNumber[18]; in smsatInquiryPage80()
2951 See SBC-3, revision31, Table193, p273 in smsatInquiryPageB1()
2952 and SAT-3 revision 3, 10.3.6, p141 in smsatInquiryPageB1()
2962 pInquiry[4] = (bit8) ((pSimpleData->word[217]) >> 8); in smsatInquiryPageB1()
2963 pInquiry[5] = (bit8) ((pSimpleData->word[217]) & 0xFF); in smsatInquiryPageB1()
2969 pInquiry[7] = (bit8) ((pSimpleData->word[168]) & 0xF); in smsatInquiryPageB1()
3007 satIOContext->pSmSenseData, in smsatDefaultTranslation()
3110 satIOContext->pSmSenseData, in smsatDefaultTranslation()
3132 satIOContext->pSmSenseData, in smsatDefaultTranslation()
3155 oneDeviceData = (smDeviceData_t *)smDeviceHandle->smData; in smIDStart()
3161 if (oneDeviceData->valid == agFALSE) in smIDStart()
3163 SM_DBG1(("smIDStart: oneDeviceData is not valid, did %d !!!\n", oneDeviceData->id)); in smIDStart()
3167 smIORequestBody = (smIORequestBody_t*)smIORequest->smData;//smDequeueIO(smRoot); in smIDStart()
3177 SM_DBG3(("smIDStart: io ID %d!!!\n", smIORequestBody->id )); in smIDStart()
3179 smIORequestBody->smIORequest = smIORequest; in smIDStart()
3180 smIORequestBody->smDevHandle = smDeviceHandle; in smIDStart()
3181 satIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smIDStart()
3184 satIOContext->pSatDevData = oneDeviceData; in smIDStart()
3185 …satIOContext->pFis = &(smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHostTo… in smIDStart()
3186 satIOContext->smRequestBody = smIORequestBody; in smIDStart()
3187 satIOContext->psmDeviceHandle = smDeviceHandle; in smIDStart()
3188 satIOContext->smScsiXchg = agNULL; in smIDStart()
3190 /*smIORequest->smData = smIORequestBody;*/ in smIDStart()
3191 …(("smIDStart: smIORequestBody %p smIORequestBody->smIORequest %p!!!\n", smIORequestBody, smIOReque… in smIDStart()
3192 SM_DBG1(("smIDStart: did %d\n", oneDeviceData->id)); in smIDStart()
3230 satDevData = satIOContext->pSatDevData; in smsatIDSubStart()
3245 satIOContext->satIntIoContext = satIntIo; in smsatIDSubStart()
3249 satIntIo->satOrgSmIORequest = smIORequest; /* changed */ in smsatIDSubStart()
3250 smIORequestBody = satIntIo->satIntRequestBody; in smsatIDSubStart()
3251 satNewIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smsatIDSubStart()
3253 satNewIOContext->pSatDevData = satDevData; in smsatIDSubStart()
3254 …satNewIOContext->pFis = &(smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHos… in smsatIDSubStart()
3255 satNewIOContext->pScsiCmnd = &(satIntIo->satIntSmScsiXchg.scsiCmnd); in smsatIDSubStart()
3256 satNewIOContext->pSense = &(smIORequestBody->transport.SATA.sensePayload); in smsatIDSubStart()
3257 satNewIOContext->pSmSenseData = &(smIORequestBody->transport.SATA.smSenseData); in smsatIDSubStart()
3258 satNewIOContext->smRequestBody = satIntIo->satIntRequestBody; /* key fix */ in smsatIDSubStart()
3259 // satNewIOContext->interruptContext = tiInterruptContext; in smsatIDSubStart()
3260 satNewIOContext->satIntIoContext = satIntIo; in smsatIDSubStart()
3262 satNewIOContext->psmDeviceHandle = smDeviceHandle; in smsatIDSubStart()
3263 satNewIOContext->satOrgIOContext = satIOContext; /* changed */ in smsatIDSubStart()
3266 satNewIOContext->smScsiXchg = &(satIntIo->satIntSmScsiXchg); in smsatIDSubStart()
3271 SM_DBG6(("smsatIDSubStart: SM tiScsiXchg %p \n", satIOContext->smScsiXchg)); in smsatIDSubStart()
3272 SM_DBG6(("smsatIDSubStart: SM tiScsiXchg %p \n", satNewIOContext->smScsiXchg)); in smsatIDSubStart()
3279 &satIntIo->satIntSmIORequest, /* New smIORequest */ in smsatIDSubStart()
3281 … satNewIOContext->smScsiXchg, /* New smScsiInitiatorRequest_t *smScsiRequest, */ in smsatIDSubStart()
3315 agsaFisRegHostToDevice_t *fis; in smsatIDStart() local
3321 pSatDevData = satIOContext->pSatDevData; in smsatIDStart()
3322 fis = satIOContext->pFis; in smsatIDStart()
3325 satIntIoContext = satIOContext->satIntIoContext; in smsatIDStart()
3326 smIORequestBody = satIntIoContext->satIntRequestBody; in smsatIDStart()
3328 fis->h.fisType = 0x27; /* Reg host to device */ in smsatIDStart()
3329 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatIDStart()
3330 if (pSatDevData->satDeviceType == SATA_ATAPI_DEVICE) in smsatIDStart()
3333 fis->h.command = SAT_IDENTIFY_PACKET_DEVICE; /* 0x40 */ in smsatIDStart()
3338 fis->h.command = SAT_IDENTIFY_DEVICE; /* 0xEC */ in smsatIDStart()
3340 fis->h.features = 0; /* FIS reserve */ in smsatIDStart()
3341 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatIDStart()
3342 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatIDStart()
3343 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatIDStart()
3344 fis->d.device = 0; /* FIS LBA mode */ in smsatIDStart()
3345 fis->d.lbaLowExp = 0; in smsatIDStart()
3346 fis->d.lbaMidExp = 0; in smsatIDStart()
3347 fis->d.lbaHighExp = 0; in smsatIDStart()
3348 fis->d.featuresExp = 0; in smsatIDStart()
3349 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatIDStart()
3350 fis->d.sectorCountExp = 0; in smsatIDStart()
3351 fis->d.reserved4 = 0; in smsatIDStart()
3352 fis->d.control = 0; /* FIS HOB bit clear */ in smsatIDStart()
3353 fis->d.reserved5 = 0; in smsatIDStart()
3359 satIOContext->satCompleteCB = &smsatIDStartCB; in smsatIDStart()
3362 * Prepare SGL and send FIS to LL layer. in smsatIDStart()
3364 satIOContext->reqType = agRequestType; /* Save it */ in smsatIDStart()
3367 smhexdump("smsatIDStart", (bit8 *)satIOContext->pFis, sizeof(agsaFisRegHostToDevice_t)); in smsatIDStart()
3368 …smhexdump("smsatIDStart LL", (bit8 *)&(smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRe… in smsatIDStart()
3391 smDeviceData_t *pSatDevData = satIOContext->pSatDevData; in smsatIOStart()
3392 smScsiRspSense_t *pSense = satIOContext->pSense; in smsatIOStart()
3393 smIniScsiCmnd_t *scsiCmnd = &smSCSIRequest->scsiCmnd; in smsatIOStart()
3394 smLUN_t *pLun = &scsiCmnd->lun; in smsatIOStart()
3403 if ( ((pLun->lun[0] | pLun->lun[1] | pLun->lun[2] | pLun->lun[3] | in smsatIOStart()
3404 pLun->lun[4] | pLun->lun[5] | pLun->lun[6] | pLun->lun[7] ) != 0) && in smsatIOStart()
3405 (scsiCmnd->cdb[0] != SCSIOPC_INQUIRY) in smsatIOStart()
3409 scsiCmnd->cdb[0], pSatDevData->id)); in smsatIOStart()
3422 satIOContext->pSmSenseData, in smsatIOStart()
3423 satIOContext->interruptContext ); in smsatIOStart()
3428 …SM_DBG2(("smsatIOStart: satPendingIO %d satNCQMaxIO %d\n",pSatDevData->satPendingIO, pSatDevData->… in smsatIOStart()
3431 if (pSatDevData->IDDeviceValid == agFALSE && (scsiCmnd->cdb[0] != SCSIOPC_INQUIRY)) in smsatIOStart()
3433 SM_DBG1(("smsatIOStart: invalid identify device data did %d !!!\n", pSatDevData->id)); in smsatIOStart()
3434 …("smsatIOStart: satPendingIO %d satNCQMaxIO %d\n", pSatDevData->satPendingIO, pSatDevData->satNCQM… in smsatIOStart()
3435 …art: satPendingNCQIO %d satPendingNONNCQIO %d\n", pSatDevData->satPendingNCQIO, pSatDevData->satPe… in smsatIOStart()
3445 if (pSatDevData->satDriveState == SAT_DEV_STATE_IN_RECOVERY) in smsatIOStart()
3448 scsiCmnd->cdb[0], pSatDevData->id)); in smsatIOStart()
3449 …%p satPendingIO %d satNCQMaxIO %d\n", pSatDevData, pSatDevData->satPendingIO, pSatDevData->satNCQM… in smsatIOStart()
3450 …ingNCQIO %d satPendingNONNCQIO %d\n",pSatDevData, pSatDevData->satPendingNCQIO, pSatDevData->satPe… in smsatIOStart()
3458 if (pSatDevData->satDeviceType == SATA_ATAPI_DEVICE) in smsatIOStart()
3460 if (scsiCmnd->cdb[0] == SCSIOPC_REPORT_LUN) in smsatIOStart()
3472 switch(scsiCmnd->cdb[0]) in smsatIOStart()
3806 scsiCmnd->cdb[0], pSatDevData->id)); in smsatIOStart()
3820 satIOContext->pSmSenseData, in smsatIOStart()
3821 satIOContext->interruptContext ); in smsatIOStart()
3831 SM_DBG1(("smsatIOStart: BUSY did %d!!!\n", pSatDevData->id)); in smsatIOStart()
3833 … %p satPendingIO %d satNCQMaxIO %d\n",pSatDevData, pSatDevData->satPendingIO, pSatDevData->satNCQM… in smsatIOStart()
3834 …ingNCQIO %d satPendingNONNCQIO %d\n",pSatDevData, pSatDevData->satPendingNCQIO, pSatDevData->satPe… in smsatIOStart()
3835 pSatIntIo = satIOContext->satIntIoContext; in smsatIOStart()
3856 /* for fixed format sense data, SPC-4, p37 */ in smsatSetSensePayload()
3874 pSense->snsRespCode = 0x70; /* 0xC0 == vendor specific */ in smsatSetSensePayload()
3876 pSense->senseKey = SnsKey; in smsatSetSensePayload()
3880 pSense->info[0] = (bit8)((SnsInfo >> 24) & 0xff); in smsatSetSensePayload()
3881 pSense->info[1] = (bit8)((SnsInfo >> 16) & 0xff); in smsatSetSensePayload()
3882 pSense->info[2] = (bit8)((SnsInfo >> 8) & 0xff); in smsatSetSensePayload()
3883 pSense->info[3] = (bit8)((SnsInfo) & 0xff); in smsatSetSensePayload()
3884 pSense->addSenseLen = 11; /* fixed size of sense data = 18 */ in smsatSetSensePayload()
3885 pSense->addSenseCode = (bit8)((SnsCode >> 8) & 0xFF); in smsatSetSensePayload()
3886 pSense->senseQual = (bit8)(SnsCode & 0xFF); in smsatSetSensePayload()
3896 pSense->skeySpecific[0] = 0xC8; in smsatSetSensePayload()
3905 satIOContext->pSmSenseData->senseLen = 18; in smsatSetSensePayload()
3915 /* filling in COMMAND-SPECIFIC INFORMATION */ in smsatSetSensePayload()
3916 …tmp = satIOContext->extend << 7 | satIOContext->Sector_Cnt_Upper_Nonzero << 6 | satIOContext->LBA_… in smsatSetSensePayload()
3918 satIOContext->extend, satIOContext->Sector_Cnt_Upper_Nonzero, satIOContext->LBA_Upper_Nonzero)); in smsatSetSensePayload()
3920 pSense->cmdSpecific[0] = tmp; in smsatSetSensePayload()
3921 pSense->cmdSpecific[1] = satIOContext->LBAHigh07; in smsatSetSensePayload()
3922 pSense->cmdSpecific[2] = satIOContext->LBAMid07; in smsatSetSensePayload()
3923 pSense->cmdSpecific[3] = satIOContext->LBALow07; in smsatSetSensePayload()
3924 // smhexdump("smsatSetSensePayload: cmdSpecific",(bit8 *)pSense->cmdSpecific, 4); in smsatSetSensePayload()
3925 // smhexdump("smsatSetSensePayload: info",(bit8 *)pSense->info, 4); in smsatSetSensePayload()
4000 * SAT implementation for ATAPI Packet and send FIS request to LL layer.
4009 * - \e smIOSuccess: I/O request successfully initiated.
4010 * - \e smIOBusy: No resources available, try again later.
4011 * - \e smIONoDevice: Invalid device handle.
4012 * - \e smIOError: Other errors.
4028 agsaFisRegHostToDevice_t *fis; in smsatPacket() local
4030 pSatDevData = satIOContext->pSatDevData; in smsatPacket()
4031 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatPacket()
4032 fis = satIOContext->pFis; in smsatPacket()
4035 scsiCmnd->cdb[0],scsiCmnd->cdb[1],scsiCmnd->cdb[2],scsiCmnd->cdb[3], in smsatPacket()
4036 scsiCmnd->cdb[4],scsiCmnd->cdb[5],scsiCmnd->cdb[6],scsiCmnd->cdb[7], in smsatPacket()
4037 scsiCmnd->cdb[8],scsiCmnd->cdb[9],scsiCmnd->cdb[10],scsiCmnd->cdb[11])); in smsatPacket()
4039 fis->h.fisType = 0x27; /* Reg host to device */ in smsatPacket()
4040 fis->h.c_pmPort = 0x80; /* C Bit is set 1*/ in smsatPacket()
4041 fis->h.command = SAT_PACKET; /* 0xA0 */ in smsatPacket()
4042 if (pSatDevData->satDMADIRSupport) /* DMADIR enabled*/ in smsatPacket()
4044 …fis->h.features = (smScsiRequest->dataDirection == smDirectionIn)? 0x04 : 0; /* 1 for D2H, 0 fo… in smsatPacket()
4048 fis->h.features = 0; /* FIS reserve */ in smsatPacket()
4051 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatPacket()
4054 fis->h.features |= 0x01; in smsatPacket()
4059 fis->h.features |= 0x0; in smsatPacket()
4062 if ( scsiCmnd->expDataLength > 0xFFFF ) in smsatPacket()
4064 fis->d.lbaMid = 0xFF; /* FIS LBA (15:8 ) */ in smsatPacket()
4065 fis->d.lbaHigh = 0xFF; /* FIS LBA (23:16) */ in smsatPacket()
4069 fis->d.lbaMid = (bit8)scsiCmnd->expDataLength; /* FIS LBA (15:8 ) */ in smsatPacket()
4070 fis->d.lbaHigh = (bit8)(scsiCmnd->expDataLength>>8); /* FIS LBA (23:16) */ in smsatPacket()
4073 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatPacket()
4074 fis->d.device = 0; /* FIS LBA (27:24) and FIS LBA mode */ in smsatPacket()
4075 fis->d.lbaLowExp = 0; in smsatPacket()
4076 fis->d.lbaMidExp = 0; in smsatPacket()
4077 fis->d.lbaHighExp = 0; in smsatPacket()
4078 fis->d.featuresExp = 0; in smsatPacket()
4079 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatPacket()
4080 fis->d.sectorCountExp = 0; in smsatPacket()
4081 fis->d.reserved4 = 0; in smsatPacket()
4082 fis->d.control = 0; /* FIS HOB bit clear */ in smsatPacket()
4083 fis->d.reserved5 = 0; in smsatPacket()
4085 satIOContext->ATACmd = SAT_PACKET; in smsatPacket()
4087 if (smScsiRequest->dataDirection == smDirectionIn) in smsatPacket()
4096 satIOContext->satCompleteCB = &smsatPacketCB; in smsatPacket()
4099 * Prepare SGL and send FIS to LL layer. in smsatPacket()
4101 satIOContext->reqType = agRequestType; /* Save it */ in smsatPacket()
4116 * This function creates Set Features fis and sends the request to LL layer
4125 * - \e smIOSuccess: I/O request successfully initiated.
4126 * - \e smIOBusy: No resources available, try again later.
4127 * - \e smIONoDevice: Invalid device handle.
4128 * - \e smIOError: Other errors.
4142 agsaFisRegHostToDevice_t *fis; in smsatSetFeaturesPIO() local
4144 fis = satIOContext->pFis; in smsatSetFeaturesPIO()
4149 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSetFeaturesPIO()
4150 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSetFeaturesPIO()
4151 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatSetFeaturesPIO()
4152 fis->h.features = 0x03; /* set transfer mode */ in smsatSetFeaturesPIO()
4153 fis->d.lbaLow = 0; in smsatSetFeaturesPIO()
4154 fis->d.lbaMid = 0; in smsatSetFeaturesPIO()
4155 fis->d.lbaHigh = 0; in smsatSetFeaturesPIO()
4156 fis->d.device = 0; in smsatSetFeaturesPIO()
4157 fis->d.lbaLowExp = 0; in smsatSetFeaturesPIO()
4158 fis->d.lbaMidExp = 0; in smsatSetFeaturesPIO()
4159 fis->d.lbaHighExp = 0; in smsatSetFeaturesPIO()
4160 fis->d.featuresExp = 0; in smsatSetFeaturesPIO()
4161 fis->d.sectorCountExp = 0; in smsatSetFeaturesPIO()
4162 fis->d.reserved4 = 0; in smsatSetFeaturesPIO()
4163 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSetFeaturesPIO()
4164 fis->d.reserved5 = 0; in smsatSetFeaturesPIO()
4170 fis->d.sectorCount = 0x0C; /*enable PIO transfer mode */ in smsatSetFeaturesPIO()
4171 satIOContext->satCompleteCB = &smsatSetFeaturesPIOCB; in smsatSetFeaturesPIO()
4174 * Prepare SGL and send FIS to LL layer. in smsatSetFeaturesPIO()
4176 satIOContext->reqType = agRequestType; /* Save it */ in smsatSetFeaturesPIO()
4186 if (smIORequest->tdData == smIORequest->smData) in smsatSetFeaturesPIO()
4205 * - \e smIOSuccess: I/O request successfully initiated.
4206 * - \e smIOBusy: No resources available, try again later.
4207 * - \e smIONoDevice: Invalid device handle.
4208 * - \e smIOError: Other errors.
4224 agsaFisRegHostToDevice_t *fis; in smsatRequestSenseForATAPI() local
4226 pSatDevData = satIOContext->pSatDevData; in smsatRequestSenseForATAPI()
4227 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatRequestSenseForATAPI()
4228 fis = satIOContext->pFis; in smsatRequestSenseForATAPI()
4230 scsiCmnd->cdb[0] = SCSIOPC_REQUEST_SENSE; in smsatRequestSenseForATAPI()
4231 scsiCmnd->cdb[1] = 0; in smsatRequestSenseForATAPI()
4232 scsiCmnd->cdb[2] = 0; in smsatRequestSenseForATAPI()
4233 scsiCmnd->cdb[3] = 0; in smsatRequestSenseForATAPI()
4234 scsiCmnd->cdb[4] = (bit8)scsiCmnd->expDataLength; in smsatRequestSenseForATAPI()
4235 scsiCmnd->cdb[5] = 0; in smsatRequestSenseForATAPI()
4237 scsiCmnd->cdb[0],scsiCmnd->cdb[1],scsiCmnd->cdb[2],scsiCmnd->cdb[3], in smsatRequestSenseForATAPI()
4238 scsiCmnd->cdb[4],scsiCmnd->cdb[5],scsiCmnd->cdb[6],scsiCmnd->cdb[7], in smsatRequestSenseForATAPI()
4239 scsiCmnd->cdb[8],scsiCmnd->cdb[9],scsiCmnd->cdb[10],scsiCmnd->cdb[11])); in smsatRequestSenseForATAPI()
4241 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRequestSenseForATAPI()
4242 fis->h.c_pmPort = 0x80; /* C Bit is set 1*/ in smsatRequestSenseForATAPI()
4243 fis->h.command = SAT_PACKET; /* 0xA0 */ in smsatRequestSenseForATAPI()
4244 if (pSatDevData->satDMADIRSupport) /* DMADIR enabled*/ in smsatRequestSenseForATAPI()
4246 …fis->h.features = (smScsiRequest->dataDirection == smDirectionIn)? 0x04 : 0; /* 1 for D2H, 0 fo… in smsatRequestSenseForATAPI()
4250 fis->h.features = 0; /* FIS reserve */ in smsatRequestSenseForATAPI()
4253 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRequestSenseForATAPI()
4255 fis->h.features |= 0x01; in smsatRequestSenseForATAPI()
4259 fis->h.features |= 0x0; in smsatRequestSenseForATAPI()
4262 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatRequestSenseForATAPI()
4263 fis->d.lbaMid = (bit8)scsiCmnd->expDataLength; /* FIS LBA (15:8 ) */ in smsatRequestSenseForATAPI()
4264 fis->d.lbaHigh = (bit8)(scsiCmnd->expDataLength>>8); /* FIS LBA (23:16) */ in smsatRequestSenseForATAPI()
4265 fis->d.device = 0; /* FIS LBA (27:24) and FIS LBA mode */ in smsatRequestSenseForATAPI()
4266 fis->d.lbaLowExp = 0; in smsatRequestSenseForATAPI()
4267 fis->d.lbaMidExp = 0; in smsatRequestSenseForATAPI()
4268 fis->d.lbaHighExp = 0; in smsatRequestSenseForATAPI()
4269 fis->d.featuresExp = 0; in smsatRequestSenseForATAPI()
4270 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatRequestSenseForATAPI()
4271 fis->d.sectorCountExp = 0; in smsatRequestSenseForATAPI()
4272 fis->d.reserved4 = 0; in smsatRequestSenseForATAPI()
4273 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRequestSenseForATAPI()
4274 fis->d.reserved5 = 0; in smsatRequestSenseForATAPI()
4276 satIOContext->ATACmd = SAT_PACKET; in smsatRequestSenseForATAPI()
4281 satIOContext->satCompleteCB = &smsatRequestSenseForATAPICB; in smsatRequestSenseForATAPI()
4284 * Prepare SGL and send FIS to LL layer. in smsatRequestSenseForATAPI()
4286 satIOContext->reqType = agRequestType; /* Save it */ in smsatRequestSenseForATAPI()
4300 * This function creates DEVICE RESET fis and sends the request to LL layer
4309 * - \e smIOSuccess: I/O request successfully initiated.
4310 * - \e smIOBusy: No resources available, try again later.
4311 * - \e smIONoDevice: Invalid device handle.
4312 * - \e smIOError: Other errors.
4326 agsaFisRegHostToDevice_t *fis; in smsatDeviceReset() local
4328 fis = satIOContext->pFis; in smsatDeviceReset()
4333 fis->h.fisType = 0x27; /* Reg host to device */ in smsatDeviceReset()
4334 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatDeviceReset()
4335 fis->h.command = SAT_DEVICE_RESET; /* 0x08 */ in smsatDeviceReset()
4336 fis->h.features = 0; in smsatDeviceReset()
4337 fis->d.lbaLow = 0; in smsatDeviceReset()
4338 fis->d.lbaMid = 0; in smsatDeviceReset()
4339 fis->d.lbaHigh = 0; in smsatDeviceReset()
4340 fis->d.device = 0; in smsatDeviceReset()
4341 fis->d.lbaLowExp = 0; in smsatDeviceReset()
4342 fis->d.lbaMidExp = 0; in smsatDeviceReset()
4343 fis->d.lbaHighExp = 0; in smsatDeviceReset()
4344 fis->d.featuresExp = 0; in smsatDeviceReset()
4345 fis->d.sectorCount = 0; in smsatDeviceReset()
4346 fis->d.sectorCountExp = 0; in smsatDeviceReset()
4347 fis->d.reserved4 = 0; in smsatDeviceReset()
4348 fis->d.control = 0; /* FIS HOB bit clear */ in smsatDeviceReset()
4349 fis->d.reserved5 = 0; in smsatDeviceReset()
4355 satIOContext->satCompleteCB = &smsatDeviceResetCB; in smsatDeviceReset()
4358 * Prepare SGL and send FIS to LL layer. in smsatDeviceReset()
4360 satIOContext->reqType = agRequestType; /* Save it */ in smsatDeviceReset()
4377 * This function creates Execute Device Diagnostic fis and sends the request to LL layer
4386 * - \e smIOSuccess: I/O request successfully initiated.
4387 * - \e smIOBusy: No resources available, try again later.
4388 * - \e smIONoDevice: Invalid device handle.
4389 * - \e smIOError: Other errors.
4403 agsaFisRegHostToDevice_t *fis; in smsatExecuteDeviceDiagnostic() local
4405 fis = satIOContext->pFis; in smsatExecuteDeviceDiagnostic()
4410 fis->h.fisType = 0x27; /* Reg host to device */ in smsatExecuteDeviceDiagnostic()
4411 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatExecuteDeviceDiagnostic()
4412 fis->h.command = SAT_EXECUTE_DEVICE_DIAGNOSTIC; /* 0x90 */ in smsatExecuteDeviceDiagnostic()
4413 fis->h.features = 0; in smsatExecuteDeviceDiagnostic()
4414 fis->d.lbaLow = 0; in smsatExecuteDeviceDiagnostic()
4415 fis->d.lbaMid = 0; in smsatExecuteDeviceDiagnostic()
4416 fis->d.lbaHigh = 0; in smsatExecuteDeviceDiagnostic()
4417 fis->d.device = 0; in smsatExecuteDeviceDiagnostic()
4418 fis->d.lbaLowExp = 0; in smsatExecuteDeviceDiagnostic()
4419 fis->d.lbaMidExp = 0; in smsatExecuteDeviceDiagnostic()
4420 fis->d.lbaHighExp = 0; in smsatExecuteDeviceDiagnostic()
4421 fis->d.featuresExp = 0; in smsatExecuteDeviceDiagnostic()
4422 fis->d.sectorCount = 0; in smsatExecuteDeviceDiagnostic()
4423 fis->d.sectorCountExp = 0; in smsatExecuteDeviceDiagnostic()
4424 fis->d.reserved4 = 0; in smsatExecuteDeviceDiagnostic()
4425 fis->d.control = 0; /* FIS HOB bit clear */ in smsatExecuteDeviceDiagnostic()
4426 fis->d.reserved5 = 0; in smsatExecuteDeviceDiagnostic()
4432 satIOContext->satCompleteCB = &smsatExecuteDeviceDiagnosticCB; in smsatExecuteDeviceDiagnostic()
4435 * Prepare SGL and send FIS to LL layer. in smsatExecuteDeviceDiagnostic()
4437 satIOContext->reqType = agRequestType; /* Save it */ in smsatExecuteDeviceDiagnostic()
4479 agsaFisRegHostToDevice_t *fis; in smsatRead6() local
4483 pSense = satIOContext->pSense; in smsatRead6()
4484 pSatDevData = satIOContext->pSatDevData; in smsatRead6()
4485 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatRead6()
4486 fis = satIOContext->pFis; in smsatRead6()
4495 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatRead6()
4509 satIOContext->pSmSenseData, in smsatRead6()
4510 satIOContext->interruptContext ); in smsatRead6()
4517 lba = (((scsiCmnd->cdb[1]) & 0x1f) << (8*2)) in smsatRead6()
4518 + (scsiCmnd->cdb[2] << 8) + scsiCmnd->cdb[3]; in smsatRead6()
4519 tl = scsiCmnd->cdb[4]; in smsatRead6()
4528 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatRead6()
4531 if (pSatDevData->satNCQ != agTRUE && in smsatRead6()
4532 pSatDevData->sat48BitSupport != agTRUE in smsatRead6()
4535 if (lba > SAT_TR_LBA_LIMIT - 1) in smsatRead6()
4549 satIOContext->pSmSenseData, in smsatRead6()
4550 satIOContext->interruptContext ); in smsatRead6()
4560 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead6()
4567 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead6()
4568 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead6()
4569 fis->h.command = SAT_READ_DMA; /* 0xC8 */ in smsatRead6()
4570 fis->h.features = 0; /* FIS reserve */ in smsatRead6()
4571 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatRead6()
4572 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatRead6()
4573 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatRead6()
4574 fis->d.device = 0x40; /* FIS LBA mode */ in smsatRead6()
4575 fis->d.lbaLowExp = 0; in smsatRead6()
4576 fis->d.lbaMidExp = 0; in smsatRead6()
4577 fis->d.lbaHighExp = 0; in smsatRead6()
4578 fis->d.featuresExp = 0; in smsatRead6()
4582 fis->d.sectorCount = 0xff; /* FIS sector count (7:0) */ in smsatRead6()
4586 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatRead6()
4588 fis->d.sectorCountExp = 0; in smsatRead6()
4589 fis->d.reserved4 = 0; in smsatRead6()
4590 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead6()
4591 fis->d.reserved5 = 0; in smsatRead6()
4601 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead6()
4602 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead6()
4603 fis->h.command = SAT_READ_SECTORS; /* 0x20 */ in smsatRead6()
4604 fis->h.features = 0; /* FIS reserve */ in smsatRead6()
4605 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatRead6()
4606 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatRead6()
4607 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatRead6()
4608 fis->d.device = 0x40; /* FIS LBA mode */ in smsatRead6()
4609 fis->d.lbaLowExp = 0; in smsatRead6()
4610 fis->d.lbaMidExp = 0; in smsatRead6()
4611 fis->d.lbaHighExp = 0; in smsatRead6()
4612 fis->d.featuresExp = 0; in smsatRead6()
4616 fis->d.sectorCount = 0xff; /* FIS sector count (7:0) */ in smsatRead6()
4620 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatRead6()
4622 fis->d.sectorCountExp = 0; in smsatRead6()
4623 fis->d.reserved4 = 0; in smsatRead6()
4624 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead6()
4625 fis->d.reserved5 = 0; in smsatRead6()
4633 if (pSatDevData->sat48BitSupport == agTRUE) in smsatRead6()
4635 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead6()
4640 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead6()
4641 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead6()
4642 fis->h.command = SAT_READ_DMA_EXT; /* 0x25 */ in smsatRead6()
4643 fis->h.features = 0; /* FIS reserve */ in smsatRead6()
4644 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatRead6()
4645 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatRead6()
4646 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatRead6()
4647 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead6()
4648 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatRead6()
4649 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead6()
4650 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead6()
4651 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead6()
4655 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatRead6()
4656 fis->d.sectorCountExp = 0x01; /* FIS sector count (15:8) */ in smsatRead6()
4660 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatRead6()
4661 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatRead6()
4663 fis->d.reserved4 = 0; in smsatRead6()
4664 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead6()
4665 fis->d.reserved5 = 0; in smsatRead6()
4675 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead6()
4676 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead6()
4677 fis->h.command = SAT_READ_SECTORS_EXT; /* 0x24 */ in smsatRead6()
4678 fis->h.features = 0; /* FIS reserve */ in smsatRead6()
4679 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatRead6()
4680 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatRead6()
4681 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatRead6()
4682 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead6()
4683 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatRead6()
4684 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead6()
4685 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead6()
4686 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead6()
4690 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatRead6()
4691 fis->d.sectorCountExp = 0x01; /* FIS sector count (15:8) */ in smsatRead6()
4695 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatRead6()
4696 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatRead6()
4698 fis->d.reserved4 = 0; in smsatRead6()
4699 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead6()
4700 fis->d.reserved5 = 0; in smsatRead6()
4707 if (pSatDevData->satNCQ == agTRUE) in smsatRead6()
4710 if (pSatDevData->sat48BitSupport != agTRUE) in smsatRead6()
4726 satIOContext->pSmSenseData, in smsatRead6()
4727 satIOContext->interruptContext ); in smsatRead6()
4732 /* Support 48-bit FPDMA addressing, use READ FPDMA QUEUE command */ in smsatRead6()
4734 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead6()
4735 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead6()
4736 fis->h.command = SAT_READ_FPDMA_QUEUED; /* 0x60 */ in smsatRead6()
4737 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatRead6()
4738 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatRead6()
4739 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatRead6()
4740 fis->d.device = 0x40; /* FIS FUA clear */ in smsatRead6()
4741 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatRead6()
4742 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead6()
4743 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead6()
4747 fis->h.features = 0; /* FIS sector count (7:0) */ in smsatRead6()
4748 fis->d.featuresExp = 0x01; /* FIS sector count (15:8) */ in smsatRead6()
4752 fis->h.features = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatRead6()
4753 fis->d.featuresExp = 0; /* FIS sector count (15:8) */ in smsatRead6()
4755 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatRead6()
4756 fis->d.sectorCountExp = 0; in smsatRead6()
4757 fis->d.reserved4 = 0; in smsatRead6()
4758 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead6()
4759 fis->d.reserved5 = 0; in smsatRead6()
4766 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatRead6()
4769 * Prepare SGL and send FIS to LL layer. in smsatRead6()
4771 satIOContext->reqType = agRequestType; /* Save it */ in smsatRead6()
4791 smDeviceData_t *pSatDevData = satIOContext->pSatDevData; in smsatRead10()
4792 smScsiRspSense_t *pSense = satIOContext->pSense; in smsatRead10()
4793 smIniScsiCmnd_t *scsiCmnd = &smScsiRequest->scsiCmnd; in smsatRead10()
4794 agsaFisRegHostToDevice_t *fis = satIOContext->pFis; in smsatRead10() local
4806 SM_DBG2(("smsatRead10: pSatDevData did=%d\n", pSatDevData->id)); in smsatRead10()
4807 // smhexdump("smsatRead10", (bit8 *)scsiCmnd->cdb, 10); in smsatRead10()
4810 if (scsiCmnd->cdb[1] & SCSI_FUA_NV_MASK) in smsatRead10()
4824 satIOContext->pSmSenseData, in smsatRead10()
4825 satIOContext->interruptContext ); in smsatRead10()
4834 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatRead10()
4848 satIOContext->pSmSenseData, in smsatRead10()
4849 satIOContext->interruptContext ); in smsatRead10()
4863 LBA[4] = scsiCmnd->cdb[2]; in smsatRead10()
4864 LBA[5] = scsiCmnd->cdb[3]; in smsatRead10()
4865 LBA[6] = scsiCmnd->cdb[4]; in smsatRead10()
4866 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatRead10()
4874 TL[6] = scsiCmnd->cdb[7]; in smsatRead10()
4875 TL[7] = scsiCmnd->cdb[8]; /* LSB */ in smsatRead10()
4879 lba = (scsiCmnd->cdb[2] << 24) + (scsiCmnd->cdb[3] << 16) in smsatRead10()
4880 + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatRead10()
4881 tl = (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatRead10()
4895 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatRead10()
4899 if (pSatDevData->satNCQ != agTRUE && in smsatRead10()
4900 pSatDevData->sat48BitSupport != agTRUE in smsatRead10()
4919 satIOContext->pSmSenseData, in smsatRead10()
4920 satIOContext->interruptContext ); in smsatRead10()
4943 satIOContext->pSmSenseData, in smsatRead10()
4944 satIOContext->interruptContext ); in smsatRead10()
4950 if (pSatDevData->satNCQ == agTRUE) in smsatRead10()
4953 if (pSatDevData->sat48BitSupport != agTRUE) in smsatRead10()
4968 satIOContext->pSmSenseData, in smsatRead10()
4969 satIOContext->interruptContext ); in smsatRead10()
4975 /* Support 48-bit FPDMA addressing, use READ FPDMA QUEUE command */ in smsatRead10()
4977 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead10()
4978 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead10()
4979 fis->h.command = SAT_READ_FPDMA_QUEUED; /* 0x60 */ in smsatRead10()
4980 fis->h.features = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatRead10()
4981 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead10()
4982 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead10()
4983 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead10()
4986 if (scsiCmnd->cdb[1] & SCSI_READ10_FUA_MASK) in smsatRead10()
4987 fis->d.device = 0xC0; /* FIS FUA set */ in smsatRead10()
4989 fis->d.device = 0x40; /* FIS FUA clear */ in smsatRead10()
4991 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatRead10()
4992 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead10()
4993 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead10()
4994 fis->d.featuresExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatRead10()
4995 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatRead10()
4996 fis->d.sectorCountExp = 0; in smsatRead10()
4997 fis->d.reserved4 = 0; in smsatRead10()
4998 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead10()
4999 fis->d.reserved5 = 0; in smsatRead10()
5002 satIOContext->ATACmd = SAT_READ_FPDMA_QUEUED; in smsatRead10()
5004 else if (pSatDevData->sat48BitSupport == agTRUE) /* case 3 and 4 */ in smsatRead10()
5006 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead10()
5011 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead10()
5013 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead10()
5014 fis->h.command = SAT_READ_DMA_EXT; /* 0x25 */ in smsatRead10()
5015 fis->h.features = 0; /* FIS reserve */ in smsatRead10()
5016 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead10()
5017 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead10()
5018 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead10()
5019 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead10()
5020 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatRead10()
5021 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead10()
5022 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead10()
5023 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead10()
5024 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatRead10()
5025 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatRead10()
5026 fis->d.reserved4 = 0; in smsatRead10()
5027 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead10()
5028 fis->d.reserved5 = 0; in smsatRead10()
5031 satIOContext->ATACmd = SAT_READ_DMA_EXT; in smsatRead10()
5040 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead10()
5041 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead10()
5044 if (scsiCmnd->cdb[1] & SCSI_READ10_FUA_MASK) in smsatRead10()
5060 satIOContext->pSmSenseData, in smsatRead10()
5061 satIOContext->interruptContext ); in smsatRead10()
5065 fis->h.command = SAT_READ_SECTORS_EXT; /* 0x24 */ in smsatRead10()
5067 fis->h.features = 0; /* FIS reserve */ in smsatRead10()
5068 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead10()
5069 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead10()
5070 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead10()
5071 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead10()
5072 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatRead10()
5073 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead10()
5074 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead10()
5075 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead10()
5076 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatRead10()
5077 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatRead10()
5078 fis->d.reserved4 = 0; in smsatRead10()
5079 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead10()
5080 fis->d.reserved5 = 0; in smsatRead10()
5083 satIOContext->ATACmd = SAT_READ_SECTORS_EXT; in smsatRead10()
5088 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead10()
5096 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead10()
5097 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead10()
5098 fis->h.command = SAT_READ_DMA; /* 0xC8 */ in smsatRead10()
5099 fis->h.features = 0; /* FIS reserve */ in smsatRead10()
5100 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead10()
5101 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead10()
5102 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead10()
5103 fis->d.device = in smsatRead10()
5104 … (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead10()
5105 fis->d.lbaLowExp = 0; in smsatRead10()
5106 fis->d.lbaMidExp = 0; in smsatRead10()
5107 fis->d.lbaHighExp = 0; in smsatRead10()
5108 fis->d.featuresExp = 0; in smsatRead10()
5109 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatRead10()
5110 fis->d.sectorCountExp = 0; in smsatRead10()
5111 fis->d.reserved4 = 0; in smsatRead10()
5112 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead10()
5113 fis->d.reserved5 = 0; in smsatRead10()
5117 satIOContext->ATACmd = SAT_READ_DMA; in smsatRead10()
5127 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead10()
5128 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead10()
5129 fis->h.command = SAT_READ_SECTORS; /* 0x20 */ in smsatRead10()
5130 fis->h.features = 0; /* FIS reserve */ in smsatRead10()
5131 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead10()
5132 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead10()
5133 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead10()
5134 fis->d.device = in smsatRead10()
5135 … (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead10()
5136 fis->d.lbaLowExp = 0; in smsatRead10()
5137 fis->d.lbaMidExp = 0; in smsatRead10()
5138 fis->d.lbaHighExp = 0; in smsatRead10()
5139 fis->d.featuresExp = 0; in smsatRead10()
5140 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatRead10()
5141 fis->d.sectorCountExp = 0; in smsatRead10()
5142 fis->d.reserved4 = 0; in smsatRead10()
5143 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead10()
5144 fis->d.reserved5 = 0; in smsatRead10()
5148 satIOContext->ATACmd = SAT_READ_SECTORS; in smsatRead10()
5151 // smhexdump("satRead10 final fis", (bit8 *)fis, sizeof(agsaFisRegHostToDevice_t)); in smsatRead10()
5154 satIOContext->currentLBA = lba; in smsatRead10()
5155 satIOContext->OrgTL = tl; in smsatRead10()
5162 if (fis->h.command == SAT_READ_SECTORS || fis->h.command == SAT_READ_DMA) in smsatRead10()
5173 satIOContext->LoopNum = LoopNum; in smsatRead10()
5180 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatRead10()
5186 /* re-setting tl */ in smsatRead10()
5187 if (fis->h.command == SAT_READ_SECTORS || fis->h.command == SAT_READ_DMA) in smsatRead10()
5189 fis->d.sectorCount = 0x0; in smsatRead10()
5196 (satIOContext->OrgTL)*SATA_SECTOR_SIZE, in smsatRead10()
5199 else if (fis->h.command == SAT_READ_SECTORS_EXT || fis->h.command == SAT_READ_DMA_EXT) in smsatRead10()
5202 fis->d.sectorCount = 0xFF; in smsatRead10()
5203 fis->d.sectorCountExp = 0xFF; in smsatRead10()
5210 (satIOContext->OrgTL)*SATA_SECTOR_SIZE, in smsatRead10()
5216 fis->h.features = 0xFF; in smsatRead10()
5217 fis->d.featuresExp = 0xFF; in smsatRead10()
5224 (satIOContext->OrgTL)*SATA_SECTOR_SIZE, in smsatRead10()
5229 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatRead10()
5234 * Prepare SGL and send FIS to LL layer. in smsatRead10()
5236 satIOContext->reqType = agRequestType; /* Save it */ in smsatRead10()
5263 agsaFisRegHostToDevice_t *fis; in smsatRead12() local
5271 pSense = satIOContext->pSense; in smsatRead12()
5272 pSatDevData = satIOContext->pSatDevData; in smsatRead12()
5273 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatRead12()
5274 fis = satIOContext->pFis; in smsatRead12()
5279 if (scsiCmnd->cdb[1] & SCSI_FUA_NV_MASK) in smsatRead12()
5293 satIOContext->pSmSenseData, in smsatRead12()
5294 satIOContext->interruptContext ); in smsatRead12()
5303 if ( (scsiCmnd->cdb[11] & SCSI_NACA_MASK) || (scsiCmnd->cdb[11] & SCSI_LINK_MASK) ) in smsatRead12()
5317 satIOContext->pSmSenseData, in smsatRead12()
5318 satIOContext->interruptContext ); in smsatRead12()
5332 LBA[4] = scsiCmnd->cdb[2]; in smsatRead12()
5333 LBA[5] = scsiCmnd->cdb[3]; in smsatRead12()
5334 LBA[6] = scsiCmnd->cdb[4]; in smsatRead12()
5335 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatRead12()
5341 TL[4] = scsiCmnd->cdb[6]; in smsatRead12()
5342 TL[5] = scsiCmnd->cdb[7]; in smsatRead12()
5343 TL[6] = scsiCmnd->cdb[8]; in smsatRead12()
5344 TL[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatRead12()
5357 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatRead12()
5360 if (pSatDevData->satNCQ != agTRUE && in smsatRead12()
5361 pSatDevData->sat48BitSupport != agTRUE in smsatRead12()
5381 satIOContext->pSmSenseData, in smsatRead12()
5382 satIOContext->interruptContext ); in smsatRead12()
5405 satIOContext->pSmSenseData, in smsatRead12()
5406 satIOContext->interruptContext ); in smsatRead12()
5413 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead12()
5422 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead12()
5423 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead12()
5424 fis->h.command = SAT_READ_DMA; /* 0xC8 */ in smsatRead12()
5425 fis->h.features = 0; /* FIS reserve */ in smsatRead12()
5426 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead12()
5427 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead12()
5428 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead12()
5429 fis->d.device = in smsatRead12()
5430 … (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead12()
5431 fis->d.lbaLowExp = 0; in smsatRead12()
5432 fis->d.lbaMidExp = 0; in smsatRead12()
5433 fis->d.lbaHighExp = 0; in smsatRead12()
5434 fis->d.featuresExp = 0; in smsatRead12()
5435 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatRead12()
5436 fis->d.sectorCountExp = 0; in smsatRead12()
5437 fis->d.reserved4 = 0; in smsatRead12()
5438 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead12()
5439 fis->d.reserved5 = 0; in smsatRead12()
5443 satIOContext->ATACmd = SAT_READ_DMA; in smsatRead12()
5453 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead12()
5454 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead12()
5455 fis->h.command = SAT_READ_SECTORS; /* 0x20 */ in smsatRead12()
5456 fis->h.features = 0; /* FIS reserve */ in smsatRead12()
5457 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead12()
5458 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead12()
5459 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead12()
5460 fis->d.device = in smsatRead12()
5461 … (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead12()
5462 fis->d.lbaLowExp = 0; in smsatRead12()
5463 fis->d.lbaMidExp = 0; in smsatRead12()
5464 fis->d.lbaHighExp = 0; in smsatRead12()
5465 fis->d.featuresExp = 0; in smsatRead12()
5466 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatRead12()
5467 fis->d.sectorCountExp = 0; in smsatRead12()
5468 fis->d.reserved4 = 0; in smsatRead12()
5469 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead12()
5470 fis->d.reserved5 = 0; in smsatRead12()
5474 satIOContext->ATACmd = SAT_READ_SECTORS; in smsatRead12()
5478 if (pSatDevData->sat48BitSupport == agTRUE) in smsatRead12()
5480 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead12()
5485 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead12()
5487 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead12()
5488 fis->h.command = SAT_READ_DMA_EXT; /* 0x25 */ in smsatRead12()
5489 fis->h.features = 0; /* FIS reserve */ in smsatRead12()
5490 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead12()
5491 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead12()
5492 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead12()
5493 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead12()
5494 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatRead12()
5495 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead12()
5496 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead12()
5497 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead12()
5498 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatRead12()
5499 fis->d.sectorCountExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatRead12()
5500 fis->d.reserved4 = 0; in smsatRead12()
5501 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead12()
5502 fis->d.reserved5 = 0; in smsatRead12()
5505 satIOContext->ATACmd = SAT_READ_DMA_EXT; in smsatRead12()
5514 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead12()
5515 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead12()
5518 if (scsiCmnd->cdb[1] & SCSI_READ12_FUA_MASK) in smsatRead12()
5534 satIOContext->pSmSenseData, in smsatRead12()
5535 satIOContext->interruptContext ); in smsatRead12()
5539 fis->h.command = SAT_READ_SECTORS_EXT; /* 0x24 */ in smsatRead12()
5541 fis->h.features = 0; /* FIS reserve */ in smsatRead12()
5542 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead12()
5543 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead12()
5544 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead12()
5545 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead12()
5546 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatRead12()
5547 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead12()
5548 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead12()
5549 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead12()
5550 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatRead12()
5551 fis->d.sectorCountExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatRead12()
5552 fis->d.reserved4 = 0; in smsatRead12()
5553 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead12()
5554 fis->d.reserved5 = 0; in smsatRead12()
5557 satIOContext->ATACmd = SAT_READ_SECTORS_EXT; in smsatRead12()
5562 if (pSatDevData->satNCQ == agTRUE) in smsatRead12()
5565 if (pSatDevData->sat48BitSupport != agTRUE) in smsatRead12()
5580 satIOContext->pSmSenseData, in smsatRead12()
5581 satIOContext->interruptContext ); in smsatRead12()
5587 /* Support 48-bit FPDMA addressing, use READ FPDMA QUEUE command */ in smsatRead12()
5589 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead12()
5590 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead12()
5591 fis->h.command = SAT_READ_FPDMA_QUEUED; /* 0x60 */ in smsatRead12()
5592 fis->h.features = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatRead12()
5593 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatRead12()
5594 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatRead12()
5595 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatRead12()
5598 if (scsiCmnd->cdb[1] & SCSI_READ12_FUA_MASK) in smsatRead12()
5599 fis->d.device = 0xC0; /* FIS FUA set */ in smsatRead12()
5601 fis->d.device = 0x40; /* FIS FUA clear */ in smsatRead12()
5603 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatRead12()
5604 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead12()
5605 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead12()
5606 fis->d.featuresExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatRead12()
5607 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatRead12()
5608 fis->d.sectorCountExp = 0; in smsatRead12()
5609 fis->d.reserved4 = 0; in smsatRead12()
5610 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead12()
5611 fis->d.reserved5 = 0; in smsatRead12()
5614 satIOContext->ATACmd = SAT_READ_FPDMA_QUEUED; in smsatRead12()
5618 satIOContext->currentLBA = lba; in smsatRead12()
5619 satIOContext->OrgTL = tl; in smsatRead12()
5626 if (fis->h.command == SAT_READ_SECTORS || fis->h.command == SAT_READ_DMA) in smsatRead12()
5630 else if (fis->h.command == SAT_READ_SECTORS_EXT || fis->h.command == SAT_READ_DMA_EXT) in smsatRead12()
5641 satIOContext->LoopNum = LoopNum; in smsatRead12()
5646 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatRead12()
5651 /* re-setting tl */ in smsatRead12()
5652 if (fis->h.command == SAT_READ_SECTORS || fis->h.command == SAT_READ_DMA) in smsatRead12()
5654 fis->d.sectorCount = 0xFF; in smsatRead12()
5656 else if (fis->h.command == SAT_READ_SECTORS_EXT || fis->h.command == SAT_READ_DMA_EXT) in smsatRead12()
5659 fis->d.sectorCount = 0xFF; in smsatRead12()
5660 fis->d.sectorCountExp = 0xFF; in smsatRead12()
5665 fis->h.features = 0xFF; in smsatRead12()
5666 fis->d.featuresExp = 0xFF; in smsatRead12()
5670 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatRead12()
5674 * Prepare SGL and send FIS to LL layer. in smsatRead12()
5676 satIOContext->reqType = agRequestType; /* Save it */ in smsatRead12()
5702 agsaFisRegHostToDevice_t *fis; in smsatRead16() local
5711 pSense = satIOContext->pSense; in smsatRead16()
5712 pSatDevData = satIOContext->pSatDevData; in smsatRead16()
5713 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatRead16()
5714 fis = satIOContext->pFis; in smsatRead16()
5719 if (scsiCmnd->cdb[1] & SCSI_FUA_NV_MASK) in smsatRead16()
5733 satIOContext->pSmSenseData, in smsatRead16()
5734 satIOContext->interruptContext ); in smsatRead16()
5743 if ( (scsiCmnd->cdb[15] & SCSI_NACA_MASK) || (scsiCmnd->cdb[15] & SCSI_LINK_MASK) ) in smsatRead16()
5757 satIOContext->pSmSenseData, in smsatRead16()
5758 satIOContext->interruptContext ); in smsatRead16()
5770 LBA[0] = scsiCmnd->cdb[2]; /* MSB */ in smsatRead16()
5771 LBA[1] = scsiCmnd->cdb[3]; in smsatRead16()
5772 LBA[2] = scsiCmnd->cdb[4]; in smsatRead16()
5773 LBA[3] = scsiCmnd->cdb[5]; in smsatRead16()
5774 LBA[4] = scsiCmnd->cdb[6]; in smsatRead16()
5775 LBA[5] = scsiCmnd->cdb[7]; in smsatRead16()
5776 LBA[6] = scsiCmnd->cdb[8]; in smsatRead16()
5777 LBA[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatRead16()
5783 TL[4] = scsiCmnd->cdb[10]; /* MSB */ in smsatRead16()
5784 TL[5] = scsiCmnd->cdb[11]; in smsatRead16()
5785 TL[6] = scsiCmnd->cdb[12]; in smsatRead16()
5786 TL[7] = scsiCmnd->cdb[13]; /* LSB */ in smsatRead16()
5802 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatRead16()
5805 if (pSatDevData->satNCQ != agTRUE && in smsatRead16()
5806 pSatDevData->sat48BitSupport != agTRUE in smsatRead16()
5829 satIOContext->pSmSenseData, in smsatRead16()
5830 satIOContext->interruptContext ); in smsatRead16()
5857 satIOContext->pSmSenseData, in smsatRead16()
5858 satIOContext->interruptContext ); in smsatRead16()
5865 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead16()
5874 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead16()
5875 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead16()
5876 fis->h.command = SAT_READ_DMA; /* 0xC8 */ in smsatRead16()
5877 fis->h.features = 0; /* FIS reserve */ in smsatRead16()
5878 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatRead16()
5879 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatRead16()
5880 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatRead16()
5881 fis->d.device = in smsatRead16()
5882 … (bit8)((0x4 << 4) | (scsiCmnd->cdb[6] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead16()
5883 fis->d.lbaLowExp = 0; in smsatRead16()
5884 fis->d.lbaMidExp = 0; in smsatRead16()
5885 fis->d.lbaHighExp = 0; in smsatRead16()
5886 fis->d.featuresExp = 0; in smsatRead16()
5887 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatRead16()
5888 fis->d.sectorCountExp = 0; in smsatRead16()
5889 fis->d.reserved4 = 0; in smsatRead16()
5890 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead16()
5891 fis->d.reserved5 = 0; in smsatRead16()
5895 satIOContext->ATACmd = SAT_READ_DMA; in smsatRead16()
5905 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead16()
5906 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead16()
5907 fis->h.command = SAT_READ_SECTORS; /* 0x20 */ in smsatRead16()
5908 fis->h.features = 0; /* FIS reserve */ in smsatRead16()
5909 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatRead16()
5910 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatRead16()
5911 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatRead16()
5912 fis->d.device = in smsatRead16()
5913 … (bit8)((0x4 << 4) | (scsiCmnd->cdb[6] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead16()
5914 fis->d.lbaLowExp = 0; in smsatRead16()
5915 fis->d.lbaMidExp = 0; in smsatRead16()
5916 fis->d.lbaHighExp = 0; in smsatRead16()
5917 fis->d.featuresExp = 0; in smsatRead16()
5918 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatRead16()
5919 fis->d.sectorCountExp = 0; in smsatRead16()
5920 fis->d.reserved4 = 0; in smsatRead16()
5921 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead16()
5922 fis->d.reserved5 = 0; in smsatRead16()
5926 satIOContext->ATACmd = SAT_READ_SECTORS; in smsatRead16()
5930 if (pSatDevData->sat48BitSupport == agTRUE) in smsatRead16()
5932 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatRead16()
5937 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead16()
5939 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead16()
5940 fis->h.command = SAT_READ_DMA_EXT; /* 0x25 */ in smsatRead16()
5941 fis->h.features = 0; /* FIS reserve */ in smsatRead16()
5942 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatRead16()
5943 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatRead16()
5944 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatRead16()
5945 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead16()
5946 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatRead16()
5947 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatRead16()
5948 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatRead16()
5949 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead16()
5950 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatRead16()
5951 fis->d.sectorCountExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatRead16()
5952 fis->d.reserved4 = 0; in smsatRead16()
5953 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead16()
5954 fis->d.reserved5 = 0; in smsatRead16()
5957 satIOContext->ATACmd = SAT_READ_DMA_EXT; in smsatRead16()
5966 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead16()
5967 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead16()
5970 if (scsiCmnd->cdb[1] & SCSI_READ16_FUA_MASK) in smsatRead16()
5985 satIOContext->pSmSenseData, in smsatRead16()
5986 satIOContext->interruptContext ); in smsatRead16()
5990 fis->h.command = SAT_READ_SECTORS_EXT; /* 0x24 */ in smsatRead16()
5992 fis->h.features = 0; /* FIS reserve */ in smsatRead16()
5993 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatRead16()
5994 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatRead16()
5995 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatRead16()
5996 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead16()
5997 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatRead16()
5998 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatRead16()
5999 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatRead16()
6000 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead16()
6001 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatRead16()
6002 fis->d.sectorCountExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatRead16()
6003 fis->d.reserved4 = 0; in smsatRead16()
6004 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead16()
6005 fis->d.reserved5 = 0; in smsatRead16()
6008 satIOContext->ATACmd = SAT_READ_SECTORS_EXT; in smsatRead16()
6014 if (pSatDevData->satNCQ == agTRUE) in smsatRead16()
6017 if (pSatDevData->sat48BitSupport != agTRUE) in smsatRead16()
6032 satIOContext->pSmSenseData, in smsatRead16()
6033 satIOContext->interruptContext ); in smsatRead16()
6039 /* Support 48-bit FPDMA addressing, use READ FPDMA QUEUE command */ in smsatRead16()
6041 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead16()
6042 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead16()
6043 fis->h.command = SAT_READ_FPDMA_QUEUED; /* 0x60 */ in smsatRead16()
6044 fis->h.features = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatRead16()
6045 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatRead16()
6046 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatRead16()
6047 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatRead16()
6050 if (scsiCmnd->cdb[1] & SCSI_READ16_FUA_MASK) in smsatRead16()
6051 fis->d.device = 0xC0; /* FIS FUA set */ in smsatRead16()
6053 fis->d.device = 0x40; /* FIS FUA clear */ in smsatRead16()
6055 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatRead16()
6056 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatRead16()
6057 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatRead16()
6058 fis->d.featuresExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatRead16()
6059 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatRead16()
6060 fis->d.sectorCountExp = 0; in smsatRead16()
6061 fis->d.reserved4 = 0; in smsatRead16()
6062 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead16()
6063 fis->d.reserved5 = 0; in smsatRead16()
6066 satIOContext->ATACmd = SAT_READ_FPDMA_QUEUED; in smsatRead16()
6070 satIOContext->currentLBA = lba; in smsatRead16()
6071 satIOContext->OrgTL = tl; in smsatRead16()
6078 if (fis->h.command == SAT_READ_SECTORS || fis->h.command == SAT_READ_DMA) in smsatRead16()
6082 else if (fis->h.command == SAT_READ_SECTORS_EXT || fis->h.command == SAT_READ_DMA_EXT) in smsatRead16()
6092 satIOContext->LoopNum = LoopNum; in smsatRead16()
6097 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatRead16()
6102 /* re-setting tl */ in smsatRead16()
6103 if (fis->h.command == SAT_READ_SECTORS || fis->h.command == SAT_READ_DMA) in smsatRead16()
6105 fis->d.sectorCount = 0xFF; in smsatRead16()
6107 else if (fis->h.command == SAT_READ_SECTORS_EXT || fis->h.command == SAT_READ_DMA_EXT) in smsatRead16()
6110 fis->d.sectorCount = 0xFF; in smsatRead16()
6111 fis->d.sectorCountExp = 0xFF; in smsatRead16()
6116 fis->h.features = 0xFF; in smsatRead16()
6117 fis->d.featuresExp = 0xFF; in smsatRead16()
6121 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatRead16()
6125 * Prepare SGL and send FIS to LL layer. in smsatRead16()
6127 satIOContext->reqType = agRequestType; /* Save it */ in smsatRead16()
6155 agsaFisRegHostToDevice_t *fis; in smsatWrite6() local
6159 pSense = satIOContext->pSense; in smsatWrite6()
6160 pSatDevData = satIOContext->pSatDevData; in smsatWrite6()
6161 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWrite6()
6162 fis = satIOContext->pFis; in smsatWrite6()
6168 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatWrite6()
6182 satIOContext->pSmSenseData, in smsatWrite6()
6183 satIOContext->interruptContext ); in smsatWrite6()
6191 lba = (((scsiCmnd->cdb[1]) & 0x1f) << (8*2)) in smsatWrite6()
6192 + (scsiCmnd->cdb[2] << 8) + scsiCmnd->cdb[3]; in smsatWrite6()
6193 tl = scsiCmnd->cdb[4]; in smsatWrite6()
6203 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWrite6()
6206 if (pSatDevData->satNCQ != agTRUE && in smsatWrite6()
6207 pSatDevData->sat48BitSupport != agTRUE in smsatWrite6()
6210 if (lba > SAT_TR_LBA_LIMIT - 1) in smsatWrite6()
6224 satIOContext->pSmSenseData, in smsatWrite6()
6225 satIOContext->interruptContext ); in smsatWrite6()
6235 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite6()
6242 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite6()
6243 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite6()
6244 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWrite6()
6245 fis->h.features = 0; /* FIS reserve */ in smsatWrite6()
6246 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatWrite6()
6247 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatWrite6()
6248 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatWrite6()
6249 fis->d.device = 0x40; /* FIS LBA mode */ in smsatWrite6()
6250 fis->d.lbaLowExp = 0; in smsatWrite6()
6251 fis->d.lbaMidExp = 0; in smsatWrite6()
6252 fis->d.lbaHighExp = 0; in smsatWrite6()
6253 fis->d.featuresExp = 0; in smsatWrite6()
6257 fis->d.sectorCount = 0xff; /* FIS sector count (7:0) */ in smsatWrite6()
6261 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatWrite6()
6263 fis->d.sectorCountExp = 0; in smsatWrite6()
6264 fis->d.reserved4 = 0; in smsatWrite6()
6265 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite6()
6266 fis->d.reserved5 = 0; in smsatWrite6()
6276 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite6()
6277 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite6()
6278 fis->h.command = SAT_WRITE_SECTORS; /* 0xCA */ in smsatWrite6()
6279 fis->h.features = 0; /* FIS reserve */ in smsatWrite6()
6280 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatWrite6()
6281 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatWrite6()
6282 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatWrite6()
6283 fis->d.device = 0x40; /* FIS LBA mode */ in smsatWrite6()
6284 fis->d.lbaLowExp = 0; in smsatWrite6()
6285 fis->d.lbaMidExp = 0; in smsatWrite6()
6286 fis->d.lbaHighExp = 0; in smsatWrite6()
6287 fis->d.featuresExp = 0; in smsatWrite6()
6291 fis->d.sectorCount = 0xff; /* FIS sector count (7:0) */ in smsatWrite6()
6295 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatWrite6()
6297 fis->d.sectorCountExp = 0; in smsatWrite6()
6298 fis->d.reserved4 = 0; in smsatWrite6()
6299 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite6()
6300 fis->d.reserved5 = 0; in smsatWrite6()
6308 if (pSatDevData->sat48BitSupport == agTRUE) in smsatWrite6()
6310 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite6()
6315 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite6()
6316 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite6()
6317 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWrite6()
6318 fis->h.features = 0; /* FIS reserve */ in smsatWrite6()
6319 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatWrite6()
6320 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatWrite6()
6321 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatWrite6()
6322 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite6()
6323 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatWrite6()
6324 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite6()
6325 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite6()
6326 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite6()
6330 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatWrite6()
6331 fis->d.sectorCountExp = 0x01; /* FIS sector count (15:8) */ in smsatWrite6()
6335 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatWrite6()
6336 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatWrite6()
6338 fis->d.reserved4 = 0; in smsatWrite6()
6339 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite6()
6340 fis->d.reserved5 = 0; in smsatWrite6()
6350 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite6()
6351 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite6()
6352 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWrite6()
6353 fis->h.features = 0; /* FIS reserve */ in smsatWrite6()
6354 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatWrite6()
6355 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatWrite6()
6356 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatWrite6()
6357 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite6()
6358 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatWrite6()
6359 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite6()
6360 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite6()
6361 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite6()
6365 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatWrite6()
6366 fis->d.sectorCountExp = 0x01; /* FIS sector count (15:8) */ in smsatWrite6()
6370 fis->d.sectorCount = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatWrite6()
6371 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatWrite6()
6373 fis->d.reserved4 = 0; in smsatWrite6()
6374 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite6()
6375 fis->d.reserved5 = 0; in smsatWrite6()
6382 if (pSatDevData->satNCQ == agTRUE) in smsatWrite6()
6385 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWrite6()
6401 satIOContext->pSmSenseData, in smsatWrite6()
6402 satIOContext->interruptContext ); in smsatWrite6()
6407 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWrite6()
6409 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite6()
6410 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite6()
6411 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWrite6()
6412 fis->d.lbaLow = scsiCmnd->cdb[3]; /* FIS LBA (7 :0 ) */ in smsatWrite6()
6413 fis->d.lbaMid = scsiCmnd->cdb[2]; /* FIS LBA (15:8 ) */ in smsatWrite6()
6414 fis->d.lbaHigh = (bit8)((scsiCmnd->cdb[1]) & 0x1f); /* FIS LBA (23:16) */ in smsatWrite6()
6415 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWrite6()
6416 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatWrite6()
6417 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite6()
6418 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite6()
6422 fis->h.features = 0; /* FIS sector count (7:0) */ in smsatWrite6()
6423 fis->d.featuresExp = 0x01; /* FIS sector count (15:8) */ in smsatWrite6()
6427 fis->h.features = scsiCmnd->cdb[4]; /* FIS sector count (7:0) */ in smsatWrite6()
6428 fis->d.featuresExp = 0; /* FIS sector count (15:8) */ in smsatWrite6()
6430 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWrite6()
6431 fis->d.sectorCountExp = 0; in smsatWrite6()
6432 fis->d.reserved4 = 0; in smsatWrite6()
6433 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite6()
6434 fis->d.reserved5 = 0; in smsatWrite6()
6441 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatWrite6()
6444 * Prepare SGL and send FIS to LL layer. in smsatWrite6()
6446 satIOContext->reqType = agRequestType; /* Save it */ in smsatWrite6()
6465 smDeviceData_t *pSatDevData = satIOContext->pSatDevData; in smsatWrite10()
6466 smScsiRspSense_t *pSense = satIOContext->pSense; in smsatWrite10()
6467 smIniScsiCmnd_t *scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWrite10()
6468 agsaFisRegHostToDevice_t *fis = satIOContext->pFis; in smsatWrite10() local
6481 if (scsiCmnd->cdb[1] & SCSI_FUA_NV_MASK) in smsatWrite10()
6495 satIOContext->pSmSenseData, in smsatWrite10()
6496 satIOContext->interruptContext ); in smsatWrite10()
6505 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatWrite10()
6519 satIOContext->pSmSenseData, in smsatWrite10()
6520 satIOContext->interruptContext ); in smsatWrite10()
6534 LBA[4] = scsiCmnd->cdb[2]; in smsatWrite10()
6535 LBA[5] = scsiCmnd->cdb[3]; in smsatWrite10()
6536 LBA[6] = scsiCmnd->cdb[4]; in smsatWrite10()
6537 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatWrite10()
6545 TL[6] = scsiCmnd->cdb[7]; in smsatWrite10()
6546 TL[7] = scsiCmnd->cdb[8]; /* LSB */ in smsatWrite10()
6551 lba = (scsiCmnd->cdb[2] << (24)) + (scsiCmnd->cdb[3] << (16)) in smsatWrite10()
6552 + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatWrite10()
6553 tl = (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatWrite10()
6565 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWrite10()
6568 if (pSatDevData->satNCQ != agTRUE && in smsatWrite10()
6569 pSatDevData->sat48BitSupport != agTRUE in smsatWrite10()
6576 SM_DBG1(("smsatWrite10: cdb 0x%x 0x%x 0x%x 0x%x!!!\n",scsiCmnd->cdb[2], scsiCmnd->cdb[3], in smsatWrite10()
6577 scsiCmnd->cdb[4], scsiCmnd->cdb[5])); in smsatWrite10()
6591 satIOContext->pSmSenseData, in smsatWrite10()
6592 satIOContext->interruptContext ); in smsatWrite10()
6615 satIOContext->pSmSenseData, in smsatWrite10()
6616 satIOContext->interruptContext ); in smsatWrite10()
6624 if (pSatDevData->satNCQ == agTRUE) in smsatWrite10()
6627 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWrite10()
6642 satIOContext->pSmSenseData, in smsatWrite10()
6643 satIOContext->interruptContext ); in smsatWrite10()
6648 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWrite10()
6650 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite10()
6651 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite10()
6652 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWrite10()
6653 fis->h.features = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWrite10()
6654 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite10()
6655 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite10()
6656 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite10()
6659 if (scsiCmnd->cdb[1] & SCSI_WRITE10_FUA_MASK) in smsatWrite10()
6660 fis->d.device = 0xC0; /* FIS FUA set */ in smsatWrite10()
6662 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWrite10()
6664 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWrite10()
6665 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite10()
6666 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite10()
6667 fis->d.featuresExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatWrite10()
6668 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWrite10()
6669 fis->d.sectorCountExp = 0; in smsatWrite10()
6670 fis->d.reserved4 = 0; in smsatWrite10()
6671 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite10()
6672 fis->d.reserved5 = 0; in smsatWrite10()
6675 satIOContext->ATACmd = SAT_WRITE_FPDMA_QUEUED; in smsatWrite10()
6678 else if (pSatDevData->sat48BitSupport == agTRUE) in smsatWrite10()
6680 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite10()
6685 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite10()
6686 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite10()
6689 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWrite10()
6690 satIOContext->ATACmd = SAT_WRITE_DMA_EXT; in smsatWrite10()
6692 fis->h.features = 0; /* FIS reserve */ in smsatWrite10()
6693 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite10()
6694 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite10()
6695 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite10()
6696 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite10()
6697 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWrite10()
6698 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite10()
6699 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite10()
6700 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite10()
6701 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWrite10()
6702 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatWrite10()
6703 fis->d.reserved4 = 0; in smsatWrite10()
6704 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite10()
6705 fis->d.reserved5 = 0; in smsatWrite10()
6715 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite10()
6716 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite10()
6717 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWrite10()
6719 fis->h.features = 0; /* FIS reserve */ in smsatWrite10()
6720 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite10()
6721 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite10()
6722 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite10()
6723 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite10()
6724 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWrite10()
6725 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite10()
6726 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite10()
6727 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite10()
6728 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWrite10()
6729 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatWrite10()
6730 fis->d.reserved4 = 0; in smsatWrite10()
6731 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite10()
6732 fis->d.reserved5 = 0; in smsatWrite10()
6735 satIOContext->ATACmd = SAT_WRITE_SECTORS_EXT; in smsatWrite10()
6740 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite10()
6746 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite10()
6747 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite10()
6748 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWrite10()
6749 fis->h.features = 0; /* FIS reserve */ in smsatWrite10()
6750 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite10()
6751 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite10()
6752 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite10()
6754 /* FIS LBA mode set LBA (27:24) */ in smsatWrite10()
6755 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWrite10()
6757 fis->d.lbaLowExp = 0; in smsatWrite10()
6758 fis->d.lbaMidExp = 0; in smsatWrite10()
6759 fis->d.lbaHighExp = 0; in smsatWrite10()
6760 fis->d.featuresExp = 0; in smsatWrite10()
6761 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWrite10()
6762 fis->d.sectorCountExp = 0; in smsatWrite10()
6763 fis->d.reserved4 = 0; in smsatWrite10()
6764 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite10()
6765 fis->d.reserved5 = 0; in smsatWrite10()
6768 satIOContext->ATACmd = SAT_WRITE_DMA; in smsatWrite10()
6777 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite10()
6778 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite10()
6779 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatWrite10()
6780 fis->h.features = 0; /* FIS reserve */ in smsatWrite10()
6781 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite10()
6782 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite10()
6783 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite10()
6785 /* FIS LBA mode set LBA (27:24) */ in smsatWrite10()
6786 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWrite10()
6788 fis->d.lbaLowExp = 0; in smsatWrite10()
6789 fis->d.lbaMidExp = 0; in smsatWrite10()
6790 fis->d.lbaHighExp = 0; in smsatWrite10()
6791 fis->d.featuresExp = 0; in smsatWrite10()
6792 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWrite10()
6793 fis->d.sectorCountExp = 0; in smsatWrite10()
6794 fis->d.reserved4 = 0; in smsatWrite10()
6795 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite10()
6796 fis->d.reserved5 = 0; in smsatWrite10()
6799 satIOContext->ATACmd = SAT_WRITE_SECTORS; in smsatWrite10()
6803 // smhexdump("satWrite10 final fis", (bit8 *)fis, sizeof(agsaFisRegHostToDevice_t)); in smsatWrite10()
6805 satIOContext->currentLBA = lba; in smsatWrite10()
6806 satIOContext->OrgTL = tl; in smsatWrite10()
6813 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWrite10()
6824 satIOContext->LoopNum = LoopNum; in smsatWrite10()
6832 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatWrite10()
6837 /* re-setting tl */ in smsatWrite10()
6838 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWrite10()
6840 fis->d.sectorCount = 0x0; in smsatWrite10()
6847 (satIOContext->OrgTL)*SATA_SECTOR_SIZE, in smsatWrite10()
6850 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWrite10()
6851 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWrite10()
6852 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWrite10()
6855 fis->d.sectorCount = 0xFF; in smsatWrite10()
6856 fis->d.sectorCountExp = 0xFF; in smsatWrite10()
6863 (satIOContext->OrgTL)*SATA_SECTOR_SIZE, in smsatWrite10()
6869 fis->h.features = 0xFF; in smsatWrite10()
6870 fis->d.featuresExp = 0xFF; in smsatWrite10()
6877 (satIOContext->OrgTL)*SATA_SECTOR_SIZE, in smsatWrite10()
6883 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatWrite10()
6888 * Prepare SGL and send FIS to LL layer. in smsatWrite10()
6890 satIOContext->reqType = agRequestType; /* Save it */ in smsatWrite10()
6914 agsaFisRegHostToDevice_t *fis; in smsatWrite12() local
6922 pSense = satIOContext->pSense; in smsatWrite12()
6923 pSatDevData = satIOContext->pSatDevData; in smsatWrite12()
6924 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWrite12()
6925 fis = satIOContext->pFis; in smsatWrite12()
6930 if (scsiCmnd->cdb[1] & SCSI_FUA_NV_MASK) in smsatWrite12()
6944 satIOContext->pSmSenseData, in smsatWrite12()
6945 satIOContext->interruptContext ); in smsatWrite12()
6955 if ( (scsiCmnd->cdb[11] & SCSI_NACA_MASK) || (scsiCmnd->cdb[11] & SCSI_LINK_MASK) ) in smsatWrite12()
6969 satIOContext->pSmSenseData, in smsatWrite12()
6970 satIOContext->interruptContext ); in smsatWrite12()
6985 LBA[4] = scsiCmnd->cdb[2]; in smsatWrite12()
6986 LBA[5] = scsiCmnd->cdb[3]; in smsatWrite12()
6987 LBA[6] = scsiCmnd->cdb[4]; in smsatWrite12()
6988 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatWrite12()
6994 TL[4] = scsiCmnd->cdb[6]; in smsatWrite12()
6995 TL[5] = scsiCmnd->cdb[7]; in smsatWrite12()
6996 TL[6] = scsiCmnd->cdb[8]; in smsatWrite12()
6997 TL[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatWrite12()
7011 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWrite12()
7014 if (pSatDevData->satNCQ != agTRUE && in smsatWrite12()
7015 pSatDevData->sat48BitSupport != agTRUE in smsatWrite12()
7039 satIOContext->pSmSenseData, in smsatWrite12()
7040 satIOContext->interruptContext ); in smsatWrite12()
7060 satIOContext->pSmSenseData, in smsatWrite12()
7061 satIOContext->interruptContext ); in smsatWrite12()
7065 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite12()
7071 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite12()
7072 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite12()
7073 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWrite12()
7074 fis->h.features = 0; /* FIS reserve */ in smsatWrite12()
7075 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite12()
7076 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite12()
7077 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite12()
7079 /* FIS LBA mode set LBA (27:24) */ in smsatWrite12()
7080 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWrite12()
7082 fis->d.lbaLowExp = 0; in smsatWrite12()
7083 fis->d.lbaMidExp = 0; in smsatWrite12()
7084 fis->d.lbaHighExp = 0; in smsatWrite12()
7085 fis->d.featuresExp = 0; in smsatWrite12()
7086 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWrite12()
7087 fis->d.sectorCountExp = 0; in smsatWrite12()
7088 fis->d.reserved4 = 0; in smsatWrite12()
7089 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite12()
7090 fis->d.reserved5 = 0; in smsatWrite12()
7093 satIOContext->ATACmd = SAT_WRITE_DMA; in smsatWrite12()
7102 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite12()
7103 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite12()
7104 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatWrite12()
7105 fis->h.features = 0; /* FIS reserve */ in smsatWrite12()
7106 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite12()
7107 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite12()
7108 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite12()
7110 /* FIS LBA mode set LBA (27:24) */ in smsatWrite12()
7111 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWrite12()
7113 fis->d.lbaLowExp = 0; in smsatWrite12()
7114 fis->d.lbaMidExp = 0; in smsatWrite12()
7115 fis->d.lbaHighExp = 0; in smsatWrite12()
7116 fis->d.featuresExp = 0; in smsatWrite12()
7117 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWrite12()
7118 fis->d.sectorCountExp = 0; in smsatWrite12()
7119 fis->d.reserved4 = 0; in smsatWrite12()
7120 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite12()
7121 fis->d.reserved5 = 0; in smsatWrite12()
7124 satIOContext->ATACmd = SAT_WRITE_SECTORS; in smsatWrite12()
7128 if (pSatDevData->sat48BitSupport == agTRUE) in smsatWrite12()
7130 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite12()
7135 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite12()
7136 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite12()
7139 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWrite12()
7141 fis->h.features = 0; /* FIS reserve */ in smsatWrite12()
7142 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite12()
7143 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite12()
7144 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite12()
7145 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite12()
7146 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWrite12()
7147 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite12()
7148 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite12()
7149 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite12()
7150 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWrite12()
7151 fis->d.sectorCountExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatWrite12()
7152 fis->d.reserved4 = 0; in smsatWrite12()
7153 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite12()
7154 fis->d.reserved5 = 0; in smsatWrite12()
7157 satIOContext->ATACmd = SAT_WRITE_DMA_EXT; in smsatWrite12()
7165 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite12()
7166 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite12()
7167 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWrite12()
7169 fis->h.features = 0; /* FIS reserve */ in smsatWrite12()
7170 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite12()
7171 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite12()
7172 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite12()
7173 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite12()
7174 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWrite12()
7175 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite12()
7176 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite12()
7177 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite12()
7178 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWrite12()
7179 fis->d.sectorCountExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatWrite12()
7180 fis->d.reserved4 = 0; in smsatWrite12()
7181 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite12()
7182 fis->d.reserved5 = 0; in smsatWrite12()
7185 satIOContext->ATACmd = SAT_WRITE_SECTORS_EXT; in smsatWrite12()
7190 if (pSatDevData->satNCQ == agTRUE) in smsatWrite12()
7193 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWrite12()
7208 satIOContext->pSmSenseData, in smsatWrite12()
7209 satIOContext->interruptContext ); in smsatWrite12()
7214 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWrite12()
7216 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite12()
7217 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite12()
7218 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWrite12()
7219 fis->h.features = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWrite12()
7220 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWrite12()
7221 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWrite12()
7222 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWrite12()
7225 if (scsiCmnd->cdb[1] & SCSI_WRITE12_FUA_MASK) in smsatWrite12()
7226 fis->d.device = 0xC0; /* FIS FUA set */ in smsatWrite12()
7228 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWrite12()
7230 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWrite12()
7231 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite12()
7232 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite12()
7233 fis->d.featuresExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatWrite12()
7234 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWrite12()
7235 fis->d.sectorCountExp = 0; in smsatWrite12()
7236 fis->d.reserved4 = 0; in smsatWrite12()
7237 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite12()
7238 fis->d.reserved5 = 0; in smsatWrite12()
7241 satIOContext->ATACmd = SAT_WRITE_FPDMA_QUEUED; in smsatWrite12()
7244 satIOContext->currentLBA = lba; in smsatWrite12()
7245 satIOContext->OrgTL = tl; in smsatWrite12()
7252 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWrite12()
7256 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWrite12()
7257 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWrite12()
7258 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWrite12()
7270 satIOContext->LoopNum = LoopNum; in smsatWrite12()
7278 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatWrite12()
7283 /* re-setting tl */ in smsatWrite12()
7284 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWrite12()
7286 fis->d.sectorCount = 0xFF; in smsatWrite12()
7288 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWrite12()
7289 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWrite12()
7290 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWrite12()
7293 fis->d.sectorCount = 0xFF; in smsatWrite12()
7294 fis->d.sectorCountExp = 0xFF; in smsatWrite12()
7299 fis->h.features = 0xFF; in smsatWrite12()
7300 fis->d.featuresExp = 0xFF; in smsatWrite12()
7305 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatWrite12()
7310 * Prepare SGL and send FIS to LL layer. in smsatWrite12()
7312 satIOContext->reqType = agRequestType; /* Save it */ in smsatWrite12()
7336 agsaFisRegHostToDevice_t *fis; in smsatWrite16() local
7344 pSense = satIOContext->pSense; in smsatWrite16()
7345 pSatDevData = satIOContext->pSatDevData; in smsatWrite16()
7346 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWrite16()
7347 fis = satIOContext->pFis; in smsatWrite16()
7352 if (scsiCmnd->cdb[1] & SCSI_FUA_NV_MASK) in smsatWrite16()
7366 satIOContext->pSmSenseData, in smsatWrite16()
7367 satIOContext->interruptContext ); in smsatWrite16()
7376 if ( (scsiCmnd->cdb[15] & SCSI_NACA_MASK) || (scsiCmnd->cdb[15] & SCSI_LINK_MASK) ) in smsatWrite16()
7390 satIOContext->pSmSenseData, in smsatWrite16()
7391 satIOContext->interruptContext ); in smsatWrite16()
7403 LBA[0] = scsiCmnd->cdb[2]; /* MSB */ in smsatWrite16()
7404 LBA[1] = scsiCmnd->cdb[3]; in smsatWrite16()
7405 LBA[2] = scsiCmnd->cdb[4]; in smsatWrite16()
7406 LBA[3] = scsiCmnd->cdb[5]; in smsatWrite16()
7407 LBA[4] = scsiCmnd->cdb[6]; in smsatWrite16()
7408 LBA[5] = scsiCmnd->cdb[7]; in smsatWrite16()
7409 LBA[6] = scsiCmnd->cdb[8]; in smsatWrite16()
7410 LBA[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatWrite16()
7416 TL[4] = scsiCmnd->cdb[10]; /* MSB */ in smsatWrite16()
7417 TL[5] = scsiCmnd->cdb[11]; in smsatWrite16()
7418 TL[6] = scsiCmnd->cdb[12]; in smsatWrite16()
7419 TL[7] = scsiCmnd->cdb[13]; /* LSB */ in smsatWrite16()
7435 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWrite16()
7438 if (pSatDevData->satNCQ != agTRUE && in smsatWrite16()
7439 pSatDevData->sat48BitSupport != agTRUE in smsatWrite16()
7458 satIOContext->pSmSenseData, in smsatWrite16()
7459 satIOContext->interruptContext ); in smsatWrite16()
7482 satIOContext->pSmSenseData, in smsatWrite16()
7483 satIOContext->interruptContext ); in smsatWrite16()
7490 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite16()
7496 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite16()
7497 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite16()
7498 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWrite16()
7499 fis->h.features = 0; /* FIS reserve */ in smsatWrite16()
7500 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWrite16()
7501 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWrite16()
7502 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWrite16()
7504 /* FIS LBA mode set LBA (27:24) */ in smsatWrite16()
7505 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[6] & 0xF)); in smsatWrite16()
7507 fis->d.lbaLowExp = 0; in smsatWrite16()
7508 fis->d.lbaMidExp = 0; in smsatWrite16()
7509 fis->d.lbaHighExp = 0; in smsatWrite16()
7510 fis->d.featuresExp = 0; in smsatWrite16()
7511 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWrite16()
7512 fis->d.sectorCountExp = 0; in smsatWrite16()
7513 fis->d.reserved4 = 0; in smsatWrite16()
7514 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite16()
7515 fis->d.reserved5 = 0; in smsatWrite16()
7518 satIOContext->ATACmd = SAT_WRITE_DMA; in smsatWrite16()
7527 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite16()
7528 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite16()
7529 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatWrite16()
7530 fis->h.features = 0; /* FIS reserve */ in smsatWrite16()
7531 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWrite16()
7532 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWrite16()
7533 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWrite16()
7535 /* FIS LBA mode set LBA (27:24) */ in smsatWrite16()
7536 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[6] & 0xF)); in smsatWrite16()
7538 fis->d.lbaLowExp = 0; in smsatWrite16()
7539 fis->d.lbaMidExp = 0; in smsatWrite16()
7540 fis->d.lbaHighExp = 0; in smsatWrite16()
7541 fis->d.featuresExp = 0; in smsatWrite16()
7542 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWrite16()
7543 fis->d.sectorCountExp = 0; in smsatWrite16()
7544 fis->d.reserved4 = 0; in smsatWrite16()
7545 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite16()
7546 fis->d.reserved5 = 0; in smsatWrite16()
7549 satIOContext->ATACmd = SAT_WRITE_SECTORS; in smsatWrite16()
7553 if (pSatDevData->sat48BitSupport == agTRUE) in smsatWrite16()
7555 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWrite16()
7560 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite16()
7561 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite16()
7564 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWrite16()
7566 fis->h.features = 0; /* FIS reserve */ in smsatWrite16()
7567 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWrite16()
7568 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWrite16()
7569 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWrite16()
7570 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite16()
7571 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatWrite16()
7572 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatWrite16()
7573 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatWrite16()
7574 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite16()
7575 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWrite16()
7576 fis->d.sectorCountExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatWrite16()
7577 fis->d.reserved4 = 0; in smsatWrite16()
7578 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite16()
7579 fis->d.reserved5 = 0; in smsatWrite16()
7582 satIOContext->ATACmd = SAT_WRITE_DMA_EXT; in smsatWrite16()
7590 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite16()
7591 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite16()
7592 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWrite16()
7594 fis->h.features = 0; /* FIS reserve */ in smsatWrite16()
7595 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWrite16()
7596 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWrite16()
7597 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWrite16()
7598 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite16()
7599 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatWrite16()
7600 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatWrite16()
7601 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatWrite16()
7602 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite16()
7603 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWrite16()
7604 fis->d.sectorCountExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatWrite16()
7605 fis->d.reserved4 = 0; in smsatWrite16()
7606 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite16()
7607 fis->d.reserved5 = 0; in smsatWrite16()
7610 satIOContext->ATACmd = SAT_WRITE_SECTORS_EXT; in smsatWrite16()
7615 if (pSatDevData->satNCQ == agTRUE) in smsatWrite16()
7618 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWrite16()
7633 satIOContext->pSmSenseData, in smsatWrite16()
7634 satIOContext->interruptContext ); in smsatWrite16()
7639 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWrite16()
7641 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite16()
7642 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite16()
7643 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWrite16()
7644 fis->h.features = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWrite16()
7645 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWrite16()
7646 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWrite16()
7647 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWrite16()
7650 if (scsiCmnd->cdb[1] & SCSI_WRITE16_FUA_MASK) in smsatWrite16()
7651 fis->d.device = 0xC0; /* FIS FUA set */ in smsatWrite16()
7653 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWrite16()
7655 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatWrite16()
7656 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatWrite16()
7657 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatWrite16()
7658 fis->d.featuresExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatWrite16()
7659 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWrite16()
7660 fis->d.sectorCountExp = 0; in smsatWrite16()
7661 fis->d.reserved4 = 0; in smsatWrite16()
7662 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite16()
7663 fis->d.reserved5 = 0; in smsatWrite16()
7666 satIOContext->ATACmd = SAT_WRITE_FPDMA_QUEUED; in smsatWrite16()
7669 satIOContext->currentLBA = lba; in smsatWrite16()
7670 satIOContext->OrgTL = tl; in smsatWrite16()
7677 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWrite16()
7681 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWrite16()
7682 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWrite16()
7683 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWrite16()
7695 satIOContext->LoopNum = LoopNum; in smsatWrite16()
7703 satIOContext->satCompleteCB = &smsatNonChainedDataIOCB; in smsatWrite16()
7708 /* re-setting tl */ in smsatWrite16()
7709 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWrite16()
7711 fis->d.sectorCount = 0xFF; in smsatWrite16()
7713 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWrite16()
7714 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWrite16()
7715 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWrite16()
7718 fis->d.sectorCount = 0xFF; in smsatWrite16()
7719 fis->d.sectorCountExp = 0xFF; in smsatWrite16()
7724 fis->h.features = 0xFF; in smsatWrite16()
7725 fis->d.featuresExp = 0xFF; in smsatWrite16()
7730 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatWrite16()
7735 * Prepare SGL and send FIS to LL layer. in smsatWrite16()
7737 satIOContext->reqType = agRequestType; /* Save it */ in smsatWrite16()
7764 agsaFisRegHostToDevice_t *fis; in smsatVerify10() local
7774 pSense = satIOContext->pSense; in smsatVerify10()
7775 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatVerify10()
7776 pSatDevData = satIOContext->pSatDevData; in smsatVerify10()
7777 fis = satIOContext->pFis; in smsatVerify10()
7780 if (scsiCmnd->cdb[1] & SCSI_VERIFY_BYTCHK_MASK) in smsatVerify10()
7796 satIOContext->pSmSenseData, in smsatVerify10()
7797 satIOContext->interruptContext ); in smsatVerify10()
7805 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatVerify10()
7819 satIOContext->pSmSenseData, in smsatVerify10()
7820 satIOContext->interruptContext ); in smsatVerify10()
7835 LBA[4] = scsiCmnd->cdb[2]; in smsatVerify10()
7836 LBA[5] = scsiCmnd->cdb[3]; in smsatVerify10()
7837 LBA[6] = scsiCmnd->cdb[4]; in smsatVerify10()
7838 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatVerify10()
7846 TL[6] = scsiCmnd->cdb[7]; in smsatVerify10()
7847 TL[7] = scsiCmnd->cdb[8]; /* LSB */ in smsatVerify10()
7851 lba = (scsiCmnd->cdb[2] << (8*3)) + (scsiCmnd->cdb[3] << (8*2)) in smsatVerify10()
7852 + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatVerify10()
7853 tl = (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatVerify10()
7855 if (pSatDevData->satNCQ != agTRUE && in smsatVerify10()
7856 pSatDevData->sat48BitSupport != agTRUE in smsatVerify10()
7863 SM_DBG1(("smsatVerify10: cdb 0x%x 0x%x 0x%x 0x%x!!!\n",scsiCmnd->cdb[2], scsiCmnd->cdb[3], in smsatVerify10()
7864 scsiCmnd->cdb[4], scsiCmnd->cdb[5])); in smsatVerify10()
7878 satIOContext->pSmSenseData, in smsatVerify10()
7879 satIOContext->interruptContext ); in smsatVerify10()
7902 satIOContext->pSmSenseData, in smsatVerify10()
7903 satIOContext->interruptContext ); in smsatVerify10()
7909 if (pSatDevData->sat48BitSupport == agTRUE) in smsatVerify10()
7912 fis->h.fisType = 0x27; /* Reg host to device */ in smsatVerify10()
7913 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatVerify10()
7915 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatVerify10()
7916 fis->h.features = 0; /* FIS reserve */ in smsatVerify10()
7917 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatVerify10()
7918 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatVerify10()
7919 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatVerify10()
7920 fis->d.device = 0x40; /* FIS LBA mode set 01000000 */ in smsatVerify10()
7921 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatVerify10()
7922 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatVerify10()
7923 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatVerify10()
7924 fis->d.featuresExp = 0; /* FIS reserve */ in smsatVerify10()
7925 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatVerify10()
7926 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatVerify10()
7928 fis->d.reserved4 = 0; in smsatVerify10()
7929 fis->d.control = 0; /* FIS HOB bit clear */ in smsatVerify10()
7930 fis->d.reserved5 = 0; in smsatVerify10()
7933 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS_EXT; in smsatVerify10()
7938 fis->h.fisType = 0x27; /* Reg host to device */ in smsatVerify10()
7939 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatVerify10()
7940 fis->h.command = SAT_READ_VERIFY_SECTORS; /* 0x40 */ in smsatVerify10()
7941 fis->h.features = 0; /* FIS reserve */ in smsatVerify10()
7942 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatVerify10()
7943 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatVerify10()
7944 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatVerify10()
7945 /* FIS LBA mode set LBA (27:24) */ in smsatVerify10()
7946 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatVerify10()
7947 fis->d.lbaLowExp = 0; in smsatVerify10()
7948 fis->d.lbaMidExp = 0; in smsatVerify10()
7949 fis->d.lbaHighExp = 0; in smsatVerify10()
7950 fis->d.featuresExp = 0; in smsatVerify10()
7951 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatVerify10()
7952 fis->d.sectorCountExp = 0; in smsatVerify10()
7953 fis->d.reserved4 = 0; in smsatVerify10()
7954 fis->d.control = 0; /* FIS HOB bit clear */ in smsatVerify10()
7955 fis->d.reserved5 = 0; in smsatVerify10()
7958 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS; in smsatVerify10()
7962 satIOContext->currentLBA = lba; in smsatVerify10()
7963 satIOContext->OrgTL = tl; in smsatVerify10()
7970 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatVerify10()
7974 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatVerify10()
7985 satIOContext->LoopNum = LoopNum; in smsatVerify10()
7992 satIOContext->satCompleteCB = &smsatNonChainedVerifyCB; in smsatVerify10()
7997 /* re-setting tl */ in smsatVerify10()
7998 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatVerify10()
8000 fis->d.sectorCount = 0xFF; in smsatVerify10()
8002 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatVerify10()
8004 fis->d.sectorCount = 0xFF; in smsatVerify10()
8005 fis->d.sectorCountExp = 0xFF; in smsatVerify10()
8014 satIOContext->satCompleteCB = &smsatChainedVerifyCB; in smsatVerify10()
8019 * Prepare SGL and send FIS to LL layer. in smsatVerify10()
8021 satIOContext->reqType = agRequestType; /* Save it */ in smsatVerify10()
8047 agsaFisRegHostToDevice_t *fis; in smsatVerify12() local
8057 pSense = satIOContext->pSense; in smsatVerify12()
8058 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatVerify12()
8059 pSatDevData = satIOContext->pSatDevData; in smsatVerify12()
8060 fis = satIOContext->pFis; in smsatVerify12()
8063 if (scsiCmnd->cdb[1] & SCSI_VERIFY_BYTCHK_MASK) in smsatVerify12()
8081 satIOContext->pSmSenseData, in smsatVerify12()
8082 satIOContext->interruptContext ); in smsatVerify12()
8090 if ( (scsiCmnd->cdb[11] & SCSI_NACA_MASK) || (scsiCmnd->cdb[11] & SCSI_LINK_MASK) ) in smsatVerify12()
8104 satIOContext->pSmSenseData, in smsatVerify12()
8105 satIOContext->interruptContext ); in smsatVerify12()
8119 LBA[4] = scsiCmnd->cdb[2]; in smsatVerify12()
8120 LBA[5] = scsiCmnd->cdb[3]; in smsatVerify12()
8121 LBA[6] = scsiCmnd->cdb[4]; in smsatVerify12()
8122 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatVerify12()
8128 TL[4] = scsiCmnd->cdb[6]; in smsatVerify12()
8129 TL[5] = scsiCmnd->cdb[7]; in smsatVerify12()
8130 TL[6] = scsiCmnd->cdb[8]; in smsatVerify12()
8131 TL[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatVerify12()
8137 if (pSatDevData->satNCQ != agTRUE && in smsatVerify12()
8138 pSatDevData->sat48BitSupport != agTRUE in smsatVerify12()
8145 SM_DBG1(("smsatVerify12: cdb 0x%x 0x%x 0x%x 0x%x!!!\n",scsiCmnd->cdb[2], scsiCmnd->cdb[3], in smsatVerify12()
8146 scsiCmnd->cdb[4], scsiCmnd->cdb[5])); in smsatVerify12()
8160 satIOContext->pSmSenseData, in smsatVerify12()
8161 satIOContext->interruptContext ); in smsatVerify12()
8184 satIOContext->pSmSenseData, in smsatVerify12()
8185 satIOContext->interruptContext ); in smsatVerify12()
8191 if (pSatDevData->sat48BitSupport == agTRUE) in smsatVerify12()
8194 fis->h.fisType = 0x27; /* Reg host to device */ in smsatVerify12()
8195 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatVerify12()
8197 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatVerify12()
8198 fis->h.features = 0; /* FIS reserve */ in smsatVerify12()
8199 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatVerify12()
8200 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatVerify12()
8201 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatVerify12()
8202 fis->d.device = 0x40; /* FIS LBA mode set 01000000 */ in smsatVerify12()
8203 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatVerify12()
8204 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatVerify12()
8205 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatVerify12()
8206 fis->d.featuresExp = 0; /* FIS reserve */ in smsatVerify12()
8207 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatVerify12()
8208 fis->d.sectorCountExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatVerify12()
8210 fis->d.reserved4 = 0; in smsatVerify12()
8211 fis->d.control = 0; /* FIS HOB bit clear */ in smsatVerify12()
8212 fis->d.reserved5 = 0; in smsatVerify12()
8215 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS_EXT; in smsatVerify12()
8220 fis->h.fisType = 0x27; /* Reg host to device */ in smsatVerify12()
8221 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatVerify12()
8222 fis->h.command = SAT_READ_VERIFY_SECTORS; /* 0x40 */ in smsatVerify12()
8223 fis->h.features = 0; /* FIS reserve */ in smsatVerify12()
8224 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatVerify12()
8225 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatVerify12()
8226 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatVerify12()
8227 /* FIS LBA mode set LBA (27:24) */ in smsatVerify12()
8228 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatVerify12()
8229 fis->d.lbaLowExp = 0; in smsatVerify12()
8230 fis->d.lbaMidExp = 0; in smsatVerify12()
8231 fis->d.lbaHighExp = 0; in smsatVerify12()
8232 fis->d.featuresExp = 0; in smsatVerify12()
8233 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatVerify12()
8234 fis->d.sectorCountExp = 0; in smsatVerify12()
8235 fis->d.reserved4 = 0; in smsatVerify12()
8236 fis->d.control = 0; /* FIS HOB bit clear */ in smsatVerify12()
8237 fis->d.reserved5 = 0; in smsatVerify12()
8240 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS; in smsatVerify12()
8244 satIOContext->currentLBA = lba; in smsatVerify12()
8245 satIOContext->OrgTL = tl; in smsatVerify12()
8252 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatVerify12()
8256 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatVerify12()
8267 satIOContext->LoopNum = LoopNum; in smsatVerify12()
8274 satIOContext->satCompleteCB = &smsatNonChainedVerifyCB; in smsatVerify12()
8279 /* re-setting tl */ in smsatVerify12()
8280 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatVerify12()
8282 fis->d.sectorCount = 0xFF; in smsatVerify12()
8284 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatVerify12()
8286 fis->d.sectorCount = 0xFF; in smsatVerify12()
8287 fis->d.sectorCountExp = 0xFF; in smsatVerify12()
8296 satIOContext->satCompleteCB = &smsatChainedVerifyCB; in smsatVerify12()
8301 * Prepare SGL and send FIS to LL layer. in smsatVerify12()
8303 satIOContext->reqType = agRequestType; /* Save it */ in smsatVerify12()
8329 agsaFisRegHostToDevice_t *fis; in smsatVerify16() local
8339 pSense = satIOContext->pSense; in smsatVerify16()
8340 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatVerify16()
8341 pSatDevData = satIOContext->pSatDevData; in smsatVerify16()
8342 fis = satIOContext->pFis; in smsatVerify16()
8345 if (scsiCmnd->cdb[1] & SCSI_VERIFY_BYTCHK_MASK) in smsatVerify16()
8361 satIOContext->pSmSenseData, in smsatVerify16()
8362 satIOContext->interruptContext ); in smsatVerify16()
8368 if ( (scsiCmnd->cdb[15] & SCSI_NACA_MASK) || (scsiCmnd->cdb[15] & SCSI_LINK_MASK) ) in smsatVerify16()
8380 satIOContext->pSmSenseData, in smsatVerify16()
8381 satIOContext->interruptContext ); in smsatVerify16()
8389 LBA[0] = scsiCmnd->cdb[2]; /* MSB */ in smsatVerify16()
8390 LBA[1] = scsiCmnd->cdb[3]; in smsatVerify16()
8391 LBA[2] = scsiCmnd->cdb[4]; in smsatVerify16()
8392 LBA[3] = scsiCmnd->cdb[5]; in smsatVerify16()
8393 LBA[4] = scsiCmnd->cdb[6]; in smsatVerify16()
8394 LBA[5] = scsiCmnd->cdb[7]; in smsatVerify16()
8395 LBA[6] = scsiCmnd->cdb[8]; in smsatVerify16()
8396 LBA[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatVerify16()
8402 TL[4] = scsiCmnd->cdb[10]; /* MSB */ in smsatVerify16()
8403 TL[5] = scsiCmnd->cdb[11]; in smsatVerify16()
8404 TL[6] = scsiCmnd->cdb[12]; in smsatVerify16()
8405 TL[7] = scsiCmnd->cdb[13]; /* LSB */ in smsatVerify16()
8409 if (pSatDevData->satNCQ != agTRUE && in smsatVerify16()
8410 pSatDevData->sat48BitSupport != agTRUE in smsatVerify16()
8427 satIOContext->pSmSenseData, in smsatVerify16()
8428 satIOContext->interruptContext ); in smsatVerify16()
8448 satIOContext->pSmSenseData, in smsatVerify16()
8449 satIOContext->interruptContext ); in smsatVerify16()
8454 if (pSatDevData->sat48BitSupport == agTRUE) in smsatVerify16()
8457 fis->h.fisType = 0x27; /* Reg host to device */ in smsatVerify16()
8458 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatVerify16()
8459 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatVerify16()
8460 fis->h.features = 0; /* FIS reserve */ in smsatVerify16()
8461 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatVerify16()
8462 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatVerify16()
8463 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatVerify16()
8464 fis->d.device = 0x40; /* FIS LBA mode set 01000000 */ in smsatVerify16()
8465 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatVerify16()
8466 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatVerify16()
8467 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatVerify16()
8468 fis->d.featuresExp = 0; /* FIS reserve */ in smsatVerify16()
8469 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatVerify16()
8470 fis->d.sectorCountExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatVerify16()
8472 fis->d.reserved4 = 0; in smsatVerify16()
8473 fis->d.control = 0; /* FIS HOB bit clear */ in smsatVerify16()
8474 fis->d.reserved5 = 0; in smsatVerify16()
8477 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS_EXT; in smsatVerify16()
8482 fis->h.fisType = 0x27; /* Reg host to device */ in smsatVerify16()
8483 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatVerify16()
8484 fis->h.command = SAT_READ_VERIFY_SECTORS; /* 0x40 */ in smsatVerify16()
8485 fis->h.features = 0; /* FIS reserve */ in smsatVerify16()
8486 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatVerify16()
8487 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatVerify16()
8488 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatVerify16()
8489 /* FIS LBA mode set LBA (27:24) */ in smsatVerify16()
8490 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[6] & 0xF)); in smsatVerify16()
8491 fis->d.lbaLowExp = 0; in smsatVerify16()
8492 fis->d.lbaMidExp = 0; in smsatVerify16()
8493 fis->d.lbaHighExp = 0; in smsatVerify16()
8494 fis->d.featuresExp = 0; in smsatVerify16()
8495 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatVerify16()
8496 fis->d.sectorCountExp = 0; in smsatVerify16()
8497 fis->d.reserved4 = 0; in smsatVerify16()
8498 fis->d.control = 0; /* FIS HOB bit clear */ in smsatVerify16()
8499 fis->d.reserved5 = 0; in smsatVerify16()
8502 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS; in smsatVerify16()
8506 satIOContext->currentLBA = lba; in smsatVerify16()
8507 satIOContext->OrgTL = tl; in smsatVerify16()
8514 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatVerify16()
8518 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatVerify16()
8529 satIOContext->LoopNum = LoopNum; in smsatVerify16()
8536 satIOContext->satCompleteCB = &smsatNonChainedVerifyCB; in smsatVerify16()
8541 /* re-setting tl */ in smsatVerify16()
8542 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatVerify16()
8544 fis->d.sectorCount = 0xFF; in smsatVerify16()
8546 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatVerify16()
8548 fis->d.sectorCount = 0xFF; in smsatVerify16()
8549 fis->d.sectorCountExp = 0xFF; in smsatVerify16()
8558 satIOContext->satCompleteCB = &smsatChainedVerifyCB; in smsatVerify16()
8563 * Prepare SGL and send FIS to LL layer. in smsatVerify16()
8565 satIOContext->reqType = agRequestType; /* Save it */ in smsatVerify16()
8589 agsaFisRegHostToDevice_t *fis; in smsatTestUnitReady() local
8591 pSense = satIOContext->pSense; in smsatTestUnitReady()
8592 pSatDevData = satIOContext->pSatDevData; in smsatTestUnitReady()
8593 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatTestUnitReady()
8594 fis = satIOContext->pFis; in smsatTestUnitReady()
8600 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatTestUnitReady()
8614 satIOContext->pSmSenseData, in smsatTestUnitReady()
8615 satIOContext->interruptContext ); in smsatTestUnitReady()
8622 if (pSatDevData->satStopState == agTRUE) in smsatTestUnitReady()
8636 satIOContext->pSmSenseData, in smsatTestUnitReady()
8637 satIOContext->interruptContext ); in smsatTestUnitReady()
8645 if (pSatDevData->satDriveState == SAT_DEV_STATE_FORMAT_IN_PROGRESS) in smsatTestUnitReady()
8661 satIOContext->pSmSenseData, in smsatTestUnitReady()
8662 satIOContext->interruptContext ); in smsatTestUnitReady()
8670 if (pSatDevData->satPendingIO != 0) in smsatTestUnitReady()
8672 if (pSatDevData->satDeviceFaultState == agTRUE) in smsatTestUnitReady()
8686 satIOContext->pSmSenseData, in smsatTestUnitReady()
8687 satIOContext->interruptContext ); in smsatTestUnitReady()
8696 if(pSatDevData->satRemovableMedia && pSatDevData->satRemovableMediaEnabled) in smsatTestUnitReady()
8700 fis->h.fisType = 0x27; /* Reg host to device */ in smsatTestUnitReady()
8701 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatTestUnitReady()
8702 fis->h.command = SAT_GET_MEDIA_STATUS; /* 0xDA */ in smsatTestUnitReady()
8703 fis->h.features = 0; /* FIS features NA */ in smsatTestUnitReady()
8704 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatTestUnitReady()
8705 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatTestUnitReady()
8706 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatTestUnitReady()
8707 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatTestUnitReady()
8708 fis->d.lbaLowExp = 0; in smsatTestUnitReady()
8709 fis->d.lbaMidExp = 0; in smsatTestUnitReady()
8710 fis->d.lbaHighExp = 0; in smsatTestUnitReady()
8711 fis->d.featuresExp = 0; in smsatTestUnitReady()
8712 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatTestUnitReady()
8713 fis->d.sectorCountExp = 0; in smsatTestUnitReady()
8714 fis->d.reserved4 = 0; in smsatTestUnitReady()
8715 fis->d.control = 0; /* FIS HOB bit clear */ in smsatTestUnitReady()
8716 fis->d.reserved5 = 0; in smsatTestUnitReady()
8721 satIOContext->satCompleteCB = &smsatTestUnitReadyCB; in smsatTestUnitReady()
8724 * Prepare SGL and send FIS to LL layer. in smsatTestUnitReady()
8726 satIOContext->reqType = agRequestType; /* Save it */ in smsatTestUnitReady()
8760 internally generated - no directly corresponding scsi in smsatTestUnitReady_1()
8765 agsaFisRegHostToDevice_t *fis; in smsatTestUnitReady_1() local
8767 fis = satIOContext->pFis; in smsatTestUnitReady_1()
8772 fis->h.fisType = 0x27; /* Reg host to device */ in smsatTestUnitReady_1()
8773 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatTestUnitReady_1()
8774 fis->h.command = SAT_CHECK_POWER_MODE; /* 0xE5 */ in smsatTestUnitReady_1()
8775 fis->h.features = 0; in smsatTestUnitReady_1()
8776 fis->d.lbaLow = 0; in smsatTestUnitReady_1()
8777 fis->d.lbaMid = 0; in smsatTestUnitReady_1()
8778 fis->d.lbaHigh = 0; in smsatTestUnitReady_1()
8779 fis->d.device = 0; in smsatTestUnitReady_1()
8780 fis->d.lbaLowExp = 0; in smsatTestUnitReady_1()
8781 fis->d.lbaMidExp = 0; in smsatTestUnitReady_1()
8782 fis->d.lbaHighExp = 0; in smsatTestUnitReady_1()
8783 fis->d.featuresExp = 0; in smsatTestUnitReady_1()
8784 fis->d.sectorCount = 0; in smsatTestUnitReady_1()
8785 fis->d.sectorCountExp = 0; in smsatTestUnitReady_1()
8786 fis->d.reserved4 = 0; in smsatTestUnitReady_1()
8787 fis->d.control = 0; /* FIS HOB bit clear */ in smsatTestUnitReady_1()
8788 fis->d.reserved5 = 0; in smsatTestUnitReady_1()
8794 satIOContext->satCompleteCB = &smsatTestUnitReadyCB; in smsatTestUnitReady_1()
8797 * Prepare SGL and send FIS to LL layer. in smsatTestUnitReady_1()
8799 satIOContext->reqType = agRequestType; /* Save it */ in smsatTestUnitReady_1()
8822 CMDDT bit is obsolete in SPC-3 and this is assumed in SAT revision 8 in smsatInquiry()
8829 pSense = satIOContext->pSense; in smsatInquiry()
8830 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatInquiry()
8831 pSatDevData = satIOContext->pSatDevData; in smsatInquiry()
8833 SM_DBG5(("smsatInquiry: pSatDevData did %d\n", pSatDevData->id)); in smsatInquiry()
8834 //smhexdump("smsatInquiry", (bit8 *)scsiCmnd->cdb, 6); in smsatInquiry()
8837 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatInquiry()
8849 satIOContext->pSmSenseData, in smsatInquiry()
8850 satIOContext->interruptContext ); in smsatInquiry()
8856 /* SPC-4 spec 6.4 p141 */ in smsatInquiry()
8858 if ( !(scsiCmnd->cdb[1] & SCSI_EVPD_MASK) && in smsatInquiry()
8859 (scsiCmnd->cdb[2] != 0) in smsatInquiry()
8872 satIOContext->pSmSenseData, in smsatInquiry()
8873 satIOContext->interruptContext ); in smsatInquiry()
8877 …allocation length 0x%x %d\n", ((scsiCmnd->cdb[3]) << 8) + scsiCmnd->cdb[4], ((scsiCmnd->cdb[3]) <<… in smsatInquiry()
8879 if ( pSatDevData->IDDeviceValid == agFALSE) in smsatInquiry()
8924 satDevData = satIOContext->pSatDevData; in smsatStartIDDev()
8946 satIntIo->satOrgSmIORequest = smIORequest; /* changed */ in smsatStartIDDev()
8947 smIORequestBody = satIntIo->satIntRequestBody; in smsatStartIDDev()
8948 satNewIOContext = &(smIORequestBody->transport.SATA.satIOContext); in smsatStartIDDev()
8950 satNewIOContext->pSatDevData = satDevData; in smsatStartIDDev()
8951 …satNewIOContext->pFis = &(smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHos… in smsatStartIDDev()
8952 satNewIOContext->pScsiCmnd = &(satIntIo->satIntSmScsiXchg.scsiCmnd); in smsatStartIDDev()
8953 satNewIOContext->pSense = &(smIORequestBody->transport.SATA.sensePayload); in smsatStartIDDev()
8954 satNewIOContext->pSmSenseData = &(smIORequestBody->transport.SATA.smSenseData); in smsatStartIDDev()
8955 satNewIOContext->smRequestBody = satIntIo->satIntRequestBody; /* key fix */ in smsatStartIDDev()
8956 satNewIOContext->interruptContext = tiInterruptContext; in smsatStartIDDev()
8957 satNewIOContext->satIntIoContext = satIntIo; in smsatStartIDDev()
8959 satNewIOContext->psmDeviceHandle = agNULL; in smsatStartIDDev()
8960 satNewIOContext->satOrgIOContext = satIOContext; /* changed */ in smsatStartIDDev()
8963 satNewIOContext->smScsiXchg = &(satIntIo->satIntSmScsiXchg); in smsatStartIDDev()
8968 SM_DBG6(("smsatStartIDDev: OS tiScsiXchg %p \n", satIOContext->smScsiXchg)); in smsatStartIDDev()
8969 SM_DBG6(("smsatStartIDDev: TD tiScsiXchg %p \n", satNewIOContext->smScsiXchg)); in smsatStartIDDev()
8976 &satIntIo->satIntSmIORequest, /* New smIORequest */ in smsatStartIDDev()
8978 … satNewIOContext->smScsiXchg, /* New tiScsiInitiatorRequest_t *tiScsiRequest, */ in smsatStartIDDev()
9011 agsaFisRegHostToDevice_t *fis; in smsatSendIDDev() local
9017 pSatDevData = satIOContext->pSatDevData; in smsatSendIDDev()
9018 fis = satIOContext->pFis; in smsatSendIDDev()
9020 SM_DBG6(("smsatSendIDDev: did %d\n", pSatDevData->id)); in smsatSendIDDev()
9022 satIntIoContext = satIOContext->satIntIoContext; in smsatSendIDDev()
9023 smIORequestBody = satIntIoContext->satIntRequestBody; in smsatSendIDDev()
9025 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendIDDev()
9026 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendIDDev()
9027 if (pSatDevData->satDeviceType == SATA_ATAPI_DEVICE) in smsatSendIDDev()
9028 fis->h.command = SAT_IDENTIFY_PACKET_DEVICE; /* 0x40 */ in smsatSendIDDev()
9030 fis->h.command = SAT_IDENTIFY_DEVICE; /* 0xEC */ in smsatSendIDDev()
9031 fis->h.features = 0; /* FIS reserve */ in smsatSendIDDev()
9032 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatSendIDDev()
9033 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSendIDDev()
9034 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSendIDDev()
9035 fis->d.device = 0; /* FIS LBA mode */ in smsatSendIDDev()
9036 fis->d.lbaLowExp = 0; in smsatSendIDDev()
9037 fis->d.lbaMidExp = 0; in smsatSendIDDev()
9038 fis->d.lbaHighExp = 0; in smsatSendIDDev()
9039 fis->d.featuresExp = 0; in smsatSendIDDev()
9040 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSendIDDev()
9041 fis->d.sectorCountExp = 0; in smsatSendIDDev()
9042 fis->d.reserved4 = 0; in smsatSendIDDev()
9043 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendIDDev()
9044 fis->d.reserved5 = 0; in smsatSendIDDev()
9050 satIOContext->satCompleteCB = &smsatInquiryCB; in smsatSendIDDev()
9053 * Prepare SGL and send FIS to LL layer. in smsatSendIDDev()
9055 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendIDDev()
9058 smhexdump("smsatSendIDDev", (bit8 *)satIOContext->pFis, sizeof(agsaFisRegHostToDevice_t)); in smsatSendIDDev()
9059 …smhexdump("smsatSendIDDev LL", (bit8 *)&(smIORequestBody->transport.SATA.agSATARequestBody.fis.fis… in smsatSendIDDev()
9092 agsaFisRegHostToDevice_t *fis; in smsatRequestSense() local
9099 pSense = satIOContext->pSense; in smsatRequestSense()
9100 pSatDevData = satIOContext->pSatDevData; in smsatRequestSense()
9101 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatRequestSense()
9102 fis = satIOContext->pFis; in smsatRequestSense()
9103 pDataBuffer = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatRequestSense()
9104 allocationLen = scsiCmnd->cdb[4]; in smsatRequestSense()
9105 allocationLen = MIN(allocationLen, scsiCmnd->expDataLength); in smsatRequestSense()
9110 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatRequestSense()
9125 satIOContext->pSmSenseData, in smsatRequestSense()
9126 satIOContext->interruptContext ); in smsatRequestSense()
9136 if ( scsiCmnd->cdb[1] & ATA_REMOVABLE_MEDIA_DEVICE_MASK ) in smsatRequestSense()
9151 satIOContext->pSmSenseData, in smsatRequestSense()
9152 satIOContext->interruptContext ); in smsatRequestSense()
9159 if (pSatDevData->satSMARTEnabled == agTRUE) in smsatRequestSense()
9162 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRequestSense()
9163 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRequestSense()
9165 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatRequestSense()
9166 fis->h.features = SAT_SMART_RETURN_STATUS; /* FIS features */ in smsatRequestSense()
9167 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRequestSense()
9168 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatRequestSense()
9169 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatRequestSense()
9170 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatRequestSense()
9171 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatRequestSense()
9172 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatRequestSense()
9173 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRequestSense()
9174 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatRequestSense()
9175 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRequestSense()
9176 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatRequestSense()
9177 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRequestSense()
9178 fis->d.reserved4 = 0; in smsatRequestSense()
9179 fis->d.reserved5 = 0; in smsatRequestSense()
9184 satIOContext->satCompleteCB = &smsatRequestSenseCB; in smsatRequestSense()
9187 * Prepare SGL and send FIS to LL layer. in smsatRequestSense()
9189 satIOContext->reqType = agRequestType; /* Save it */ in smsatRequestSense()
9210 smScsiRequest->scsiCmnd.expDataLength, in smsatRequestSense()
9232 satIOContext->interruptContext ); in smsatRequestSense()
9252 /* use this --- tttttthe one the same */ in smsatRequestSense()
9255 satIntIo->satOrgSmIORequest = smIORequest; in smsatRequestSense()
9256 smIORequestBody = (smIORequestBody_t *)satIntIo->satIntRequestBody; in smsatRequestSense()
9257 satIOContext2 = &(smIORequestBody->transport.SATA.satIOContext); in smsatRequestSense()
9259 satIOContext2->pSatDevData = pSatDevData; in smsatRequestSense()
9260 …satIOContext2->pFis = &(smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHostT… in smsatRequestSense()
9261 satIOContext2->pScsiCmnd = &(satIntIo->satIntSmScsiXchg.scsiCmnd); in smsatRequestSense()
9262 satIOContext2->pSense = &(smIORequestBody->transport.SATA.sensePayload); in smsatRequestSense()
9263 satIOContext2->pSmSenseData = &(smIORequestBody->transport.SATA.smSenseData); in smsatRequestSense()
9264 satIOContext2->pSmSenseData->senseData = satIOContext2->pSense; in smsatRequestSense()
9265 satIOContext2->smRequestBody = satIntIo->satIntRequestBody; in smsatRequestSense()
9266 satIOContext2->interruptContext = satIOContext->interruptContext; in smsatRequestSense()
9267 satIOContext2->satIntIoContext = satIntIo; in smsatRequestSense()
9268 satIOContext2->psmDeviceHandle = smDeviceHandle; in smsatRequestSense()
9269 satIOContext2->satOrgIOContext = satIOContext; in smsatRequestSense()
9271 …SM_DBG4(("smsatRequestSense: satIntIo->satIntSmScsiXchg.agSgl1.len %d\n", satIntIo->satIntSmScsiXc… in smsatRequestSense()
9273 …SM_DBG4(("smsatRequestSense: satIntIo->satIntSmScsiXchg.agSgl1.upper %d\n", satIntIo->satIntSmScsi… in smsatRequestSense()
9275 …SM_DBG4(("smsatRequestSense: satIntIo->satIntSmScsiXchg.agSgl1.lower %d\n", satIntIo->satIntSmScsi… in smsatRequestSense()
9277 …SM_DBG4(("smsatRequestSense: satIntIo->satIntSmScsiXchg.agSgl1.type %d\n", satIntIo->satIntSmScsiX… in smsatRequestSense()
9280 &(satIntIo->satIntSmIORequest), in smsatRequestSense()
9282 &(satIntIo->satIntSmScsiXchg), in smsatRequestSense()
9306 satIOContext->interruptContext ); in smsatRequestSense()
9330 agsaFisRegHostToDevice_t *fis; in smsatRequestSense_1() local
9332 fis = satIOContext->pFis; in smsatRequestSense_1()
9337 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRequestSense_1()
9338 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRequestSense_1()
9339 fis->h.command = SAT_CHECK_POWER_MODE; /* 0xE5 */ in smsatRequestSense_1()
9340 fis->h.features = 0; in smsatRequestSense_1()
9341 fis->d.lbaLow = 0; in smsatRequestSense_1()
9342 fis->d.lbaMid = 0; in smsatRequestSense_1()
9343 fis->d.lbaHigh = 0; in smsatRequestSense_1()
9344 fis->d.device = 0; in smsatRequestSense_1()
9345 fis->d.lbaLowExp = 0; in smsatRequestSense_1()
9346 fis->d.lbaMidExp = 0; in smsatRequestSense_1()
9347 fis->d.lbaHighExp = 0; in smsatRequestSense_1()
9348 fis->d.featuresExp = 0; in smsatRequestSense_1()
9349 fis->d.sectorCount = 0; in smsatRequestSense_1()
9350 fis->d.sectorCountExp = 0; in smsatRequestSense_1()
9351 fis->d.reserved4 = 0; in smsatRequestSense_1()
9352 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRequestSense_1()
9353 fis->d.reserved5 = 0; in smsatRequestSense_1()
9359 satIOContext->satCompleteCB = &smsatRequestSenseCB; in smsatRequestSense_1()
9362 * Prepare SGL and send FIS to LL layer. in smsatRequestSense_1()
9364 satIOContext->reqType = agRequestType; /* Save it */ in smsatRequestSense_1()
9367 SM_DBG4(("smsatRequestSense_1: smSgl1.len %d\n", smScsiRequest->smSgl1.len)); in smsatRequestSense_1()
9369 SM_DBG4(("smsatRequestSense_1: smSgl1.upper %d\n", smScsiRequest->smSgl1.upper)); in smsatRequestSense_1()
9371 SM_DBG4(("smsatRequestSense_1: smSgl1.lower %d\n", smScsiRequest->smSgl1.lower)); in smsatRequestSense_1()
9373 SM_DBG4(("smsatRequestSense_1: smSgl1.type %d\n", smScsiRequest->smSgl1.type)); in smsatRequestSense_1()
9375 // smhexdump("smsatRequestSense_1", (bit8 *)fis, sizeof(agsaFisRegHostToDevice_t)); in smsatRequestSense_1()
9413 pSense = satIOContext->pSense; in smsatModeSense6()
9414 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatModeSense6()
9415 pModeSense = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatModeSense6()
9416 pSatDevData = satIOContext->pSatDevData; in smsatModeSense6()
9418 //smhexdump("smsatModeSense6", (bit8 *)scsiCmnd->cdb, 6); in smsatModeSense6()
9422 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatModeSense6()
9434 satIOContext->pSmSenseData, in smsatModeSense6()
9435 satIOContext->interruptContext ); in smsatModeSense6()
9442 PC = (bit8)((scsiCmnd->cdb[2]) & SCSI_MODE_SENSE6_PC_MASK); in smsatModeSense6()
9455 satIOContext->pSmSenseData, in smsatModeSense6()
9456 satIOContext->interruptContext ); in smsatModeSense6()
9461 page = (bit8)((scsiCmnd->cdb[2]) & SCSI_MODE_SENSE6_PAGE_CODE_MASK); in smsatModeSense6()
9466 allocationLen = scsiCmnd->cdb[4]; in smsatModeSense6()
9467 allocationLen = MIN(allocationLen, scsiCmnd->expDataLength); in smsatModeSense6()
9469 Based on page code value, returns a corresponding mode page in smsatModeSense6()
9476 case MODESENSE_READ_WRITE_ERROR_RECOVERY_PAGE: /* Read-Write Error Recovery */ in smsatModeSense6()
9491 page, pSatDevData->id)); in smsatModeSense6()
9505 satIOContext->pSmSenseData, in smsatModeSense6()
9506 satIOContext->interruptContext ); in smsatModeSense6()
9518 case MODESENSE_READ_WRITE_ERROR_RECOVERY_PAGE: /* Read-Write Error Recovery */ in smsatModeSense6()
9535 AllPages[0] = (bit8)(lenRead - 1); in smsatModeSense6()
9537 AllPages[2] = 0x00; /* no write-protect, no support for DPO-FUA */ in smsatModeSense6()
9541 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense6()
9545 AllPages[4] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense6()
9573 if (pSatDevData->satWriteCacheEnabled == agTRUE) in smsatModeSense6()
9591 if (pSatDevData->satLookAheadEnabled == agTRUE) in smsatModeSense6()
9610 if (pSatDevData->satNCQ == agTRUE) in smsatModeSense6()
9624 AllPages[54] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense6()
9625 AllPages[55] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense6()
9629 if (pSatDevData->satSMARTEnabled == agTRUE) in smsatModeSense6()
9638 AllPages[60] = 0x00; /* Interval timer vendor-specific */ in smsatModeSense6()
9642 AllPages[64] = 0x00; /* REPORT-COUNT */ in smsatModeSense6()
9652 Control[0] = MODE_SENSE6_CONTROL_PAGE_LEN - 1; in smsatModeSense6()
9654 Control[2] = 0x00; /* no write-protect, no support for DPO-FUA */ in smsatModeSense6()
9657 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense6()
9661 Control[4] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense6()
9673 * Fill-up control mode page, SAT, Table 65 in smsatModeSense6()
9678 if (pSatDevData->satNCQ == agTRUE) in smsatModeSense6()
9692 Control[22] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense6()
9693 Control[23] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense6()
9701 RWErrorRecovery[0] = MODE_SENSE6_READ_WRITE_ERROR_RECOVERY_PAGE_LEN - 1; in smsatModeSense6()
9703 RWErrorRecovery[2] = 0x00; /* no write-protect, no support for DPO-FUA */ in smsatModeSense6()
9706 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense6()
9710 RWErrorRecovery[4] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense6()
9722 * Fill-up Read-Write Error Recovery mode page, SAT, Table 66 in smsatModeSense6()
9748 Caching[0] = 0x20 - 1; /* 32 - 1 */ in smsatModeSense6()
9750 Caching[2] = 0x00; /* no write-protect, no support for DPO-FUA */ in smsatModeSense6()
9761 satIOContext->interruptContext); in smsatModeSense6()
9764 Caching[0] = MODE_SENSE6_CACHING_LEN - 1; in smsatModeSense6()
9766 Caching[2] = 0x00; /* no write-protect, no support for DPO-FUA */ in smsatModeSense6()
9769 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense6()
9773 Caching[4] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense6()
9785 * Fill-up Caching mode page, SAT, Table 67 in smsatModeSense6()
9790 if (pSatDevData->satWriteCacheEnabled == agTRUE) in smsatModeSense6()
9808 if (pSatDevData->satLookAheadEnabled == agTRUE) in smsatModeSense6()
9830 InfoExceptionCtrl[0] = MODE_SENSE6_INFORMATION_EXCEPTION_CONTROL_PAGE_LEN - 1; in smsatModeSense6()
9832 InfoExceptionCtrl[2] = 0x00; /* no write-protect, no support for DPO-FUA */ in smsatModeSense6()
9835 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense6()
9839 InfoExceptionCtrl[4] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense6()
9851 * Fill-up informational-exceptions control mode page, SAT, Table 68 in smsatModeSense6()
9855 if (pSatDevData->satSMARTEnabled == agTRUE) in smsatModeSense6()
9864 InfoExceptionCtrl[16] = 0x00; /* Interval timer vendor-specific */ in smsatModeSense6()
9868 InfoExceptionCtrl[20] = 0x00; /* REPORT-COUNT */ in smsatModeSense6()
9891 satIOContext->pSmSenseData, in smsatModeSense6()
9892 satIOContext->interruptContext ); in smsatModeSense6()
9906 allocationLen - lenRead, in smsatModeSense6()
9908 satIOContext->interruptContext ); in smsatModeSense6()
9921 satIOContext->interruptContext); in smsatModeSense6()
9954 pSense = satIOContext->pSense; in smsatModeSense10()
9955 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatModeSense10()
9956 pModeSense = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatModeSense10()
9957 pSatDevData = satIOContext->pSatDevData; in smsatModeSense10()
9961 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatModeSense10()
9975 satIOContext->pSmSenseData, in smsatModeSense10()
9976 satIOContext->interruptContext ); in smsatModeSense10()
9985 PC = (bit8)((scsiCmnd->cdb[2]) & SCSI_MODE_SENSE10_PC_MASK); in smsatModeSense10()
10000 satIOContext->pSmSenseData, in smsatModeSense10()
10001 satIOContext->interruptContext ); in smsatModeSense10()
10008 LLBAA = (bit8)((scsiCmnd->cdb[1]) & SCSI_MODE_SENSE10_LLBAA_MASK); in smsatModeSense10()
10011 page = (bit8)((scsiCmnd->cdb[2]) & SCSI_MODE_SENSE10_PAGE_CODE_MASK); in smsatModeSense10()
10012 SM_DBG5(("smsatModeSense10: page=0x%x, did %d\n", page, pSatDevData->id)); in smsatModeSense10()
10013 allocationLen = (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatModeSense10()
10014 allocationLen = MIN(allocationLen, scsiCmnd->expDataLength); in smsatModeSense10()
10017 Based on page code value, returns a corresponding mode page in smsatModeSense10()
10024 case MODESENSE_READ_WRITE_ERROR_RECOVERY_PAGE: /* Read-Write Error Recovery */ in smsatModeSense10()
10036 …BG1(("smsatModeSense10 *** ERROR *** not supported page 0x%x did %d!!!\n", page, pSatDevData->id)); in smsatModeSense10()
10048 satIOContext->pSmSenseData, in smsatModeSense10()
10049 satIOContext->interruptContext ); in smsatModeSense10()
10074 case MODESENSE_READ_WRITE_ERROR_RECOVERY_PAGE: /* Read-Write Error Recovery */ in smsatModeSense10()
10113 AllPages[1] = (bit8)(lenRead - 2); in smsatModeSense10()
10115 AllPages[3] = 0x00; /* device-specific param: no write-protect, no support for DPO-FUA */ in smsatModeSense10()
10137 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense10()
10143 AllPages[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10166 AllPages[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10203 * Fill-up Caching mode page, SAT, Table 67 in smsatModeSense10()
10208 if (pSatDevData->satWriteCacheEnabled == agTRUE) in smsatModeSense10()
10226 if (pSatDevData->satLookAheadEnabled == agTRUE) in smsatModeSense10()
10244 * Fill-up control mode page, SAT, Table 65 in smsatModeSense10()
10249 if (pSatDevData->satNCQ == agTRUE) in smsatModeSense10()
10263 AllPages[index+42] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense10()
10264 AllPages[index+43] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense10()
10268 * Fill-up informational-exceptions control mode page, SAT, Table 68 in smsatModeSense10()
10272 if (pSatDevData->satSMARTEnabled == agTRUE) in smsatModeSense10()
10281 AllPages[index+48] = 0x00; /* Interval timer vendor-specific */ in smsatModeSense10()
10285 AllPages[index+52] = 0x00; /* REPORT-COUNT */ in smsatModeSense10()
10296 Control[1] = (bit8)(lenRead - 2); in smsatModeSense10()
10298 Control[3] = 0x00; /* device-specific param: no write-protect, no support for DPO-FUA */ in smsatModeSense10()
10320 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense10()
10326 Control[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10349 Control[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10371 * Fill-up control mode page, SAT, Table 65 in smsatModeSense10()
10376 if (pSatDevData->satNCQ == agTRUE) in smsatModeSense10()
10390 Control[index+10] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense10()
10391 Control[index+11] = 0x00; /* we don't support non-000b value for the self-test code */ in smsatModeSense10()
10399 RWErrorRecovery[1] = (bit8)(lenRead - 2); in smsatModeSense10()
10401 RWErrorRecovery[3] = 0x00; /* device-specific param: no write-protect, no support for DPO-FUA */ in smsatModeSense10()
10423 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense10()
10429 RWErrorRecovery[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10452 RWErrorRecovery[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10474 * Fill-up Read-Write Error Recovery mode page, SAT, Table 66 in smsatModeSense10()
10495 Caching[1] = (bit8)(lenRead - 2); in smsatModeSense10()
10497 Caching[3] = 0x00; /* device-specific param: no write-protect, no support for DPO-FUA */ in smsatModeSense10()
10519 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense10()
10525 Caching[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10548 Caching[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10570 * Fill-up Caching mode page, SAT, Table 67 in smsatModeSense10()
10575 if (pSatDevData->satWriteCacheEnabled == agTRUE) in smsatModeSense10()
10593 if (pSatDevData->satLookAheadEnabled == agTRUE) in smsatModeSense10()
10615 InfoExceptionCtrl[1] = (bit8)(lenRead - 2); in smsatModeSense10()
10617 … InfoExceptionCtrl[3] = 0x00; /* device-specific param: no write-protect, no support for DPO-FUA */ in smsatModeSense10()
10639 * Fill-up direct-access device block-descriptor, SAT, Table 19 in smsatModeSense10()
10645 InfoExceptionCtrl[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10668 InfoExceptionCtrl[8] = 0x04; /* density-code : reserved for direct-access */ in smsatModeSense10()
10690 * Fill-up informational-exceptions control mode page, SAT, Table 68 in smsatModeSense10()
10694 if (pSatDevData->satSMARTEnabled == agTRUE) in smsatModeSense10()
10703 InfoExceptionCtrl[index+4] = 0x00; /* Interval timer vendor-specific */ in smsatModeSense10()
10707 InfoExceptionCtrl[index+8] = 0x00; /* REPORT-COUNT */ in smsatModeSense10()
10730 satIOContext->pSmSenseData, in smsatModeSense10()
10731 satIOContext->interruptContext ); in smsatModeSense10()
10744 allocationLen - lenRead, in smsatModeSense10()
10746 satIOContext->interruptContext ); in smsatModeSense10()
10759 satIOContext->interruptContext); in smsatModeSense10()
10786 pSense = satIOContext->pSense; in smsatReadCapacity10()
10787 pVirtAddr = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatReadCapacity10()
10788 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatReadCapacity10()
10789 pSatDevData = satIOContext->pSatDevData; in smsatReadCapacity10()
10790 pSATAIdData = &pSatDevData->satIdentifyData; in smsatReadCapacity10()
10791 allocationLen = scsiCmnd->expDataLength; in smsatReadCapacity10()
10797 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatReadCapacity10()
10811 satIOContext->pSmSenseData, in smsatReadCapacity10()
10812 satIOContext->interruptContext ); in smsatReadCapacity10()
10822 if ((scsiCmnd->cdb[2] || scsiCmnd->cdb[3] || scsiCmnd->cdb[4] || scsiCmnd->cdb[5])) in smsatReadCapacity10()
10825 pSatDevData->id)); in smsatReadCapacity10()
10839 satIOContext->pSmSenseData, in smsatReadCapacity10()
10840 satIOContext->interruptContext ); in smsatReadCapacity10()
10848 if ( ((scsiCmnd->cdb[8]) & SCSI_READ_CAPACITY10_PMI_MASK) != 0 ) in smsatReadCapacity10()
10851 pSatDevData->id)); in smsatReadCapacity10()
10865 satIOContext->pSmSenseData, in smsatReadCapacity10()
10866 satIOContext->interruptContext ); in smsatReadCapacity10()
10877 * If 48-bit addressing is supported, set capacity information from Identify in smsatReadCapacity10()
10878 * Device Word 100-103. in smsatReadCapacity10()
10880 if (pSatDevData->sat48BitSupport == agTRUE) in smsatReadCapacity10()
10884 * SBC-2 specifies that if the capacity exceeded the 4-byte RETURNED LOGICAL in smsatReadCapacity10()
10889 /* ATA Identify Device information word 100 - 103 */ in smsatReadCapacity10()
10890 if ( (pSATAIdData->maxLBA32_47 != 0 ) || (pSATAIdData->maxLBA48_63 != 0)) in smsatReadCapacity10()
10898 else /* Fit the Readcapacity10 4-bytes response length */ in smsatReadCapacity10()
10900 lastLba = (((pSATAIdData->maxLBA16_31) << 16) ) | in smsatReadCapacity10()
10901 (pSATAIdData->maxLBA0_15); in smsatReadCapacity10()
10902 lastLba = lastLba - 1; /* LBA starts from zero */ in smsatReadCapacity10()
10906 lastLba = lastLba - (512*10) - 1; in smsatReadCapacity10()
10925 * For 28-bit addressing, set capacity information from Identify in smsatReadCapacity10()
10926 * Device Word 60-61. in smsatReadCapacity10()
10930 /* ATA Identify Device information word 60 - 61 */ in smsatReadCapacity10()
10931 lastLba = (((pSATAIdData->numOfUserAddressableSectorsHi) << 16) ) | in smsatReadCapacity10()
10932 (pSATAIdData->numOfUserAddressableSectorsLo); in smsatReadCapacity10()
10933 lastLba = lastLba - 1; /* LBA starts from zero */ in smsatReadCapacity10()
10941 if (((pSATAIdData->word104_107[2]) & 0x1000) == 0) in smsatReadCapacity10()
10954 word118 = pSATAIdData->word112_126[6]; in smsatReadCapacity10()
10955 word117 = pSATAIdData->word112_126[5]; in smsatReadCapacity10()
10971 pSatDevData->satMaxLBA[0] = 0; /* MSB */ in smsatReadCapacity10()
10972 pSatDevData->satMaxLBA[1] = 0; in smsatReadCapacity10()
10973 pSatDevData->satMaxLBA[2] = 0; in smsatReadCapacity10()
10974 pSatDevData->satMaxLBA[3] = 0; in smsatReadCapacity10()
10975 pSatDevData->satMaxLBA[4] = dataBuffer[0]; in smsatReadCapacity10()
10976 pSatDevData->satMaxLBA[5] = dataBuffer[1]; in smsatReadCapacity10()
10977 pSatDevData->satMaxLBA[6] = dataBuffer[2]; in smsatReadCapacity10()
10978 pSatDevData->satMaxLBA[7] = dataBuffer[3]; /* LSB */ in smsatReadCapacity10()
10984 pSatDevData->id)); in smsatReadCapacity10()
10998 satIOContext->interruptContext); in smsatReadCapacity10()
11022 pSense = satIOContext->pSense; in smsatReadCapacity16()
11023 pVirtAddr = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatReadCapacity16()
11024 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatReadCapacity16()
11025 pSatDevData = satIOContext->pSatDevData; in smsatReadCapacity16()
11026 pSATAIdData = &pSatDevData->satIdentifyData; in smsatReadCapacity16()
11031 allocationLen = (((bit32)scsiCmnd->cdb[10]) << 24) | in smsatReadCapacity16()
11032 (((bit32)scsiCmnd->cdb[11]) << 16) | in smsatReadCapacity16()
11033 (((bit32)scsiCmnd->cdb[12]) << 8 ) | in smsatReadCapacity16()
11034 (((bit32)scsiCmnd->cdb[13]) ); in smsatReadCapacity16()
11035 allocationLen = MIN(allocationLen, scsiCmnd->expDataLength); in smsatReadCapacity16()
11054 satIOContext->pSmSenseData, in smsatReadCapacity16()
11055 satIOContext->interruptContext ); in smsatReadCapacity16()
11063 if ( (scsiCmnd->cdb[15] & SCSI_NACA_MASK) || (scsiCmnd->cdb[15] & SCSI_LINK_MASK) ) in smsatReadCapacity16()
11077 satIOContext->pSmSenseData, in smsatReadCapacity16()
11078 satIOContext->interruptContext ); in smsatReadCapacity16()
11087 if ((scsiCmnd->cdb[2] || scsiCmnd->cdb[3] || scsiCmnd->cdb[4] || scsiCmnd->cdb[5]) || in smsatReadCapacity16()
11088 (scsiCmnd->cdb[6] || scsiCmnd->cdb[7] || scsiCmnd->cdb[8] || scsiCmnd->cdb[9]) ) in smsatReadCapacity16()
11091 pSatDevData->id)); in smsatReadCapacity16()
11105 satIOContext->pSmSenseData, in smsatReadCapacity16()
11106 satIOContext->interruptContext ); in smsatReadCapacity16()
11114 if ( ((scsiCmnd->cdb[14]) & SCSI_READ_CAPACITY16_PMI_MASK) != 0 ) in smsatReadCapacity16()
11117 pSatDevData->id)); in smsatReadCapacity16()
11131 satIOContext->pSmSenseData, in smsatReadCapacity16()
11132 satIOContext->interruptContext ); in smsatReadCapacity16()
11142 * If 48-bit addressing is supported, set capacity information from Identify in smsatReadCapacity16()
11143 * Device Word 100-103. in smsatReadCapacity16()
11145 if (pSatDevData->sat48BitSupport == agTRUE) in smsatReadCapacity16()
11147 dataBuffer[0] = (bit8)(((pSATAIdData->maxLBA48_63) >> 8) & 0xff); /* MSB */ in smsatReadCapacity16()
11148 dataBuffer[1] = (bit8)((pSATAIdData->maxLBA48_63) & 0xff); in smsatReadCapacity16()
11149 dataBuffer[2] = (bit8)(((pSATAIdData->maxLBA32_47) >> 8) & 0xff); in smsatReadCapacity16()
11150 dataBuffer[3] = (bit8)((pSATAIdData->maxLBA32_47) & 0xff); in smsatReadCapacity16()
11152 lastLbaLo = (((pSATAIdData->maxLBA16_31) << 16) ) | (pSATAIdData->maxLBA0_15); in smsatReadCapacity16()
11153 lastLbaLo = lastLbaLo - 1; /* LBA starts from zero */ in smsatReadCapacity16()
11163 * For 28-bit addressing, set capacity information from Identify in smsatReadCapacity16()
11164 * Device Word 60-61. in smsatReadCapacity16()
11173 lastLbaLo = (((pSATAIdData->numOfUserAddressableSectorsHi) << 16) ) | in smsatReadCapacity16()
11174 (pSATAIdData->numOfUserAddressableSectorsLo); in smsatReadCapacity16()
11175 lastLbaLo = lastLbaLo - 1; /* LBA starts from zero */ in smsatReadCapacity16()
11194 pSatDevData->satMaxLBA[0] = dataBuffer[0]; /* MSB */ in smsatReadCapacity16()
11195 pSatDevData->satMaxLBA[1] = dataBuffer[1]; in smsatReadCapacity16()
11196 pSatDevData->satMaxLBA[2] = dataBuffer[2]; in smsatReadCapacity16()
11197 pSatDevData->satMaxLBA[3] = dataBuffer[3]; in smsatReadCapacity16()
11198 pSatDevData->satMaxLBA[4] = dataBuffer[4]; in smsatReadCapacity16()
11199 pSatDevData->satMaxLBA[5] = dataBuffer[5]; in smsatReadCapacity16()
11200 pSatDevData->satMaxLBA[6] = dataBuffer[6]; in smsatReadCapacity16()
11201 pSatDevData->satMaxLBA[7] = dataBuffer[7]; /* LSB */ in smsatReadCapacity16()
11207 pSatDevData->id)); in smsatReadCapacity16()
11231 allocationLen - readCapacityLen, in smsatReadCapacity16()
11233 satIOContext->interruptContext ); in smsatReadCapacity16()
11246 satIOContext->interruptContext); in smsatReadCapacity16()
11270 pSense = satIOContext->pSense; in smsatReportLun()
11272 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatReportLun()
11274 pSatDevData = satIOContext->pSatDevData; in smsatReportLun()
11279 allocationLen = (((bit32)scsiCmnd->cdb[6]) << 24) | in smsatReportLun()
11280 (((bit32)scsiCmnd->cdb[7]) << 16) | in smsatReportLun()
11281 (((bit32)scsiCmnd->cdb[8]) << 8 ) | in smsatReportLun()
11282 (((bit32)scsiCmnd->cdb[9]) ); in smsatReportLun()
11283 allocationLen = MIN(allocationLen, scsiCmnd->expDataLength); in smsatReportLun()
11288 reportLunLen, pSatDevData->id)); in smsatReportLun()
11299 satIOContext->pSmSenseData, in smsatReportLun()
11300 satIOContext->interruptContext ); in smsatReportLun()
11304 pReportLun->len[0] = 0; in smsatReportLun()
11305 pReportLun->len[1] = 0; in smsatReportLun()
11306 pReportLun->len[2] = 0; in smsatReportLun()
11307 pReportLun->len[3] = sizeof (tiLUN_t); in smsatReportLun()
11308 pReportLun->reserved = 0; in smsatReportLun()
11310 * - address method to 0x00: Peripheral device addressing method, in smsatReportLun()
11311 * - bus identifier to 0 in smsatReportLun()
11313 pReportLun->lunList[0].lun[0] = 0; in smsatReportLun()
11314 pReportLun->lunList[0].lun[1] = 0; in smsatReportLun()
11315 pReportLun->lunList[0].lun[2] = 0; in smsatReportLun()
11316 pReportLun->lunList[0].lun[3] = 0; in smsatReportLun()
11317 pReportLun->lunList[0].lun[4] = 0; in smsatReportLun()
11318 pReportLun->lunList[0].lun[5] = 0; in smsatReportLun()
11319 pReportLun->lunList[0].lun[6] = 0; in smsatReportLun()
11320 pReportLun->lunList[0].lun[7] = 0; in smsatReportLun()
11322 sm_memcpy(smScsiRequest->sglVirtualAddr, dataBuffer, MIN(allocationLen, reportLunLen)); in smsatReportLun()
11333 allocationLen - reportLunLen, in smsatReportLun()
11335 satIOContext->interruptContext ); in smsatReportLun()
11348 satIOContext->interruptContext); in smsatReportLun()
11364 satDevData->satFormatState will be agFalse since SAT does not actually sends in smsatFormatUnit()
11372 pSense = satIOContext->pSense; in smsatFormatUnit()
11373 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatFormatUnit()
11381 if ( ((scsiCmnd->cdb[1] & SCSI_FORMAT_UNIT_FMTDATA_MASK) == 0) || in smsatFormatUnit()
11382 ((scsiCmnd->cdb[1] & SCSI_FORMAT_UNIT_FMTDATA_MASK) && in smsatFormatUnit()
11383 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_DCRT_MASK)) in smsatFormatUnit()
11393 satIOContext->interruptContext); in smsatFormatUnit()
11402 if ( (((scsiCmnd->cdb[1] & SCSI_FORMAT_UNIT_DEFECT_LIST_FORMAT_MASK) == 0x00) || in smsatFormatUnit()
11403 ((scsiCmnd->cdb[1] & SCSI_FORMAT_UNIT_DEFECT_LIST_FORMAT_MASK) == 0x06)) ) in smsatFormatUnit()
11406 if ((scsiCmnd->cdb[2] & SCSI_FORMAT_UNIT_LONGLIST_MASK) == 0x00) in smsatFormatUnit()
11411 if ((scsiCmnd->cdb[2] & SCSI_FORMAT_UNIT_LONGLIST_MASK) == 0x01) in smsatFormatUnit()
11416 if ((scsiCmnd->cdb[index] != 0) || (scsiCmnd->cdb[index+1] != 0)) in smsatFormatUnit()
11430 satIOContext->pSmSenseData, in smsatFormatUnit()
11431 satIOContext->interruptContext ); in smsatFormatUnit()
11438 if ( (scsiCmnd->cdb[1] & SCSI_FORMAT_UNIT_FMTDATA_MASK) && in smsatFormatUnit()
11439 (scsiCmnd->cdb[1] & SCSI_FORMAT_UNIT_CMPLIST_MASK) ) in smsatFormatUnit()
11453 satIOContext->pSmSenseData, in smsatFormatUnit()
11454 satIOContext->interruptContext ); in smsatFormatUnit()
11461 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatFormatUnit()
11475 satIOContext->pSmSenseData, in smsatFormatUnit()
11476 satIOContext->interruptContext ); in smsatFormatUnit()
11483 if (scsiCmnd->cdb[1] & SCSI_FORMAT_UNIT_FMTDATA_MASK) in smsatFormatUnit()
11487 if ( (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IMMED_MASK) || in smsatFormatUnit()
11488 ( !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_FOV_MASK)) || in smsatFormatUnit()
11489 ( (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_FOV_MASK) && in smsatFormatUnit()
11490 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_DCRT_MASK) && in smsatFormatUnit()
11491 !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IP_MASK)) in smsatFormatUnit()
11501 satIOContext->interruptContext); in smsatFormatUnit()
11513 if ( ( !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IMMED_MASK) && in smsatFormatUnit()
11514 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_FOV_MASK) && in smsatFormatUnit()
11515 !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_DCRT_MASK) && in smsatFormatUnit()
11516 !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IP_MASK) ) in smsatFormatUnit()
11518 ( !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IMMED_MASK) && in smsatFormatUnit()
11519 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_FOV_MASK) && in smsatFormatUnit()
11520 !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_DCRT_MASK) && in smsatFormatUnit()
11521 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IP_MASK) ) in smsatFormatUnit()
11523 ( !(scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IMMED_MASK) && in smsatFormatUnit()
11524 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_FOV_MASK) && in smsatFormatUnit()
11525 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_DCRT_MASK) && in smsatFormatUnit()
11526 (scsiCmnd->cdb[7] & SCSI_FORMAT_UNIT_IP_MASK) ) in smsatFormatUnit()
11542 satIOContext->pSmSenseData, in smsatFormatUnit()
11543 satIOContext->interruptContext ); in smsatFormatUnit()
11562 satIOContext->interruptContext); in smsatFormatUnit()
11582 agsaFisRegHostToDevice_t *fis; in smsatSendDiagnostic() local
11585 pSense = satIOContext->pSense; in smsatSendDiagnostic()
11586 pSatDevData = satIOContext->pSatDevData; in smsatSendDiagnostic()
11587 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatSendDiagnostic()
11588 fis = satIOContext->pFis; in smsatSendDiagnostic()
11593 pSatDevData->satVerifyState = 0; in smsatSendDiagnostic()
11595 pSatDevData->satBGPendingDiag = agFALSE; in smsatSendDiagnostic()
11605 if ( (scsiCmnd->cdb[1] & SCSI_PF_MASK) || in smsatSendDiagnostic()
11606 (scsiCmnd->cdb[1] & SCSI_DEVOFFL_MASK) || in smsatSendDiagnostic()
11607 (scsiCmnd->cdb[1] & SCSI_UNITOFFL_MASK) || in smsatSendDiagnostic()
11608 ( (scsiCmnd->cdb[3] != 0) || (scsiCmnd->cdb[4] != 0) ) in smsatSendDiagnostic()
11623 satIOContext->pSmSenseData, in smsatSendDiagnostic()
11624 satIOContext->interruptContext ); in smsatSendDiagnostic()
11632 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatSendDiagnostic()
11646 satIOContext->pSmSenseData, in smsatSendDiagnostic()
11647 satIOContext->interruptContext ); in smsatSendDiagnostic()
11653 parmLen = (scsiCmnd->cdb[3] << 8) + scsiCmnd->cdb[4]; in smsatSendDiagnostic()
11658 if ( !(scsiCmnd->cdb[1] & SCSI_SEND_DIAGNOSTIC_SELFTEST_MASK) && in smsatSendDiagnostic()
11659 (pSatDevData->satSMARTSelfTest == agFALSE) in smsatSendDiagnostic()
11674 satIOContext->pSmSenseData, in smsatSendDiagnostic()
11675 satIOContext->interruptContext ); in smsatSendDiagnostic()
11682 if ( !(scsiCmnd->cdb[1] & SCSI_SEND_DIAGNOSTIC_SELFTEST_MASK) && in smsatSendDiagnostic()
11683 (pSatDevData->satSMARTSelfTest == agTRUE) && in smsatSendDiagnostic()
11684 (pSatDevData->satSMARTEnabled == agFALSE) in smsatSendDiagnostic()
11699 satIOContext->pSmSenseData, in smsatSendDiagnostic()
11700 satIOContext->interruptContext ); in smsatSendDiagnostic()
11718 if ( ((scsiCmnd->cdb[1] & SCSI_SEND_DIAGNOSTIC_SELFTEST_MASK) && in smsatSendDiagnostic()
11719 (pSatDevData->satSMARTSelfTest == agFALSE)) in smsatSendDiagnostic()
11721 ((scsiCmnd->cdb[1] & SCSI_SEND_DIAGNOSTIC_SELFTEST_MASK) && in smsatSendDiagnostic()
11722 (pSatDevData->satSMARTSelfTest == agTRUE) && in smsatSendDiagnostic()
11723 (pSatDevData->satSMARTEnabled == agFALSE)) in smsatSendDiagnostic()
11731 if (pSatDevData->sat48BitSupport == agTRUE) in smsatSendDiagnostic()
11734 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
11735 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
11736 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatSendDiagnostic()
11737 fis->h.features = 0; /* FIS reserve */ in smsatSendDiagnostic()
11738 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
11739 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
11740 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
11741 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatSendDiagnostic()
11742 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatSendDiagnostic()
11743 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatSendDiagnostic()
11744 fis->d.featuresExp = 0; /* FIS reserve */ in smsatSendDiagnostic()
11745 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
11746 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatSendDiagnostic()
11747 fis->d.reserved4 = 0; in smsatSendDiagnostic()
11748 fis->d.device = 0x40; /* 01000000 */ in smsatSendDiagnostic()
11749 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
11750 fis->d.reserved5 = 0; in smsatSendDiagnostic()
11757 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
11758 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
11759 fis->h.command = SAT_READ_VERIFY_SECTORS;/* 0x40 */ in smsatSendDiagnostic()
11760 fis->h.features = 0; /* FIS features NA */ in smsatSendDiagnostic()
11761 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
11762 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
11763 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
11764 fis->d.lbaLowExp = 0; in smsatSendDiagnostic()
11765 fis->d.lbaMidExp = 0; in smsatSendDiagnostic()
11766 fis->d.lbaHighExp = 0; in smsatSendDiagnostic()
11767 fis->d.featuresExp = 0; in smsatSendDiagnostic()
11768 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
11769 fis->d.sectorCountExp = 0; in smsatSendDiagnostic()
11770 fis->d.reserved4 = 0; in smsatSendDiagnostic()
11771 fis->d.device = 0x40; /* 01000000 */ in smsatSendDiagnostic()
11772 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
11773 fis->d.reserved5 = 0; in smsatSendDiagnostic()
11780 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic()
11783 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic()
11785 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic()
11798 if ( (scsiCmnd->cdb[1] & SCSI_SEND_DIAGNOSTIC_SELFTEST_MASK) && in smsatSendDiagnostic()
11799 (pSatDevData->satSMARTSelfTest == agTRUE) && in smsatSendDiagnostic()
11800 (pSatDevData->satSMARTEnabled == agTRUE) in smsatSendDiagnostic()
11803 /* sends SMART EXECUTE OFF-LINE IMMEDIATE */ in smsatSendDiagnostic()
11804 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
11805 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
11806 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatSendDiagnostic()
11807 fis->h.features = SAT_SMART_EXEUTE_OFF_LINE_IMMEDIATE; /* FIS features NA */ in smsatSendDiagnostic()
11808 fis->d.lbaLow = 0x81; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
11809 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
11810 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
11811 fis->d.lbaLowExp = 0; in smsatSendDiagnostic()
11812 fis->d.lbaMidExp = 0; in smsatSendDiagnostic()
11813 fis->d.lbaHighExp = 0; in smsatSendDiagnostic()
11814 fis->d.featuresExp = 0; in smsatSendDiagnostic()
11815 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
11816 fis->d.sectorCountExp = 0; in smsatSendDiagnostic()
11817 fis->d.reserved4 = 0; in smsatSendDiagnostic()
11818 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSendDiagnostic()
11819 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
11820 fis->d.reserved5 = 0; in smsatSendDiagnostic()
11826 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic()
11829 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic()
11831 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic()
11849 if ( !(scsiCmnd->cdb[1] & SCSI_SEND_DIAGNOSTIC_SELFTEST_MASK) && in smsatSendDiagnostic()
11850 (pSatDevData->satSMARTSelfTest == agTRUE) && in smsatSendDiagnostic()
11851 (pSatDevData->satSMARTEnabled == agTRUE) in smsatSendDiagnostic()
11855 /* finding self-test code */ in smsatSendDiagnostic()
11856 switch ((scsiCmnd->cdb[1] & SCSI_SEND_DIAGNOSTIC_TEST_CODE_MASK) >> 5) in smsatSendDiagnostic()
11859 pSatDevData->satBGPendingDiag = agTRUE; in smsatSendDiagnostic()
11866 satIOContext->interruptContext ); in smsatSendDiagnostic()
11867 /* sends SMART EXECUTE OFF-LINE IMMEDIATE */ in smsatSendDiagnostic()
11868 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
11869 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
11870 fis->h.command = SAT_SMART; /* 0x40 */ in smsatSendDiagnostic()
11871 fis->h.features = SAT_SMART_EXEUTE_OFF_LINE_IMMEDIATE; /* FIS features NA */ in smsatSendDiagnostic()
11872 fis->d.lbaLow = 0x01; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
11873 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
11874 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
11876 fis->d.lbaLowExp = 0; in smsatSendDiagnostic()
11877 fis->d.lbaMidExp = 0; in smsatSendDiagnostic()
11878 fis->d.lbaHighExp = 0; in smsatSendDiagnostic()
11879 fis->d.featuresExp = 0; in smsatSendDiagnostic()
11880 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
11881 fis->d.sectorCountExp = 0; in smsatSendDiagnostic()
11882 fis->d.reserved4 = 0; in smsatSendDiagnostic()
11883 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSendDiagnostic()
11884 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
11885 fis->d.reserved5 = 0; in smsatSendDiagnostic()
11891 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic()
11894 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic()
11896 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic()
11908 pSatDevData->satBGPendingDiag = agTRUE; in smsatSendDiagnostic()
11915 satIOContext->interruptContext ); in smsatSendDiagnostic()
11918 /* issuing SMART EXECUTE OFF-LINE IMMEDIATE */ in smsatSendDiagnostic()
11919 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
11920 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
11921 fis->h.command = SAT_SMART; /* 0x40 */ in smsatSendDiagnostic()
11922 fis->h.features = SAT_SMART_EXEUTE_OFF_LINE_IMMEDIATE; /* FIS features NA */ in smsatSendDiagnostic()
11923 fis->d.lbaLow = 0x02; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
11924 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
11925 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
11926 fis->d.lbaLowExp = 0; in smsatSendDiagnostic()
11927 fis->d.lbaMidExp = 0; in smsatSendDiagnostic()
11928 fis->d.lbaHighExp = 0; in smsatSendDiagnostic()
11929 fis->d.featuresExp = 0; in smsatSendDiagnostic()
11930 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
11931 fis->d.sectorCountExp = 0; in smsatSendDiagnostic()
11932 fis->d.reserved4 = 0; in smsatSendDiagnostic()
11933 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSendDiagnostic()
11934 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
11935 fis->d.reserved5 = 0; in smsatSendDiagnostic()
11941 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic()
11944 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic()
11946 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic()
11974 satIOContext->pSmSenseData, in smsatSendDiagnostic()
11975 satIOContext->interruptContext ); in smsatSendDiagnostic()
11980 if (pSatDevData->satBGPendingDiag == agTRUE) in smsatSendDiagnostic()
11982 /* sends SMART EXECUTE OFF-LINE IMMEDIATE abort */ in smsatSendDiagnostic()
11983 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
11984 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
11985 fis->h.command = SAT_SMART; /* 0x40 */ in smsatSendDiagnostic()
11986 fis->h.features = SAT_SMART_EXEUTE_OFF_LINE_IMMEDIATE; /* FIS features NA */ in smsatSendDiagnostic()
11987 fis->d.lbaLow = 0x7F; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
11988 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
11989 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
11991 fis->d.lbaLowExp = 0; in smsatSendDiagnostic()
11992 fis->d.lbaMidExp = 0; in smsatSendDiagnostic()
11993 fis->d.lbaHighExp = 0; in smsatSendDiagnostic()
11994 fis->d.featuresExp = 0; in smsatSendDiagnostic()
11995 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
11996 fis->d.sectorCountExp = 0; in smsatSendDiagnostic()
11997 fis->d.reserved4 = 0; in smsatSendDiagnostic()
11998 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSendDiagnostic()
11999 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
12000 fis->d.reserved5 = 0; in smsatSendDiagnostic()
12006 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic()
12009 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic()
12011 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic()
12039 satIOContext->pSmSenseData, in smsatSendDiagnostic()
12040 satIOContext->interruptContext ); in smsatSendDiagnostic()
12048 /* issuing SMART EXECUTE OFF-LINE IMMEDIATE */ in smsatSendDiagnostic()
12049 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
12050 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
12051 fis->h.command = SAT_SMART; /* 0x40 */ in smsatSendDiagnostic()
12052 fis->h.features = SAT_SMART_EXEUTE_OFF_LINE_IMMEDIATE; /* FIS features NA */ in smsatSendDiagnostic()
12053 fis->d.lbaLow = 0x81; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
12054 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
12055 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
12056 fis->d.lbaLowExp = 0; in smsatSendDiagnostic()
12057 fis->d.lbaMidExp = 0; in smsatSendDiagnostic()
12058 fis->d.lbaHighExp = 0; in smsatSendDiagnostic()
12059 fis->d.featuresExp = 0; in smsatSendDiagnostic()
12060 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
12061 fis->d.sectorCountExp = 0; in smsatSendDiagnostic()
12062 fis->d.reserved4 = 0; in smsatSendDiagnostic()
12063 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSendDiagnostic()
12064 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
12065 fis->d.reserved5 = 0; in smsatSendDiagnostic()
12071 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic()
12074 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic()
12076 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic()
12088 /* issuing SMART EXECUTE OFF-LINE IMMEDIATE */ in smsatSendDiagnostic()
12089 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic()
12090 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic()
12091 fis->h.command = SAT_SMART; /* 0x40 */ in smsatSendDiagnostic()
12092 fis->h.features = SAT_SMART_EXEUTE_OFF_LINE_IMMEDIATE; /* FIS features NA */ in smsatSendDiagnostic()
12093 fis->d.lbaLow = 0x82; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic()
12094 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic()
12095 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatSendDiagnostic()
12096 fis->d.lbaLowExp = 0; in smsatSendDiagnostic()
12097 fis->d.lbaMidExp = 0; in smsatSendDiagnostic()
12098 fis->d.lbaHighExp = 0; in smsatSendDiagnostic()
12099 fis->d.featuresExp = 0; in smsatSendDiagnostic()
12100 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSendDiagnostic()
12101 fis->d.sectorCountExp = 0; in smsatSendDiagnostic()
12102 fis->d.reserved4 = 0; in smsatSendDiagnostic()
12103 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSendDiagnostic()
12104 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic()
12105 fis->d.reserved5 = 0; in smsatSendDiagnostic()
12111 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic()
12114 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic()
12116 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic()
12134 /* returns the results of default self-testing, which is good */ in smsatSendDiagnostic()
12142 satIOContext->interruptContext ); in smsatSendDiagnostic()
12156 satIOContext->interruptContext ); in smsatSendDiagnostic()
12178 agsaFisRegHostToDevice_t *fis; in smsatStartStopUnit() local
12180 pSense = satIOContext->pSense; in smsatStartStopUnit()
12181 pSatDevData = satIOContext->pSatDevData; in smsatStartStopUnit()
12182 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatStartStopUnit()
12183 fis = satIOContext->pFis; in smsatStartStopUnit()
12189 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatStartStopUnit()
12203 satIOContext->pSmSenseData, in smsatStartStopUnit()
12204 satIOContext->interruptContext ); in smsatStartStopUnit()
12212 if ( !(scsiCmnd->cdb[4] & SCSI_START_MASK) && !(scsiCmnd->cdb[4] & SCSI_LOEJ_MASK) ) in smsatStartStopUnit()
12214 if ( (scsiCmnd->cdb[1] & SCSI_IMMED_MASK) ) in smsatStartStopUnit()
12224 satIOContext->interruptContext ); in smsatStartStopUnit()
12225 SM_DBG5(("smsatStartStopUnit: return table48 case 1-1\n")); in smsatStartStopUnit()
12229 if (pSatDevData->sat48BitSupport == agTRUE) in smsatStartStopUnit()
12232 fis->h.fisType = 0x27; /* Reg host to device */ in smsatStartStopUnit()
12233 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatStartStopUnit()
12235 fis->h.command = SAT_FLUSH_CACHE_EXT; /* 0xEA */ in smsatStartStopUnit()
12236 fis->h.features = 0; /* FIS reserve */ in smsatStartStopUnit()
12237 fis->d.featuresExp = 0; /* FIS reserve */ in smsatStartStopUnit()
12238 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatStartStopUnit()
12239 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatStartStopUnit()
12240 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatStartStopUnit()
12241 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatStartStopUnit()
12242 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatStartStopUnit()
12243 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatStartStopUnit()
12244 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatStartStopUnit()
12245 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatStartStopUnit()
12246 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatStartStopUnit()
12247 fis->d.control = 0; /* FIS HOB bit clear */ in smsatStartStopUnit()
12248 fis->d.reserved4 = 0; in smsatStartStopUnit()
12249 fis->d.reserved5 = 0; in smsatStartStopUnit()
12256 fis->h.fisType = 0x27; /* Reg host to device */ in smsatStartStopUnit()
12257 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatStartStopUnit()
12259 fis->h.command = SAT_FLUSH_CACHE; /* 0xE7 */ in smsatStartStopUnit()
12260 fis->h.features = 0; /* FIS features NA */ in smsatStartStopUnit()
12261 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatStartStopUnit()
12262 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatStartStopUnit()
12263 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatStartStopUnit()
12264 fis->d.lbaLowExp = 0; in smsatStartStopUnit()
12265 fis->d.lbaMidExp = 0; in smsatStartStopUnit()
12266 fis->d.lbaHighExp = 0; in smsatStartStopUnit()
12267 fis->d.featuresExp = 0; in smsatStartStopUnit()
12268 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatStartStopUnit()
12269 fis->d.sectorCountExp = 0; in smsatStartStopUnit()
12270 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatStartStopUnit()
12271 fis->d.control = 0; /* FIS HOB bit clear */ in smsatStartStopUnit()
12272 fis->d.reserved4 = 0; in smsatStartStopUnit()
12273 fis->d.reserved5 = 0; in smsatStartStopUnit()
12280 satIOContext->satCompleteCB = &smsatStartStopUnitCB; in smsatStartStopUnit()
12283 * Prepare SGL and send FIS to LL layer. in smsatStartStopUnit()
12285 satIOContext->reqType = agRequestType; /* Save it */ in smsatStartStopUnit()
12298 else if ( (scsiCmnd->cdb[4] & SCSI_START_MASK) && !(scsiCmnd->cdb[4] & SCSI_LOEJ_MASK) ) in smsatStartStopUnit()
12301 if ( (scsiCmnd->cdb[1] & SCSI_IMMED_MASK) ) in smsatStartStopUnit()
12310 satIOContext->interruptContext ); in smsatStartStopUnit()
12319 if (pSatDevData->sat48BitSupport == agTRUE) in smsatStartStopUnit()
12322 fis->h.fisType = 0x27; /* Reg host to device */ in smsatStartStopUnit()
12323 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatStartStopUnit()
12325 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatStartStopUnit()
12326 fis->h.features = 0; /* FIS reserve */ in smsatStartStopUnit()
12327 fis->d.lbaLow = 0x01; /* FIS LBA (7 :0 ) */ in smsatStartStopUnit()
12328 fis->d.lbaMid = 0x00; /* FIS LBA (15:8 ) */ in smsatStartStopUnit()
12329 fis->d.lbaHigh = 0x00; /* FIS LBA (23:16) */ in smsatStartStopUnit()
12330 fis->d.lbaLowExp = 0x00; /* FIS LBA (31:24) */ in smsatStartStopUnit()
12331 fis->d.lbaMidExp = 0x00; /* FIS LBA (39:32) */ in smsatStartStopUnit()
12332 fis->d.lbaHighExp = 0x00; /* FIS LBA (47:40) */ in smsatStartStopUnit()
12333 fis->d.featuresExp = 0; /* FIS reserve */ in smsatStartStopUnit()
12334 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatStartStopUnit()
12335 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatStartStopUnit()
12336 fis->d.reserved4 = 0; in smsatStartStopUnit()
12337 fis->d.device = 0x40; /* 01000000 */ in smsatStartStopUnit()
12338 fis->d.control = 0; /* FIS HOB bit clear */ in smsatStartStopUnit()
12339 fis->d.reserved5 = 0; in smsatStartStopUnit()
12345 fis->h.fisType = 0x27; /* Reg host to device */ in smsatStartStopUnit()
12346 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatStartStopUnit()
12348 fis->h.command = SAT_READ_VERIFY_SECTORS;/* 0x40 */ in smsatStartStopUnit()
12349 fis->h.features = 0; /* FIS features NA */ in smsatStartStopUnit()
12350 fis->d.lbaLow = 0x01; /* FIS LBA (7 :0 ) */ in smsatStartStopUnit()
12351 fis->d.lbaMid = 0x00; /* FIS LBA (15:8 ) */ in smsatStartStopUnit()
12352 fis->d.lbaHigh = 0x00; /* FIS LBA (23:16) */ in smsatStartStopUnit()
12353 fis->d.lbaLowExp = 0; in smsatStartStopUnit()
12354 fis->d.lbaMidExp = 0; in smsatStartStopUnit()
12355 fis->d.lbaHighExp = 0; in smsatStartStopUnit()
12356 fis->d.featuresExp = 0; in smsatStartStopUnit()
12357 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatStartStopUnit()
12358 fis->d.sectorCountExp = 0; in smsatStartStopUnit()
12359 fis->d.reserved4 = 0; in smsatStartStopUnit()
12360 fis->d.device = 0x40; /* 01000000 */ in smsatStartStopUnit()
12361 fis->d.control = 0; /* FIS HOB bit clear */ in smsatStartStopUnit()
12362 fis->d.reserved5 = 0; in smsatStartStopUnit()
12370 satIOContext->satCompleteCB = &smsatStartStopUnitCB; in smsatStartStopUnit()
12373 * Prepare SGL and send FIS to LL layer. in smsatStartStopUnit()
12375 satIOContext->reqType = agRequestType; /* Save it */ in smsatStartStopUnit()
12387 else if ( !(scsiCmnd->cdb[4] & SCSI_START_MASK) && (scsiCmnd->cdb[4] & SCSI_LOEJ_MASK) ) in smsatStartStopUnit()
12389 if(pSatDevData->satRemovableMedia && pSatDevData->satRemovableMediaEnabled) in smsatStartStopUnit()
12393 if ( (scsiCmnd->cdb[1] & SCSI_IMMED_MASK) ) in smsatStartStopUnit()
12402 satIOContext->interruptContext ); in smsatStartStopUnit()
12410 /* Media Eject fis */ in smsatStartStopUnit()
12411 fis->h.fisType = 0x27; /* Reg host to device */ in smsatStartStopUnit()
12412 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatStartStopUnit()
12414 fis->h.command = SAT_MEDIA_EJECT; /* 0xED */ in smsatStartStopUnit()
12415 fis->h.features = 0; /* FIS features NA */ in smsatStartStopUnit()
12416 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatStartStopUnit()
12417 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatStartStopUnit()
12418 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatStartStopUnit()
12419 fis->d.lbaLowExp = 0; in smsatStartStopUnit()
12420 fis->d.lbaMidExp = 0; in smsatStartStopUnit()
12421 fis->d.lbaHighExp = 0; in smsatStartStopUnit()
12422 fis->d.featuresExp = 0; in smsatStartStopUnit()
12424 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatStartStopUnit()
12425 fis->d.sectorCountExp = 0; in smsatStartStopUnit()
12426 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatStartStopUnit()
12427 fis->d.control = 0; /* FIS HOB bit clear */ in smsatStartStopUnit()
12428 fis->d.reserved4 = 0; in smsatStartStopUnit()
12429 fis->d.reserved5 = 0; in smsatStartStopUnit()
12435 satIOContext->satCompleteCB = &smsatStartStopUnitCB; in smsatStartStopUnit()
12438 * Prepare SGL and send FIS to LL layer. in smsatStartStopUnit()
12440 satIOContext->reqType = agRequestType; /* Save it */ in smsatStartStopUnit()
12465 satIOContext->pSmSenseData, in smsatStartStopUnit()
12466 satIOContext->interruptContext ); in smsatStartStopUnit()
12474 else /* ( (scsiCmnd->cdb[4] & SCSI_START_MASK) && (scsiCmnd->cdb[4] & SCSI_LOEJ_MASK) ) */ in smsatStartStopUnit()
12488 satIOContext->pSmSenseData, in smsatStartStopUnit()
12489 satIOContext->interruptContext ); in smsatStartStopUnit()
12511 agsaFisRegHostToDevice_t *fis; in smsatWriteSame10() local
12515 pSense = satIOContext->pSense; in smsatWriteSame10()
12516 pSatDevData = satIOContext->pSatDevData; in smsatWriteSame10()
12517 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWriteSame10()
12518 fis = satIOContext->pFis; in smsatWriteSame10()
12524 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatWriteSame10()
12538 satIOContext->pSmSenseData, in smsatWriteSame10()
12539 satIOContext->interruptContext ); in smsatWriteSame10()
12548 if ( !(scsiCmnd->cdb[1] & SCSI_WRITE_SAME_LBDATA_MASK) && in smsatWriteSame10()
12549 !(scsiCmnd->cdb[1] & SCSI_WRITE_SAME_PBDATA_MASK)) in smsatWriteSame10()
12558 if ( pSatDevData->sat48BitSupport != agTRUE ) in smsatWriteSame10()
12562 -> problem in transfer length. Therefore, return check condition in smsatWriteSame10()
12576 satIOContext->pSmSenseData, in smsatWriteSame10()
12577 satIOContext->interruptContext ); in smsatWriteSame10()
12584 lba = (scsiCmnd->cdb[2] << (8*3)) + (scsiCmnd->cdb[3] << (8*2)) in smsatWriteSame10()
12585 + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatWriteSame10()
12586 tl = (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatWriteSame10()
12596 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWriteSame10()
12599 if (pSatDevData->satNCQ != agTRUE && in smsatWriteSame10()
12600 pSatDevData->sat48BitSupport != agTRUE in smsatWriteSame10()
12603 if (lba > SAT_TR_LBA_LIMIT - 1) /* SAT_TR_LBA_LIMIT is 2^28, 0x10000000 */ in smsatWriteSame10()
12617 satIOContext->pSmSenseData, in smsatWriteSame10()
12618 satIOContext->interruptContext ); in smsatWriteSame10()
12628 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteSame10()
12633 SM_DBG1(("smsatWriteSame10: case 1-2 !!! error due to writesame10!!!\n")); in smsatWriteSame10()
12646 satIOContext->pSmSenseData, in smsatWriteSame10()
12647 satIOContext->interruptContext ); in smsatWriteSame10()
12656 SM_DBG1(("smsatWriteSame10: case 1-1 !!! error due to writesame10!!!\n")); in smsatWriteSame10()
12669 satIOContext->pSmSenseData, in smsatWriteSame10()
12670 satIOContext->interruptContext ); in smsatWriteSame10()
12676 if (pSatDevData->sat48BitSupport == agTRUE) in smsatWriteSame10()
12678 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteSame10()
12683 SM_DBG5(("smsatWriteSame10: case 1-3\n")); in smsatWriteSame10()
12684 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteSame10()
12685 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteSame10()
12687 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWriteSame10()
12689 fis->h.features = 0; /* FIS reserve */ in smsatWriteSame10()
12690 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteSame10()
12691 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteSame10()
12692 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteSame10()
12693 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteSame10()
12694 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteSame10()
12695 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteSame10()
12696 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteSame10()
12697 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteSame10()
12702 pSatDevData->satMaxUserAddrSectors should be 0x0FFFFFFF in smsatWriteSame10()
12703 and allowed value is 0x0FFFFFFF - 1 in smsatWriteSame10()
12705 if (pSatDevData->satMaxUserAddrSectors > 0x0FFFFFFF) in smsatWriteSame10()
12720 satIOContext->pSmSenseData, in smsatWriteSame10()
12721 satIOContext->interruptContext ); in smsatWriteSame10()
12726 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatWriteSame10()
12727 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatWriteSame10()
12728 fis->d.reserved4 = 0; in smsatWriteSame10()
12729 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteSame10()
12730 fis->d.reserved5 = 0; in smsatWriteSame10()
12739 SM_DBG5(("smsatWriteSame10: case 1-4\n")); in smsatWriteSame10()
12740 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteSame10()
12741 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteSame10()
12743 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWriteSame10()
12744 fis->h.features = 0; /* FIS reserve */ in smsatWriteSame10()
12745 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteSame10()
12746 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteSame10()
12747 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteSame10()
12748 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteSame10()
12749 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteSame10()
12750 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteSame10()
12751 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteSame10()
12752 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteSame10()
12757 pSatDevData->satMaxUserAddrSectors should be 0x0FFFFFFF in smsatWriteSame10()
12758 and allowed value is 0x0FFFFFFF - 1 in smsatWriteSame10()
12760 if (pSatDevData->satMaxUserAddrSectors > 0x0FFFFFFF) in smsatWriteSame10()
12775 satIOContext->pSmSenseData, in smsatWriteSame10()
12776 satIOContext->interruptContext ); in smsatWriteSame10()
12781 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatWriteSame10()
12782 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatWriteSame10()
12783 fis->d.reserved4 = 0; in smsatWriteSame10()
12784 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteSame10()
12785 fis->d.reserved5 = 0; in smsatWriteSame10()
12792 if (pSatDevData->satNCQ == agTRUE) in smsatWriteSame10()
12795 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWriteSame10()
12797 SM_DBG1(("smsatWriteSame10: case 1-5 !!! error NCQ but 28 bit address support!!!\n")); in smsatWriteSame10()
12810 satIOContext->pSmSenseData, in smsatWriteSame10()
12811 satIOContext->interruptContext ); in smsatWriteSame10()
12814 SM_DBG5(("smsatWriteSame10: case 1-5\n")); in smsatWriteSame10()
12816 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWriteSame10()
12818 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteSame10()
12819 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteSame10()
12820 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWriteSame10()
12826 pSatDevData->satMaxUserAddrSectors should be 0x0FFFFFFF in smsatWriteSame10()
12827 and allowed value is 0x0FFFFFFF - 1 in smsatWriteSame10()
12829 if (pSatDevData->satMaxUserAddrSectors > 0x0FFFFFFF) in smsatWriteSame10()
12844 satIOContext->pSmSenseData, in smsatWriteSame10()
12845 satIOContext->interruptContext ); in smsatWriteSame10()
12850 fis->h.features = 1; /* FIS sector count (7:0) */ in smsatWriteSame10()
12851 fis->d.featuresExp = 0; /* FIS sector count (15:8) */ in smsatWriteSame10()
12854 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteSame10()
12855 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteSame10()
12856 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteSame10()
12859 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWriteSame10()
12861 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteSame10()
12862 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteSame10()
12863 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteSame10()
12864 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWriteSame10()
12865 fis->d.sectorCountExp = 0; in smsatWriteSame10()
12866 fis->d.reserved4 = 0; in smsatWriteSame10()
12867 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteSame10()
12868 fis->d.reserved5 = 0; in smsatWriteSame10()
12874 satIOContext->satCompleteCB = &smsatWriteSame10CB; in smsatWriteSame10()
12877 * Prepare SGL and send FIS to LL layer. in smsatWriteSame10()
12879 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteSame10()
12890 else if ( !(scsiCmnd->cdb[1] & SCSI_WRITE_SAME_LBDATA_MASK) && in smsatWriteSame10()
12891 (scsiCmnd->cdb[1] & SCSI_WRITE_SAME_PBDATA_MASK)) in smsatWriteSame10()
12906 satIOContext->pSmSenseData, in smsatWriteSame10()
12907 satIOContext->interruptContext ); in smsatWriteSame10()
12912 else if ( (scsiCmnd->cdb[1] & SCSI_WRITE_SAME_LBDATA_MASK) && in smsatWriteSame10()
12913 !(scsiCmnd->cdb[1] & SCSI_WRITE_SAME_PBDATA_MASK)) in smsatWriteSame10()
12918 else /* ( (scsiCmnd->cdb[1] & SCSI_WRITE_SAME_LBDATA_MASK) && in smsatWriteSame10()
12919 (scsiCmnd->cdb[1] & SCSI_WRITE_SAME_PBDATA_MASK)) */ in smsatWriteSame10()
12935 satIOContext->pSmSenseData, in smsatWriteSame10()
12936 satIOContext->interruptContext ); in smsatWriteSame10()
12957 pSense = satIOContext->pSense; in smsatWriteSame16()
12971 smIORequest, /* == &satIntIo->satOrgSmIORequest */ in smsatWriteSame16()
12974 satIOContext->pSmSenseData, in smsatWriteSame16()
12975 satIOContext->interruptContext ); in smsatWriteSame16()
12994 agsaFisRegHostToDevice_t *fis; in smsatLogSense() local
13001 pSense = satIOContext->pSense; in smsatLogSense()
13002 pSatDevData = satIOContext->pSatDevData; in smsatLogSense()
13003 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatLogSense()
13004 fis = satIOContext->pFis; in smsatLogSense()
13005 pLogPage = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatLogSense()
13012 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatLogSense()
13026 satIOContext->pSmSenseData, in smsatLogSense()
13027 satIOContext->interruptContext ); in smsatLogSense()
13034 AllocLen = ((scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]); in smsatLogSense()
13035 AllocLen = MIN(AllocLen, scsiCmnd->expDataLength); in smsatLogSense()
13044 switch (scsiCmnd->cdb[2] & SCSI_LOG_SENSE_PAGE_CODE_MASK) in smsatLogSense()
13049 if (pSatDevData->satSMARTFeatureSet == agTRUE) in smsatLogSense()
13053 if (pSatDevData->satSMARTSelfTest == agTRUE) in smsatLogSense()
13055 /* add Self-Test results log page */ in smsatLogSense()
13061 /* only supported, no informational exception log, no Self-Test results log page */ in smsatLogSense()
13095 /* page length = SELFTEST_RESULTS_LOG_PAGE_LENGTH - 1 - 3 = 400 = 0x190 */ in smsatLogSense()
13107 AllLogPages[3] = INFORMATION_EXCEPTIONS_LOG_PAGE_LENGTH - 1 - 3; /* page length */ in smsatLogSense()
13111 …SM_DBG1(("smsatLogSense: default Page Code 0x%x!!!\n", scsiCmnd->cdb[2] & SCSI_LOG_SENSE_PAGE_CODE… in smsatLogSense()
13124 satIOContext->pSmSenseData, in smsatLogSense()
13125 satIOContext->interruptContext ); in smsatLogSense()
13135 satIOContext->interruptContext); in smsatLogSense()
13142 switch (scsiCmnd->cdb[2] & SCSI_LOG_SENSE_PAGE_CODE_MASK) in smsatLogSense()
13147 if (pSatDevData->satSMARTFeatureSet == agTRUE) in smsatLogSense()
13151 if (pSatDevData->satSMARTSelfTest == agTRUE) in smsatLogSense()
13153 /* add Self-Test results log page */ in smsatLogSense()
13159 /* only supported, no informational exception log, no Self-Test results log page */ in smsatLogSense()
13197 /* SPC-4, 4.3.4.6, p28 */ in smsatLogSense()
13206 AllocLen - lenRead, in smsatLogSense()
13208 satIOContext->interruptContext ); in smsatLogSense()
13218 satIOContext->interruptContext); in smsatLogSense()
13223 /* checking SMART self-test */ in smsatLogSense()
13224 if (pSatDevData->satSMARTSelfTest == agFALSE) in smsatLogSense()
13239 satIOContext->pSmSenseData, in smsatLogSense()
13240 satIOContext->interruptContext ); in smsatLogSense()
13245 if (pSatDevData->satSMARTEnabled == agFALSE) in smsatLogSense()
13263 if ( pSatDevData->sat48BitSupport == agTRUE ) in smsatLogSense()
13265 SM_DBG5(("smsatLogSense: case 2-1 sends READ LOG EXT\n")); in smsatLogSense()
13279 SM_DBG5(("smsatLogSense: case 2-2 sends SMART READ LOG\n")); in smsatLogSense()
13297 if (pSatDevData->satSMARTFeatureSet == agFALSE) in smsatLogSense()
13311 satIOContext->pSmSenseData, in smsatLogSense()
13312 satIOContext->interruptContext ); in smsatLogSense()
13317 if (pSatDevData->satSMARTEnabled == agFALSE) in smsatLogSense()
13331 satIOContext->pSmSenseData, in smsatLogSense()
13332 satIOContext->interruptContext ); in smsatLogSense()
13340 fis->h.fisType = 0x27; /* Reg host to device */ in smsatLogSense()
13341 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatLogSense()
13343 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatLogSense()
13344 fis->h.features = SAT_SMART_RETURN_STATUS;/* FIS features */ in smsatLogSense()
13345 fis->d.featuresExp = 0; /* FIS reserve */ in smsatLogSense()
13346 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatLogSense()
13347 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatLogSense()
13348 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatLogSense()
13349 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatLogSense()
13350 fis->d.lbaMid = 0x4F; /* FIS LBA (15:8 ) */ in smsatLogSense()
13351 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatLogSense()
13352 fis->d.lbaHigh = 0xC2; /* FIS LBA (23:16) */ in smsatLogSense()
13353 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatLogSense()
13354 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatLogSense()
13355 fis->d.control = 0; /* FIS HOB bit clear */ in smsatLogSense()
13356 fis->d.reserved4 = 0; in smsatLogSense()
13357 fis->d.reserved5 = 0; in smsatLogSense()
13362 satIOContext->satCompleteCB = &smsatLogSenseCB; in smsatLogSense()
13365 * Prepare SGL and send FIS to LL layer. in smsatLogSense()
13367 satIOContext->reqType = agRequestType; /* Save it */ in smsatLogSense()
13381 …SM_DBG1(("smsatLogSense: default Page Code 0x%x!!!\n", scsiCmnd->cdb[2] & SCSI_LOG_SENSE_PAGE_CODE… in smsatLogSense()
13394 satIOContext->pSmSenseData, in smsatLogSense()
13395 satIOContext->interruptContext ); in smsatLogSense()
13422 pSatDevData = satIOContext->pSatDevData; in smsatLogSenseAllocate()
13440 satIOContext->interruptContext ); in smsatLogSenseAllocate()
13446 satIntIo->satOrgSmIORequest = smIORequest; in smsatLogSenseAllocate()
13447 smIORequestBody = (smIORequestBody_t *)satIntIo->satIntRequestBody; in smsatLogSenseAllocate()
13448 satIOContext2 = &(smIORequestBody->transport.SATA.satIOContext); in smsatLogSenseAllocate()
13450 satIOContext2->pSatDevData = pSatDevData; in smsatLogSenseAllocate()
13451 …satIOContext2->pFis = &(smIORequestBody->transport.SATA.agSATARequestBody.fis.fisRegHostT… in smsatLogSenseAllocate()
13452 satIOContext2->pScsiCmnd = &(satIntIo->satIntSmScsiXchg.scsiCmnd); in smsatLogSenseAllocate()
13453 satIOContext2->pSense = &(smIORequestBody->transport.SATA.sensePayload); in smsatLogSenseAllocate()
13454 satIOContext2->pSmSenseData = &(smIORequestBody->transport.SATA.smSenseData); in smsatLogSenseAllocate()
13455 satIOContext2->pSmSenseData->senseData = satIOContext2->pSense; in smsatLogSenseAllocate()
13456 satIOContext2->smRequestBody = satIntIo->satIntRequestBody; in smsatLogSenseAllocate()
13457 satIOContext2->interruptContext = satIOContext->interruptContext; in smsatLogSenseAllocate()
13458 satIOContext2->satIntIoContext = satIntIo; in smsatLogSenseAllocate()
13459 satIOContext2->psmDeviceHandle = smDeviceHandle; in smsatLogSenseAllocate()
13460 satIOContext2->satOrgIOContext = satIOContext; in smsatLogSenseAllocate()
13466 &(satIntIo->satIntSmIORequest), in smsatLogSenseAllocate()
13468 &(satIntIo->satIntSmScsiXchg), in smsatLogSenseAllocate()
13475 &(satIntIo->satIntSmIORequest), in smsatLogSenseAllocate()
13477 &(satIntIo->satIntSmScsiXchg), in smsatLogSenseAllocate()
13485 &(satIntIo->satIntSmIORequest), in smsatLogSenseAllocate()
13487 &(satIntIo->satIntSmScsiXchg), in smsatLogSenseAllocate()
13504 satIOContext->interruptContext ); in smsatLogSenseAllocate()
13523 agsaFisRegHostToDevice_t *fis; in smsatSMARTEnable() local
13525 fis = satIOContext->pFis; in smsatSMARTEnable()
13530 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSMARTEnable()
13531 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSMARTEnable()
13532 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatSMARTEnable()
13533 fis->h.features = SAT_SMART_ENABLE_OPERATIONS; in smsatSMARTEnable()
13534 fis->d.lbaLow = 0; in smsatSMARTEnable()
13535 fis->d.lbaMid = 0x4F; in smsatSMARTEnable()
13536 fis->d.lbaHigh = 0xC2; in smsatSMARTEnable()
13537 fis->d.device = 0; in smsatSMARTEnable()
13538 fis->d.lbaLowExp = 0; in smsatSMARTEnable()
13539 fis->d.lbaMidExp = 0; in smsatSMARTEnable()
13540 fis->d.lbaHighExp = 0; in smsatSMARTEnable()
13541 fis->d.featuresExp = 0; in smsatSMARTEnable()
13542 fis->d.sectorCount = 0; in smsatSMARTEnable()
13543 fis->d.sectorCountExp = 0; in smsatSMARTEnable()
13544 fis->d.reserved4 = 0; in smsatSMARTEnable()
13545 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSMARTEnable()
13546 fis->d.reserved5 = 0; in smsatSMARTEnable()
13552 satIOContext->satCompleteCB = &smsatSMARTEnableCB; in smsatSMARTEnable()
13555 * Prepare SGL and send FIS to LL layer. in smsatSMARTEnable()
13557 satIOContext->reqType = agRequestType; /* Save it */ in smsatSMARTEnable()
13580 agsaFisRegHostToDevice_t *fis; in smsatLogSense_2() local
13582 fis = satIOContext->pFis; in smsatLogSense_2()
13586 fis->h.fisType = 0x27; /* Reg host to device */ in smsatLogSense_2()
13587 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatLogSense_2()
13589 fis->h.command = SAT_READ_LOG_EXT; /* 0x2F */ in smsatLogSense_2()
13590 fis->h.features = 0; /* FIS reserve */ in smsatLogSense_2()
13591 fis->d.lbaLow = 0x07; /* 0x07 */ in smsatLogSense_2()
13592 fis->d.lbaMid = 0; /* */ in smsatLogSense_2()
13593 fis->d.lbaHigh = 0; /* */ in smsatLogSense_2()
13594 fis->d.device = 0; /* */ in smsatLogSense_2()
13595 fis->d.lbaLowExp = 0; /* */ in smsatLogSense_2()
13596 fis->d.lbaMidExp = 0; /* */ in smsatLogSense_2()
13597 fis->d.lbaHighExp = 0; /* */ in smsatLogSense_2()
13598 fis->d.featuresExp = 0; /* FIS reserve */ in smsatLogSense_2()
13599 fis->d.sectorCount = 0x01; /* 1 sector counts */ in smsatLogSense_2()
13600 fis->d.sectorCountExp = 0x00; /* 1 sector counts */ in smsatLogSense_2()
13601 fis->d.reserved4 = 0; in smsatLogSense_2()
13602 fis->d.control = 0; /* FIS HOB bit clear */ in smsatLogSense_2()
13603 fis->d.reserved5 = 0; in smsatLogSense_2()
13609 satIOContext->satCompleteCB = &smsatLogSenseCB; in smsatLogSense_2()
13612 * Prepare SGL and send FIS to LL layer. in smsatLogSense_2()
13614 satIOContext->reqType = agRequestType; /* Save it */ in smsatLogSense_2()
13635 agsaFisRegHostToDevice_t *fis; in smsatLogSense_3() local
13637 fis = satIOContext->pFis; in smsatLogSense_3()
13640 fis->h.fisType = 0x27; /* Reg host to device */ in smsatLogSense_3()
13641 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatLogSense_3()
13642 fis->h.command = SAT_SMART; /* 0x2F */ in smsatLogSense_3()
13643 fis->h.features = SAT_SMART_READ_LOG; /* 0xd5 */ in smsatLogSense_3()
13644 fis->d.lbaLow = 0x06; /* 0x06 */ in smsatLogSense_3()
13645 fis->d.lbaMid = 0x4F; /* 0x4f */ in smsatLogSense_3()
13646 fis->d.lbaHigh = 0xC2; /* 0xc2 */ in smsatLogSense_3()
13647 fis->d.device = 0; /* */ in smsatLogSense_3()
13648 fis->d.lbaLowExp = 0; /* */ in smsatLogSense_3()
13649 fis->d.lbaMidExp = 0; /* */ in smsatLogSense_3()
13650 fis->d.lbaHighExp = 0; /* */ in smsatLogSense_3()
13651 fis->d.featuresExp = 0; /* FIS reserve */ in smsatLogSense_3()
13652 fis->d.sectorCount = 0x01; /* 1 sector counts */ in smsatLogSense_3()
13653 fis->d.sectorCountExp = 0x00; /* 1 sector counts */ in smsatLogSense_3()
13654 fis->d.reserved4 = 0; in smsatLogSense_3()
13655 fis->d.control = 0; /* FIS HOB bit clear */ in smsatLogSense_3()
13656 fis->d.reserved5 = 0; in smsatLogSense_3()
13660 satIOContext->satCompleteCB = &smsatLogSenseCB; in smsatLogSense_3()
13662 * Prepare SGL and send FIS to LL layer. in smsatLogSense_3()
13664 satIOContext->reqType = agRequestType; /* Save it */ in smsatLogSense_3()
13688 agsaFisRegHostToDevice_t *fis; in smsatModeSelect6() local
13695 pSense = satIOContext->pSense; in smsatModeSelect6()
13696 pSatDevData = satIOContext->pSatDevData; in smsatModeSelect6()
13697 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatModeSelect6()
13698 fis = satIOContext->pFis; in smsatModeSelect6()
13699 pLogPage = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatModeSelect6()
13705 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatModeSelect6()
13719 satIOContext->pSmSenseData, in smsatModeSelect6()
13720 satIOContext->interruptContext ); in smsatModeSelect6()
13727 if ( !(scsiCmnd->cdb[1] & SCSI_MODE_SELECT6_PF_MASK)) in smsatModeSelect6()
13741 satIOContext->pSmSenseData, in smsatModeSelect6()
13742 satIOContext->interruptContext ); in smsatModeSelect6()
13748 parameterListLen = scsiCmnd->cdb[4]; in smsatModeSelect6()
13749 parameterListLen = MIN(parameterListLen, scsiCmnd->expDataLength); in smsatModeSelect6()
13757 satIOContext->interruptContext); in smsatModeSelect6()
13780 satIOContext->interruptContext); in smsatModeSelect6()
13799 satIOContext->pSmSenseData, in smsatModeSelect6()
13800 satIOContext->interruptContext ); in smsatModeSelect6()
13813 (pSatDevData->satNCQ == agTRUE && pLogPage[StartingIndex+3] != 0x12) || in smsatModeSelect6()
13814 (pSatDevData->satNCQ == agFALSE && pLogPage[StartingIndex+3] != 0x02) || in smsatModeSelect6()
13846 satIOContext->pSmSenseData, in smsatModeSelect6()
13847 satIOContext->interruptContext ); in smsatModeSelect6()
13860 satIOContext->interruptContext); in smsatModeSelect6()
13865 SM_DBG1(("smsatModeSelect6: Read-Write Error Recovery mode page!!!\n")); in smsatModeSelect6()
13891 satIOContext->pSmSenseData, in smsatModeSelect6()
13892 satIOContext->interruptContext ); in smsatModeSelect6()
13905 satIOContext->interruptContext); in smsatModeSelect6()
13944 satIOContext->pSmSenseData, in smsatModeSelect6()
13945 satIOContext->interruptContext ); in smsatModeSelect6()
13951 /* sends ATA SET FEATURES based on WCE bit */ in smsatModeSelect6()
13956 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect6()
13957 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect6()
13959 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatModeSelect6()
13960 fis->h.features = 0x82; /* disable write cache */ in smsatModeSelect6()
13961 fis->d.lbaLow = 0; /* */ in smsatModeSelect6()
13962 fis->d.lbaMid = 0; /* */ in smsatModeSelect6()
13963 fis->d.lbaHigh = 0; /* */ in smsatModeSelect6()
13964 fis->d.device = 0; /* */ in smsatModeSelect6()
13965 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect6()
13966 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect6()
13967 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect6()
13968 fis->d.featuresExp = 0; /* */ in smsatModeSelect6()
13969 fis->d.sectorCount = 0; /* */ in smsatModeSelect6()
13970 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect6()
13971 fis->d.reserved4 = 0; in smsatModeSelect6()
13972 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect6()
13973 fis->d.reserved5 = 0; in smsatModeSelect6()
13979 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect6()
13982 * Prepare SGL and send FIS to LL layer. in smsatModeSelect6()
13984 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect6()
13997 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect6()
13998 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect6()
14000 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatModeSelect6()
14001 fis->h.features = 0x02; /* enable write cache */ in smsatModeSelect6()
14002 fis->d.lbaLow = 0; /* */ in smsatModeSelect6()
14003 fis->d.lbaMid = 0; /* */ in smsatModeSelect6()
14004 fis->d.lbaHigh = 0; /* */ in smsatModeSelect6()
14005 fis->d.device = 0; /* */ in smsatModeSelect6()
14006 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect6()
14007 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect6()
14008 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect6()
14009 fis->d.featuresExp = 0; /* */ in smsatModeSelect6()
14010 fis->d.sectorCount = 0; /* */ in smsatModeSelect6()
14011 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect6()
14012 fis->d.reserved4 = 0; in smsatModeSelect6()
14013 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect6()
14014 fis->d.reserved5 = 0; in smsatModeSelect6()
14020 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect6()
14023 * Prepare SGL and send FIS to LL layer. in smsatModeSelect6()
14025 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect6()
14058 satIOContext->pSmSenseData, in smsatModeSelect6()
14059 satIOContext->interruptContext ); in smsatModeSelect6()
14064 /* sends either ATA SMART ENABLE/DISABLE OPERATIONS based on DEXCPT bit */ in smsatModeSelect6()
14069 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect6()
14070 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect6()
14072 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatModeSelect6()
14073 fis->h.features = SAT_SMART_ENABLE_OPERATIONS; /* enable */ in smsatModeSelect6()
14074 fis->d.lbaLow = 0; /* */ in smsatModeSelect6()
14075 fis->d.lbaMid = 0x4F; /* 0x4F */ in smsatModeSelect6()
14076 fis->d.lbaHigh = 0xC2; /* 0xC2 */ in smsatModeSelect6()
14077 fis->d.device = 0; /* */ in smsatModeSelect6()
14078 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect6()
14079 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect6()
14080 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect6()
14081 fis->d.featuresExp = 0; /* */ in smsatModeSelect6()
14082 fis->d.sectorCount = 0; /* */ in smsatModeSelect6()
14083 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect6()
14084 fis->d.reserved4 = 0; in smsatModeSelect6()
14085 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect6()
14086 fis->d.reserved5 = 0; in smsatModeSelect6()
14092 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect6()
14095 * Prepare SGL and send FIS to LL layer. in smsatModeSelect6()
14097 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect6()
14110 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect6()
14111 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect6()
14113 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatModeSelect6()
14114 fis->h.features = SAT_SMART_DISABLE_OPERATIONS; /* disable */ in smsatModeSelect6()
14115 fis->d.lbaLow = 0; /* */ in smsatModeSelect6()
14116 fis->d.lbaMid = 0x4F; /* 0x4F */ in smsatModeSelect6()
14117 fis->d.lbaHigh = 0xC2; /* 0xC2 */ in smsatModeSelect6()
14118 fis->d.device = 0; /* */ in smsatModeSelect6()
14119 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect6()
14120 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect6()
14121 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect6()
14122 fis->d.featuresExp = 0; /* */ in smsatModeSelect6()
14123 fis->d.sectorCount = 0; /* */ in smsatModeSelect6()
14124 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect6()
14125 fis->d.reserved4 = 0; in smsatModeSelect6()
14126 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect6()
14127 fis->d.reserved5 = 0; in smsatModeSelect6()
14133 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect6()
14136 * Prepare SGL and send FIS to LL layer. in smsatModeSelect6()
14138 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect6()
14164 satIOContext->pSmSenseData, in smsatModeSelect6()
14165 satIOContext->interruptContext ); in smsatModeSelect6()
14185 agsaFisRegHostToDevice_t *fis; in smsatModeSelect10() local
14193 pSense = satIOContext->pSense; in smsatModeSelect10()
14194 pSatDevData = satIOContext->pSatDevData; in smsatModeSelect10()
14195 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatModeSelect10()
14196 fis = satIOContext->pFis; in smsatModeSelect10()
14197 pLogPage = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatModeSelect10()
14203 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatModeSelect10()
14217 satIOContext->pSmSenseData, in smsatModeSelect10()
14218 satIOContext->interruptContext ); in smsatModeSelect10()
14225 if ( !(scsiCmnd->cdb[1] & SCSI_MODE_SELECT10_PF_MASK)) in smsatModeSelect10()
14239 satIOContext->pSmSenseData, in smsatModeSelect10()
14240 satIOContext->interruptContext ); in smsatModeSelect10()
14246 parameterListLen = ((scsiCmnd->cdb[7]) << 8) + scsiCmnd->cdb[8]; in smsatModeSelect10()
14247 parameterListLen = MIN(parameterListLen, scsiCmnd->expDataLength); in smsatModeSelect10()
14255 satIOContext->interruptContext); in smsatModeSelect10()
14285 satIOContext->interruptContext); in smsatModeSelect10()
14304 satIOContext->pSmSenseData, in smsatModeSelect10()
14305 satIOContext->interruptContext ); in smsatModeSelect10()
14347 (pSatDevData->satNCQ == agTRUE && pLogPage[StartingIndex+3] != 0x12) || in smsatModeSelect10()
14348 (pSatDevData->satNCQ == agFALSE && pLogPage[StartingIndex+3] != 0x02) || in smsatModeSelect10()
14380 satIOContext->pSmSenseData, in smsatModeSelect10()
14381 satIOContext->interruptContext ); in smsatModeSelect10()
14394 satIOContext->interruptContext); in smsatModeSelect10()
14399 SM_DBG5(("smsatModeSelect10: Read-Write Error Recovery mode page\n")); in smsatModeSelect10()
14425 satIOContext->pSmSenseData, in smsatModeSelect10()
14426 satIOContext->interruptContext ); in smsatModeSelect10()
14439 satIOContext->interruptContext); in smsatModeSelect10()
14478 satIOContext->pSmSenseData, in smsatModeSelect10()
14479 satIOContext->interruptContext ); in smsatModeSelect10()
14485 /* sends ATA SET FEATURES based on WCE bit */ in smsatModeSelect10()
14490 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect10()
14491 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect10()
14493 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatModeSelect10()
14494 fis->h.features = 0x82; /* disable write cache */ in smsatModeSelect10()
14495 fis->d.lbaLow = 0; /* */ in smsatModeSelect10()
14496 fis->d.lbaMid = 0; /* */ in smsatModeSelect10()
14497 fis->d.lbaHigh = 0; /* */ in smsatModeSelect10()
14498 fis->d.device = 0; /* */ in smsatModeSelect10()
14499 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect10()
14500 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect10()
14501 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect10()
14502 fis->d.featuresExp = 0; /* */ in smsatModeSelect10()
14503 fis->d.sectorCount = 0; /* */ in smsatModeSelect10()
14504 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect10()
14505 fis->d.reserved4 = 0; in smsatModeSelect10()
14506 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect10()
14507 fis->d.reserved5 = 0; in smsatModeSelect10()
14513 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect10()
14516 * Prepare SGL and send FIS to LL layer. in smsatModeSelect10()
14518 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect10()
14531 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect10()
14532 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect10()
14534 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatModeSelect10()
14535 fis->h.features = 0x02; /* enable write cache */ in smsatModeSelect10()
14536 fis->d.lbaLow = 0; /* */ in smsatModeSelect10()
14537 fis->d.lbaMid = 0; /* */ in smsatModeSelect10()
14538 fis->d.lbaHigh = 0; /* */ in smsatModeSelect10()
14539 fis->d.device = 0; /* */ in smsatModeSelect10()
14540 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect10()
14541 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect10()
14542 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect10()
14543 fis->d.featuresExp = 0; /* */ in smsatModeSelect10()
14544 fis->d.sectorCount = 0; /* */ in smsatModeSelect10()
14545 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect10()
14546 fis->d.reserved4 = 0; in smsatModeSelect10()
14547 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect10()
14548 fis->d.reserved5 = 0; in smsatModeSelect10()
14554 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect10()
14557 * Prepare SGL and send FIS to LL layer. in smsatModeSelect10()
14559 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect10()
14592 satIOContext->pSmSenseData, in smsatModeSelect10()
14593 satIOContext->interruptContext ); in smsatModeSelect10()
14598 /* sends either ATA SMART ENABLE/DISABLE OPERATIONS based on DEXCPT bit */ in smsatModeSelect10()
14603 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect10()
14604 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect10()
14606 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatModeSelect10()
14607 fis->h.features = SAT_SMART_ENABLE_OPERATIONS; /* enable */ in smsatModeSelect10()
14608 fis->d.lbaLow = 0; /* */ in smsatModeSelect10()
14609 fis->d.lbaMid = 0x4F; /* 0x4F */ in smsatModeSelect10()
14610 fis->d.lbaHigh = 0xC2; /* 0xC2 */ in smsatModeSelect10()
14611 fis->d.device = 0; /* */ in smsatModeSelect10()
14612 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect10()
14613 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect10()
14614 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect10()
14615 fis->d.featuresExp = 0; /* */ in smsatModeSelect10()
14616 fis->d.sectorCount = 0; /* */ in smsatModeSelect10()
14617 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect10()
14618 fis->d.reserved4 = 0; in smsatModeSelect10()
14619 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect10()
14620 fis->d.reserved5 = 0; in smsatModeSelect10()
14626 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect10()
14629 * Prepare SGL and send FIS to LL layer. in smsatModeSelect10()
14631 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect10()
14644 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect10()
14645 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect10()
14647 fis->h.command = SAT_SMART; /* 0xB0 */ in smsatModeSelect10()
14648 fis->h.features = SAT_SMART_DISABLE_OPERATIONS; /* disable */ in smsatModeSelect10()
14649 fis->d.lbaLow = 0; /* */ in smsatModeSelect10()
14650 fis->d.lbaMid = 0x4F; /* 0x4F */ in smsatModeSelect10()
14651 fis->d.lbaHigh = 0xC2; /* 0xC2 */ in smsatModeSelect10()
14652 fis->d.device = 0; /* */ in smsatModeSelect10()
14653 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect10()
14654 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect10()
14655 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect10()
14656 fis->d.featuresExp = 0; /* */ in smsatModeSelect10()
14657 fis->d.sectorCount = 0; /* */ in smsatModeSelect10()
14658 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect10()
14659 fis->d.reserved4 = 0; in smsatModeSelect10()
14660 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect10()
14661 fis->d.reserved5 = 0; in smsatModeSelect10()
14667 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect10()
14670 * Prepare SGL and send FIS to LL layer. in smsatModeSelect10()
14672 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect10()
14698 satIOContext->pSmSenseData, in smsatModeSelect10()
14699 satIOContext->interruptContext ); in smsatModeSelect10()
14718 agsaFisRegHostToDevice_t *fis; in smsatSynchronizeCache10() local
14720 pSense = satIOContext->pSense; in smsatSynchronizeCache10()
14721 pSatDevData = satIOContext->pSatDevData; in smsatSynchronizeCache10()
14722 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatSynchronizeCache10()
14723 fis = satIOContext->pFis; in smsatSynchronizeCache10()
14729 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatSynchronizeCache10()
14743 satIOContext->pSmSenseData, in smsatSynchronizeCache10()
14744 satIOContext->interruptContext ); in smsatSynchronizeCache10()
14751 if (scsiCmnd->cdb[1] & SCSI_SYNC_CACHE_IMMED_MASK) in smsatSynchronizeCache10()
14761 satIOContext->interruptContext); in smsatSynchronizeCache10()
14765 if (pSatDevData->sat48BitSupport == agTRUE) in smsatSynchronizeCache10()
14769 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSynchronizeCache10()
14770 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSynchronizeCache10()
14772 fis->h.command = SAT_FLUSH_CACHE_EXT; /* 0xEA */ in smsatSynchronizeCache10()
14773 fis->h.features = 0; /* FIS reserve */ in smsatSynchronizeCache10()
14774 fis->d.featuresExp = 0; /* FIS reserve */ in smsatSynchronizeCache10()
14775 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSynchronizeCache10()
14776 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatSynchronizeCache10()
14777 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatSynchronizeCache10()
14778 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatSynchronizeCache10()
14779 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSynchronizeCache10()
14780 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatSynchronizeCache10()
14781 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSynchronizeCache10()
14782 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatSynchronizeCache10()
14783 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSynchronizeCache10()
14784 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSynchronizeCache10()
14785 fis->d.reserved4 = 0; in smsatSynchronizeCache10()
14786 fis->d.reserved5 = 0; in smsatSynchronizeCache10()
14793 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSynchronizeCache10()
14794 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSynchronizeCache10()
14796 fis->h.command = SAT_FLUSH_CACHE; /* 0xE7 */ in smsatSynchronizeCache10()
14797 fis->h.features = 0; /* FIS features NA */ in smsatSynchronizeCache10()
14798 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatSynchronizeCache10()
14799 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSynchronizeCache10()
14800 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSynchronizeCache10()
14801 fis->d.lbaLowExp = 0; in smsatSynchronizeCache10()
14802 fis->d.lbaMidExp = 0; in smsatSynchronizeCache10()
14803 fis->d.lbaHighExp = 0; in smsatSynchronizeCache10()
14804 fis->d.featuresExp = 0; in smsatSynchronizeCache10()
14805 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSynchronizeCache10()
14806 fis->d.sectorCountExp = 0; in smsatSynchronizeCache10()
14807 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSynchronizeCache10()
14808 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSynchronizeCache10()
14809 fis->d.reserved4 = 0; in smsatSynchronizeCache10()
14810 fis->d.reserved5 = 0; in smsatSynchronizeCache10()
14818 satIOContext->satCompleteCB = &smsatSynchronizeCache10n16CB; in smsatSynchronizeCache10()
14821 * Prepare SGL and send FIS to LL layer. in smsatSynchronizeCache10()
14823 satIOContext->reqType = agRequestType; /* Save it */ in smsatSynchronizeCache10()
14849 agsaFisRegHostToDevice_t *fis; in smsatSynchronizeCache16() local
14851 pSense = satIOContext->pSense; in smsatSynchronizeCache16()
14852 pSatDevData = satIOContext->pSatDevData; in smsatSynchronizeCache16()
14853 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatSynchronizeCache16()
14854 fis = satIOContext->pFis; in smsatSynchronizeCache16()
14860 if ( (scsiCmnd->cdb[15] & SCSI_NACA_MASK) || (scsiCmnd->cdb[15] & SCSI_LINK_MASK) ) in smsatSynchronizeCache16()
14874 satIOContext->pSmSenseData, in smsatSynchronizeCache16()
14875 satIOContext->interruptContext ); in smsatSynchronizeCache16()
14883 if (scsiCmnd->cdb[1] & SCSI_SYNC_CACHE_IMMED_MASK) in smsatSynchronizeCache16()
14893 satIOContext->interruptContext); in smsatSynchronizeCache16()
14897 if (pSatDevData->sat48BitSupport == agTRUE) in smsatSynchronizeCache16()
14901 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSynchronizeCache16()
14902 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSynchronizeCache16()
14904 fis->h.command = SAT_FLUSH_CACHE_EXT; /* 0xEA */ in smsatSynchronizeCache16()
14905 fis->h.features = 0; /* FIS reserve */ in smsatSynchronizeCache16()
14906 fis->d.featuresExp = 0; /* FIS reserve */ in smsatSynchronizeCache16()
14907 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSynchronizeCache16()
14908 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatSynchronizeCache16()
14909 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatSynchronizeCache16()
14910 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatSynchronizeCache16()
14911 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSynchronizeCache16()
14912 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatSynchronizeCache16()
14913 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSynchronizeCache16()
14914 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatSynchronizeCache16()
14915 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSynchronizeCache16()
14916 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSynchronizeCache16()
14917 fis->d.reserved4 = 0; in smsatSynchronizeCache16()
14918 fis->d.reserved5 = 0; in smsatSynchronizeCache16()
14925 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSynchronizeCache16()
14926 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSynchronizeCache16()
14928 fis->h.command = SAT_FLUSH_CACHE; /* 0xE7 */ in smsatSynchronizeCache16()
14929 fis->h.features = 0; /* FIS features NA */ in smsatSynchronizeCache16()
14930 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatSynchronizeCache16()
14931 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSynchronizeCache16()
14932 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSynchronizeCache16()
14933 fis->d.lbaLowExp = 0; in smsatSynchronizeCache16()
14934 fis->d.lbaMidExp = 0; in smsatSynchronizeCache16()
14935 fis->d.lbaHighExp = 0; in smsatSynchronizeCache16()
14936 fis->d.featuresExp = 0; in smsatSynchronizeCache16()
14937 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatSynchronizeCache16()
14938 fis->d.sectorCountExp = 0; in smsatSynchronizeCache16()
14939 fis->d.device = 0; /* FIS DEV is discared in SATA */ in smsatSynchronizeCache16()
14940 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSynchronizeCache16()
14941 fis->d.reserved4 = 0; in smsatSynchronizeCache16()
14942 fis->d.reserved5 = 0; in smsatSynchronizeCache16()
14950 satIOContext->satCompleteCB = &smsatSynchronizeCache10n16CB; in smsatSynchronizeCache16()
14953 * Prepare SGL and send FIS to LL layer. in smsatSynchronizeCache16()
14955 satIOContext->reqType = agRequestType; /* Save it */ in smsatSynchronizeCache16()
14985 agsaFisRegHostToDevice_t *fis; in smsatWriteAndVerify10() local
14993 pSense = satIOContext->pSense; in smsatWriteAndVerify10()
14994 pSatDevData = satIOContext->pSatDevData; in smsatWriteAndVerify10()
14995 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWriteAndVerify10()
14996 fis = satIOContext->pFis; in smsatWriteAndVerify10()
15001 if (scsiCmnd->cdb[1] & SCSI_WRITE_N_VERIFY_BYTCHK_MASK) in smsatWriteAndVerify10()
15015 satIOContext->pSmSenseData, in smsatWriteAndVerify10()
15016 satIOContext->interruptContext ); in smsatWriteAndVerify10()
15025 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatWriteAndVerify10()
15039 satIOContext->pSmSenseData, in smsatWriteAndVerify10()
15040 satIOContext->interruptContext ); in smsatWriteAndVerify10()
15054 LBA[4] = scsiCmnd->cdb[2]; in smsatWriteAndVerify10()
15055 LBA[5] = scsiCmnd->cdb[3]; in smsatWriteAndVerify10()
15056 LBA[6] = scsiCmnd->cdb[4]; in smsatWriteAndVerify10()
15057 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatWriteAndVerify10()
15065 TL[6] = scsiCmnd->cdb[7]; in smsatWriteAndVerify10()
15066 TL[7] = scsiCmnd->cdb[8]; /* LSB */ in smsatWriteAndVerify10()
15070 lba = (scsiCmnd->cdb[2] << (8*3)) + (scsiCmnd->cdb[3] << (8*2)) in smsatWriteAndVerify10()
15071 + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatWriteAndVerify10()
15072 tl = (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatWriteAndVerify10()
15082 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWriteAndVerify10()
15085 if (pSatDevData->satNCQ != agTRUE && in smsatWriteAndVerify10()
15086 pSatDevData->sat48BitSupport != agTRUE in smsatWriteAndVerify10()
15105 satIOContext->pSmSenseData, in smsatWriteAndVerify10()
15106 satIOContext->interruptContext ); in smsatWriteAndVerify10()
15129 satIOContext->pSmSenseData, in smsatWriteAndVerify10()
15130 satIOContext->interruptContext ); in smsatWriteAndVerify10()
15138 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteAndVerify10()
15144 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify10()
15145 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWriteAndVerify10()
15146 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWriteAndVerify10()
15147 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify10()
15148 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify10()
15149 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify10()
15150 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify10()
15152 /* FIS LBA mode set LBA (27:24) */ in smsatWriteAndVerify10()
15153 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWriteAndVerify10()
15155 fis->d.lbaLowExp = 0; in smsatWriteAndVerify10()
15156 fis->d.lbaMidExp = 0; in smsatWriteAndVerify10()
15157 fis->d.lbaHighExp = 0; in smsatWriteAndVerify10()
15158 fis->d.featuresExp = 0; in smsatWriteAndVerify10()
15159 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWriteAndVerify10()
15160 fis->d.sectorCountExp = 0; in smsatWriteAndVerify10()
15161 fis->d.reserved4 = 0; in smsatWriteAndVerify10()
15162 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify10()
15163 fis->d.reserved5 = 0; in smsatWriteAndVerify10()
15166 satIOContext->ATACmd = SAT_WRITE_DMA; in smsatWriteAndVerify10()
15175 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify10()
15176 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWriteAndVerify10()
15177 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatWriteAndVerify10()
15178 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify10()
15179 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify10()
15180 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify10()
15181 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify10()
15183 /* FIS LBA mode set LBA (27:24) */ in smsatWriteAndVerify10()
15184 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWriteAndVerify10()
15186 fis->d.lbaLowExp = 0; in smsatWriteAndVerify10()
15187 fis->d.lbaMidExp = 0; in smsatWriteAndVerify10()
15188 fis->d.lbaHighExp = 0; in smsatWriteAndVerify10()
15189 fis->d.featuresExp = 0; in smsatWriteAndVerify10()
15190 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWriteAndVerify10()
15191 fis->d.sectorCountExp = 0; in smsatWriteAndVerify10()
15192 fis->d.reserved4 = 0; in smsatWriteAndVerify10()
15193 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify10()
15194 fis->d.reserved5 = 0; in smsatWriteAndVerify10()
15197 satIOContext->ATACmd = SAT_WRITE_SECTORS; in smsatWriteAndVerify10()
15202 if (pSatDevData->sat48BitSupport == agTRUE) in smsatWriteAndVerify10()
15204 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteAndVerify10()
15209 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify10()
15210 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify10()
15213 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWriteAndVerify10()
15215 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify10()
15216 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify10()
15217 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify10()
15218 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify10()
15219 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteAndVerify10()
15220 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteAndVerify10()
15221 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteAndVerify10()
15222 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteAndVerify10()
15223 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteAndVerify10()
15224 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWriteAndVerify10()
15225 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatWriteAndVerify10()
15226 fis->d.reserved4 = 0; in smsatWriteAndVerify10()
15227 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify10()
15228 fis->d.reserved5 = 0; in smsatWriteAndVerify10()
15231 satIOContext->ATACmd = SAT_WRITE_DMA_EXT; in smsatWriteAndVerify10()
15239 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify10()
15240 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify10()
15241 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWriteAndVerify10()
15243 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify10()
15244 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify10()
15245 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify10()
15246 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify10()
15247 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteAndVerify10()
15248 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteAndVerify10()
15249 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteAndVerify10()
15250 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteAndVerify10()
15251 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteAndVerify10()
15252 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWriteAndVerify10()
15253 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatWriteAndVerify10()
15254 fis->d.reserved4 = 0; in smsatWriteAndVerify10()
15255 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify10()
15256 fis->d.reserved5 = 0; in smsatWriteAndVerify10()
15259 satIOContext->ATACmd = SAT_WRITE_SECTORS_EXT; in smsatWriteAndVerify10()
15263 if (pSatDevData->satNCQ == agTRUE) in smsatWriteAndVerify10()
15266 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWriteAndVerify10()
15281 satIOContext->pSmSenseData, in smsatWriteAndVerify10()
15282 satIOContext->interruptContext ); in smsatWriteAndVerify10()
15287 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWriteAndVerify10()
15289 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify10()
15290 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify10()
15291 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWriteAndVerify10()
15292 fis->h.features = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatWriteAndVerify10()
15293 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify10()
15294 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify10()
15295 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify10()
15298 if (scsiCmnd->cdb[1] & SCSI_WRITE_N_VERIFY10_FUA_MASK) in smsatWriteAndVerify10()
15299 fis->d.device = 0xC0; /* FIS FUA set */ in smsatWriteAndVerify10()
15301 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWriteAndVerify10()
15303 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteAndVerify10()
15304 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteAndVerify10()
15305 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteAndVerify10()
15306 fis->d.featuresExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatWriteAndVerify10()
15307 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWriteAndVerify10()
15308 fis->d.sectorCountExp = 0; in smsatWriteAndVerify10()
15309 fis->d.reserved4 = 0; in smsatWriteAndVerify10()
15310 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify10()
15311 fis->d.reserved5 = 0; in smsatWriteAndVerify10()
15314 satIOContext->ATACmd = SAT_WRITE_FPDMA_QUEUED; in smsatWriteAndVerify10()
15317 satIOContext->currentLBA = lba; in smsatWriteAndVerify10()
15318 satIOContext->OrgTL = tl; in smsatWriteAndVerify10()
15325 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWriteAndVerify10()
15329 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWriteAndVerify10()
15330 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWriteAndVerify10()
15331 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWriteAndVerify10()
15343 satIOContext->LoopNum = LoopNum; in smsatWriteAndVerify10()
15351 satIOContext->satCompleteCB = &smsatNonChainedWriteNVerifyCB; in smsatWriteAndVerify10()
15356 /* re-setting tl */ in smsatWriteAndVerify10()
15357 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWriteAndVerify10()
15359 fis->d.sectorCount = 0xFF; in smsatWriteAndVerify10()
15361 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWriteAndVerify10()
15362 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWriteAndVerify10()
15363 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWriteAndVerify10()
15366 fis->d.sectorCount = 0xFF; in smsatWriteAndVerify10()
15367 fis->d.sectorCountExp = 0xFF; in smsatWriteAndVerify10()
15372 fis->h.features = 0xFF; in smsatWriteAndVerify10()
15373 fis->d.featuresExp = 0xFF; in smsatWriteAndVerify10()
15378 satIOContext->satCompleteCB = &smsatChainedWriteNVerifyCB; in smsatWriteAndVerify10()
15383 * Prepare SGL and send FIS to LL layer. in smsatWriteAndVerify10()
15385 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteAndVerify10()
15414 agsaFisRegHostToDevice_t *fis; in smsatWriteAndVerify12() local
15422 pSense = satIOContext->pSense; in smsatWriteAndVerify12()
15423 pSatDevData = satIOContext->pSatDevData; in smsatWriteAndVerify12()
15424 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWriteAndVerify12()
15425 fis = satIOContext->pFis; in smsatWriteAndVerify12()
15430 if (scsiCmnd->cdb[1] & SCSI_WRITE_N_VERIFY_BYTCHK_MASK) in smsatWriteAndVerify12()
15444 satIOContext->pSmSenseData, in smsatWriteAndVerify12()
15445 satIOContext->interruptContext ); in smsatWriteAndVerify12()
15453 if ( (scsiCmnd->cdb[11] & SCSI_NACA_MASK) || (scsiCmnd->cdb[11] & SCSI_LINK_MASK) ) in smsatWriteAndVerify12()
15467 satIOContext->pSmSenseData, in smsatWriteAndVerify12()
15468 satIOContext->interruptContext ); in smsatWriteAndVerify12()
15482 LBA[4] = scsiCmnd->cdb[2]; in smsatWriteAndVerify12()
15483 LBA[5] = scsiCmnd->cdb[3]; in smsatWriteAndVerify12()
15484 LBA[6] = scsiCmnd->cdb[4]; in smsatWriteAndVerify12()
15485 LBA[7] = scsiCmnd->cdb[5]; /* LSB */ in smsatWriteAndVerify12()
15491 TL[4] = scsiCmnd->cdb[6]; in smsatWriteAndVerify12()
15492 TL[5] = scsiCmnd->cdb[7]; in smsatWriteAndVerify12()
15493 TL[6] = scsiCmnd->cdb[8]; in smsatWriteAndVerify12()
15494 TL[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatWriteAndVerify12()
15508 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWriteAndVerify12()
15511 if (pSatDevData->satNCQ != agTRUE && in smsatWriteAndVerify12()
15512 pSatDevData->sat48BitSupport != agTRUE in smsatWriteAndVerify12()
15536 satIOContext->pSmSenseData, in smsatWriteAndVerify12()
15537 satIOContext->interruptContext ); in smsatWriteAndVerify12()
15557 satIOContext->pSmSenseData, in smsatWriteAndVerify12()
15558 satIOContext->interruptContext ); in smsatWriteAndVerify12()
15562 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteAndVerify12()
15568 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify12()
15569 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWriteAndVerify12()
15570 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWriteAndVerify12()
15571 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify12()
15572 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify12()
15573 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify12()
15574 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify12()
15576 /* FIS LBA mode set LBA (27:24) */ in smsatWriteAndVerify12()
15577 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWriteAndVerify12()
15579 fis->d.lbaLowExp = 0; in smsatWriteAndVerify12()
15580 fis->d.lbaMidExp = 0; in smsatWriteAndVerify12()
15581 fis->d.lbaHighExp = 0; in smsatWriteAndVerify12()
15582 fis->d.featuresExp = 0; in smsatWriteAndVerify12()
15583 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWriteAndVerify12()
15584 fis->d.sectorCountExp = 0; in smsatWriteAndVerify12()
15585 fis->d.reserved4 = 0; in smsatWriteAndVerify12()
15586 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify12()
15587 fis->d.reserved5 = 0; in smsatWriteAndVerify12()
15590 satIOContext->ATACmd = SAT_WRITE_DMA; in smsatWriteAndVerify12()
15599 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify12()
15600 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWriteAndVerify12()
15601 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatWriteAndVerify12()
15602 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify12()
15603 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify12()
15604 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify12()
15605 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify12()
15607 /* FIS LBA mode set LBA (27:24) */ in smsatWriteAndVerify12()
15608 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatWriteAndVerify12()
15610 fis->d.lbaLowExp = 0; in smsatWriteAndVerify12()
15611 fis->d.lbaMidExp = 0; in smsatWriteAndVerify12()
15612 fis->d.lbaHighExp = 0; in smsatWriteAndVerify12()
15613 fis->d.featuresExp = 0; in smsatWriteAndVerify12()
15614 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWriteAndVerify12()
15615 fis->d.sectorCountExp = 0; in smsatWriteAndVerify12()
15616 fis->d.reserved4 = 0; in smsatWriteAndVerify12()
15617 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify12()
15618 fis->d.reserved5 = 0; in smsatWriteAndVerify12()
15621 satIOContext->ATACmd = SAT_WRITE_SECTORS; in smsatWriteAndVerify12()
15625 if (pSatDevData->sat48BitSupport == agTRUE) in smsatWriteAndVerify12()
15627 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteAndVerify12()
15632 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify12()
15633 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify12()
15636 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWriteAndVerify12()
15638 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify12()
15639 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify12()
15640 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify12()
15641 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify12()
15642 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteAndVerify12()
15643 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteAndVerify12()
15644 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteAndVerify12()
15645 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteAndVerify12()
15646 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteAndVerify12()
15647 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWriteAndVerify12()
15648 fis->d.sectorCountExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatWriteAndVerify12()
15649 fis->d.reserved4 = 0; in smsatWriteAndVerify12()
15650 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify12()
15651 fis->d.reserved5 = 0; in smsatWriteAndVerify12()
15654 satIOContext->ATACmd = SAT_WRITE_DMA_EXT; in smsatWriteAndVerify12()
15662 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify12()
15663 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify12()
15664 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWriteAndVerify12()
15666 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify12()
15667 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify12()
15668 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify12()
15669 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify12()
15670 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteAndVerify12()
15671 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteAndVerify12()
15672 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteAndVerify12()
15673 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteAndVerify12()
15674 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteAndVerify12()
15675 fis->d.sectorCount = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWriteAndVerify12()
15676 fis->d.sectorCountExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatWriteAndVerify12()
15677 fis->d.reserved4 = 0; in smsatWriteAndVerify12()
15678 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify12()
15679 fis->d.reserved5 = 0; in smsatWriteAndVerify12()
15682 satIOContext->ATACmd = SAT_WRITE_SECTORS_EXT; in smsatWriteAndVerify12()
15687 if (pSatDevData->satNCQ == agTRUE) in smsatWriteAndVerify12()
15690 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWriteAndVerify12()
15705 satIOContext->pSmSenseData, in smsatWriteAndVerify12()
15706 satIOContext->interruptContext ); in smsatWriteAndVerify12()
15711 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWriteAndVerify12()
15713 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify12()
15714 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify12()
15715 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWriteAndVerify12()
15716 fis->h.features = scsiCmnd->cdb[9]; /* FIS sector count (7:0) */ in smsatWriteAndVerify12()
15717 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify12()
15718 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify12()
15719 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatWriteAndVerify12()
15722 if (scsiCmnd->cdb[1] & SCSI_WRITE12_FUA_MASK) in smsatWriteAndVerify12()
15723 fis->d.device = 0xC0; /* FIS FUA set */ in smsatWriteAndVerify12()
15725 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWriteAndVerify12()
15727 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatWriteAndVerify12()
15728 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteAndVerify12()
15729 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteAndVerify12()
15730 fis->d.featuresExp = scsiCmnd->cdb[8]; /* FIS sector count (15:8) */ in smsatWriteAndVerify12()
15731 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWriteAndVerify12()
15732 fis->d.sectorCountExp = 0; in smsatWriteAndVerify12()
15733 fis->d.reserved4 = 0; in smsatWriteAndVerify12()
15734 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify12()
15735 fis->d.reserved5 = 0; in smsatWriteAndVerify12()
15738 satIOContext->ATACmd = SAT_WRITE_FPDMA_QUEUED; in smsatWriteAndVerify12()
15741 satIOContext->currentLBA = lba; in smsatWriteAndVerify12()
15742 // satIOContext->OrgLBA = lba; in smsatWriteAndVerify12()
15743 satIOContext->OrgTL = tl; in smsatWriteAndVerify12()
15750 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWriteAndVerify12()
15754 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWriteAndVerify12()
15755 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWriteAndVerify12()
15756 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWriteAndVerify12()
15768 satIOContext->LoopNum = LoopNum; in smsatWriteAndVerify12()
15769 satIOContext->LoopNum2 = LoopNum; in smsatWriteAndVerify12()
15777 satIOContext->satCompleteCB = &smsatNonChainedWriteNVerifyCB; in smsatWriteAndVerify12()
15782 /* re-setting tl */ in smsatWriteAndVerify12()
15783 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWriteAndVerify12()
15785 fis->d.sectorCount = 0xFF; in smsatWriteAndVerify12()
15787 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWriteAndVerify12()
15788 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWriteAndVerify12()
15789 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWriteAndVerify12()
15792 fis->d.sectorCount = 0xFF; in smsatWriteAndVerify12()
15793 fis->d.sectorCountExp = 0xFF; in smsatWriteAndVerify12()
15798 fis->h.features = 0xFF; in smsatWriteAndVerify12()
15799 fis->d.featuresExp = 0xFF; in smsatWriteAndVerify12()
15804 satIOContext->satCompleteCB = &smsatChainedWriteNVerifyCB; in smsatWriteAndVerify12()
15809 * Prepare SGL and send FIS to LL layer. in smsatWriteAndVerify12()
15811 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteAndVerify12()
15832 since write16 has 8 bytes LBA -> problem ATA LBA(upto 6 bytes), no support in smsatWriteAndVerify16()
15839 agsaFisRegHostToDevice_t *fis; in smsatWriteAndVerify16() local
15847 pSense = satIOContext->pSense; in smsatWriteAndVerify16()
15848 pSatDevData = satIOContext->pSatDevData; in smsatWriteAndVerify16()
15849 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWriteAndVerify16()
15850 fis = satIOContext->pFis; in smsatWriteAndVerify16()
15855 if (scsiCmnd->cdb[1] & SCSI_WRITE_N_VERIFY_BYTCHK_MASK) in smsatWriteAndVerify16()
15869 satIOContext->pSmSenseData, in smsatWriteAndVerify16()
15870 satIOContext->interruptContext ); in smsatWriteAndVerify16()
15879 if ( (scsiCmnd->cdb[15] & SCSI_NACA_MASK) || (scsiCmnd->cdb[15] & SCSI_LINK_MASK) ) in smsatWriteAndVerify16()
15893 satIOContext->pSmSenseData, in smsatWriteAndVerify16()
15894 satIOContext->interruptContext ); in smsatWriteAndVerify16()
15905 LBA[0] = scsiCmnd->cdb[2]; /* MSB */ in smsatWriteAndVerify16()
15906 LBA[1] = scsiCmnd->cdb[3]; in smsatWriteAndVerify16()
15907 LBA[2] = scsiCmnd->cdb[4]; in smsatWriteAndVerify16()
15908 LBA[3] = scsiCmnd->cdb[5]; in smsatWriteAndVerify16()
15909 LBA[4] = scsiCmnd->cdb[6]; in smsatWriteAndVerify16()
15910 LBA[5] = scsiCmnd->cdb[7]; in smsatWriteAndVerify16()
15911 LBA[6] = scsiCmnd->cdb[8]; in smsatWriteAndVerify16()
15912 LBA[7] = scsiCmnd->cdb[9]; /* LSB */ in smsatWriteAndVerify16()
15918 TL[4] = scsiCmnd->cdb[10]; /* MSB */ in smsatWriteAndVerify16()
15919 TL[5] = scsiCmnd->cdb[11]; in smsatWriteAndVerify16()
15920 TL[6] = scsiCmnd->cdb[12]; in smsatWriteAndVerify16()
15921 TL[7] = scsiCmnd->cdb[13]; /* LSB */ in smsatWriteAndVerify16()
15936 When no 48-bit addressing support or NCQ, if LBA is beyond (2^28 - 1), in smsatWriteAndVerify16()
15939 if (pSatDevData->satNCQ != agTRUE && in smsatWriteAndVerify16()
15940 pSatDevData->sat48BitSupport != agTRUE in smsatWriteAndVerify16()
15959 satIOContext->pSmSenseData, in smsatWriteAndVerify16()
15960 satIOContext->interruptContext ); in smsatWriteAndVerify16()
15983 satIOContext->pSmSenseData, in smsatWriteAndVerify16()
15984 satIOContext->interruptContext ); in smsatWriteAndVerify16()
15992 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteAndVerify16()
15998 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify16()
15999 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWriteAndVerify16()
16000 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWriteAndVerify16()
16001 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify16()
16002 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify16()
16003 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify16()
16004 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWriteAndVerify16()
16006 /* FIS LBA mode set LBA (27:24) */ in smsatWriteAndVerify16()
16007 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[6] & 0xF)); in smsatWriteAndVerify16()
16009 fis->d.lbaLowExp = 0; in smsatWriteAndVerify16()
16010 fis->d.lbaMidExp = 0; in smsatWriteAndVerify16()
16011 fis->d.lbaHighExp = 0; in smsatWriteAndVerify16()
16012 fis->d.featuresExp = 0; in smsatWriteAndVerify16()
16013 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWriteAndVerify16()
16014 fis->d.sectorCountExp = 0; in smsatWriteAndVerify16()
16015 fis->d.reserved4 = 0; in smsatWriteAndVerify16()
16016 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify16()
16017 fis->d.reserved5 = 0; in smsatWriteAndVerify16()
16020 satIOContext->ATACmd = SAT_WRITE_DMA; in smsatWriteAndVerify16()
16029 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify16()
16030 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWriteAndVerify16()
16031 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatWriteAndVerify16()
16032 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify16()
16033 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify16()
16034 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify16()
16035 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWriteAndVerify16()
16037 /* FIS LBA mode set LBA (27:24) */ in smsatWriteAndVerify16()
16038 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[6] & 0xF)); in smsatWriteAndVerify16()
16040 fis->d.lbaLowExp = 0; in smsatWriteAndVerify16()
16041 fis->d.lbaMidExp = 0; in smsatWriteAndVerify16()
16042 fis->d.lbaHighExp = 0; in smsatWriteAndVerify16()
16043 fis->d.featuresExp = 0; in smsatWriteAndVerify16()
16044 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWriteAndVerify16()
16045 fis->d.sectorCountExp = 0; in smsatWriteAndVerify16()
16046 fis->d.reserved4 = 0; in smsatWriteAndVerify16()
16047 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify16()
16048 fis->d.reserved5 = 0; in smsatWriteAndVerify16()
16051 satIOContext->ATACmd = SAT_WRITE_SECTORS; in smsatWriteAndVerify16()
16055 if (pSatDevData->sat48BitSupport == agTRUE) in smsatWriteAndVerify16()
16057 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatWriteAndVerify16()
16062 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify16()
16063 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify16()
16066 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWriteAndVerify16()
16068 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify16()
16069 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify16()
16070 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify16()
16071 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWriteAndVerify16()
16072 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteAndVerify16()
16073 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatWriteAndVerify16()
16074 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatWriteAndVerify16()
16075 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatWriteAndVerify16()
16076 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteAndVerify16()
16077 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWriteAndVerify16()
16078 fis->d.sectorCountExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatWriteAndVerify16()
16079 fis->d.reserved4 = 0; in smsatWriteAndVerify16()
16080 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify16()
16081 fis->d.reserved5 = 0; in smsatWriteAndVerify16()
16084 satIOContext->ATACmd = SAT_WRITE_DMA_EXT; in smsatWriteAndVerify16()
16092 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify16()
16093 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify16()
16094 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWriteAndVerify16()
16096 fis->h.features = 0; /* FIS reserve */ in smsatWriteAndVerify16()
16097 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify16()
16098 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify16()
16099 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWriteAndVerify16()
16100 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteAndVerify16()
16101 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatWriteAndVerify16()
16102 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatWriteAndVerify16()
16103 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatWriteAndVerify16()
16104 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteAndVerify16()
16105 fis->d.sectorCount = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWriteAndVerify16()
16106 fis->d.sectorCountExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatWriteAndVerify16()
16107 fis->d.reserved4 = 0; in smsatWriteAndVerify16()
16108 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify16()
16109 fis->d.reserved5 = 0; in smsatWriteAndVerify16()
16112 satIOContext->ATACmd = SAT_WRITE_SECTORS_EXT; in smsatWriteAndVerify16()
16117 if (pSatDevData->satNCQ == agTRUE) in smsatWriteAndVerify16()
16120 if (pSatDevData->sat48BitSupport != agTRUE) in smsatWriteAndVerify16()
16135 satIOContext->pSmSenseData, in smsatWriteAndVerify16()
16136 satIOContext->interruptContext ); in smsatWriteAndVerify16()
16141 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatWriteAndVerify16()
16143 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteAndVerify16()
16144 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteAndVerify16()
16145 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWriteAndVerify16()
16146 fis->h.features = scsiCmnd->cdb[13]; /* FIS sector count (7:0) */ in smsatWriteAndVerify16()
16147 fis->d.lbaLow = scsiCmnd->cdb[9]; /* FIS LBA (7 :0 ) */ in smsatWriteAndVerify16()
16148 fis->d.lbaMid = scsiCmnd->cdb[8]; /* FIS LBA (15:8 ) */ in smsatWriteAndVerify16()
16149 fis->d.lbaHigh = scsiCmnd->cdb[7]; /* FIS LBA (23:16) */ in smsatWriteAndVerify16()
16152 if (scsiCmnd->cdb[1] & SCSI_WRITE16_FUA_MASK) in smsatWriteAndVerify16()
16153 fis->d.device = 0xC0; /* FIS FUA set */ in smsatWriteAndVerify16()
16155 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWriteAndVerify16()
16157 fis->d.lbaLowExp = scsiCmnd->cdb[6]; /* FIS LBA (31:24) */ in smsatWriteAndVerify16()
16158 fis->d.lbaMidExp = scsiCmnd->cdb[5]; /* FIS LBA (39:32) */ in smsatWriteAndVerify16()
16159 fis->d.lbaHighExp = scsiCmnd->cdb[4]; /* FIS LBA (47:40) */ in smsatWriteAndVerify16()
16160 fis->d.featuresExp = scsiCmnd->cdb[12]; /* FIS sector count (15:8) */ in smsatWriteAndVerify16()
16161 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWriteAndVerify16()
16162 fis->d.sectorCountExp = 0; in smsatWriteAndVerify16()
16163 fis->d.reserved4 = 0; in smsatWriteAndVerify16()
16164 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteAndVerify16()
16165 fis->d.reserved5 = 0; in smsatWriteAndVerify16()
16168 satIOContext->ATACmd = SAT_WRITE_FPDMA_QUEUED; in smsatWriteAndVerify16()
16171 satIOContext->currentLBA = lba; in smsatWriteAndVerify16()
16172 satIOContext->OrgTL = tl; in smsatWriteAndVerify16()
16179 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWriteAndVerify16()
16183 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWriteAndVerify16()
16184 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWriteAndVerify16()
16185 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWriteAndVerify16()
16197 satIOContext->LoopNum = LoopNum; in smsatWriteAndVerify16()
16205 satIOContext->satCompleteCB = &smsatNonChainedWriteNVerifyCB; in smsatWriteAndVerify16()
16210 /* re-setting tl */ in smsatWriteAndVerify16()
16211 if (fis->h.command == SAT_WRITE_SECTORS || fis->h.command == SAT_WRITE_DMA) in smsatWriteAndVerify16()
16213 fis->d.sectorCount = 0xFF; in smsatWriteAndVerify16()
16215 else if (fis->h.command == SAT_WRITE_SECTORS_EXT || in smsatWriteAndVerify16()
16216 fis->h.command == SAT_WRITE_DMA_EXT || in smsatWriteAndVerify16()
16217 fis->h.command == SAT_WRITE_DMA_FUA_EXT in smsatWriteAndVerify16()
16220 fis->d.sectorCount = 0xFF; in smsatWriteAndVerify16()
16221 fis->d.sectorCountExp = 0xFF; in smsatWriteAndVerify16()
16226 fis->h.features = 0xFF; in smsatWriteAndVerify16()
16227 fis->d.featuresExp = 0xFF; in smsatWriteAndVerify16()
16232 satIOContext->satCompleteCB = &smsatChainedWriteNVerifyCB; in smsatWriteAndVerify16()
16237 * Prepare SGL and send FIS to LL layer. in smsatWriteAndVerify16()
16239 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteAndVerify16()
16263 agsaFisRegHostToDevice_t *fis; in smsatReadMediaSerialNumber() local
16269 pSense = satIOContext->pSense; in smsatReadMediaSerialNumber()
16270 pSatDevData = satIOContext->pSatDevData; in smsatReadMediaSerialNumber()
16271 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatReadMediaSerialNumber()
16272 fis = satIOContext->pFis; in smsatReadMediaSerialNumber()
16273 pSATAIdData = &(pSatDevData->satIdentifyData); in smsatReadMediaSerialNumber()
16274 pSerialNumber = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatReadMediaSerialNumber()
16280 if ( (scsiCmnd->cdb[11] & SCSI_NACA_MASK) || (scsiCmnd->cdb[11] & SCSI_LINK_MASK) ) in smsatReadMediaSerialNumber()
16294 satIOContext->pSmSenseData, in smsatReadMediaSerialNumber()
16295 satIOContext->interruptContext ); in smsatReadMediaSerialNumber()
16301 allocationLen = (((bit32)scsiCmnd->cdb[6]) << 24) | in smsatReadMediaSerialNumber()
16302 (((bit32)scsiCmnd->cdb[7]) << 16) | in smsatReadMediaSerialNumber()
16303 (((bit32)scsiCmnd->cdb[8]) << 8 ) | in smsatReadMediaSerialNumber()
16304 (((bit32)scsiCmnd->cdb[9])); in smsatReadMediaSerialNumber()
16305 allocationLen = MIN(allocationLen, scsiCmnd->expDataLength); in smsatReadMediaSerialNumber()
16308 if (pSATAIdData->commandSetFeatureDefault & 0x4) in smsatReadMediaSerialNumber()
16311 /* SPC-3 6.16 p192; filling in length */ in smsatReadMediaSerialNumber()
16319 /* 1 sector - 4 = 512 - 4 to avoid underflow; 0x1fc*/ in smsatReadMediaSerialNumber()
16334 satIOContext->interruptContext); in smsatReadMediaSerialNumber()
16339 if ( pSatDevData->IDDeviceValid == agTRUE) in smsatReadMediaSerialNumber()
16341 if (pSATAIdData->commandSetFeatureDefault & 0x4) in smsatReadMediaSerialNumber()
16346 … smhexdump("ID smsatReadMediaSerialNumber", (bit8*)pSATAIdData->currentMediaSerialNumber, 2*30); in smsatReadMediaSerialNumber()
16348 /* SPC-3 6.16 p192; filling in length */ in smsatReadMediaSerialNumber()
16353 sm_memcpy(&MediaSerialNumber[4], (void *)pSATAIdData->currentMediaSerialNumber, 60); in smsatReadMediaSerialNumber()
16365 satIOContext->interruptContext); in smsatReadMediaSerialNumber()
16375 if (pSatDevData->sat48BitSupport == agTRUE) in smsatReadMediaSerialNumber()
16378 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReadMediaSerialNumber()
16379 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReadMediaSerialNumber()
16380 fis->h.command = SAT_READ_SECTORS_EXT; /* 0x24 */ in smsatReadMediaSerialNumber()
16382 fis->h.features = 0; /* FIS reserve */ in smsatReadMediaSerialNumber()
16383 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatReadMediaSerialNumber()
16384 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatReadMediaSerialNumber()
16385 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatReadMediaSerialNumber()
16386 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatReadMediaSerialNumber()
16387 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatReadMediaSerialNumber()
16388 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatReadMediaSerialNumber()
16389 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatReadMediaSerialNumber()
16390 fis->d.featuresExp = 0; /* FIS reserve */ in smsatReadMediaSerialNumber()
16391 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReadMediaSerialNumber()
16392 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatReadMediaSerialNumber()
16393 fis->d.reserved4 = 0; in smsatReadMediaSerialNumber()
16394 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReadMediaSerialNumber()
16395 fis->d.reserved5 = 0; in smsatReadMediaSerialNumber()
16402 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReadMediaSerialNumber()
16403 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReadMediaSerialNumber()
16404 fis->h.command = SAT_READ_SECTORS; /* 0x20 */ in smsatReadMediaSerialNumber()
16405 fis->h.features = 0; /* FIS reserve */ in smsatReadMediaSerialNumber()
16406 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatReadMediaSerialNumber()
16407 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatReadMediaSerialNumber()
16408 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatReadMediaSerialNumber()
16409 fis->d.device = 0x40; /* FIS LBA (27:24) and FIS LBA mode */ in smsatReadMediaSerialNumber()
16410 fis->d.lbaLowExp = 0; in smsatReadMediaSerialNumber()
16411 fis->d.lbaMidExp = 0; in smsatReadMediaSerialNumber()
16412 fis->d.lbaHighExp = 0; in smsatReadMediaSerialNumber()
16413 fis->d.featuresExp = 0; in smsatReadMediaSerialNumber()
16414 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReadMediaSerialNumber()
16415 fis->d.sectorCountExp = 0; in smsatReadMediaSerialNumber()
16416 fis->d.reserved4 = 0; in smsatReadMediaSerialNumber()
16417 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReadMediaSerialNumber()
16418 fis->d.reserved5 = 0; in smsatReadMediaSerialNumber()
16423 satIOContext->satCompleteCB = &smsatReadMediaSerialNumberCB; in smsatReadMediaSerialNumber()
16424 satIOContext->reqType = agRequestType; /* Save it */ in smsatReadMediaSerialNumber()
16442 satIOContext->interruptContext); in smsatReadMediaSerialNumber()
16462 agsaFisRegHostToDevice_t *fis; in smsatReadBuffer() local
16469 pSense = satIOContext->pSense; in smsatReadBuffer()
16470 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatReadBuffer()
16471 fis = satIOContext->pFis; in smsatReadBuffer()
16472 pBuff = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatReadBuffer()
16478 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatReadBuffer()
16492 satIOContext->pSmSenseData, in smsatReadBuffer()
16493 satIOContext->interruptContext ); in smsatReadBuffer()
16499 bufferOffset = (scsiCmnd->cdb[3] << (8*2)) + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatReadBuffer()
16500 tl = (scsiCmnd->cdb[6] << (8*2)) + (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatReadBuffer()
16502 mode = (bit8)(scsiCmnd->cdb[1] & SCSI_READ_BUFFER_MODE_MASK); in smsatReadBuffer()
16503 bufferID = scsiCmnd->cdb[2]; in smsatReadBuffer()
16510 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReadBuffer()
16511 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReadBuffer()
16512 fis->h.command = SAT_READ_BUFFER; /* 0xE4 */ in smsatReadBuffer()
16513 fis->h.features = 0; /* FIS reserve */ in smsatReadBuffer()
16514 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatReadBuffer()
16515 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatReadBuffer()
16516 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatReadBuffer()
16517 fis->d.device = 0x40; /* FIS LBA (27:24) and FIS LBA mode */ in smsatReadBuffer()
16518 fis->d.lbaLowExp = 0; in smsatReadBuffer()
16519 fis->d.lbaMidExp = 0; in smsatReadBuffer()
16520 fis->d.lbaHighExp = 0; in smsatReadBuffer()
16521 fis->d.featuresExp = 0; in smsatReadBuffer()
16522 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatReadBuffer()
16523 fis->d.sectorCountExp = 0; in smsatReadBuffer()
16524 fis->d.reserved4 = 0; in smsatReadBuffer()
16525 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReadBuffer()
16526 fis->d.reserved5 = 0; in smsatReadBuffer()
16531 satIOContext->satCompleteCB = &smsatReadBufferCB; in smsatReadBuffer()
16533 satIOContext->reqType = agRequestType; /* Save it */ in smsatReadBuffer()
16557 satIOContext->pSmSenseData, in smsatReadBuffer()
16558 satIOContext->interruptContext ); in smsatReadBuffer()
16578 satIOContext->pSmSenseData, in smsatReadBuffer()
16579 satIOContext->interruptContext ); in smsatReadBuffer()
16598 satIOContext->pSmSenseData, in smsatReadBuffer()
16599 satIOContext->interruptContext ); in smsatReadBuffer()
16620 satIOContext->pSmSenseData, in smsatReadBuffer()
16621 satIOContext->interruptContext ); in smsatReadBuffer()
16628 /* SPC-4, 6.15.5, p189; SAT-2 Rev00, 8.7.2.3, p41*/ in smsatReadBuffer()
16642 tl - READ_BUFFER_DESCRIPTOR_MODE_DATA_LEN, in smsatReadBuffer()
16644 satIOContext->interruptContext ); in smsatReadBuffer()
16657 satIOContext->interruptContext); in smsatReadBuffer()
16676 satIOContext->pSmSenseData, in smsatReadBuffer()
16677 satIOContext->interruptContext ); in smsatReadBuffer()
16698 satIOContext->pSmSenseData, in smsatReadBuffer()
16699 satIOContext->interruptContext ); in smsatReadBuffer()
16720 agsaFisRegHostToDevice_t *fis; in smsatWriteBuffer() local
16728 pSense = satIOContext->pSense; in smsatWriteBuffer()
16729 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatWriteBuffer()
16731 fis = satIOContext->pFis; in smsatWriteBuffer()
16733 pBuff = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatWriteBuffer()
16739 if ( (scsiCmnd->cdb[9] & SCSI_NACA_MASK) || (scsiCmnd->cdb[9] & SCSI_LINK_MASK) ) in smsatWriteBuffer()
16753 satIOContext->pSmSenseData, in smsatWriteBuffer()
16754 satIOContext->interruptContext ); in smsatWriteBuffer()
16760 bufferOffset = (scsiCmnd->cdb[3] << (8*2)) + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatWriteBuffer()
16761 parmLen = (scsiCmnd->cdb[6] << (8*2)) + (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatWriteBuffer()
16763 mode = (bit8)(scsiCmnd->cdb[1] & SCSI_READ_BUFFER_MODE_MASK); in smsatWriteBuffer()
16764 bufferID = scsiCmnd->cdb[2]; in smsatWriteBuffer()
16776 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteBuffer()
16777 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteBuffer()
16778 fis->h.command = SAT_WRITE_BUFFER; /* 0xE8 */ in smsatWriteBuffer()
16779 fis->h.features = 0; /* FIS reserve */ in smsatWriteBuffer()
16780 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatWriteBuffer()
16781 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatWriteBuffer()
16782 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatWriteBuffer()
16783 fis->d.device = 0x40; /* FIS LBA (27:24) and FIS LBA mode */ in smsatWriteBuffer()
16784 fis->d.lbaLowExp = 0; in smsatWriteBuffer()
16785 fis->d.lbaMidExp = 0; in smsatWriteBuffer()
16786 fis->d.lbaHighExp = 0; in smsatWriteBuffer()
16787 fis->d.featuresExp = 0; in smsatWriteBuffer()
16788 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatWriteBuffer()
16789 fis->d.sectorCountExp = 0; in smsatWriteBuffer()
16790 fis->d.reserved4 = 0; in smsatWriteBuffer()
16791 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteBuffer()
16792 fis->d.reserved5 = 0; in smsatWriteBuffer()
16797 satIOContext->satCompleteCB = &smsatWriteBufferCB; in smsatWriteBuffer()
16799 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteBuffer()
16816 satIOContext->interruptContext); in smsatWriteBuffer()
16835 satIOContext->pSmSenseData, in smsatWriteBuffer()
16836 satIOContext->interruptContext ); in smsatWriteBuffer()
16856 satIOContext->pSmSenseData, in smsatWriteBuffer()
16857 satIOContext->interruptContext ); in smsatWriteBuffer()
16877 satIOContext->pSmSenseData, in smsatWriteBuffer()
16878 satIOContext->interruptContext ); in smsatWriteBuffer()
16898 satIOContext->pSmSenseData, in smsatWriteBuffer()
16899 satIOContext->interruptContext ); in smsatWriteBuffer()
16923 agsaFisRegHostToDevice_t *fis; in smsatReassignBlocks() local
16931 pSense = satIOContext->pSense; in smsatReassignBlocks()
16932 pSatDevData = satIOContext->pSatDevData; in smsatReassignBlocks()
16933 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatReassignBlocks()
16934 fis = satIOContext->pFis; in smsatReassignBlocks()
16935 pParmList = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatReassignBlocks()
16941 if ( (scsiCmnd->cdb[5] & SCSI_NACA_MASK) || (scsiCmnd->cdb[5] & SCSI_LINK_MASK) ) in smsatReassignBlocks()
16955 satIOContext->pSmSenseData, in smsatReassignBlocks()
16956 satIOContext->interruptContext ); in smsatReassignBlocks()
16962 sm_memset(satIOContext->LBA, 0, 8); in smsatReassignBlocks()
16963 satIOContext->ParmIndex = 0; in smsatReassignBlocks()
16964 satIOContext->ParmLen = 0; in smsatReassignBlocks()
16966 LongList = (bit8)(scsiCmnd->cdb[1] & SCSI_REASSIGN_BLOCKS_LONGLIST_MASK); in smsatReassignBlocks()
16967 LongLBA = (bit8)(scsiCmnd->cdb[1] & SCSI_REASSIGN_BLOCKS_LONGLBA_MASK); in smsatReassignBlocks()
16980 satIOContext->ParmLen = defectListLen + 4 /* header size */; in smsatReassignBlocks()
17007 if (pSatDevData->sat48BitSupport == agTRUE) in smsatReassignBlocks()
17010 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks()
17011 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReassignBlocks()
17012 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatReassignBlocks()
17013 fis->h.features = 0; /* FIS reserve */ in smsatReassignBlocks()
17014 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks()
17015 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks()
17016 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks()
17017 fis->d.lbaLowExp = LBA[4]; /* FIS LBA (31:24) */ in smsatReassignBlocks()
17018 fis->d.lbaMidExp = LBA[3]; /* FIS LBA (39:32) */ in smsatReassignBlocks()
17019 fis->d.lbaHighExp = LBA[2]; /* FIS LBA (47:40) */ in smsatReassignBlocks()
17020 fis->d.featuresExp = 0; /* FIS reserve */ in smsatReassignBlocks()
17021 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks()
17022 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatReassignBlocks()
17023 fis->d.reserved4 = 0; in smsatReassignBlocks()
17024 fis->d.device = 0x40; /* 01000000 */ in smsatReassignBlocks()
17025 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks()
17026 fis->d.reserved5 = 0; in smsatReassignBlocks()
17031 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks()
17032 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReassignBlocks()
17033 fis->h.command = SAT_READ_VERIFY_SECTORS;/* 0x40 */ in smsatReassignBlocks()
17034 fis->h.features = 0; /* FIS features NA */ in smsatReassignBlocks()
17035 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks()
17036 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks()
17037 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks()
17038 fis->d.lbaLowExp = 0; in smsatReassignBlocks()
17039 fis->d.lbaMidExp = 0; in smsatReassignBlocks()
17040 fis->d.lbaHighExp = 0; in smsatReassignBlocks()
17041 fis->d.featuresExp = 0; in smsatReassignBlocks()
17042 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks()
17043 fis->d.sectorCountExp = 0; in smsatReassignBlocks()
17044 fis->d.reserved4 = 0; in smsatReassignBlocks()
17045 fis->d.device = (bit8)((0x4 << 4) | (LBA[4] & 0xF)); in smsatReassignBlocks()
17047 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks()
17048 fis->d.reserved5 = 0; in smsatReassignBlocks()
17051 sm_memcpy(satIOContext->LBA, LBA, 8); in smsatReassignBlocks()
17052 satIOContext->ParmIndex = startingIndex; in smsatReassignBlocks()
17058 satIOContext->satCompleteCB = &smsatReassignBlocksCB; in smsatReassignBlocks()
17061 * Prepare SGL and send FIS to LL layer. in smsatReassignBlocks()
17063 satIOContext->reqType = agRequestType; /* Save it */ in smsatReassignBlocks()
17090 agsaFisRegHostToDevice_t *fis; in smsatRead_1() local
17099 fis = satIOContext->pFis; in smsatRead_1()
17100 satOrgIOContext = satIOContext->satOrgIOContext; in smsatRead_1()
17101 scsiCmnd = satOrgIOContext->pScsiCmnd; in smsatRead_1()
17105 switch (satOrgIOContext->ATACmd) in smsatRead_1()
17123 SM_DBG1(("smsatRead_1: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatRead_1()
17128 Remainder = satOrgIOContext->OrgTL % DenomTL; in smsatRead_1()
17129 satOrgIOContext->currentLBA = satOrgIOContext->currentLBA + DenomTL; in smsatRead_1()
17130 lba = satOrgIOContext->currentLBA; in smsatRead_1()
17137 switch (satOrgIOContext->ATACmd) in smsatRead_1()
17140 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead_1()
17141 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead_1()
17142 fis->h.command = SAT_READ_DMA; /* 0xC8 */ in smsatRead_1()
17143 fis->h.features = 0; /* FIS reserve */ in smsatRead_1()
17144 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatRead_1()
17145 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatRead_1()
17146 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatRead_1()
17147 fis->d.device = in smsatRead_1()
17148 (bit8)((0x4 << 4) | (LBA[0] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead_1()
17149 fis->d.lbaLowExp = 0; in smsatRead_1()
17150 fis->d.lbaMidExp = 0; in smsatRead_1()
17151 fis->d.lbaHighExp = 0; in smsatRead_1()
17152 fis->d.featuresExp = 0; in smsatRead_1()
17154 if (satOrgIOContext->LoopNum == 1) in smsatRead_1()
17157 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatRead_1()
17161 fis->d.sectorCount = 0x0; /* FIS sector count (7:0) */ in smsatRead_1()
17164 fis->d.sectorCountExp = 0; in smsatRead_1()
17165 fis->d.reserved4 = 0; in smsatRead_1()
17166 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead_1()
17167 fis->d.reserved5 = 0; in smsatRead_1()
17173 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead_1()
17174 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead_1()
17175 fis->h.command = SAT_READ_SECTORS; /* 0x20 */ in smsatRead_1()
17176 fis->h.features = 0; /* FIS reserve */ in smsatRead_1()
17177 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatRead_1()
17178 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatRead_1()
17179 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatRead_1()
17180 fis->d.device = in smsatRead_1()
17181 (bit8)((0x4 << 4) | (LBA[0] & 0xF)); /* FIS LBA (27:24) and FIS LBA mode */ in smsatRead_1()
17182 fis->d.lbaLowExp = 0; in smsatRead_1()
17183 fis->d.lbaMidExp = 0; in smsatRead_1()
17184 fis->d.lbaHighExp = 0; in smsatRead_1()
17185 fis->d.featuresExp = 0; in smsatRead_1()
17186 if (satOrgIOContext->LoopNum == 1) in smsatRead_1()
17189 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatRead_1()
17193 fis->d.sectorCount = 0x0; /* FIS sector count (7:0) */ in smsatRead_1()
17195 fis->d.sectorCountExp = 0; in smsatRead_1()
17196 fis->d.reserved4 = 0; in smsatRead_1()
17197 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead_1()
17198 fis->d.reserved5 = 0; in smsatRead_1()
17204 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead_1()
17205 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead_1()
17206 fis->h.command = SAT_READ_DMA_EXT; /* 0x25 */ in smsatRead_1()
17207 fis->h.features = 0; /* FIS reserve */ in smsatRead_1()
17208 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatRead_1()
17209 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatRead_1()
17210 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatRead_1()
17211 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead_1()
17212 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatRead_1()
17213 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead_1()
17214 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead_1()
17215 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead_1()
17216 if (satOrgIOContext->LoopNum == 1) in smsatRead_1()
17219 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatRead_1()
17220 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatRead_1()
17225 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatRead_1()
17226 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatRead_1()
17228 fis->d.reserved4 = 0; in smsatRead_1()
17229 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead_1()
17230 fis->d.reserved5 = 0; in smsatRead_1()
17236 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead_1()
17237 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead_1()
17238 fis->h.command = SAT_READ_SECTORS_EXT; /* 0x24 */ in smsatRead_1()
17239 fis->h.features = 0; /* FIS reserve */ in smsatRead_1()
17240 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatRead_1()
17241 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatRead_1()
17242 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatRead_1()
17243 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatRead_1()
17244 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatRead_1()
17245 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead_1()
17246 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead_1()
17247 fis->d.featuresExp = 0; /* FIS reserve */ in smsatRead_1()
17248 if (satOrgIOContext->LoopNum == 1) in smsatRead_1()
17251 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatRead_1()
17252 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatRead_1()
17256 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatRead_1()
17257 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatRead_1()
17259 fis->d.reserved4 = 0; in smsatRead_1()
17260 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead_1()
17261 fis->d.reserved5 = 0; in smsatRead_1()
17266 fis->h.fisType = 0x27; /* Reg host to device */ in smsatRead_1()
17267 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatRead_1()
17268 fis->h.command = SAT_READ_FPDMA_QUEUED; /* 0x60 */ in smsatRead_1()
17269 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatRead_1()
17270 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatRead_1()
17271 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatRead_1()
17274 if (scsiCmnd->cdb[1] & SCSI_READ10_FUA_MASK) in smsatRead_1()
17275 fis->d.device = 0xC0; /* FIS FUA set */ in smsatRead_1()
17277 fis->d.device = 0x40; /* FIS FUA clear */ in smsatRead_1()
17279 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatRead_1()
17280 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatRead_1()
17281 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatRead_1()
17282 if (satOrgIOContext->LoopNum == 1) in smsatRead_1()
17285 fis->h.features = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatRead_1()
17286 fis->d.featuresExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatRead_1()
17290 fis->h.features = 0xFF; /* FIS sector count (7:0) */ in smsatRead_1()
17291 fis->d.featuresExp = 0xFF; /* FIS sector count (15:8) */ in smsatRead_1()
17293 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatRead_1()
17294 fis->d.sectorCountExp = 0; in smsatRead_1()
17295 fis->d.reserved4 = 0; in smsatRead_1()
17296 fis->d.control = 0; /* FIS HOB bit clear */ in smsatRead_1()
17297 fis->d.reserved5 = 0; in smsatRead_1()
17302 SM_DBG1(("smsatRead_1: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatRead_1()
17310 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatRead_1()
17312 if (satOrgIOContext->ATACmd == SAT_READ_DMA || satOrgIOContext->ATACmd == SAT_READ_SECTORS) in smsatRead_1()
17317 (smScsiInitiatorRequest_t *)satOrgIOContext->smScsiXchg, in smsatRead_1()
17320 (satOrgIOContext->OrgTL) * SATA_SECTOR_SIZE, in smsatRead_1()
17328 (smScsiInitiatorRequest_t *)satOrgIOContext->smScsiXchg, in smsatRead_1()
17331 (satOrgIOContext->OrgTL) * SATA_SECTOR_SIZE, in smsatRead_1()
17336 * Prepare SGL and send FIS to LL layer. in smsatRead_1()
17338 satIOContext->reqType = agRequestType; /* Save it */ in smsatRead_1()
17343 … (smScsiInitiatorRequest_t *)satOrgIOContext->smScsiXchg, //smScsiRequest, in smsatRead_1()
17366 agsaFisRegHostToDevice_t *fis; in smsatWrite_1() local
17375 fis = satIOContext->pFis; in smsatWrite_1()
17376 satOrgIOContext = satIOContext->satOrgIOContext; in smsatWrite_1()
17377 scsiCmnd = satOrgIOContext->pScsiCmnd; in smsatWrite_1()
17381 switch (satOrgIOContext->ATACmd) in smsatWrite_1()
17402 SM_DBG1(("smsatWrite_1: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatWrite_1()
17407 Remainder = satOrgIOContext->OrgTL % DenomTL; in smsatWrite_1()
17408 satOrgIOContext->currentLBA = satOrgIOContext->currentLBA + DenomTL; in smsatWrite_1()
17409 lba = satOrgIOContext->currentLBA; in smsatWrite_1()
17417 switch (satOrgIOContext->ATACmd) in smsatWrite_1()
17420 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite_1()
17421 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite_1()
17422 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatWrite_1()
17423 fis->h.features = 0; /* FIS reserve */ in smsatWrite_1()
17424 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatWrite_1()
17425 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatWrite_1()
17426 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatWrite_1()
17428 /* FIS LBA mode set LBA (27:24) */ in smsatWrite_1()
17429 fis->d.device = (bit8)((0x4 << 4) | (LBA[0] & 0xF)); in smsatWrite_1()
17431 fis->d.lbaLowExp = 0; in smsatWrite_1()
17432 fis->d.lbaMidExp = 0; in smsatWrite_1()
17433 fis->d.lbaHighExp = 0; in smsatWrite_1()
17434 fis->d.featuresExp = 0; in smsatWrite_1()
17435 if (satOrgIOContext->LoopNum == 1) in smsatWrite_1()
17438 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatWrite_1()
17442 fis->d.sectorCount = 0x0; /* FIS sector count (7:0) */ in smsatWrite_1()
17444 fis->d.sectorCountExp = 0; in smsatWrite_1()
17445 fis->d.reserved4 = 0; in smsatWrite_1()
17446 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite_1()
17447 fis->d.reserved5 = 0; in smsatWrite_1()
17453 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite_1()
17454 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatWrite_1()
17455 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatWrite_1()
17456 fis->h.features = 0; /* FIS reserve */ in smsatWrite_1()
17457 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatWrite_1()
17458 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatWrite_1()
17459 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatWrite_1()
17461 /* FIS LBA mode set LBA (27:24) */ in smsatWrite_1()
17462 fis->d.device = (bit8)((0x4 << 4) | (LBA[0] & 0xF)); in smsatWrite_1()
17464 fis->d.lbaLowExp = 0; in smsatWrite_1()
17465 fis->d.lbaMidExp = 0; in smsatWrite_1()
17466 fis->d.lbaHighExp = 0; in smsatWrite_1()
17467 fis->d.featuresExp = 0; in smsatWrite_1()
17468 if (satOrgIOContext->LoopNum == 1) in smsatWrite_1()
17471 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatWrite_1()
17475 fis->d.sectorCount = 0x0; /* FIS sector count (7:0) */ in smsatWrite_1()
17477 fis->d.sectorCountExp = 0; in smsatWrite_1()
17478 fis->d.reserved4 = 0; in smsatWrite_1()
17479 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite_1()
17480 fis->d.reserved5 = 0; in smsatWrite_1()
17486 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite_1()
17487 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite_1()
17488 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x3D */ in smsatWrite_1()
17489 fis->h.features = 0; /* FIS reserve */ in smsatWrite_1()
17490 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatWrite_1()
17491 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatWrite_1()
17492 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatWrite_1()
17493 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite_1()
17494 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatWrite_1()
17495 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite_1()
17496 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite_1()
17497 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite_1()
17498 if (satOrgIOContext->LoopNum == 1) in smsatWrite_1()
17501 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatWrite_1()
17502 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatWrite_1()
17506 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatWrite_1()
17507 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatWrite_1()
17509 fis->d.reserved4 = 0; in smsatWrite_1()
17510 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite_1()
17511 fis->d.reserved5 = 0; in smsatWrite_1()
17517 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite_1()
17518 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite_1()
17519 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWrite_1()
17521 fis->h.features = 0; /* FIS reserve */ in smsatWrite_1()
17522 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatWrite_1()
17523 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatWrite_1()
17524 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatWrite_1()
17525 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWrite_1()
17526 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatWrite_1()
17527 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite_1()
17528 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite_1()
17529 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWrite_1()
17530 if (satOrgIOContext->LoopNum == 1) in smsatWrite_1()
17533 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatWrite_1()
17534 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatWrite_1()
17538 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatWrite_1()
17539 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatWrite_1()
17541 fis->d.reserved4 = 0; in smsatWrite_1()
17542 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite_1()
17543 fis->d.reserved5 = 0; in smsatWrite_1()
17549 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWrite_1()
17550 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWrite_1()
17551 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWrite_1()
17552 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatWrite_1()
17553 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatWrite_1()
17554 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatWrite_1()
17557 if (scsiCmnd->cdb[1] & SCSI_WRITE10_FUA_MASK) in smsatWrite_1()
17558 fis->d.device = 0xC0; /* FIS FUA set */ in smsatWrite_1()
17560 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWrite_1()
17562 fis->d.lbaLowExp = LBA[0];; /* FIS LBA (31:24) */ in smsatWrite_1()
17563 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWrite_1()
17564 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWrite_1()
17565 if (satOrgIOContext->LoopNum == 1) in smsatWrite_1()
17568 fis->h.features = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatWrite_1()
17569 fis->d.featuresExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatWrite_1()
17573 fis->h.features = 0xFF; /* FIS sector count (7:0) */ in smsatWrite_1()
17574 fis->d.featuresExp = 0xFF; /* FIS sector count (15:8) */ in smsatWrite_1()
17576 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWrite_1()
17577 fis->d.sectorCountExp = 0; in smsatWrite_1()
17578 fis->d.reserved4 = 0; in smsatWrite_1()
17579 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWrite_1()
17580 fis->d.reserved5 = 0; in smsatWrite_1()
17586 SM_DBG1(("smsatWrite_1: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatWrite_1()
17594 satIOContext->satCompleteCB = &smsatChainedDataIOCB; in smsatWrite_1()
17596 if (satOrgIOContext->ATACmd == SAT_WRITE_DMA || satOrgIOContext->ATACmd == SAT_WRITE_SECTORS) in smsatWrite_1()
17601 (smScsiInitiatorRequest_t *)satOrgIOContext->smScsiXchg, in smsatWrite_1()
17604 (satOrgIOContext->OrgTL) * SATA_SECTOR_SIZE, in smsatWrite_1()
17612 (smScsiInitiatorRequest_t *)satOrgIOContext->smScsiXchg, in smsatWrite_1()
17615 (satOrgIOContext->OrgTL) * SATA_SECTOR_SIZE, in smsatWrite_1()
17620 * Prepare SGL and send FIS to LL layer. in smsatWrite_1()
17622 satIOContext->reqType = agRequestType; /* Save it */ in smsatWrite_1()
17627 … (smScsiInitiatorRequest_t *)satOrgIOContext->smScsiXchg, //smScsiRequest, in smsatWrite_1()
17646 agsaFisRegHostToDevice_t *fis; in smsatPassthrough() local
17652 pSense = satIOContext->pSense; in smsatPassthrough()
17653 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatPassthrough()
17654 pSatDevData = satIOContext->pSatDevData; in smsatPassthrough()
17655 fis = satIOContext->pFis; in smsatPassthrough()
17661 ataPassThroughHdr.opc = scsiCmnd->cdb[0]; in smsatPassthrough()
17662 ataPassThroughHdr.mulCount = scsiCmnd->cdb[1] >> 5; in smsatPassthrough()
17663 ataPassThroughHdr.proto = (scsiCmnd->cdb[1] >> 1) & 0x0F; in smsatPassthrough()
17664 ataPassThroughHdr.extend = scsiCmnd->cdb[1] & 1; in smsatPassthrough()
17665 ataPassThroughHdr.offline = scsiCmnd->cdb[2] >> 6; in smsatPassthrough()
17666 ataPassThroughHdr.ckCond = (scsiCmnd->cdb[2] >> 5) & 1; in smsatPassthrough()
17667 ataPassThroughHdr.tType = (scsiCmnd->cdb[2] >> 4) & 1; in smsatPassthrough()
17668 ataPassThroughHdr.tDir = (scsiCmnd->cdb[2] >> 3) & 1; in smsatPassthrough()
17669 ataPassThroughHdr.byteBlock = (scsiCmnd->cdb[2] >> 2) & 1; in smsatPassthrough()
17670 ataPassThroughHdr.tlength = scsiCmnd->cdb[2] & 0x3; in smsatPassthrough()
17719 satIOContext->pSmSenseData, in smsatPassthrough()
17720 satIOContext->interruptContext ); in smsatPassthrough()
17725 if(scsiCmnd->cdb[0] == 0xA1) in smsatPassthrough()
17727 … SM_DBG1(("smsatPassthrough A1h: COMMAND: %x FEATURE: %x \n",scsiCmnd->cdb[9],scsiCmnd->cdb[3])); in smsatPassthrough()
17729 fis->h.fisType = 0x27; /* Reg host to device */ in smsatPassthrough()
17730 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatPassthrough()
17731 fis->h.features = scsiCmnd->cdb[3]; in smsatPassthrough()
17732 fis->d.sectorCount = scsiCmnd->cdb[4]; /* 0x01 FIS sector count (7:0) */ in smsatPassthrough()
17733 fis->d.lbaLow = scsiCmnd->cdb[5]; /* Reading LBA FIS LBA (7 :0 ) */ in smsatPassthrough()
17734 fis->d.lbaMid = scsiCmnd->cdb[6]; in smsatPassthrough()
17735 fis->d.lbaHigh = scsiCmnd->cdb[7]; in smsatPassthrough()
17736 fis->d.device = scsiCmnd->cdb[8]; in smsatPassthrough()
17737 fis->h.command = scsiCmnd->cdb[9]; in smsatPassthrough()
17738 fis->d.featuresExp = 0; in smsatPassthrough()
17739 fis->d.sectorCountExp = 0; in smsatPassthrough()
17740 fis->d.lbaLowExp = 0; in smsatPassthrough()
17741 fis->d.lbaMidExp = 0; in smsatPassthrough()
17742 fis->d.lbaHighExp = 0; in smsatPassthrough()
17743 fis->d.reserved4 = 0; in smsatPassthrough()
17744 fis->d.control = 0; /* FIS HOB bit clear */ in smsatPassthrough()
17745 fis->d.reserved5 = 0; in smsatPassthrough()
17748 satIOContext->satCompleteCB = &smsatPassthroughCB; in smsatPassthrough()
17751 * Prepare SGL and send FIS to LL layer. in smsatPassthrough()
17754 satIOContext->reqType = agRequestType; in smsatPassthrough()
17763 else if(scsiCmnd->cdb[0] == 0x85) in smsatPassthrough()
17765 … SM_DBG1(("smsatPassthrough 85h: COMMAND: %x FEATURE: %x \n",scsiCmnd->cdb[14],scsiCmnd->cdb[4])); in smsatPassthrough()
17767 fis->h.fisType = 0x27; /* Reg host to device */ in smsatPassthrough()
17768 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatPassthrough()
17772 fis->d.featuresExp = scsiCmnd->cdb[3]; in smsatPassthrough()
17773 fis->d.sectorCountExp = scsiCmnd->cdb[5]; in smsatPassthrough()
17774 fis->d.lbaMidExp = scsiCmnd->cdb[9]; in smsatPassthrough()
17775 fis->d.lbaHighExp = scsiCmnd->cdb[11]; in smsatPassthrough()
17776 fis->d.lbaLowExp = scsiCmnd->cdb[7]; in smsatPassthrough()
17778 fis->h.features = scsiCmnd->cdb[4]; in smsatPassthrough()
17779 fis->d.sectorCount = scsiCmnd->cdb[6]; in smsatPassthrough()
17780 fis->d.lbaLow = scsiCmnd->cdb[8]; in smsatPassthrough()
17781 fis->d.lbaMid = scsiCmnd->cdb[10]; in smsatPassthrough()
17782 fis->d.lbaHigh = scsiCmnd->cdb[12]; in smsatPassthrough()
17783 fis->d.device = scsiCmnd->cdb[13]; in smsatPassthrough()
17784 fis->h.command = scsiCmnd->cdb[14]; in smsatPassthrough()
17785 fis->d.reserved4 = 0; in smsatPassthrough()
17786 fis->d.control = 0; in smsatPassthrough()
17787 fis->d.reserved5 = 0; in smsatPassthrough()
17793 satIOContext->satCompleteCB = &smsatPassthroughCB; in smsatPassthrough()
17796 * Prepare SGL and send FIS to LL layer. in smsatPassthrough()
17798 satIOContext->reqType = agRequestType; in smsatPassthrough()
17819 satIOContext->pSmSenseData, in smsatPassthrough()
17820 satIOContext->interruptContext ); in smsatPassthrough()
17841 agsaFisRegHostToDevice_t *fis; in smsatNonChainedWriteNVerify_Verify() local
17843 pSatDevData = satIOContext->pSatDevData; in smsatNonChainedWriteNVerify_Verify()
17844 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatNonChainedWriteNVerify_Verify()
17845 fis = satIOContext->pFis; in smsatNonChainedWriteNVerify_Verify()
17847 if (pSatDevData->sat48BitSupport == agTRUE) in smsatNonChainedWriteNVerify_Verify()
17849 fis->h.fisType = 0x27; /* Reg host to device */ in smsatNonChainedWriteNVerify_Verify()
17850 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatNonChainedWriteNVerify_Verify()
17852 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatNonChainedWriteNVerify_Verify()
17853 fis->h.features = 0; /* FIS reserve */ in smsatNonChainedWriteNVerify_Verify()
17854 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatNonChainedWriteNVerify_Verify()
17855 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatNonChainedWriteNVerify_Verify()
17856 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatNonChainedWriteNVerify_Verify()
17857 fis->d.device = 0x40; /* FIS LBA mode set 01000000 */ in smsatNonChainedWriteNVerify_Verify()
17858 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatNonChainedWriteNVerify_Verify()
17859 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatNonChainedWriteNVerify_Verify()
17860 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatNonChainedWriteNVerify_Verify()
17861 fis->d.featuresExp = 0; /* FIS reserve */ in smsatNonChainedWriteNVerify_Verify()
17862 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatNonChainedWriteNVerify_Verify()
17863 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatNonChainedWriteNVerify_Verify()
17865 fis->d.reserved4 = 0; in smsatNonChainedWriteNVerify_Verify()
17866 fis->d.control = 0; /* FIS HOB bit clear */ in smsatNonChainedWriteNVerify_Verify()
17867 fis->d.reserved5 = 0; in smsatNonChainedWriteNVerify_Verify()
17873 satIOContext->satCompleteCB = &smsatNonChainedWriteNVerifyCB; in smsatNonChainedWriteNVerify_Verify()
17876 * Prepare SGL and send FIS to LL layer. in smsatNonChainedWriteNVerify_Verify()
17878 satIOContext->reqType = agRequestType; /* Save it */ in smsatNonChainedWriteNVerify_Verify()
17915 agsaFisRegHostToDevice_t *fis; in smsatChainedWriteNVerify_Start_Verify() local
17922 pSatDevData = satIOContext->pSatDevData; in smsatChainedWriteNVerify_Start_Verify()
17923 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatChainedWriteNVerify_Start_Verify()
17924 fis = satIOContext->pFis; in smsatChainedWriteNVerify_Start_Verify()
17930 LBA[0] = scsiCmnd->cdb[2]; /* MSB */ in smsatChainedWriteNVerify_Start_Verify()
17931 LBA[1] = scsiCmnd->cdb[3]; in smsatChainedWriteNVerify_Start_Verify()
17932 LBA[2] = scsiCmnd->cdb[4]; in smsatChainedWriteNVerify_Start_Verify()
17933 LBA[3] = scsiCmnd->cdb[5]; /* LSB */ in smsatChainedWriteNVerify_Start_Verify()
17934 TL[0] = scsiCmnd->cdb[6]; /* MSB */ in smsatChainedWriteNVerify_Start_Verify()
17935 TL[1] = scsiCmnd->cdb[7]; in smsatChainedWriteNVerify_Start_Verify()
17936 TL[2] = scsiCmnd->cdb[7]; in smsatChainedWriteNVerify_Start_Verify()
17937 TL[3] = scsiCmnd->cdb[8]; /* LSB */ in smsatChainedWriteNVerify_Start_Verify()
17940 if (pSatDevData->sat48BitSupport == agTRUE) in smsatChainedWriteNVerify_Start_Verify()
17943 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Start_Verify()
17944 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatChainedWriteNVerify_Start_Verify()
17946 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatChainedWriteNVerify_Start_Verify()
17947 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Start_Verify()
17948 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Start_Verify()
17949 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Start_Verify()
17950 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Start_Verify()
17951 fis->d.device = 0x40; /* FIS LBA mode set 01000000 */ in smsatChainedWriteNVerify_Start_Verify()
17952 fis->d.lbaLowExp = scsiCmnd->cdb[2]; /* FIS LBA (31:24) */ in smsatChainedWriteNVerify_Start_Verify()
17953 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatChainedWriteNVerify_Start_Verify()
17954 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatChainedWriteNVerify_Start_Verify()
17955 fis->d.featuresExp = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Start_Verify()
17956 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Start_Verify()
17957 fis->d.sectorCountExp = scsiCmnd->cdb[7]; /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Start_Verify()
17959 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Start_Verify()
17960 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Start_Verify()
17961 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Start_Verify()
17964 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS_EXT; in smsatChainedWriteNVerify_Start_Verify()
17969 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Start_Verify()
17970 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatChainedWriteNVerify_Start_Verify()
17971 fis->h.command = SAT_READ_VERIFY_SECTORS; /* 0x40 */ in smsatChainedWriteNVerify_Start_Verify()
17972 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Start_Verify()
17973 fis->d.lbaLow = scsiCmnd->cdb[5]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Start_Verify()
17974 fis->d.lbaMid = scsiCmnd->cdb[4]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Start_Verify()
17975 fis->d.lbaHigh = scsiCmnd->cdb[3]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Start_Verify()
17976 /* FIS LBA mode set LBA (27:24) */ in smsatChainedWriteNVerify_Start_Verify()
17977 fis->d.device = (bit8)((0x4 << 4) | (scsiCmnd->cdb[2] & 0xF)); in smsatChainedWriteNVerify_Start_Verify()
17978 fis->d.lbaLowExp = 0; in smsatChainedWriteNVerify_Start_Verify()
17979 fis->d.lbaMidExp = 0; in smsatChainedWriteNVerify_Start_Verify()
17980 fis->d.lbaHighExp = 0; in smsatChainedWriteNVerify_Start_Verify()
17981 fis->d.featuresExp = 0; in smsatChainedWriteNVerify_Start_Verify()
17982 fis->d.sectorCount = scsiCmnd->cdb[8]; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Start_Verify()
17983 fis->d.sectorCountExp = 0; in smsatChainedWriteNVerify_Start_Verify()
17984 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Start_Verify()
17985 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Start_Verify()
17986 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Start_Verify()
17989 satIOContext->ATACmd = SAT_READ_VERIFY_SECTORS; in smsatChainedWriteNVerify_Start_Verify()
17993 satIOContext->currentLBA = lba; in smsatChainedWriteNVerify_Start_Verify()
17994 satIOContext->OrgTL = tl; in smsatChainedWriteNVerify_Start_Verify()
18001 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatChainedWriteNVerify_Start_Verify()
18005 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatChainedWriteNVerify_Start_Verify()
18016 satIOContext->LoopNum = LoopNum; in smsatChainedWriteNVerify_Start_Verify()
18023 satIOContext->satCompleteCB = &smsatNonChainedWriteNVerifyCB; in smsatChainedWriteNVerify_Start_Verify()
18028 /* re-setting tl */ in smsatChainedWriteNVerify_Start_Verify()
18029 if (fis->h.command == SAT_READ_VERIFY_SECTORS) in smsatChainedWriteNVerify_Start_Verify()
18031 fis->d.sectorCount = 0xFF; in smsatChainedWriteNVerify_Start_Verify()
18033 else if (fis->h.command == SAT_READ_VERIFY_SECTORS_EXT) in smsatChainedWriteNVerify_Start_Verify()
18035 fis->d.sectorCount = 0xFF; in smsatChainedWriteNVerify_Start_Verify()
18036 fis->d.sectorCountExp = 0xFF; in smsatChainedWriteNVerify_Start_Verify()
18045 satIOContext->satCompleteCB = &smsatChainedWriteNVerifyCB; in smsatChainedWriteNVerify_Start_Verify()
18050 * Prepare SGL and send FIS to LL layer. in smsatChainedWriteNVerify_Start_Verify()
18052 satIOContext->reqType = agRequestType; /* Save it */ in smsatChainedWriteNVerify_Start_Verify()
18080 agsaFisRegHostToDevice_t *fis; in smsatChainedWriteNVerify_Write() local
18089 fis = satIOContext->pFis; in smsatChainedWriteNVerify_Write()
18090 satOrgIOContext = satIOContext->satOrgIOContext; in smsatChainedWriteNVerify_Write()
18091 scsiCmnd = satOrgIOContext->pScsiCmnd; in smsatChainedWriteNVerify_Write()
18096 switch (satOrgIOContext->ATACmd) in smsatChainedWriteNVerify_Write()
18117 …SM_DBG1(("satChainedWriteNVerify_Write: error incorrect ata command 0x%x!!!\n", satIOContext->ATAC… in smsatChainedWriteNVerify_Write()
18122 Remainder = satOrgIOContext->OrgTL % DenomTL; in smsatChainedWriteNVerify_Write()
18123 satOrgIOContext->currentLBA = satOrgIOContext->currentLBA + DenomTL; in smsatChainedWriteNVerify_Write()
18124 lba = satOrgIOContext->currentLBA; in smsatChainedWriteNVerify_Write()
18131 switch (satOrgIOContext->ATACmd) in smsatChainedWriteNVerify_Write()
18134 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Write()
18135 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatChainedWriteNVerify_Write()
18136 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatChainedWriteNVerify_Write()
18137 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Write()
18138 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Write()
18139 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Write()
18140 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Write()
18142 /* FIS LBA mode set LBA (27:24) */ in smsatChainedWriteNVerify_Write()
18143 fis->d.device = (bit8)((0x4 << 4) | (LBA[0] & 0xF)); in smsatChainedWriteNVerify_Write()
18145 fis->d.lbaLowExp = 0; in smsatChainedWriteNVerify_Write()
18146 fis->d.lbaMidExp = 0; in smsatChainedWriteNVerify_Write()
18147 fis->d.lbaHighExp = 0; in smsatChainedWriteNVerify_Write()
18148 fis->d.featuresExp = 0; in smsatChainedWriteNVerify_Write()
18149 if (satOrgIOContext->LoopNum == 1) in smsatChainedWriteNVerify_Write()
18152 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18156 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18158 fis->d.sectorCountExp = 0; in smsatChainedWriteNVerify_Write()
18159 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Write()
18160 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Write()
18161 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Write()
18167 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Write()
18168 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatChainedWriteNVerify_Write()
18169 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatChainedWriteNVerify_Write()
18170 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Write()
18171 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Write()
18172 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Write()
18173 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Write()
18175 /* FIS LBA mode set LBA (27:24) */ in smsatChainedWriteNVerify_Write()
18176 fis->d.device = (bit8)((0x4 << 4) | (LBA[0] & 0xF)); in smsatChainedWriteNVerify_Write()
18178 fis->d.lbaLowExp = 0; in smsatChainedWriteNVerify_Write()
18179 fis->d.lbaMidExp = 0; in smsatChainedWriteNVerify_Write()
18180 fis->d.lbaHighExp = 0; in smsatChainedWriteNVerify_Write()
18181 fis->d.featuresExp = 0; in smsatChainedWriteNVerify_Write()
18182 if (satOrgIOContext->LoopNum == 1) in smsatChainedWriteNVerify_Write()
18185 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18189 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18191 fis->d.sectorCountExp = 0; in smsatChainedWriteNVerify_Write()
18192 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Write()
18193 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Write()
18194 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Write()
18200 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Write()
18201 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatChainedWriteNVerify_Write()
18202 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x3D */ in smsatChainedWriteNVerify_Write()
18203 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Write()
18204 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Write()
18205 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Write()
18206 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Write()
18207 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatChainedWriteNVerify_Write()
18208 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatChainedWriteNVerify_Write()
18209 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatChainedWriteNVerify_Write()
18210 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatChainedWriteNVerify_Write()
18211 fis->d.featuresExp = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Write()
18212 if (satOrgIOContext->LoopNum == 1) in smsatChainedWriteNVerify_Write()
18215 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18216 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Write()
18220 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18221 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Write()
18223 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Write()
18224 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Write()
18225 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Write()
18231 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Write()
18232 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatChainedWriteNVerify_Write()
18233 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatChainedWriteNVerify_Write()
18235 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Write()
18236 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Write()
18237 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Write()
18238 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Write()
18239 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatChainedWriteNVerify_Write()
18240 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatChainedWriteNVerify_Write()
18241 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatChainedWriteNVerify_Write()
18242 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatChainedWriteNVerify_Write()
18243 fis->d.featuresExp = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Write()
18244 if (satOrgIOContext->LoopNum == 1) in smsatChainedWriteNVerify_Write()
18247 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18248 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Write()
18252 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18253 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Write()
18255 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Write()
18256 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Write()
18257 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Write()
18263 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Write()
18264 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatChainedWriteNVerify_Write()
18265 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatChainedWriteNVerify_Write()
18266 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Write()
18267 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Write()
18268 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Write()
18271 if (scsiCmnd->cdb[1] & SCSI_WRITE10_FUA_MASK) in smsatChainedWriteNVerify_Write()
18272 fis->d.device = 0xC0; /* FIS FUA set */ in smsatChainedWriteNVerify_Write()
18274 fis->d.device = 0x40; /* FIS FUA clear */ in smsatChainedWriteNVerify_Write()
18276 fis->d.lbaLowExp = LBA[0];; /* FIS LBA (31:24) */ in smsatChainedWriteNVerify_Write()
18277 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatChainedWriteNVerify_Write()
18278 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatChainedWriteNVerify_Write()
18279 if (satOrgIOContext->LoopNum == 1) in smsatChainedWriteNVerify_Write()
18282 fis->h.features = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18283 fis->d.featuresExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Write()
18287 fis->h.features = 0xFF; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Write()
18288 fis->d.featuresExp = 0xFF; /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Write()
18290 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatChainedWriteNVerify_Write()
18291 fis->d.sectorCountExp = 0; in smsatChainedWriteNVerify_Write()
18292 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Write()
18293 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Write()
18294 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Write()
18300 …SM_DBG1(("satChainedWriteNVerify_Write: error incorrect ata command 0x%x!!!\n", satIOContext->ATAC… in smsatChainedWriteNVerify_Write()
18308 satIOContext->satCompleteCB = &smsatChainedWriteNVerifyCB; in smsatChainedWriteNVerify_Write()
18312 * Prepare SGL and send FIS to LL layer. in smsatChainedWriteNVerify_Write()
18314 satIOContext->reqType = agRequestType; /* Save it */ in smsatChainedWriteNVerify_Write()
18337 agsaFisRegHostToDevice_t *fis; in smsatChainedWriteNVerify_Verify() local
18345 fis = satIOContext->pFis; in smsatChainedWriteNVerify_Verify()
18346 satOrgIOContext = satIOContext->satOrgIOContext; in smsatChainedWriteNVerify_Verify()
18348 switch (satOrgIOContext->ATACmd) in smsatChainedWriteNVerify_Verify()
18357 …(("smsatChainedWriteNVerify_Verify: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatChainedWriteNVerify_Verify()
18362 Remainder = satOrgIOContext->OrgTL % DenomTL; in smsatChainedWriteNVerify_Verify()
18363 satOrgIOContext->currentLBA = satOrgIOContext->currentLBA + DenomTL; in smsatChainedWriteNVerify_Verify()
18364 lba = satOrgIOContext->currentLBA; in smsatChainedWriteNVerify_Verify()
18371 switch (satOrgIOContext->ATACmd) in smsatChainedWriteNVerify_Verify()
18374 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Verify()
18375 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatChainedWriteNVerify_Verify()
18376 fis->h.command = SAT_READ_VERIFY_SECTORS; /* 0x40 */ in smsatChainedWriteNVerify_Verify()
18377 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Verify()
18378 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Verify()
18379 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Verify()
18380 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Verify()
18382 /* FIS LBA mode set LBA (27:24) */ in smsatChainedWriteNVerify_Verify()
18383 fis->d.device = (bit8)((0x4 << 4) | (LBA[0] & 0xF)); in smsatChainedWriteNVerify_Verify()
18385 fis->d.lbaLowExp = 0; in smsatChainedWriteNVerify_Verify()
18386 fis->d.lbaMidExp = 0; in smsatChainedWriteNVerify_Verify()
18387 fis->d.lbaHighExp = 0; in smsatChainedWriteNVerify_Verify()
18388 fis->d.featuresExp = 0; in smsatChainedWriteNVerify_Verify()
18389 if (satOrgIOContext->LoopNum == 1) in smsatChainedWriteNVerify_Verify()
18392 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Verify()
18396 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Verify()
18398 fis->d.sectorCountExp = 0; in smsatChainedWriteNVerify_Verify()
18399 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Verify()
18400 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Verify()
18401 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Verify()
18407 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedWriteNVerify_Verify()
18408 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatChainedWriteNVerify_Verify()
18409 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT; /* 0x42 */ in smsatChainedWriteNVerify_Verify()
18410 fis->h.features = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Verify()
18411 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedWriteNVerify_Verify()
18412 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedWriteNVerify_Verify()
18413 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedWriteNVerify_Verify()
18414 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatChainedWriteNVerify_Verify()
18415 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatChainedWriteNVerify_Verify()
18416 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatChainedWriteNVerify_Verify()
18417 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatChainedWriteNVerify_Verify()
18418 fis->d.featuresExp = 0; /* FIS reserve */ in smsatChainedWriteNVerify_Verify()
18419 if (satOrgIOContext->LoopNum == 1) in smsatChainedWriteNVerify_Verify()
18422 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Verify()
18423 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Verify()
18427 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedWriteNVerify_Verify()
18428 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatChainedWriteNVerify_Verify()
18430 fis->d.reserved4 = 0; in smsatChainedWriteNVerify_Verify()
18431 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedWriteNVerify_Verify()
18432 fis->d.reserved5 = 0; in smsatChainedWriteNVerify_Verify()
18439 …(("smsatChainedWriteNVerify_Verify: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatChainedWriteNVerify_Verify()
18447 satIOContext->satCompleteCB = &smsatChainedWriteNVerifyCB; in smsatChainedWriteNVerify_Verify()
18451 * Prepare SGL and send FIS to LL layer. in smsatChainedWriteNVerify_Verify()
18453 satIOContext->reqType = agRequestType; /* Save it */ in smsatChainedWriteNVerify_Verify()
18476 agsaFisRegHostToDevice_t *fis; in smsatChainedVerify() local
18484 fis = satIOContext->pFis; in smsatChainedVerify()
18485 satOrgIOContext = satIOContext->satOrgIOContext; in smsatChainedVerify()
18487 switch (satOrgIOContext->ATACmd) in smsatChainedVerify()
18496 SM_DBG1(("satChainedVerify: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatChainedVerify()
18501 Remainder = satOrgIOContext->OrgTL % DenomTL; in smsatChainedVerify()
18502 satOrgIOContext->currentLBA = satOrgIOContext->currentLBA + DenomTL; in smsatChainedVerify()
18503 lba = satOrgIOContext->currentLBA; in smsatChainedVerify()
18510 switch (satOrgIOContext->ATACmd) in smsatChainedVerify()
18513 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedVerify()
18514 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatChainedVerify()
18515 fis->h.command = SAT_READ_VERIFY_SECTORS; /* 0x40 */ in smsatChainedVerify()
18516 fis->h.features = 0; /* FIS reserve */ in smsatChainedVerify()
18517 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedVerify()
18518 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedVerify()
18519 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedVerify()
18521 /* FIS LBA mode set LBA (27:24) */ in smsatChainedVerify()
18522 fis->d.device = (bit8)((0x4 << 4) | (LBA[0] & 0xF)); in smsatChainedVerify()
18524 fis->d.lbaLowExp = 0; in smsatChainedVerify()
18525 fis->d.lbaMidExp = 0; in smsatChainedVerify()
18526 fis->d.lbaHighExp = 0; in smsatChainedVerify()
18527 fis->d.featuresExp = 0; in smsatChainedVerify()
18528 if (satOrgIOContext->LoopNum == 1) in smsatChainedVerify()
18531 fis->d.sectorCount = (bit8)Remainder; /* FIS sector count (7:0) */ in smsatChainedVerify()
18535 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedVerify()
18537 fis->d.sectorCountExp = 0; in smsatChainedVerify()
18538 fis->d.reserved4 = 0; in smsatChainedVerify()
18539 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedVerify()
18540 fis->d.reserved5 = 0; in smsatChainedVerify()
18546 fis->h.fisType = 0x27; /* Reg host to device */ in smsatChainedVerify()
18547 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatChainedVerify()
18548 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT; /* 0x42 */ in smsatChainedVerify()
18549 fis->h.features = 0; /* FIS reserve */ in smsatChainedVerify()
18550 fis->d.lbaLow = LBA[3]; /* FIS LBA (7 :0 ) */ in smsatChainedVerify()
18551 fis->d.lbaMid = LBA[2]; /* FIS LBA (15:8 ) */ in smsatChainedVerify()
18552 fis->d.lbaHigh = LBA[1]; /* FIS LBA (23:16) */ in smsatChainedVerify()
18553 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatChainedVerify()
18554 fis->d.lbaLowExp = LBA[0]; /* FIS LBA (31:24) */ in smsatChainedVerify()
18555 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatChainedVerify()
18556 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatChainedVerify()
18557 fis->d.featuresExp = 0; /* FIS reserve */ in smsatChainedVerify()
18558 if (satOrgIOContext->LoopNum == 1) in smsatChainedVerify()
18561 fis->d.sectorCount = (bit8)(Remainder & 0xFF); /* FIS sector count (7:0) */ in smsatChainedVerify()
18562 fis->d.sectorCountExp = (bit8)((Remainder & 0xFF00) >> 8); /* FIS sector count (15:8) */ in smsatChainedVerify()
18566 fis->d.sectorCount = 0xFF; /* FIS sector count (7:0) */ in smsatChainedVerify()
18567 fis->d.sectorCountExp = 0xFF; /* FIS sector count (15:8) */ in smsatChainedVerify()
18569 fis->d.reserved4 = 0; in smsatChainedVerify()
18570 fis->d.control = 0; /* FIS HOB bit clear */ in smsatChainedVerify()
18571 fis->d.reserved5 = 0; in smsatChainedVerify()
18578 SM_DBG1(("satChainedVerify: error incorrect ata command 0x%x!!!\n", satIOContext->ATACmd)); in smsatChainedVerify()
18586 satIOContext->satCompleteCB = &smsatChainedVerifyCB; in smsatChainedVerify()
18590 * Prepare SGL and send FIS to LL layer. in smsatChainedVerify()
18592 satIOContext->reqType = agRequestType; /* Save it */ in smsatChainedVerify()
18620 agsaFisRegHostToDevice_t *fis; in smsatWriteSame10_1() local
18624 fis = satIOContext->pFis; in smsatWriteSame10_1()
18632 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteSame10_1()
18633 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteSame10_1()
18634 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatWriteSame10_1()
18635 fis->h.features = 0; /* FIS reserve */ in smsatWriteSame10_1()
18636 fis->d.lbaLow = lba4; /* FIS LBA (7 :0 ) */ in smsatWriteSame10_1()
18637 fis->d.lbaMid = lba3; /* FIS LBA (15:8 ) */ in smsatWriteSame10_1()
18638 fis->d.lbaHigh = lba2; /* FIS LBA (23:16) */ in smsatWriteSame10_1()
18639 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteSame10_1()
18640 fis->d.lbaLowExp = lba1; /* FIS LBA (31:24) */ in smsatWriteSame10_1()
18641 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteSame10_1()
18642 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteSame10_1()
18643 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteSame10_1()
18645 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatWriteSame10_1()
18646 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatWriteSame10_1()
18647 fis->d.reserved4 = 0; in smsatWriteSame10_1()
18648 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteSame10_1()
18649 fis->d.reserved5 = 0; in smsatWriteSame10_1()
18653 satIOContext->satCompleteCB = &smsatWriteSame10CB; in smsatWriteSame10_1()
18655 * Prepare SGL and send FIS to LL layer. in smsatWriteSame10_1()
18657 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteSame10_1()
18684 agsaFisRegHostToDevice_t *fis; in smsatWriteSame10_2() local
18688 fis = satIOContext->pFis; in smsatWriteSame10_2()
18696 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteSame10_2()
18697 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteSame10_2()
18698 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatWriteSame10_2()
18699 fis->h.features = 0; /* FIS reserve */ in smsatWriteSame10_2()
18700 fis->d.lbaLow = lba4; /* FIS LBA (7 :0 ) */ in smsatWriteSame10_2()
18701 fis->d.lbaMid = lba3; /* FIS LBA (15:8 ) */ in smsatWriteSame10_2()
18702 fis->d.lbaHigh = lba2; /* FIS LBA (23:16) */ in smsatWriteSame10_2()
18703 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatWriteSame10_2()
18704 fis->d.lbaLowExp = lba1; /* FIS LBA (31:24) */ in smsatWriteSame10_2()
18705 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteSame10_2()
18706 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteSame10_2()
18707 fis->d.featuresExp = 0; /* FIS reserve */ in smsatWriteSame10_2()
18709 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatWriteSame10_2()
18710 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatWriteSame10_2()
18711 fis->d.reserved4 = 0; in smsatWriteSame10_2()
18712 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteSame10_2()
18713 fis->d.reserved5 = 0; in smsatWriteSame10_2()
18717 satIOContext->satCompleteCB = &smsatWriteSame10CB; in smsatWriteSame10_2()
18719 * Prepare SGL and send FIS to LL layer. in smsatWriteSame10_2()
18721 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteSame10_2()
18748 agsaFisRegHostToDevice_t *fis; in smsatWriteSame10_3() local
18752 fis = satIOContext->pFis; in smsatWriteSame10_3()
18761 fis->h.fisType = 0x27; /* Reg host to device */ in smsatWriteSame10_3()
18762 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatWriteSame10_3()
18763 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatWriteSame10_3()
18767 fis->h.features = 1; /* FIS sector count (7:0) */ in smsatWriteSame10_3()
18768 fis->d.featuresExp = 0; /* FIS sector count (15:8) */ in smsatWriteSame10_3()
18770 fis->d.lbaLow = lba4; /* FIS LBA (7 :0 ) */ in smsatWriteSame10_3()
18771 fis->d.lbaMid = lba3; /* FIS LBA (15:8 ) */ in smsatWriteSame10_3()
18772 fis->d.lbaHigh = lba2; /* FIS LBA (23:16) */ in smsatWriteSame10_3()
18774 fis->d.device = 0x40; /* FIS FUA clear */ in smsatWriteSame10_3()
18775 fis->d.lbaLowExp = lba1; /* FIS LBA (31:24) */ in smsatWriteSame10_3()
18776 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatWriteSame10_3()
18777 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatWriteSame10_3()
18778 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatWriteSame10_3()
18779 fis->d.sectorCountExp = 0; in smsatWriteSame10_3()
18780 fis->d.reserved4 = 0; in smsatWriteSame10_3()
18781 fis->d.control = 0; /* FIS HOB bit clear */ in smsatWriteSame10_3()
18782 fis->d.reserved5 = 0; in smsatWriteSame10_3()
18787 satIOContext->satCompleteCB = &smsatWriteSame10CB; in smsatWriteSame10_3()
18789 * Prepare SGL and send FIS to LL layer. in smsatWriteSame10_3()
18791 satIOContext->reqType = agRequestType; /* Save it */ in smsatWriteSame10_3()
18817 agsaFisRegHostToDevice_t *fis; in smsatStartStopUnit_1() local
18820 fis = satIOContext->pFis; in smsatStartStopUnit_1()
18822 fis->h.fisType = 0x27; /* Reg host to device */ in smsatStartStopUnit_1()
18823 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatStartStopUnit_1()
18824 fis->h.command = SAT_STANDBY; /* 0xE2 */ in smsatStartStopUnit_1()
18825 fis->h.features = 0; /* FIS features NA */ in smsatStartStopUnit_1()
18826 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatStartStopUnit_1()
18827 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatStartStopUnit_1()
18828 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatStartStopUnit_1()
18829 fis->d.lbaLowExp = 0; in smsatStartStopUnit_1()
18830 fis->d.lbaMidExp = 0; in smsatStartStopUnit_1()
18831 fis->d.lbaHighExp = 0; in smsatStartStopUnit_1()
18832 fis->d.featuresExp = 0; in smsatStartStopUnit_1()
18833 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatStartStopUnit_1()
18834 fis->d.sectorCountExp = 0; in smsatStartStopUnit_1()
18835 fis->d.reserved4 = 0; in smsatStartStopUnit_1()
18836 fis->d.device = 0; /* 0 */ in smsatStartStopUnit_1()
18837 fis->d.control = 0; /* FIS HOB bit clear */ in smsatStartStopUnit_1()
18838 fis->d.reserved5 = 0; in smsatStartStopUnit_1()
18844 satIOContext->satCompleteCB = &smsatStartStopUnitCB; in smsatStartStopUnit_1()
18847 * Prepare SGL and send FIS to LL layer. in smsatStartStopUnit_1()
18849 satIOContext->reqType = agRequestType; /* Save it */ in smsatStartStopUnit_1()
18877 agsaFisRegHostToDevice_t *fis; in smsatSendDiagnostic_1() local
18880 pSatDevData = satIOContext->pSatDevData; in smsatSendDiagnostic_1()
18881 fis = satIOContext->pFis; in smsatSendDiagnostic_1()
18885 if (pSatDevData->sat48BitSupport == agTRUE) in smsatSendDiagnostic_1()
18888 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic_1()
18889 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic_1()
18890 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatSendDiagnostic_1()
18891 fis->h.features = 0; /* FIS reserve */ in smsatSendDiagnostic_1()
18892 fis->d.lbaLow = pSatDevData->satMaxLBA[7]; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic_1()
18893 fis->d.lbaMid = pSatDevData->satMaxLBA[6]; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic_1()
18894 fis->d.lbaHigh = pSatDevData->satMaxLBA[5]; /* FIS LBA (23:16) */ in smsatSendDiagnostic_1()
18895 fis->d.lbaLowExp = pSatDevData->satMaxLBA[4]; /* FIS LBA (31:24) */ in smsatSendDiagnostic_1()
18896 fis->d.lbaMidExp = pSatDevData->satMaxLBA[3]; /* FIS LBA (39:32) */ in smsatSendDiagnostic_1()
18897 fis->d.lbaHighExp = pSatDevData->satMaxLBA[2]; /* FIS LBA (47:40) */ in smsatSendDiagnostic_1()
18898 fis->d.featuresExp = 0; /* FIS reserve */ in smsatSendDiagnostic_1()
18899 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatSendDiagnostic_1()
18900 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatSendDiagnostic_1()
18901 fis->d.reserved4 = 0; in smsatSendDiagnostic_1()
18902 fis->d.device = 0x40; /* 01000000 */ in smsatSendDiagnostic_1()
18903 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic_1()
18904 fis->d.reserved5 = 0; in smsatSendDiagnostic_1()
18910 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic_1()
18911 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic_1()
18912 fis->h.command = SAT_READ_VERIFY_SECTORS;/* 0x40 */ in smsatSendDiagnostic_1()
18913 fis->h.features = 0; /* FIS features NA */ in smsatSendDiagnostic_1()
18914 fis->d.lbaLow = pSatDevData->satMaxLBA[7]; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic_1()
18915 fis->d.lbaMid = pSatDevData->satMaxLBA[6]; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic_1()
18916 fis->d.lbaHigh = pSatDevData->satMaxLBA[5]; /* FIS LBA (23:16) */ in smsatSendDiagnostic_1()
18917 fis->d.lbaLowExp = 0; in smsatSendDiagnostic_1()
18918 fis->d.lbaMidExp = 0; in smsatSendDiagnostic_1()
18919 fis->d.lbaHighExp = 0; in smsatSendDiagnostic_1()
18920 fis->d.featuresExp = 0; in smsatSendDiagnostic_1()
18921 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatSendDiagnostic_1()
18922 fis->d.sectorCountExp = 0; in smsatSendDiagnostic_1()
18923 fis->d.reserved4 = 0; in smsatSendDiagnostic_1()
18924 fis->d.device = (bit8)((0x4 << 4) | (pSatDevData->satMaxLBA[4] & 0xF)); in smsatSendDiagnostic_1()
18926 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic_1()
18927 fis->d.reserved5 = 0; in smsatSendDiagnostic_1()
18935 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic_1()
18938 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic_1()
18940 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic_1()
18968 agsaFisRegHostToDevice_t *fis; in smsatSendDiagnostic_2() local
18972 pSatDevData = satIOContext->pSatDevData; in smsatSendDiagnostic_2()
18973 fis = satIOContext->pFis; in smsatSendDiagnostic_2()
18977 if (pSatDevData->sat48BitSupport == agTRUE) in smsatSendDiagnostic_2()
18980 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic_2()
18981 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic_2()
18982 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatSendDiagnostic_2()
18983 fis->h.features = 0; /* FIS reserve */ in smsatSendDiagnostic_2()
18984 fis->d.lbaLow = 0x7F; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic_2()
18985 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic_2()
18986 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSendDiagnostic_2()
18987 fis->d.lbaLowExp = 0; /* FIS LBA (31:24) */ in smsatSendDiagnostic_2()
18988 fis->d.lbaMidExp = 0; /* FIS LBA (39:32) */ in smsatSendDiagnostic_2()
18989 fis->d.lbaHighExp = 0; /* FIS LBA (47:40) */ in smsatSendDiagnostic_2()
18990 fis->d.featuresExp = 0; /* FIS reserve */ in smsatSendDiagnostic_2()
18991 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatSendDiagnostic_2()
18992 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatSendDiagnostic_2()
18993 fis->d.reserved4 = 0; in smsatSendDiagnostic_2()
18994 fis->d.device = 0x40; /* 01000000 */ in smsatSendDiagnostic_2()
18995 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic_2()
18996 fis->d.reserved5 = 0; in smsatSendDiagnostic_2()
19002 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendDiagnostic_2()
19003 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendDiagnostic_2()
19004 fis->h.command = SAT_READ_VERIFY_SECTORS;/* 0x40 */ in smsatSendDiagnostic_2()
19005 fis->h.features = 0; /* FIS features NA */ in smsatSendDiagnostic_2()
19006 fis->d.lbaLow = 0x7F; /* FIS LBA (7 :0 ) */ in smsatSendDiagnostic_2()
19007 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatSendDiagnostic_2()
19008 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatSendDiagnostic_2()
19009 fis->d.lbaLowExp = 0; in smsatSendDiagnostic_2()
19010 fis->d.lbaMidExp = 0; in smsatSendDiagnostic_2()
19011 fis->d.lbaHighExp = 0; in smsatSendDiagnostic_2()
19012 fis->d.featuresExp = 0; in smsatSendDiagnostic_2()
19013 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatSendDiagnostic_2()
19014 fis->d.sectorCountExp = 0; in smsatSendDiagnostic_2()
19015 fis->d.reserved4 = 0; in smsatSendDiagnostic_2()
19016 fis->d.device = 0x40; /* FIS LBA mode set 01000000 */ in smsatSendDiagnostic_2()
19017 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendDiagnostic_2()
19018 fis->d.reserved5 = 0; in smsatSendDiagnostic_2()
19026 satIOContext->satCompleteCB = &smsatSendDiagnosticCB; in smsatSendDiagnostic_2()
19029 * Prepare SGL and send FIS to LL layer. in smsatSendDiagnostic_2()
19031 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendDiagnostic_2()
19052 /* sends either ATA SET FEATURES based on DRA bit */ in smsatModeSelect6n10_1()
19055 agsaFisRegHostToDevice_t *fis; in smsatModeSelect6n10_1() local
19059 fis = satIOContext->pFis; in smsatModeSelect6n10_1()
19060 pLogPage = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatModeSelect6n10_1()
19074 /* sends ATA SET FEATURES based on DRA bit */ in smsatModeSelect6n10_1()
19077 SM_DBG5(("smsatModeSelect6n10_1: enable read look-ahead feature\n")); in smsatModeSelect6n10_1()
19079 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect6n10_1()
19080 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect6n10_1()
19082 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatModeSelect6n10_1()
19083 fis->h.features = 0xAA; /* enable read look-ahead */ in smsatModeSelect6n10_1()
19084 fis->d.lbaLow = 0; /* */ in smsatModeSelect6n10_1()
19085 fis->d.lbaMid = 0; /* */ in smsatModeSelect6n10_1()
19086 fis->d.lbaHigh = 0; /* */ in smsatModeSelect6n10_1()
19087 fis->d.device = 0; /* */ in smsatModeSelect6n10_1()
19088 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect6n10_1()
19089 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect6n10_1()
19090 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect6n10_1()
19091 fis->d.featuresExp = 0; /* */ in smsatModeSelect6n10_1()
19092 fis->d.sectorCount = 0; /* */ in smsatModeSelect6n10_1()
19093 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect6n10_1()
19094 fis->d.reserved4 = 0; in smsatModeSelect6n10_1()
19095 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect6n10_1()
19096 fis->d.reserved5 = 0; in smsatModeSelect6n10_1()
19102 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect6n10_1()
19105 * Prepare SGL and send FIS to LL layer. in smsatModeSelect6n10_1()
19107 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect6n10_1()
19118 SM_DBG5(("smsatModeSelect6n10_1: disable read look-ahead feature\n")); in smsatModeSelect6n10_1()
19120 fis->h.fisType = 0x27; /* Reg host to device */ in smsatModeSelect6n10_1()
19121 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatModeSelect6n10_1()
19123 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatModeSelect6n10_1()
19124 fis->h.features = 0x55; /* disable read look-ahead */ in smsatModeSelect6n10_1()
19125 fis->d.lbaLow = 0; /* */ in smsatModeSelect6n10_1()
19126 fis->d.lbaMid = 0; /* */ in smsatModeSelect6n10_1()
19127 fis->d.lbaHigh = 0; /* */ in smsatModeSelect6n10_1()
19128 fis->d.device = 0; /* */ in smsatModeSelect6n10_1()
19129 fis->d.lbaLowExp = 0; /* */ in smsatModeSelect6n10_1()
19130 fis->d.lbaMidExp = 0; /* */ in smsatModeSelect6n10_1()
19131 fis->d.lbaHighExp = 0; /* */ in smsatModeSelect6n10_1()
19132 fis->d.featuresExp = 0; /* */ in smsatModeSelect6n10_1()
19133 fis->d.sectorCount = 0; /* */ in smsatModeSelect6n10_1()
19134 fis->d.sectorCountExp = 0; /* */ in smsatModeSelect6n10_1()
19135 fis->d.reserved4 = 0; in smsatModeSelect6n10_1()
19136 fis->d.control = 0; /* FIS HOB bit clear */ in smsatModeSelect6n10_1()
19137 fis->d.reserved5 = 0; in smsatModeSelect6n10_1()
19143 satIOContext->satCompleteCB = &smsatModeSelect6n10CB; in smsatModeSelect6n10_1()
19146 * Prepare SGL and send FIS to LL layer. in smsatModeSelect6n10_1()
19148 satIOContext->reqType = agRequestType; /* Save it */ in smsatModeSelect6n10_1()
19172 agsaFisRegHostToDevice_t *fis; in smsatLogSense_1() local
19174 pSatDevData = satIOContext->pSatDevData; in smsatLogSense_1()
19175 fis = satIOContext->pFis; in smsatLogSense_1()
19180 if ( pSatDevData->sat48BitSupport == agTRUE ) in smsatLogSense_1()
19182 SM_DBG5(("smsatLogSense_1: case 2-1 sends READ LOG EXT\n")); in smsatLogSense_1()
19184 fis->h.fisType = 0x27; /* Reg host to device */ in smsatLogSense_1()
19185 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatLogSense_1()
19187 fis->h.command = SAT_READ_LOG_EXT; /* 0x2F */ in smsatLogSense_1()
19188 fis->h.features = 0; /* FIS reserve */ in smsatLogSense_1()
19189 fis->d.lbaLow = 0x07; /* 0x07 */ in smsatLogSense_1()
19190 fis->d.lbaMid = 0; /* */ in smsatLogSense_1()
19191 fis->d.lbaHigh = 0; /* */ in smsatLogSense_1()
19192 fis->d.device = 0; /* */ in smsatLogSense_1()
19193 fis->d.lbaLowExp = 0; /* */ in smsatLogSense_1()
19194 fis->d.lbaMidExp = 0; /* */ in smsatLogSense_1()
19195 fis->d.lbaHighExp = 0; /* */ in smsatLogSense_1()
19196 fis->d.featuresExp = 0; /* FIS reserve */ in smsatLogSense_1()
19197 fis->d.sectorCount = 0x01; /* 1 sector counts */ in smsatLogSense_1()
19198 fis->d.sectorCountExp = 0x00; /* 1 sector counts */ in smsatLogSense_1()
19199 fis->d.reserved4 = 0; in smsatLogSense_1()
19200 fis->d.control = 0; /* FIS HOB bit clear */ in smsatLogSense_1()
19201 fis->d.reserved5 = 0; in smsatLogSense_1()
19207 satIOContext->satCompleteCB = &smsatLogSenseCB; in smsatLogSense_1()
19210 * Prepare SGL and send FIS to LL layer. in smsatLogSense_1()
19212 satIOContext->reqType = agRequestType; /* Save it */ in smsatLogSense_1()
19224 SM_DBG5(("smsatLogSense_1: case 2-2 sends SMART READ LOG\n")); in smsatLogSense_1()
19226 fis->h.fisType = 0x27; /* Reg host to device */ in smsatLogSense_1()
19227 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatLogSense_1()
19229 fis->h.command = SAT_SMART; /* 0x2F */ in smsatLogSense_1()
19230 fis->h.features = SAT_SMART_READ_LOG; /* 0xd5 */ in smsatLogSense_1()
19231 fis->d.lbaLow = 0x06; /* 0x06 */ in smsatLogSense_1()
19232 fis->d.lbaMid = 0x00; /* 0x4f */ in smsatLogSense_1()
19233 fis->d.lbaHigh = 0x00; /* 0xc2 */ in smsatLogSense_1()
19234 fis->d.device = 0; /* */ in smsatLogSense_1()
19235 fis->d.lbaLowExp = 0; /* */ in smsatLogSense_1()
19236 fis->d.lbaMidExp = 0; /* */ in smsatLogSense_1()
19237 fis->d.lbaHighExp = 0; /* */ in smsatLogSense_1()
19238 fis->d.featuresExp = 0; /* FIS reserve */ in smsatLogSense_1()
19239 fis->d.sectorCount = 0x01; /* */ in smsatLogSense_1()
19240 fis->d.sectorCountExp = 0x00; /* */ in smsatLogSense_1()
19241 fis->d.reserved4 = 0; in smsatLogSense_1()
19242 fis->d.control = 0; /* FIS HOB bit clear */ in smsatLogSense_1()
19243 fis->d.reserved5 = 0; in smsatLogSense_1()
19249 satIOContext->satCompleteCB = &smsatLogSenseCB; in smsatLogSense_1()
19252 * Prepare SGL and send FIS to LL layer. in smsatLogSense_1()
19254 satIOContext->reqType = agRequestType; /* Save it */ in smsatLogSense_1()
19284 agsaFisRegHostToDevice_t *fis; in smsatReassignBlocks_2() local
19286 pSense = satIOContext->pSense; in smsatReassignBlocks_2()
19287 pSatDevData = satIOContext->pSatDevData; in smsatReassignBlocks_2()
19288 fis = satIOContext->pFis; in smsatReassignBlocks_2()
19291 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatReassignBlocks_2()
19297 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks_2()
19298 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatReassignBlocks_2()
19299 fis->h.command = SAT_WRITE_DMA; /* 0xCA */ in smsatReassignBlocks_2()
19300 fis->h.features = 0; /* FIS reserve */ in smsatReassignBlocks_2()
19301 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks_2()
19302 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks_2()
19303 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks_2()
19305 /* FIS LBA mode set LBA (27:24) */ in smsatReassignBlocks_2()
19306 fis->d.device = (bit8)((0x4 << 4) | (LBA[4] & 0xF)); in smsatReassignBlocks_2()
19308 fis->d.lbaLowExp = 0; in smsatReassignBlocks_2()
19309 fis->d.lbaMidExp = 0; in smsatReassignBlocks_2()
19310 fis->d.lbaHighExp = 0; in smsatReassignBlocks_2()
19311 fis->d.featuresExp = 0; in smsatReassignBlocks_2()
19312 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks_2()
19313 fis->d.sectorCountExp = 0; in smsatReassignBlocks_2()
19314 fis->d.reserved4 = 0; in smsatReassignBlocks_2()
19315 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks_2()
19316 fis->d.reserved5 = 0; in smsatReassignBlocks_2()
19319 satIOContext->ATACmd = SAT_WRITE_DMA; in smsatReassignBlocks_2()
19328 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks_2()
19329 fis->h.c_pmPort = 0x80; /* C bit is set */ in smsatReassignBlocks_2()
19330 fis->h.command = SAT_WRITE_SECTORS; /* 0x30 */ in smsatReassignBlocks_2()
19331 fis->h.features = 0; /* FIS reserve */ in smsatReassignBlocks_2()
19332 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks_2()
19333 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks_2()
19334 fis->d.lbaHigh = LBA[7]; /* FIS LBA (23:16) */ in smsatReassignBlocks_2()
19336 /* FIS LBA mode set LBA (27:24) */ in smsatReassignBlocks_2()
19337 fis->d.device = (bit8)((0x4 << 4) | (LBA[4] & 0xF)); in smsatReassignBlocks_2()
19339 fis->d.lbaLowExp = 0; in smsatReassignBlocks_2()
19340 fis->d.lbaMidExp = 0; in smsatReassignBlocks_2()
19341 fis->d.lbaHighExp = 0; in smsatReassignBlocks_2()
19342 fis->d.featuresExp = 0; in smsatReassignBlocks_2()
19343 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks_2()
19344 fis->d.sectorCountExp = 0; in smsatReassignBlocks_2()
19345 fis->d.reserved4 = 0; in smsatReassignBlocks_2()
19346 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks_2()
19347 fis->d.reserved5 = 0; in smsatReassignBlocks_2()
19350 satIOContext->ATACmd = SAT_WRITE_SECTORS; in smsatReassignBlocks_2()
19354 if (pSatDevData->sat48BitSupport == agTRUE) in smsatReassignBlocks_2()
19356 if (pSatDevData->satDMASupport == agTRUE && pSatDevData->satDMAEnabled == agTRUE) in smsatReassignBlocks_2()
19361 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks_2()
19362 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReassignBlocks_2()
19365 fis->h.command = SAT_WRITE_DMA_EXT; /* 0x35 */ in smsatReassignBlocks_2()
19366 satIOContext->ATACmd = SAT_WRITE_DMA_EXT; in smsatReassignBlocks_2()
19368 fis->h.features = 0; /* FIS reserve */ in smsatReassignBlocks_2()
19369 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks_2()
19370 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks_2()
19371 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks_2()
19372 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatReassignBlocks_2()
19373 fis->d.lbaLowExp = LBA[4]; /* FIS LBA (31:24) */ in smsatReassignBlocks_2()
19374 fis->d.lbaMidExp = LBA[3]; /* FIS LBA (39:32) */ in smsatReassignBlocks_2()
19375 fis->d.lbaHighExp = LBA[2]; /* FIS LBA (47:40) */ in smsatReassignBlocks_2()
19376 fis->d.featuresExp = 0; /* FIS reserve */ in smsatReassignBlocks_2()
19377 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks_2()
19378 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatReassignBlocks_2()
19379 fis->d.reserved4 = 0; in smsatReassignBlocks_2()
19380 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks_2()
19381 fis->d.reserved5 = 0; in smsatReassignBlocks_2()
19391 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks_2()
19392 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReassignBlocks_2()
19393 fis->h.command = SAT_WRITE_SECTORS_EXT; /* 0x34 */ in smsatReassignBlocks_2()
19395 fis->h.features = 0; /* FIS reserve */ in smsatReassignBlocks_2()
19396 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks_2()
19397 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks_2()
19398 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks_2()
19399 fis->d.device = 0x40; /* FIS LBA mode set */ in smsatReassignBlocks_2()
19400 fis->d.lbaLowExp = LBA[4]; /* FIS LBA (31:24) */ in smsatReassignBlocks_2()
19401 fis->d.lbaMidExp = LBA[3]; /* FIS LBA (39:32) */ in smsatReassignBlocks_2()
19402 fis->d.lbaHighExp = LBA[2]; /* FIS LBA (47:40) */ in smsatReassignBlocks_2()
19403 fis->d.featuresExp = 0; /* FIS reserve */ in smsatReassignBlocks_2()
19404 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks_2()
19405 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatReassignBlocks_2()
19406 fis->d.reserved4 = 0; in smsatReassignBlocks_2()
19407 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks_2()
19408 fis->d.reserved5 = 0; in smsatReassignBlocks_2()
19411 satIOContext->ATACmd = SAT_WRITE_SECTORS_EXT; in smsatReassignBlocks_2()
19415 if (pSatDevData->satNCQ == agTRUE) in smsatReassignBlocks_2()
19418 if (pSatDevData->sat48BitSupport != agTRUE) in smsatReassignBlocks_2()
19433 satIOContext->pSmSenseData, in smsatReassignBlocks_2()
19434 satIOContext->interruptContext ); in smsatReassignBlocks_2()
19439 /* Support 48-bit FPDMA addressing, use WRITE FPDMA QUEUE command */ in smsatReassignBlocks_2()
19441 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks_2()
19442 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReassignBlocks_2()
19443 fis->h.command = SAT_WRITE_FPDMA_QUEUED; /* 0x61 */ in smsatReassignBlocks_2()
19444 fis->h.features = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks_2()
19445 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks_2()
19446 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks_2()
19447 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks_2()
19450 fis->d.device = 0x40; /* FIS FUA clear */ in smsatReassignBlocks_2()
19452 fis->d.lbaLowExp = LBA[4]; /* FIS LBA (31:24) */ in smsatReassignBlocks_2()
19453 fis->d.lbaMidExp = LBA[3]; /* FIS LBA (39:32) */ in smsatReassignBlocks_2()
19454 fis->d.lbaHighExp = LBA[2]; /* FIS LBA (47:40) */ in smsatReassignBlocks_2()
19455 fis->d.featuresExp = 0; /* FIS sector count (15:8) */ in smsatReassignBlocks_2()
19456 fis->d.sectorCount = 0; /* Tag (7:3) set by LL layer */ in smsatReassignBlocks_2()
19457 fis->d.sectorCountExp = 0; in smsatReassignBlocks_2()
19458 fis->d.reserved4 = 0; in smsatReassignBlocks_2()
19459 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks_2()
19460 fis->d.reserved5 = 0; in smsatReassignBlocks_2()
19463 satIOContext->ATACmd = SAT_WRITE_FPDMA_QUEUED; in smsatReassignBlocks_2()
19466 satIOContext->satCompleteCB = &smsatReassignBlocksCB; in smsatReassignBlocks_2()
19469 * Prepare SGL and send FIS to LL layer. in smsatReassignBlocks_2()
19471 satIOContext->reqType = agRequestType; /* Save it */ in smsatReassignBlocks_2()
19499 agsaFisRegHostToDevice_t *fis; in smsatReassignBlocks_1() local
19505 pSatDevData = satIOContext->pSatDevData; in smsatReassignBlocks_1()
19506 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatReassignBlocks_1()
19507 fis = satIOContext->pFis; in smsatReassignBlocks_1()
19508 pParmList = (bit8 *) smScsiRequest->sglVirtualAddr; in smsatReassignBlocks_1()
19510 LongLBA = (bit8)(scsiCmnd->cdb[1] & SCSI_REASSIGN_BLOCKS_LONGLBA_MASK); in smsatReassignBlocks_1()
19512 startingIndex = satOrgIOContext->ParmIndex; in smsatReassignBlocks_1()
19534 if (pSatDevData->sat48BitSupport == agTRUE) in smsatReassignBlocks_1()
19537 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks_1()
19538 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReassignBlocks_1()
19539 fis->h.command = SAT_READ_VERIFY_SECTORS_EXT;/* 0x42 */ in smsatReassignBlocks_1()
19540 fis->h.features = 0; /* FIS reserve */ in smsatReassignBlocks_1()
19541 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks_1()
19542 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks_1()
19543 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks_1()
19544 fis->d.lbaLowExp = LBA[4]; /* FIS LBA (31:24) */ in smsatReassignBlocks_1()
19545 fis->d.lbaMidExp = LBA[3]; /* FIS LBA (39:32) */ in smsatReassignBlocks_1()
19546 fis->d.lbaHighExp = LBA[2]; /* FIS LBA (47:40) */ in smsatReassignBlocks_1()
19547 fis->d.featuresExp = 0; /* FIS reserve */ in smsatReassignBlocks_1()
19548 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks_1()
19549 fis->d.sectorCountExp = 0; /* FIS sector count (15:8) */ in smsatReassignBlocks_1()
19550 fis->d.reserved4 = 0; in smsatReassignBlocks_1()
19551 fis->d.device = 0x40; /* 01000000 */ in smsatReassignBlocks_1()
19552 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks_1()
19553 fis->d.reserved5 = 0; in smsatReassignBlocks_1()
19558 fis->h.fisType = 0x27; /* Reg host to device */ in smsatReassignBlocks_1()
19559 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatReassignBlocks_1()
19560 fis->h.command = SAT_READ_VERIFY_SECTORS;/* 0x40 */ in smsatReassignBlocks_1()
19561 fis->h.features = 0; /* FIS features NA */ in smsatReassignBlocks_1()
19562 fis->d.lbaLow = LBA[7]; /* FIS LBA (7 :0 ) */ in smsatReassignBlocks_1()
19563 fis->d.lbaMid = LBA[6]; /* FIS LBA (15:8 ) */ in smsatReassignBlocks_1()
19564 fis->d.lbaHigh = LBA[5]; /* FIS LBA (23:16) */ in smsatReassignBlocks_1()
19565 fis->d.lbaLowExp = 0; in smsatReassignBlocks_1()
19566 fis->d.lbaMidExp = 0; in smsatReassignBlocks_1()
19567 fis->d.lbaHighExp = 0; in smsatReassignBlocks_1()
19568 fis->d.featuresExp = 0; in smsatReassignBlocks_1()
19569 fis->d.sectorCount = 1; /* FIS sector count (7:0) */ in smsatReassignBlocks_1()
19570 fis->d.sectorCountExp = 0; in smsatReassignBlocks_1()
19571 fis->d.reserved4 = 0; in smsatReassignBlocks_1()
19572 fis->d.device = (bit8)((0x4 << 4) | (LBA[4] & 0xF)); in smsatReassignBlocks_1()
19574 fis->d.control = 0; /* FIS HOB bit clear */ in smsatReassignBlocks_1()
19575 fis->d.reserved5 = 0; in smsatReassignBlocks_1()
19578 sm_memcpy(satOrgIOContext->LBA, LBA, 8); in smsatReassignBlocks_1()
19579 satOrgIOContext->ParmIndex = startingIndex; in smsatReassignBlocks_1()
19585 satIOContext->satCompleteCB = &smsatReassignBlocksCB; in smsatReassignBlocks_1()
19588 * Prepare SGL and send FIS to LL layer. in smsatReassignBlocks_1()
19590 satIOContext->reqType = agRequestType; /* Save it */ in smsatReassignBlocks_1()
19612 agsaFisRegHostToDevice_t *fis; in smsatSendReadLogExt() local
19614 fis = satIOContext->pFis; in smsatSendReadLogExt()
19616 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSendReadLogExt()
19617 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSendReadLogExt()
19618 fis->h.command = SAT_READ_LOG_EXT; /* 0x2F */ in smsatSendReadLogExt()
19619 fis->h.features = 0; /* FIS reserve */ in smsatSendReadLogExt()
19620 fis->d.lbaLow = 0x10; /* Page number */ in smsatSendReadLogExt()
19621 fis->d.lbaMid = 0; /* */ in smsatSendReadLogExt()
19622 fis->d.lbaHigh = 0; /* */ in smsatSendReadLogExt()
19623 fis->d.device = 0; /* DEV is ignored in SATA */ in smsatSendReadLogExt()
19624 fis->d.lbaLowExp = 0; /* */ in smsatSendReadLogExt()
19625 fis->d.lbaMidExp = 0; /* */ in smsatSendReadLogExt()
19626 fis->d.lbaHighExp = 0; /* */ in smsatSendReadLogExt()
19627 fis->d.featuresExp = 0; /* FIS reserve */ in smsatSendReadLogExt()
19628 fis->d.sectorCount = 0x01; /* 1 sector counts*/ in smsatSendReadLogExt()
19629 fis->d.sectorCountExp = 0x00; /* 1 sector counts */ in smsatSendReadLogExt()
19630 fis->d.reserved4 = 0; in smsatSendReadLogExt()
19631 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSendReadLogExt()
19632 fis->d.reserved5 = 0; in smsatSendReadLogExt()
19638 satIOContext->satCompleteCB = &smsatReadLogExtCB; in smsatSendReadLogExt()
19641 * Prepare SGL and send FIS to LL layer. in smsatSendReadLogExt()
19643 satIOContext->reqType = agRequestType; /* Save it */ in smsatSendReadLogExt()
19667 internally generated - no directly corresponding scsi in smsatCheckPowerMode()
19671 agsaFisRegHostToDevice_t *fis; in smsatCheckPowerMode() local
19673 fis = satIOContext->pFis; in smsatCheckPowerMode()
19678 fis->h.fisType = 0x27; /* Reg host to device */ in smsatCheckPowerMode()
19679 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatCheckPowerMode()
19680 fis->h.command = SAT_CHECK_POWER_MODE; /* 0xE5 */ in smsatCheckPowerMode()
19681 fis->h.features = 0; in smsatCheckPowerMode()
19682 fis->d.lbaLow = 0; in smsatCheckPowerMode()
19683 fis->d.lbaMid = 0; in smsatCheckPowerMode()
19684 fis->d.lbaHigh = 0; in smsatCheckPowerMode()
19685 fis->d.device = 0; in smsatCheckPowerMode()
19686 fis->d.lbaLowExp = 0; in smsatCheckPowerMode()
19687 fis->d.lbaMidExp = 0; in smsatCheckPowerMode()
19688 fis->d.lbaHighExp = 0; in smsatCheckPowerMode()
19689 fis->d.featuresExp = 0; in smsatCheckPowerMode()
19690 fis->d.sectorCount = 0; in smsatCheckPowerMode()
19691 fis->d.sectorCountExp = 0; in smsatCheckPowerMode()
19692 fis->d.reserved4 = 0; in smsatCheckPowerMode()
19693 fis->d.control = 0; /* FIS HOB bit clear */ in smsatCheckPowerMode()
19694 fis->d.reserved5 = 0; in smsatCheckPowerMode()
19700 satIOContext->satCompleteCB = &smsatCheckPowerModeCB; in smsatCheckPowerMode()
19703 * Prepare SGL and send FIS to LL layer. in smsatCheckPowerMode()
19705 satIOContext->reqType = agRequestType; /* Save it */ in smsatCheckPowerMode()
19729 agsaFisRegHostToDevice_t *fis; in smsatResetDevice() local
19735 fis = satIOContext->pFis; in smsatResetDevice()
19738 satIntIoContext = satIOContext->satIntIoContext; in smsatResetDevice()
19739 smIORequestBody = satIntIoContext->satIntRequestBody; in smsatResetDevice()
19742 /* any fis should work */ in smsatResetDevice()
19743 fis->h.fisType = 0x27; /* Reg host to device */ in smsatResetDevice()
19744 fis->h.c_pmPort = 0; /* C Bit is not set */ in smsatResetDevice()
19745 fis->h.command = 0; /* any command */ in smsatResetDevice()
19746 fis->h.features = 0; /* FIS reserve */ in smsatResetDevice()
19747 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatResetDevice()
19748 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatResetDevice()
19749 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatResetDevice()
19750 fis->d.device = 0; /* FIS LBA mode */ in smsatResetDevice()
19751 fis->d.lbaLowExp = 0; in smsatResetDevice()
19752 fis->d.lbaMidExp = 0; in smsatResetDevice()
19753 fis->d.lbaHighExp = 0; in smsatResetDevice()
19754 fis->d.featuresExp = 0; in smsatResetDevice()
19755 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatResetDevice()
19756 fis->d.sectorCountExp = 0; in smsatResetDevice()
19757 fis->d.reserved4 = 0; in smsatResetDevice()
19758 fis->d.control = 0x4; /* SRST bit is set */ in smsatResetDevice()
19759 fis->d.reserved5 = 0; in smsatResetDevice()
19765 satIOContext->satCompleteCB = &smsatResetDeviceCB; in smsatResetDevice()
19768 * Prepare SGL and send FIS to LL layer. in smsatResetDevice()
19770 satIOContext->reqType = agRequestType; /* Save it */ in smsatResetDevice()
19773 smhexdump("smsatResetDevice", (bit8 *)satIOContext->pFis, sizeof(agsaFisRegHostToDevice_t)); in smsatResetDevice()
19775 …smhexdump("smsatResetDevice LL", (bit8 *)&(smIORequestBody->transport.SATA.agSATARequestBody.fis.f… in smsatResetDevice()
19800 agsaFisRegHostToDevice_t *fis; in smsatDeResetDevice() local
19806 fis = satIOContext->pFis; in smsatDeResetDevice()
19809 satIntIoContext = satIOContext->satIntIoContext; in smsatDeResetDevice()
19810 smIORequestBody = satIntIoContext->satIntRequestBody; in smsatDeResetDevice()
19813 /* any fis should work */ in smsatDeResetDevice()
19814 fis->h.fisType = 0x27; /* Reg host to device */ in smsatDeResetDevice()
19815 fis->h.c_pmPort = 0; /* C Bit is not set */ in smsatDeResetDevice()
19816 fis->h.command = 0; /* any command */ in smsatDeResetDevice()
19817 fis->h.features = 0; /* FIS reserve */ in smsatDeResetDevice()
19818 fis->d.lbaLow = 0; /* FIS LBA (7 :0 ) */ in smsatDeResetDevice()
19819 fis->d.lbaMid = 0; /* FIS LBA (15:8 ) */ in smsatDeResetDevice()
19820 fis->d.lbaHigh = 0; /* FIS LBA (23:16) */ in smsatDeResetDevice()
19821 fis->d.device = 0; /* FIS LBA mode */ in smsatDeResetDevice()
19822 fis->d.lbaLowExp = 0; in smsatDeResetDevice()
19823 fis->d.lbaMidExp = 0; in smsatDeResetDevice()
19824 fis->d.lbaHighExp = 0; in smsatDeResetDevice()
19825 fis->d.featuresExp = 0; in smsatDeResetDevice()
19826 fis->d.sectorCount = 0; /* FIS sector count (7:0) */ in smsatDeResetDevice()
19827 fis->d.sectorCountExp = 0; in smsatDeResetDevice()
19828 fis->d.reserved4 = 0; in smsatDeResetDevice()
19829 fis->d.control = 0; /* SRST bit is not set */ in smsatDeResetDevice()
19830 fis->d.reserved5 = 0; in smsatDeResetDevice()
19836 satIOContext->satCompleteCB = &smsatDeResetDeviceCB; in smsatDeResetDevice()
19839 * Prepare SGL and send FIS to LL layer. in smsatDeResetDevice()
19841 satIOContext->reqType = agRequestType; /* Save it */ in smsatDeResetDevice()
19844 smhexdump("smsatDeResetDevice", (bit8 *)satIOContext->pFis, sizeof(agsaFisRegHostToDevice_t)); in smsatDeResetDevice()
19846 …exdump("smsatDeResetDevice LL", (bit8 *)&(smIORequestBody->transport.SATA.agSATARequestBody.fis.fi… in smsatDeResetDevice()
19872 agsaFisRegHostToDevice_t *fis; in smsatSetFeaturesAA() local
19874 fis = satIOContext->pFis; in smsatSetFeaturesAA()
19880 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSetFeaturesAA()
19881 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSetFeaturesAA()
19882 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatSetFeaturesAA()
19883 fis->h.features = 0x10; /* enable SATA feature */ in smsatSetFeaturesAA()
19884 fis->d.lbaLow = 0; in smsatSetFeaturesAA()
19885 fis->d.lbaMid = 0; in smsatSetFeaturesAA()
19886 fis->d.lbaHigh = 0; in smsatSetFeaturesAA()
19887 fis->d.device = 0; in smsatSetFeaturesAA()
19888 fis->d.lbaLowExp = 0; in smsatSetFeaturesAA()
19889 fis->d.lbaMidExp = 0; in smsatSetFeaturesAA()
19890 fis->d.lbaHighExp = 0; in smsatSetFeaturesAA()
19891 fis->d.featuresExp = 0; in smsatSetFeaturesAA()
19892 fis->d.sectorCount = 0x02; /* DMA Setup FIS Auto-Activate */ in smsatSetFeaturesAA()
19893 fis->d.sectorCountExp = 0; in smsatSetFeaturesAA()
19894 fis->d.reserved4 = 0; in smsatSetFeaturesAA()
19895 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSetFeaturesAA()
19896 fis->d.reserved5 = 0; in smsatSetFeaturesAA()
19902 satIOContext->satCompleteCB = &smsatSetFeaturesAACB; in smsatSetFeaturesAA()
19905 * Prepare SGL and send FIS to LL layer. in smsatSetFeaturesAA()
19907 satIOContext->reqType = agRequestType; /* Save it */ in smsatSetFeaturesAA()
19916 if (smIORequest->tdData == smIORequest->smData) in smsatSetFeaturesAA()
19938 agsaFisRegHostToDevice_t *fis; in smsatSetFeaturesDMA() local
19940 pSatDevData = satIOContext->pSatDevData; in smsatSetFeaturesDMA()
19941 fis = satIOContext->pFis; in smsatSetFeaturesDMA()
19947 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSetFeaturesDMA()
19948 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSetFeaturesDMA()
19949 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatSetFeaturesDMA()
19950 fis->h.features = 0x03; /* enable ATA transfer mode */ in smsatSetFeaturesDMA()
19951 fis->d.lbaLow = 0; in smsatSetFeaturesDMA()
19952 fis->d.lbaMid = 0; in smsatSetFeaturesDMA()
19953 fis->d.lbaHigh = 0; in smsatSetFeaturesDMA()
19954 fis->d.device = 0; in smsatSetFeaturesDMA()
19955 fis->d.lbaLowExp = 0; in smsatSetFeaturesDMA()
19956 fis->d.lbaMidExp = 0; in smsatSetFeaturesDMA()
19957 fis->d.lbaHighExp = 0; in smsatSetFeaturesDMA()
19958 fis->d.featuresExp = 0; in smsatSetFeaturesDMA()
19959 fis->d.sectorCount = 0x40 |(bit8)pSatDevData->satUltraDMAMode; /* enable Ultra DMA mode */ in smsatSetFeaturesDMA()
19960 fis->d.sectorCountExp = 0; in smsatSetFeaturesDMA()
19961 fis->d.reserved4 = 0; in smsatSetFeaturesDMA()
19962 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSetFeaturesDMA()
19963 fis->d.reserved5 = 0; in smsatSetFeaturesDMA()
19969 satIOContext->satCompleteCB = &smsatSetFeaturesDMACB; in smsatSetFeaturesDMA()
19972 * Prepare SGL and send FIS to LL layer. in smsatSetFeaturesDMA()
19974 satIOContext->reqType = agRequestType; /* Save it */ in smsatSetFeaturesDMA()
19983 if (smIORequest->tdData == smIORequest->smData) in smsatSetFeaturesDMA()
20005 agsaFisRegHostToDevice_t *fis; in smsatSetFeaturesReadLookAhead() local
20007 fis = satIOContext->pFis; in smsatSetFeaturesReadLookAhead()
20013 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSetFeaturesReadLookAhead()
20014 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSetFeaturesReadLookAhead()
20015 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatSetFeaturesReadLookAhead()
20016 fis->h.features = 0xAA; /* Enable read look-ahead feature */ in smsatSetFeaturesReadLookAhead()
20017 fis->d.lbaLow = 0; in smsatSetFeaturesReadLookAhead()
20018 fis->d.lbaMid = 0; in smsatSetFeaturesReadLookAhead()
20019 fis->d.lbaHigh = 0; in smsatSetFeaturesReadLookAhead()
20020 fis->d.device = 0; in smsatSetFeaturesReadLookAhead()
20021 fis->d.lbaLowExp = 0; in smsatSetFeaturesReadLookAhead()
20022 fis->d.lbaMidExp = 0; in smsatSetFeaturesReadLookAhead()
20023 fis->d.lbaHighExp = 0; in smsatSetFeaturesReadLookAhead()
20024 fis->d.featuresExp = 0; in smsatSetFeaturesReadLookAhead()
20025 fis->d.sectorCount = 0; in smsatSetFeaturesReadLookAhead()
20026 fis->d.sectorCountExp = 0; in smsatSetFeaturesReadLookAhead()
20027 fis->d.reserved4 = 0; in smsatSetFeaturesReadLookAhead()
20028 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSetFeaturesReadLookAhead()
20029 fis->d.reserved5 = 0; in smsatSetFeaturesReadLookAhead()
20035 satIOContext->satCompleteCB = &smsatSetFeaturesReadLookAheadCB; in smsatSetFeaturesReadLookAhead()
20038 * Prepare SGL and send FIS to LL layer. in smsatSetFeaturesReadLookAhead()
20040 satIOContext->reqType = agRequestType; /* Save it */ in smsatSetFeaturesReadLookAhead()
20049 if (smIORequest->tdData == smIORequest->smData) in smsatSetFeaturesReadLookAhead()
20071 agsaFisRegHostToDevice_t *fis; in smsatSetFeaturesVolatileWriteCache() local
20073 fis = satIOContext->pFis; in smsatSetFeaturesVolatileWriteCache()
20079 fis->h.fisType = 0x27; /* Reg host to device */ in smsatSetFeaturesVolatileWriteCache()
20080 fis->h.c_pmPort = 0x80; /* C Bit is set */ in smsatSetFeaturesVolatileWriteCache()
20081 fis->h.command = SAT_SET_FEATURES; /* 0xEF */ in smsatSetFeaturesVolatileWriteCache()
20082 fis->h.features = 0x02; /* Enable Volatile Write Cache feature */ in smsatSetFeaturesVolatileWriteCache()
20083 fis->d.lbaLow = 0; in smsatSetFeaturesVolatileWriteCache()
20084 fis->d.lbaMid = 0; in smsatSetFeaturesVolatileWriteCache()
20085 fis->d.lbaHigh = 0; in smsatSetFeaturesVolatileWriteCache()
20086 fis->d.device = 0; in smsatSetFeaturesVolatileWriteCache()
20087 fis->d.lbaLowExp = 0; in smsatSetFeaturesVolatileWriteCache()
20088 fis->d.lbaMidExp = 0; in smsatSetFeaturesVolatileWriteCache()
20089 fis->d.lbaHighExp = 0; in smsatSetFeaturesVolatileWriteCache()
20090 fis->d.featuresExp = 0; in smsatSetFeaturesVolatileWriteCache()
20091 fis->d.sectorCount = 0; in smsatSetFeaturesVolatileWriteCache()
20092 fis->d.sectorCountExp = 0; in smsatSetFeaturesVolatileWriteCache()
20093 fis->d.reserved4 = 0; in smsatSetFeaturesVolatileWriteCache()
20094 fis->d.control = 0; /* FIS HOB bit clear */ in smsatSetFeaturesVolatileWriteCache()
20095 fis->d.reserved5 = 0; in smsatSetFeaturesVolatileWriteCache()
20101 satIOContext->satCompleteCB = &smsatSetFeaturesVolatileWriteCacheCB; in smsatSetFeaturesVolatileWriteCache()
20103 * Prepare SGL and send FIS to LL layer. in smsatSetFeaturesVolatileWriteCache()
20105 satIOContext->reqType = agRequestType; /* Save it */ in smsatSetFeaturesVolatileWriteCache()
20113 if (smIORequest->tdData == smIORequest->smData) in smsatSetFeaturesVolatileWriteCache()
20158 if (tdsmBitScanForward(smRoot, &i, ~(pSatDevData->freeSATAFDMATagBitmap))) in smsatTagAlloc()
20160 smsatBitSet(smRoot, (bit8*)&pSatDevData->freeSATAFDMATagBitmap, i); in smsatTagAlloc()
20167 for ( i = 0; i < pSatDevData->satNCQMaxIO; i ++ ) in smsatTagAlloc()
20169 if ( 0 == smsatBitTest(smRoot, (bit8 *)&pSatDevData->freeSATAFDMATagBitmap, i) ) in smsatTagAlloc()
20171 smsatBitSet(smRoot, (bit8*)&pSatDevData->freeSATAFDMATagBitmap, i); in smsatTagAlloc()
20194 if ( tag < pSatDevData->satNCQMaxIO ) in smsatTagRelease()
20197 smsatBitClear(smRoot, (bit8 *)&pSatDevData->freeSATAFDMATagBitmap, (bit32)tag); in smsatTagRelease()
20199 …/*tdsmInterlockedAnd(smRoot, (volatile LONG *)(&pSatDevData->freeSATAFDMATagBitmap), ~(1 << (tag&3… in smsatTagRelease()
20204 SM_DBG1(("smsatTagRelease: tag %d >= satNCQMaxIO %d!!!!\n", tag, pSatDevData->satNCQMaxIO)); in smsatTagRelease()
20219 smScsiRequest = satIOContext->smScsiXchg; in smsatComputeCDB10LBA()
20220 scsiCmnd = &(smScsiRequest->scsiCmnd); in smsatComputeCDB10LBA()
20222 lba = (scsiCmnd->cdb[2] << (8*3)) + (scsiCmnd->cdb[3] << (8*2)) in smsatComputeCDB10LBA()
20223 + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatComputeCDB10LBA()
20237 smScsiRequest = satIOContext->smScsiXchg; in smsatComputeCDB10TL()
20238 scsiCmnd = &(smScsiRequest->scsiCmnd); in smsatComputeCDB10TL()
20240 tl = (scsiCmnd->cdb[7] << 8) + scsiCmnd->cdb[8]; in smsatComputeCDB10TL()
20252 smScsiRequest = satIOContext->smScsiXchg; in smsatComputeCDB12LBA()
20253 scsiCmnd = &(smScsiRequest->scsiCmnd); in smsatComputeCDB12LBA()
20255 lba = (scsiCmnd->cdb[2] << (8*3)) + (scsiCmnd->cdb[3] << (8*2)) in smsatComputeCDB12LBA()
20256 + (scsiCmnd->cdb[4] << 8) + scsiCmnd->cdb[5]; in smsatComputeCDB12LBA()
20270 smScsiRequest = satIOContext->smScsiXchg; in smsatComputeCDB12TL()
20271 scsiCmnd = &(smScsiRequest->scsiCmnd); in smsatComputeCDB12TL()
20273 tl = (scsiCmnd->cdb[6] << (8*3)) + (scsiCmnd->cdb[7] << (8*2)) in smsatComputeCDB12TL()
20274 + (scsiCmnd->cdb[8] << 8) + scsiCmnd->cdb[9]; in smsatComputeCDB12TL()
20280 But it has to be less than (2^28 - 1)
20291 smScsiRequest = satIOContext->smScsiXchg; in smsatComputeCDB16LBA()
20292 scsiCmnd = &(smScsiRequest->scsiCmnd); in smsatComputeCDB16LBA()
20294 lba = (scsiCmnd->cdb[6] << (8*3)) + (scsiCmnd->cdb[7] << (8*2)) in smsatComputeCDB16LBA()
20295 + (scsiCmnd->cdb[8] << 8) + scsiCmnd->cdb[9]; in smsatComputeCDB16LBA()
20309 smScsiRequest = satIOContext->smScsiXchg; in smsatComputeCDB16TL()
20310 scsiCmnd = &(smScsiRequest->scsiCmnd); in smsatComputeCDB16TL()
20312 tl = (scsiCmnd->cdb[10] << (8*3)) + (scsiCmnd->cdb[11] << (8*2)) in smsatComputeCDB16TL()
20313 + (scsiCmnd->cdb[12] << 8) + scsiCmnd->cdb[13]; in smsatComputeCDB16TL()
20353 flag: false - not 48BitSupport; true - 48BitSupport
20379 /* limit is 0xF FF FF = 2^28 - 1 */ in smsatCheckLimit()
20391 /* limit is 0xF FF FF = 2^48 - 1 */ in smsatCheckLimit()
20435 for(i=7;i>=0;i--) in smsatCheckLimit()
20451 final_ans[i] = (bit8)(ans[i-1] & 0xFF); in smsatCheckLimit()
20471 if (final_ans[i] > Bit28max[i-1]) in smsatCheckLimit()
20477 else if (final_ans[i] < Bit28max[i-1]) in smsatCheckLimit()
20505 if (final_ans[i] > Bit48max[i-1]) in smsatCheckLimit()
20511 else if (final_ans[i] < Bit48max[i-1]) in smsatCheckLimit()
20538 sm_memcpy(&temp_satMaxLBA, &pSatDevData->satMaxLBA, sizeof(temp_satMaxLBA)); in smsatCheckLimit()
20542 for(i=7;i>=0;i--) in smsatCheckLimit()
20558 final_satMaxLBA[i] = (bit8)(ans[i-1] & 0xFF); in smsatCheckLimit()
20560 if ( pSatDevData->ReadCapacity == 10) in smsatCheckLimit()
20590 else if ( pSatDevData->ReadCapacity == 16) in smsatCheckLimit()
20622 … SM_DBG5(("smsatCheckLimit: unknown pSatDevData->ReadCapacity %d\n", pSatDevData->ReadCapacity)); in smsatCheckLimit()
20661 agSgl = &(agEsgl->descriptor[i]); in smsatPrintSgl()
20664 i, agSgl->sgUpper, agSgl->sgLower, agSgl->len, agSgl->extReserved)); in smsatPrintSgl()
20697 scsiCmnd = &smScsiRequest->scsiCmnd; in smsatSplitSGL()
20700 if (smScsiRequest->smSgl1.type == 0x80000000) /* esgl */ in smsatSplitSGL()
20705 …satSplitSGL: UpperAddr 0x%08x LowerAddr 0x%08x\n", satIOContext->UpperAddr, satIOContext->LowerAdd… in smsatSplitSGL()
20706 …("smsatSplitSGL: SplitIdx %d AdjustBytes 0x%08x\n", satIOContext->SplitIdx, satIOContext->AdjustBy… in smsatSplitSGL()
20708 sglVirtualAddr = smScsiRequest->sglVirtualAddr; in smsatSplitSGL()
20710 agEsgl = (agsaEsgl_t *)smScsiRequest->sglVirtualAddr; in smsatSplitSGL()
20712 sglSplitVirtualAddr = &(agEsgl->descriptor[satIOContext->SplitIdx]); in smsatSplitSGL()
20722 agSgl = &(agEsgl->descriptor[0]); in smsatSplitSGL()
20723 agSgl->sgUpper = satIOContext->UpperAddr; in smsatSplitSGL()
20724 agSgl->sgLower = satIOContext->LowerAddr; in smsatSplitSGL()
20725 agSgl->len = satIOContext->AdjustBytes; in smsatSplitSGL()
20726 sm_memcpy(sglVirtualAddr, sglSplitVirtualAddr, (satIOContext->EsglLen) * sizeof(agsaSgl_t)); in smsatSplitSGL()
20727 agEsgl = (agsaEsgl_t *)smScsiRequest->sglVirtualAddr; in smsatSplitSGL()
20728 smsatPrintSgl(smRoot, (agsaEsgl_t *)sglVirtualAddr, satIOContext->EsglLen); in smsatSplitSGL()
20734 satIOContext->EsglLen = smScsiRequest->smSgl1.len; in smsatSplitSGL()
20735 agEsgl = (agsaEsgl_t *)smScsiRequest->sglVirtualAddr; in smsatSplitSGL()
20740 smsatPrintSgl(smRoot, agEsgl, satIOContext->EsglLen); in smsatSplitSGL()
20750 agSgl = &(agEsgl->descriptor[i]); in smsatSplitSGL()
20751 splitLen = splitLen + agSgl->len; in smsatSplitSGL()
20754 splitDiffExtra = splitLen - split; in smsatSplitSGL()
20755 splitDiffByte = agSgl->len - splitDiffExtra; in smsatSplitSGL()
20766 agSgl = &(agEsgl->descriptor[splitIdx]); in smsatSplitSGL()
20767 UpperAddr = agSgl->sgUpper; in smsatSplitSGL()
20768 LowerAddr = agSgl->sgLower; in smsatSplitSGL()
20775 agSgl->len = splitDiffByte; in smsatSplitSGL()
20777 smScsiRequest->smSgl1.len = splitIdx; in smsatSplitSGL()
20779 scsiCmnd->expDataLength = 0x20000; in smsatSplitSGL()
20781 satIOContext->UpperAddr = UpperAddr; in smsatSplitSGL()
20782 satIOContext->LowerAddr = tmpLowerAddr; in smsatSplitSGL()
20783 satIOContext->SplitIdx = splitIdx; in smsatSplitSGL()
20784 satIOContext->AdjustBytes = splitDiffExtra; in smsatSplitSGL()
20785 satIOContext->EsglLen = satIOContext->EsglLen - smScsiRequest->smSgl1.len; in smsatSplitSGL()
20786 satIOContext->OrgTL = satIOContext->OrgTL - 0x100; in smsatSplitSGL()
20787 // smsatPrintSgl(smRoot, agEsgl, satIOContext->EsglLen); in smsatSplitSGL()
20795 smScsiRequest->smSgl1.len = satIOContext->EsglLen; in smsatSplitSGL()
20796 for (i=0;i< smScsiRequest->smSgl1.len;i++) in smsatSplitSGL()
20798 agSgl = &(agEsgl->descriptor[i]); in smsatSplitSGL()
20799 totalLen = totalLen + (agSgl->len); in smsatSplitSGL()
20802 scsiCmnd->expDataLength = totalLen; in smsatSplitSGL()
20803 // smsatPrintSgl(smRoot, agEsgl, satIOContext->EsglLen); in smsatSplitSGL()