Re: [Qemu-devel] [PATCH 04/19] libqos/ahci: Add command header helpers

2015-02-02 Thread John Snow
On 02/02/2015 05:25 AM, Paolo Bonzini wrote: On 30/01/2015 19:41, John Snow wrote: +/* Construct our Command Header (set_command_header handles endianness.) */ +memset(&cmd, 0x00, sizeof(cmd)); +cmd.flags = 5; /* reg_h2d_fis is 5 double-words long */ +cmd.flags = 0x400; /

Re: [Qemu-devel] [PATCH 04/19] libqos/ahci: Add command header helpers

2015-02-02 Thread John Snow
On 02/02/2015 05:27 AM, Paolo Bonzini wrote: On 30/01/2015 19:41, John Snow wrote: +/* Set the #cx'th command of port #px. */ +void ahci_set_command_header(AHCIQState *ahci, uint8_t px, + uint8_t cx, AHCICommandHeader *cmd) +{ +uint64_t ba = ahci->port[px].clb

Re: [Qemu-devel] [PATCH 04/19] libqos/ahci: Add command header helpers

2015-02-02 Thread Paolo Bonzini
On 30/01/2015 19:41, John Snow wrote: > +/* Set the #cx'th command of port #px. */ > +void ahci_set_command_header(AHCIQState *ahci, uint8_t px, > + uint8_t cx, AHCICommandHeader *cmd) > +{ > +uint64_t ba = ahci->port[px].clb; > +ba += cx * sizeof(AHCICommandHe

Re: [Qemu-devel] [PATCH 04/19] libqos/ahci: Add command header helpers

2015-02-02 Thread Paolo Bonzini
On 30/01/2015 19:41, John Snow wrote: > +/* Construct our Command Header (set_command_header handles endianness.) > */ > +memset(&cmd, 0x00, sizeof(cmd)); > +cmd.flags = 5; /* reg_h2d_fis is 5 double-words long */ > +cmd.flags = 0x400; /* clear PxTFD.STS.BSY when done */ And

[Qemu-devel] [PATCH 04/19] libqos/ahci: Add command header helpers

2015-01-30 Thread John Snow
Adds command header helper functions: -ahci_command_header_set -ahci_command_header_get, -ahci_command_destroy, and -ahci_cmd_pick These helpers help to quickly manage the command header information in the AHCI device. ahci_command_header_set and get will store or retrieve an AHCI command header,