- Timestamp:
- Aug 30, 2013 1:37:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r46601 r48190 52 52 53 53 /** Size of the command buffer. */ 54 #define BUSLOGIC_COMMAND_SIZE_MAX 554 #define BUSLOGIC_COMMAND_SIZE_MAX 64 55 55 56 56 /** Size of the reply buffer. */ … … 65 65 66 66 /** State saved version. */ 67 #define BUSLOGIC_SAVED_STATE_MINOR_VERSION 367 #define BUSLOGIC_SAVED_STATE_MINOR_VERSION 4 68 68 69 69 /** Saved state version before the suspend on error feature was implemented. */ … … 71 71 /** Saved state version before 24-bit mailbox support was implemented. */ 72 72 #define BUSLOGIC_SAVED_STATE_MINOR_PRE_24BIT_MBOX 2 73 /** Saved state version before command buffer size was raised. */ 74 #define BUSLOGIC_SAVED_STATE_MINOR_PRE_CMDBUF_RESIZE 3 75 76 /** Command buffer size in old saved states. */ 77 #define BUSLOGIC_COMMAND_SIZE_OLD 5 73 78 74 79 /** The duration of software-initiated reset (in nano seconds). … … 1180 1185 int rc = PDMCritSectEnter(&pBusLogic->CritSectIntr, VINF_SUCCESS); 1181 1186 AssertRC(rc); 1182 RTGCPHYS GCPhysAddrCCB = pTaskState->MailboxGuest.u32PhysAddrCCB; 1187 1183 1188 RTGCPHYS GCPhysAddrMailboxIncoming = pBusLogic->GCPhysAddrMailboxIncomingBase 1184 1189 + ( pBusLogic->uMailboxIncomingPositionCurrent 1185 1190 * (pTaskState->fIs24Bit ? sizeof(Mailbox24) : sizeof(Mailbox32)) ); 1186 LogFlowFunc(("Completing CCB %RGp hstat=%u, dstat=%u, outgoing mailbox at %RGp\n", GCPhysAddrCCB, 1187 uHostAdapterStatus, uDeviceStatus, GCPhysAddrMailboxIncoming)); 1188 1189 /* Update CCB. */ 1190 pTaskState->CommandControlBlockGuest.c.uHostAdapterStatus = uHostAdapterStatus; 1191 pTaskState->CommandControlBlockGuest.c.uDeviceStatus = uDeviceStatus; 1192 /* Rewrite CCB up to the CDB; perhaps more than necessary. */ 1193 PDMDevHlpPCIPhysWrite(pBusLogic->CTX_SUFF(pDevIns), GCPhysAddrCCB, 1194 &pTaskState->CommandControlBlockGuest, RT_OFFSETOF(CCBC, abCDB)); 1191 1192 if (uMailboxCompletionCode != BUSLOGIC_MAILBOX_INCOMING_COMPLETION_ABORTED_NOT_FOUND) 1193 { 1194 RTGCPHYS GCPhysAddrCCB = pTaskState->MailboxGuest.u32PhysAddrCCB; 1195 LogFlowFunc(("Completing CCB %RGp hstat=%u, dstat=%u, outgoing mailbox at %RGp\n", GCPhysAddrCCB, 1196 uHostAdapterStatus, uDeviceStatus, GCPhysAddrMailboxIncoming)); 1197 1198 /* Update CCB. */ 1199 pTaskState->CommandControlBlockGuest.c.uHostAdapterStatus = uHostAdapterStatus; 1200 pTaskState->CommandControlBlockGuest.c.uDeviceStatus = uDeviceStatus; 1201 /* Rewrite CCB up to the CDB; perhaps more than necessary. */ 1202 PDMDevHlpPCIPhysWrite(pBusLogic->CTX_SUFF(pDevIns), GCPhysAddrCCB, 1203 &pTaskState->CommandControlBlockGuest, RT_OFFSETOF(CCBC, abCDB)); 1204 } 1195 1205 1196 1206 # ifdef RT_STRICT … … 2926 2936 } 2927 2937 2938 static int buslogicR3DeviceSCSIRequestAbort(PBUSLOGIC pBusLogic, PBUSLOGICTASKSTATE pTaskState) 2939 { 2940 int rc = VINF_SUCCESS; 2941 uint8_t uTargetIdCCB; 2942 PBUSLOGICDEVICE pTargetDevice; 2943 RTGCPHYS GCPhysAddrCCB = (RTGCPHYS)pTaskState->MailboxGuest.u32PhysAddrCCB; 2944 2945 PDMDevHlpPhysRead(pBusLogic->CTX_SUFF(pDevIns), GCPhysAddrCCB, 2946 &pTaskState->CommandControlBlockGuest, sizeof(CCB32)); 2947 2948 uTargetIdCCB = pTaskState->fIs24Bit ? pTaskState->CommandControlBlockGuest.o.uTargetId : pTaskState->CommandControlBlockGuest.n.uTargetId; 2949 pTargetDevice = &pBusLogic->aDeviceStates[uTargetIdCCB]; 2950 pTaskState->CTX_SUFF(pTargetDevice) = pTargetDevice; 2951 2952 buslogicR3SendIncomingMailbox(pBusLogic, pTaskState, 2953 BUSLOGIC_MAILBOX_INCOMING_ADAPTER_STATUS_ABORT_QUEUE_GENERATED, 2954 BUSLOGIC_MAILBOX_INCOMING_DEVICE_STATUS_OPERATION_GOOD, 2955 BUSLOGIC_MAILBOX_INCOMING_COMPLETION_ABORTED_NOT_FOUND); 2956 2957 RTMemCacheFree(pBusLogic->hTaskCache, pTaskState); 2958 2959 return rc; 2960 } 2961 2928 2962 /** 2929 2963 * Read a mailbox from guest memory. Convert 24-bit mailboxes to … … 3023 3057 else if (pTaskState->MailboxGuest.u.out.uActionCode == BUSLOGIC_MAILBOX_OUTGOING_ACTION_ABORT_COMMAND) 3024 3058 { 3025 AssertMsgFailed(("Not implemented yet\n")); 3059 LogFlow(("Aborting mailbox\n")); 3060 rc = buslogicR3DeviceSCSIRequestAbort(pBusLogic, pTaskState); 3026 3061 } 3027 3062 else … … 3247 3282 SSMR3GetMem (pSSM, &pBusLogic->LocalRam, sizeof(pBusLogic->LocalRam)); 3248 3283 SSMR3GetU8 (pSSM, &pBusLogic->uOperationCode); 3249 SSMR3GetMem (pSSM, &pBusLogic->aCommandBuffer, sizeof(pBusLogic->aCommandBuffer)); 3284 if (uVersion > BUSLOGIC_SAVED_STATE_MINOR_PRE_CMDBUF_RESIZE) 3285 SSMR3GetMem (pSSM, &pBusLogic->aCommandBuffer, sizeof(pBusLogic->aCommandBuffer)); 3286 else 3287 SSMR3GetMem (pSSM, &pBusLogic->aCommandBuffer, BUSLOGIC_COMMAND_SIZE_OLD); 3250 3288 SSMR3GetU8 (pSSM, &pBusLogic->iParameter); 3251 3289 SSMR3GetU8 (pSSM, &pBusLogic->cbCommandParametersLeft);
Note:
See TracChangeset
for help on using the changeset viewer.