s390x: use enum for adapter type and standardize its naming

Let's use an enum for io adapter type, and standardize its naming to
CSS_IO_ADAPTER_* by changing S390_PCIPT_ADAPTER to CSS_IO_ADAPTER_PCI.

Signed-off-by: Fei Li <sherrylf@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
Fei Li 2016-11-25 07:45:14 +01:00 committed by Cornelia Huck
parent 2a78ac660f
commit 5b00bef270
4 changed files with 9 additions and 5 deletions

View File

@ -155,7 +155,7 @@ int css_create_css_image(uint8_t cssid, bool default_image)
return 0;
}
int css_register_io_adapter(uint8_t type, uint8_t isc, bool swap,
int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap,
bool maskable, uint32_t *id)
{
IoAdapter *adapter;

View File

@ -30,7 +30,6 @@
#define FH_MASK_INDEX 0x0000ffff
#define FH_SHM_VFIO 0x00010000
#define FH_SHM_EMUL 0x00020000
#define S390_PCIPT_ADAPTER 2
#define ZPCI_MAX_FID 0xffffffff
#define ZPCI_MAX_UID 0xffff
#define UID_UNDEFINED 0

View File

@ -734,7 +734,7 @@ static int reg_irqs(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib)
{
int ret, len;
ret = css_register_io_adapter(S390_PCIPT_ADAPTER,
ret = css_register_io_adapter(CSS_IO_ADAPTER_PCI,
FIB_DATA_ISC(ldl_p(&fib.data)), true, false,
&pbdev->routes.adapter.adapter_id);
assert(ret == 0);

View File

@ -124,8 +124,13 @@ void css_generate_css_crws(uint8_t cssid);
void css_clear_sei_pending(void);
void css_adapter_interrupt(uint8_t isc);
#define CSS_IO_ADAPTER_VIRTIO 1
int css_register_io_adapter(uint8_t type, uint8_t isc, bool swap,
typedef enum {
CSS_IO_ADAPTER_VIRTIO = 0,
CSS_IO_ADAPTER_PCI = 1,
CSS_IO_ADAPTER_TYPE_NUMS,
} CssIoAdapterType;
int css_register_io_adapter(CssIoAdapterType type, uint8_t isc, bool swap,
bool maskable, uint32_t *id);
#ifndef CONFIG_USER_ONLY