libqos/ahci: Add ide cmd properties
Add a structure that defines some properties of various IDE commands. These will be used to simplify the interface to the libqos AHCI calls, lessening the redundancy of specifying and respecifying properties of commands to various helper functions. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1423158090-25580-12-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
		
							parent
							
								
									52515766f1
								
							
						
					
					
						commit
						716b64079c
					
				| 
						 | 
					@ -34,6 +34,45 @@
 | 
				
			||||||
#include "hw/pci/pci_ids.h"
 | 
					#include "hw/pci/pci_ids.h"
 | 
				
			||||||
#include "hw/pci/pci_regs.h"
 | 
					#include "hw/pci/pci_regs.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					typedef struct AHCICommandProp {
 | 
				
			||||||
 | 
					    uint8_t  cmd;        /* Command Code */
 | 
				
			||||||
 | 
					    bool     data;       /* Data transfer command? */
 | 
				
			||||||
 | 
					    bool     pio;
 | 
				
			||||||
 | 
					    bool     dma;
 | 
				
			||||||
 | 
					    bool     lba28;
 | 
				
			||||||
 | 
					    bool     lba48;
 | 
				
			||||||
 | 
					    bool     read;
 | 
				
			||||||
 | 
					    bool     write;
 | 
				
			||||||
 | 
					    bool     atapi;
 | 
				
			||||||
 | 
					    bool     ncq;
 | 
				
			||||||
 | 
					    uint64_t size;       /* Static transfer size, for commands like IDENTIFY. */
 | 
				
			||||||
 | 
					    uint32_t interrupts; /* Expected interrupts for this command. */
 | 
				
			||||||
 | 
					} AHCICommandProp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					AHCICommandProp ahci_command_properties[] = {
 | 
				
			||||||
 | 
					    { .cmd = CMD_READ_PIO,      .data = true,  .pio = true,
 | 
				
			||||||
 | 
					                                .lba28 = true, .read = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_WRITE_PIO,     .data = true,  .pio = true,
 | 
				
			||||||
 | 
					                                .lba28 = true, .write = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_READ_PIO_EXT,  .data = true,  .pio = true,
 | 
				
			||||||
 | 
					                                .lba48 = true, .read = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_WRITE_PIO_EXT, .data = true,  .pio = true,
 | 
				
			||||||
 | 
					                                .lba48 = true, .write = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_READ_DMA,      .data = true,  .dma = true,
 | 
				
			||||||
 | 
					                                .lba28 = true, .read = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_WRITE_DMA,     .data = true,  .dma = true,
 | 
				
			||||||
 | 
					                                .lba28 = true, .write = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_READ_DMA_EXT,  .data = true,  .dma = true,
 | 
				
			||||||
 | 
					                                .lba48 = true, .read = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_WRITE_DMA_EXT, .data = true,  .dma = true,
 | 
				
			||||||
 | 
					                                .lba48 = true, .write = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_IDENTIFY,      .data = true,  .pio = true,
 | 
				
			||||||
 | 
					                                .size = 512,   .read = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_READ_MAX,      .lba28 = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_READ_MAX_EXT,  .lba48 = true },
 | 
				
			||||||
 | 
					    { .cmd = CMD_FLUSH_CACHE,   .data = false }
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Allocate space in the guest using information in the AHCIQState object.
 | 
					 * Allocate space in the guest using information in the AHCIQState object.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue