qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Implementation of BusLogic SCSI host adapter (BT-958)
@ 2016-08-31 13:48 Денис Дмитриев
  2016-09-01 11:11 ` Paolo Bonzini
  0 siblings, 1 reply; 7+ messages in thread
From: Денис Дмитриев @ 2016-08-31 13:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Pavel Dovgaluk, pbonzini

Hi,
I'm trying to implement a buslogic scsi adapter(BT-958) for qemu. I
realized the driver interaction with the ports through which the driver can
write / read commands and parameters for the adapter. The driver was able
to make an adapter sample procedure. The problem is that I do not
understand how to establish communication between the driver and adapter
for transferring mailboxes. I got the address of the mailboxes from the
driver. Then I calculated the start address of the desired mailbox (the
same address to which a driver recorded a mailbox). After that, I try to
read the data at this address using pci_dma_read function but no buffer
data after reading.


uint64_t buslogicReadOutgoingMailbox(BuslogicState *s, BUSLOGICTASKSTATE
*TaskState)
{
    uint64_t    GCMailbox;
    Mailbox24   Mbx24;
    Mbx24.uCmdState = 0;
    PCIDevice *pci_dev = PCI_DEVICE(s);
    if (s->fMbxIs24Bit)
    {
        //try to calculate mailbox address
        GCMailbox = s->GCPhysAddrMailboxOutgoingBase +
(s->uMailboxOutgoingPositionCurrent * sizeof(Mailbox24));
        //try to read mailbox
        pci_dma_read(pci_dev, GCMailbox, &Mbx24, sizeof(Mailbox24));
        //after that i  have empty buffer
        TaskState->MailboxGuest.u32PhysAddrCCB    =
ADDR_TO_U32(Mbx24.aPhysAddrCCB);
        TaskState->MailboxGuest.u.out.uActionCode = Mbx24.uCmdState;
    }
    else
    {
        GCMailbox = s->GCPhysAddrMailboxOutgoingBase +
(s->uMailboxOutgoingPositionCurrent * sizeof(Mailbox32));
        pci_dma_read(pci_dev, GCMailbox, &TaskState->MailboxGuest,
sizeof(Mailbox32));
    }
    return GCMailbox;
}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-01 15:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-31 13:48 [Qemu-devel] Implementation of BusLogic SCSI host adapter (BT-958) Денис Дмитриев
2016-09-01 11:11 ` Paolo Bonzini
2016-09-01 11:19   ` Peter Maydell
2016-09-01 12:59     ` Paolo Bonzini
2016-09-01 13:01       ` Peter Maydell
2016-09-01 13:17   ` Denis Dmitriev
2016-09-01 15:12     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).