#if ARCMSR_DEBUG_UserGetDataBuffer
if(pCCB->arcmsr_request.Cdb[0]==0xA0)/*SCSI_CMD_REPORT_LUN*/
{
IOBufferMemoryDescriptor *osdatabuffer = nullptr;
uint64_t address, len, length=pCCB->request_transfer_count; /* parallelTask.fRequestedTransferCount */
/*
******************************************************************************************************************************************
**
** virtual kern_return_t UserGetDataBuffer(SCSIDeviceIdentifier fTargetID, uint64_t fControllerTaskIdentifier, IOBufferMemoryDescriptor **osdatabuffer);
**
******************************************************************************************************************************************
*/
if((UserGetDataBuffer(fTargetID, pCCB->fControllerTaskIdentifier, &osdatabuffer) != kIOReturnSuccess) || (osdatabuffer == NULL))
{
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ************************************************************************************ \n",ivars->adapter_index);
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** Get task data buffer error, ftargetID=%d fControllerTaskIdentifier=%d \n",ivars->adapter_index,(int)fTargetID,(int)pCCB->fControllerTaskIdentifier);
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ************************************************************************************ \n",ivars->adapter_index);
goto command_completion;
}
if((osdatabuffer->Map(0, 0, 0, 0, &address, &len) != kIOReturnSuccess) || (length != len))
{
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ************************************************************************************ \n",ivars->adapter_index);
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ** Map task data buffer error, ftargetID=%d fControllerTaskIdentifier=%d \n",ivars->adapter_index,(int)fTargetID,(int)pCCB->fControllerTaskIdentifier);
arcmsr_debug_print("ArcMSRUserSpaceDriver %d: ************************************************************************************ \n",ivars->adapter_index);
goto command_completion;
}
/*
*******************************************************************************************************************
** The LUN LIST LENGTH field shall contain the length in bytes of the LUN list that is available to be transferred.
** The LUN list length is the number of logical unit numbers in the logical unit inventory multiplied by eight.
*******************************************************************************************************************
*/
memset((void *)(address+3),8,1); /* report_lun_data */
memset((void *)(address+8),0,8); /* first lun */
response.fBytesTransferred = 16;
}
#endif