]> git.proxmox.com Git - mirror_qemu.git/commit
libqos/ahci: add ahci command functions
authorJohn Snow <jsnow@redhat.com>
Thu, 5 Feb 2015 17:41:23 +0000 (12:41 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 16 Feb 2015 15:07:17 +0000 (15:07 +0000)
commit64a5a272e31c99cfb348f908d71c98d2eb83ba28
tree088f9ca5577d6b19e58dbfb78b740610da2bd5e5
parent716b64079ceaa6fede724f8a24a24b0209fa5173
libqos/ahci: add ahci command functions

This patch adds the AHCICommand structure, and a set of functions to
operate on the structure.

ahci_command_create - Initialize and create a new AHCICommand in memory
ahci_command_free - Destroy this object.
ahci_command_set_buffer - Set where the guest memory DMA buffer is.
ahci_command_commit - Write this command to the AHCI HBA.
ahci_command_issue - Issue the committed command synchronously.
ahci_command_issue_async - Issue the committed command asynchronously.
ahci_command_wait - Wait for an asynchronous command to finish.
ahci_command_slot - Get the number of the command slot we committed to.

Helpers:
size_to_prdtl       - Calculate the required minimum PRDTL size from
                      a buffer size.
ahci_command_find   - Given an ATA command mnemonic, look it up in the
                      properties table to obtain info about the command.
command_header_init - Initialize the command header with sane values.
command_table_init  - Initialize the command table with sane values.

[Peter Maydell <peter.maydell@linaro.org> reported the following clang
warning:

  tests/libqos/ahci.c:598:3: warning: redefinition
  of typedef 'AHCICommand' is a C11 feature
      [-Wtypedef-redefinition]
  } AHCICommand;

I have replaced typedef struct ... AHCICommand; with struct ... ;
--Stefan]

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 1423158090-25580-13-git-send-email-jsnow@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests/ahci-test.c
tests/libqos/ahci.c
tests/libqos/ahci.h