Lines Matching full:reply

103 static void mptsas_post_reply(MPTSASState *s, MPIDefaultReply *reply)  in mptsas_post_reply()  argument
115 pci_dma_write(pci, addr_lo | s->host_mfa_high_addr, reply, in mptsas_post_reply()
116 MIN(s->reply_frame_size, 4 * reply->MsgLength)); in mptsas_post_reply()
128 void mptsas_reply(MPTSASState *s, MPIDefaultReply *reply) in mptsas_reply() argument
131 /* The reply is sent out in 16 bit chunks, while the size in mptsas_reply()
132 * in the reply is in 32 bit units. in mptsas_reply()
136 s->doorbell_reply_size = reply->MsgLength * 2; in mptsas_reply()
137 memcpy(s->doorbell_reply, reply, s->doorbell_reply_size * 2); in mptsas_reply()
141 mptsas_post_reply(s, reply); in mptsas_reply()
152 /* The reply is just the message context ID (bit 31 = clear). */ in mptsas_turbo_reply()
295 MPIMsgSCSIIOReply reply; in mptsas_process_scsi_io_request() local
365 memset(&reply, 0, sizeof(reply)); in mptsas_process_scsi_io_request()
366 reply.TargetID = scsi_io->TargetID; in mptsas_process_scsi_io_request()
367 reply.Bus = scsi_io->Bus; in mptsas_process_scsi_io_request()
368 reply.MsgLength = sizeof(reply) / 4; in mptsas_process_scsi_io_request()
369 reply.Function = scsi_io->Function; in mptsas_process_scsi_io_request()
370 reply.CDBLength = scsi_io->CDBLength; in mptsas_process_scsi_io_request()
371 reply.SenseBufferLength = scsi_io->SenseBufferLength; in mptsas_process_scsi_io_request()
372 reply.MsgContext = scsi_io->MsgContext; in mptsas_process_scsi_io_request()
373 reply.SCSIState = MPI_SCSI_STATE_NO_SCSI_STATUS; in mptsas_process_scsi_io_request()
374 reply.IOCStatus = status; in mptsas_process_scsi_io_request()
376 mptsas_fix_scsi_io_reply_endianness(&reply); in mptsas_process_scsi_io_request()
377 mptsas_reply(s, (MPIDefaultReply *)&reply); in mptsas_process_scsi_io_request()
385 MPIMsgSCSITaskMgmtReply *reply; member
395 if (++n->reply->TerminationCount == n->reply->IOCLogInfo) { in mptsas_cancel_notify()
396 n->reply->IOCLogInfo = 0; in mptsas_cancel_notify()
397 mptsas_fix_scsi_task_mgmt_reply_endianness(n->reply); in mptsas_cancel_notify()
398 mptsas_post_reply(n->s, (MPIDefaultReply *)n->reply); in mptsas_cancel_notify()
399 g_free(n->reply); in mptsas_cancel_notify()
406 MPIMsgSCSITaskMgmtReply reply; in mptsas_process_scsi_task_mgmt() local
417 QEMU_BUILD_BUG_ON(sizeof(s->doorbell_reply) < sizeof(reply)); in mptsas_process_scsi_task_mgmt()
419 memset(&reply, 0, sizeof(reply)); in mptsas_process_scsi_task_mgmt()
420 reply.TargetID = req->TargetID; in mptsas_process_scsi_task_mgmt()
421 reply.Bus = req->Bus; in mptsas_process_scsi_task_mgmt()
422 reply.MsgLength = sizeof(reply) / 4; in mptsas_process_scsi_task_mgmt()
423 reply.Function = req->Function; in mptsas_process_scsi_task_mgmt()
424 reply.TaskType = req->TaskType; in mptsas_process_scsi_task_mgmt()
425 reply.MsgContext = req->MsgContext; in mptsas_process_scsi_task_mgmt()
433 reply.IOCStatus = status; in mptsas_process_scsi_task_mgmt()
437 reply.ResponseCode = MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN; in mptsas_process_scsi_task_mgmt()
457 reply.ResponseCode = MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED; in mptsas_process_scsi_task_mgmt()
461 reply_async = g_memdup(&reply, sizeof(MPIMsgSCSITaskMgmtReply)); in mptsas_process_scsi_task_mgmt()
467 notifier->reply = reply_async; in mptsas_process_scsi_task_mgmt()
480 reply.IOCStatus = status; in mptsas_process_scsi_task_mgmt()
484 reply.ResponseCode = MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN; in mptsas_process_scsi_task_mgmt()
488 reply_async = g_memdup(&reply, sizeof(MPIMsgSCSITaskMgmtReply)); in mptsas_process_scsi_task_mgmt()
499 notifier->reply = reply_async; in mptsas_process_scsi_task_mgmt()
511 reply.TerminationCount = count; in mptsas_process_scsi_task_mgmt()
518 reply.IOCStatus = status; in mptsas_process_scsi_task_mgmt()
522 reply.ResponseCode = MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN; in mptsas_process_scsi_task_mgmt()
530 reply.IOCStatus = MPI_IOCSTATUS_SCSI_INVALID_BUS; in mptsas_process_scsi_task_mgmt()
534 reply.IOCStatus = MPI_IOCSTATUS_SCSI_INVALID_TARGETID; in mptsas_process_scsi_task_mgmt()
551 reply.ResponseCode = MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED; in mptsas_process_scsi_task_mgmt()
556 mptsas_fix_scsi_task_mgmt_reply_endianness(&reply); in mptsas_process_scsi_task_mgmt()
557 mptsas_post_reply(s, (MPIDefaultReply *)&reply); in mptsas_process_scsi_task_mgmt()
562 MPIMsgIOCInitReply reply; in mptsas_process_ioc_init() local
568 QEMU_BUILD_BUG_ON(sizeof(s->doorbell_reply) < sizeof(reply)); in mptsas_process_ioc_init()
581 memset(&reply, 0, sizeof(reply)); in mptsas_process_ioc_init()
582 reply.WhoInit = s->who_init; in mptsas_process_ioc_init()
583 reply.MsgLength = sizeof(reply) / 4; in mptsas_process_ioc_init()
584 reply.Function = req->Function; in mptsas_process_ioc_init()
585 reply.MaxDevices = s->max_devices; in mptsas_process_ioc_init()
586 reply.MaxBuses = s->max_buses; in mptsas_process_ioc_init()
587 reply.MsgContext = req->MsgContext; in mptsas_process_ioc_init()
589 mptsas_fix_ioc_init_reply_endianness(&reply); in mptsas_process_ioc_init()
590 mptsas_reply(s, (MPIDefaultReply *)&reply); in mptsas_process_ioc_init()
596 MPIMsgIOCFactsReply reply; in mptsas_process_ioc_facts() local
602 QEMU_BUILD_BUG_ON(sizeof(s->doorbell_reply) < sizeof(reply)); in mptsas_process_ioc_facts()
604 memset(&reply, 0, sizeof(reply)); in mptsas_process_ioc_facts()
605 reply.MsgVersion = 0x0105; in mptsas_process_ioc_facts()
606 reply.MsgLength = sizeof(reply) / 4; in mptsas_process_ioc_facts()
607 reply.Function = req->Function; in mptsas_process_ioc_facts()
608 reply.MsgContext = req->MsgContext; in mptsas_process_ioc_facts()
609 reply.MaxChainDepth = MPTSAS_MAXIMUM_CHAIN_DEPTH; in mptsas_process_ioc_facts()
610 reply.WhoInit = s->who_init; in mptsas_process_ioc_facts()
611 reply.BlockSize = MPTSAS_MAX_REQUEST_SIZE / sizeof(uint32_t); in mptsas_process_ioc_facts()
612 reply.ReplyQueueDepth = ARRAY_SIZE(s->reply_post) - 1; in mptsas_process_ioc_facts()
615 reply.RequestFrameSize = 128; in mptsas_process_ioc_facts()
616 reply.ProductID = MPTSAS1068_PRODUCT_ID; in mptsas_process_ioc_facts()
617 reply.CurrentHostMfaHighAddr = s->host_mfa_high_addr >> 32; in mptsas_process_ioc_facts()
618 reply.GlobalCredits = ARRAY_SIZE(s->request_post) - 1; in mptsas_process_ioc_facts()
619 reply.NumberOfPorts = MPTSAS_NUM_PORTS; in mptsas_process_ioc_facts()
620 reply.CurrentSenseBufferHighAddr = s->sense_buffer_high_addr >> 32; in mptsas_process_ioc_facts()
621 reply.CurReplyFrameSize = s->reply_frame_size; in mptsas_process_ioc_facts()
622 reply.MaxDevices = s->max_devices; in mptsas_process_ioc_facts()
623 reply.MaxBuses = s->max_buses; in mptsas_process_ioc_facts()
624 reply.FWVersionDev = 0; in mptsas_process_ioc_facts()
625 reply.FWVersionUnit = 0x92; in mptsas_process_ioc_facts()
626 reply.FWVersionMinor = 0x32; in mptsas_process_ioc_facts()
627 reply.FWVersionMajor = 0x1; in mptsas_process_ioc_facts()
629 mptsas_fix_ioc_facts_reply_endianness(&reply); in mptsas_process_ioc_facts()
630 mptsas_reply(s, (MPIDefaultReply *)&reply); in mptsas_process_ioc_facts()
636 MPIMsgPortFactsReply reply; in mptsas_process_port_facts() local
642 QEMU_BUILD_BUG_ON(sizeof(s->doorbell_reply) < sizeof(reply)); in mptsas_process_port_facts()
644 memset(&reply, 0, sizeof(reply)); in mptsas_process_port_facts()
645 reply.MsgLength = sizeof(reply) / 4; in mptsas_process_port_facts()
646 reply.Function = req->Function; in mptsas_process_port_facts()
647 reply.PortNumber = req->PortNumber; in mptsas_process_port_facts()
648 reply.MsgContext = req->MsgContext; in mptsas_process_port_facts()
651 reply.PortType = MPI_PORTFACTS_PORTTYPE_SAS; in mptsas_process_port_facts()
652 reply.MaxDevices = MPTSAS_NUM_PORTS; in mptsas_process_port_facts()
653 reply.PortSCSIID = MPTSAS_NUM_PORTS; in mptsas_process_port_facts()
654 reply.ProtocolFlags = MPI_PORTFACTS_PROTOCOL_LOGBUSADDR | MPI_PORTFACTS_PROTOCOL_INITIATOR; in mptsas_process_port_facts()
657 mptsas_fix_port_facts_reply_endianness(&reply); in mptsas_process_port_facts()
658 mptsas_reply(s, (MPIDefaultReply *)&reply); in mptsas_process_port_facts()
664 MPIMsgPortEnableReply reply; in mptsas_process_port_enable() local
670 QEMU_BUILD_BUG_ON(sizeof(s->doorbell_reply) < sizeof(reply)); in mptsas_process_port_enable()
672 memset(&reply, 0, sizeof(reply)); in mptsas_process_port_enable()
673 reply.MsgLength = sizeof(reply) / 4; in mptsas_process_port_enable()
674 reply.PortNumber = req->PortNumber; in mptsas_process_port_enable()
675 reply.Function = req->Function; in mptsas_process_port_enable()
676 reply.MsgContext = req->MsgContext; in mptsas_process_port_enable()
678 mptsas_fix_port_enable_reply_endianness(&reply); in mptsas_process_port_enable()
679 mptsas_reply(s, (MPIDefaultReply *)&reply); in mptsas_process_port_enable()
685 MPIMsgEventNotifyReply reply; in mptsas_process_event_notification() local
691 QEMU_BUILD_BUG_ON(sizeof(s->doorbell_reply) < sizeof(reply)); in mptsas_process_event_notification()
697 memset(&reply, 0, sizeof(reply)); in mptsas_process_event_notification()
698 reply.EventDataLength = sizeof(reply.Data) / 4; in mptsas_process_event_notification()
699 reply.MsgLength = sizeof(reply) / 4; in mptsas_process_event_notification()
700 reply.Function = req->Function; in mptsas_process_event_notification()
702 /* This is set because events are sent through the reply FIFOs. */ in mptsas_process_event_notification()
703 reply.MsgFlags = MPI_MSGFLAGS_CONTINUATION_REPLY; in mptsas_process_event_notification()
705 reply.MsgContext = req->MsgContext; in mptsas_process_event_notification()
706 reply.Event = MPI_EVENT_EVENT_CHANGE; in mptsas_process_event_notification()
707 reply.Data[0] = !!req->Switch; in mptsas_process_event_notification()
709 mptsas_fix_event_notification_reply_endianness(&reply); in mptsas_process_event_notification()
710 mptsas_reply(s, (MPIDefaultReply *)&reply); in mptsas_process_event_notification()
972 /* The reply can be read continuously, so leave the interrupt up. */ in mptsas_interrupt_status_write()
1162 MPIMsgSCSIIOReply reply; in mptsas_command_complete() local
1164 memset(&reply, 0, sizeof(reply)); in mptsas_command_complete()
1165 reply.TargetID = req->scsi_io.TargetID; in mptsas_command_complete()
1166 reply.Bus = req->scsi_io.Bus; in mptsas_command_complete()
1167 reply.MsgLength = sizeof(reply) / 4; in mptsas_command_complete()
1168 reply.Function = req->scsi_io.Function; in mptsas_command_complete()
1169 reply.CDBLength = req->scsi_io.CDBLength; in mptsas_command_complete()
1170 reply.SenseBufferLength = req->scsi_io.SenseBufferLength; in mptsas_command_complete()
1171 reply.MsgFlags = req->scsi_io.MsgFlags; in mptsas_command_complete()
1172 reply.MsgContext = req->scsi_io.MsgContext; in mptsas_command_complete()
1173 reply.SCSIStatus = sreq->status; in mptsas_command_complete()
1175 reply.TransferCount = req->scsi_io.DataLength - resid; in mptsas_command_complete()
1177 reply.IOCStatus = MPI_IOCSTATUS_SCSI_DATA_UNDERRUN; in mptsas_command_complete()
1180 reply.SCSIState = MPI_SCSI_STATE_AUTOSENSE_VALID; in mptsas_command_complete()
1181 reply.SenseCount = sense_len; in mptsas_command_complete()
1182 reply.IOCStatus = MPI_IOCSTATUS_SCSI_DATA_UNDERRUN; in mptsas_command_complete()
1185 mptsas_fix_scsi_io_reply_endianness(&reply); in mptsas_command_complete()
1186 mptsas_post_reply(req->dev, (MPIDefaultReply *)&reply); in mptsas_command_complete()
1197 MPIMsgSCSIIOReply reply; in mptsas_request_cancelled() local
1199 memset(&reply, 0, sizeof(reply)); in mptsas_request_cancelled()
1200 reply.TargetID = req->scsi_io.TargetID; in mptsas_request_cancelled()
1201 reply.Bus = req->scsi_io.Bus; in mptsas_request_cancelled()
1202 reply.MsgLength = sizeof(reply) / 4; in mptsas_request_cancelled()
1203 reply.Function = req->scsi_io.Function; in mptsas_request_cancelled()
1204 reply.CDBLength = req->scsi_io.CDBLength; in mptsas_request_cancelled()
1205 reply.SenseBufferLength = req->scsi_io.SenseBufferLength; in mptsas_request_cancelled()
1206 reply.MsgFlags = req->scsi_io.MsgFlags; in mptsas_request_cancelled()
1207 reply.MsgContext = req->scsi_io.MsgContext; in mptsas_request_cancelled()
1208 reply.SCSIState = MPI_SCSI_STATE_NO_SCSI_STATUS; in mptsas_request_cancelled()
1209 reply.IOCStatus = MPI_IOCSTATUS_SCSI_TASK_TERMINATED; in mptsas_request_cancelled()
1211 mptsas_fix_scsi_io_reply_endianness(&reply); in mptsas_request_cancelled()
1212 mptsas_post_reply(req->dev, (MPIDefaultReply *)&reply); in mptsas_request_cancelled()