Commit 2ea5117b authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor CONTROLVM_MESSAGE_PACKET

This patch refactors the message union and internal structures so they
will pass checkpatch.pl. The typedef is removed, and references are
changed to struct controlvm_message_packet. The comments were reflowed
and cleaned up to remove unnecessary information, and CamelCase member
names were fixed here and in references:

busNo => bus_no
devNo => dev_no
deviceCount => dev_count
channelAddr => channel_addr
channelBytes => channel_bytes
busDataTypeGuid => bus_data_type_uuid
busInstGuid => bus_inst_uuid
destroyBus => destroy_bus
guestHandle => guest_handle
recvBusInterruptHandle => recv_bus_irq_handle
configureBus => configure_bus
createDevuce => create_device
destroyDevice => destroy_device
configureDevice => configure_device
reconfigureDevice => reconfigure_device
busChangeState => bus_change_state
physicalDevice => phys_device
busCount => bus_count
switchCount => switch_count
platformNumber => platformNumber
initChipset => init_chipset
Options => options
Test => test
chipsetSelftest => chipset_selftest
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b9b141e8
...@@ -251,135 +251,100 @@ typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE { ...@@ -251,135 +251,100 @@ typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE {
} CONTROLVM_MESSAGE_DEVICE_CONFIGURE; /* total 56 bytes */ } CONTROLVM_MESSAGE_DEVICE_CONFIGURE; /* total 56 bytes */
/* This is the format for a message in any ControlVm queue. */ /* This is the format for a message in any ControlVm queue. */
typedef struct _CONTROLVM_MESSAGE_PACKET { struct controlvm_message_packet {
union { union {
/* BEGIN Request messages */
struct { struct {
u32 busNo; /*< bus # (0..n-1) from the msg u32 bus_no; /* bus # (0..n-1) from the msg
* receiver's perspective */ * receiver's perspective */
u32 dev_count; /* indicates the max number of
/* Control uses header SegmentIndex field to access bus number... */
u32 deviceCount; /*< indicates the max number of
* devices on this bus */ * devices on this bus */
u64 channelAddr; /*< Guest physical address of the u64 channel_addr; /* Guest physical address of
* channel, which can be * the channel, which can be
* dereferenced by the receiver * dereferenced by the receiver
* of this ControlVm command */ * of this ControlVm command */
u64 channelBytes; /*< size of the channel in bytes */ u64 channel_bytes; /* size of the channel */
uuid_le busDataTypeGuid;/*< indicates format of data in uuid_le bus_data_type_uuid; /* indicates format of
bus channel */ * data in bus channel*/
uuid_le busInstGuid; /*< instance guid for the bus */ uuid_le bus_inst_uuid; /* instance uuid for the bus */
} createBus; /* for CONTROLVM_BUS_CREATE */ } create_bus; /* for CONTROLVM_BUS_CREATE */
struct { struct {
u32 busNo; /*< bus # (0..n-1) from the msg u32 bus_no; /* bus # (0..n-1) from the msg
* receiver's perspective */ * receiver's perspective */
/* Control uses header SegmentIndex field to access bus number... */
u32 reserved; /* Natural alignment purposes */ u32 reserved; /* Natural alignment purposes */
} destroyBus; /* for CONTROLVM_BUS_DESTROY */ } destroy_bus; /* for CONTROLVM_BUS_DESTROY */
struct { struct {
u32 busNo; /*< bus # (0..n-1) from the u32 bus_no; /* bus # (0..n-1) from the receiver's
* msg receiver's
* perspective */ * perspective */
/* Control uses header SegmentIndex field to access bus number... */
u32 reserved1; /* for alignment purposes */ u32 reserved1; /* for alignment purposes */
u64 guestHandle; /* This is used to convert u64 guest_handle; /* This is used to convert
* guest physical address to real * guest physical address to
* physical address for DMA, for ex. */ * physical address */
u64 recvBusInterruptHandle;/*< specifies interrupt u64 recv_bus_irq_handle;
* info. It is used by SP to register /* specifies interrupt info. It is used by SP
* to receive interrupts from the CP. * to register to receive interrupts from the
* This interrupt is used for bus * CP. This interrupt is used for bus level
* level notifications. The * notifications. The corresponding
* corresponding * sendBusInterruptHandle is kept in CP. */
* sendBusInterruptHandle is kept in } configure_bus; /* for CONTROLVM_BUS_CONFIGURE */
* CP. */
} configureBus; /* for CONTROLVM_BUS_CONFIGURE */
/* for CONTROLVM_DEVICE_CREATE */ /* for CONTROLVM_DEVICE_CREATE */
CONTROLVM_PACKET_DEVICE_CREATE createDevice; CONTROLVM_PACKET_DEVICE_CREATE create_device;
struct { struct {
u32 busNo; /*< bus # (0..n-1) from the msg u32 bus_no; /* bus # (0..n-1) from the msg
* receiver's perspective */ * receiver's perspective */
u32 dev_no; /* bus-relative (0..n-1) device # */
/* Control uses header SegmentIndex field to access bus number... */ } destroy_device; /* for CONTROLVM_DEVICE_DESTROY */
u32 devNo; /*< bus-relative (0..n-1) device
* number */
} destroyDevice; /* for CONTROLVM_DEVICE_DESTROY */
/* for CONTROLVM_DEVICE_CONFIGURE */ /* for CONTROLVM_DEVICE_CONFIGURE */
CONTROLVM_PACKET_DEVICE_CONFIGURE configureDevice; CONTROLVM_PACKET_DEVICE_CONFIGURE configure_device;
struct { struct {
u32 busNo; /*< bus # (0..n-1) from the msg u32 bus_no; /* bus # (0..n-1) from the msg
* receiver's perspective */ * receiver's perspective */
u32 dev_no; /* bus-relative (0..n-1) device # */
/* Control uses header SegmentIndex field to access bus number... */ } reconfigure_device; /* for CONTROLVM_DEVICE_RECONFIGURE */
u32 devNo; /*< bus-relative (0..n-1) device
* number */
} reconfigureDevice; /* for CONTROLVM_DEVICE_RECONFIGURE */
struct { struct {
u32 busNo; u32 bus_no;
struct spar_segment_state state; struct spar_segment_state state;
u8 reserved[2]; /* Natural alignment purposes */ u8 reserved[2]; /* Natural alignment purposes */
} busChangeState; /* for CONTROLVM_BUS_CHANGESTATE */ } bus_change_state; /* for CONTROLVM_BUS_CHANGESTATE */
struct { struct {
u32 busNo; u32 bus_no;
u32 devNo; u32 dev_no;
struct spar_segment_state state; struct spar_segment_state state;
struct { struct {
u32 physicalDevice:1; /* =1 if message is for u32 phys_device:1; /* =1 if message is for
* a physical device */ * a physical device */
/* remaining bits in this 32-bit word are available */
} flags; } flags;
u8 reserved[2]; /* Natural alignment purposes */ u8 reserved[2]; /* Natural alignment purposes */
} deviceChangeState; /* for CONTROLVM_DEVICE_CHANGESTATE */ } device_change_state; /* for CONTROLVM_DEVICE_CHANGESTATE */
struct { struct {
u32 busNo; u32 bus_no;
u32 devNo; u32 dev_no;
struct spar_segment_state state; struct spar_segment_state state;
u8 reserved[6]; /* Natural alignment purposes */ u8 reserved[6]; /* Natural alignment purposes */
} deviceChangeStateEvent; /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */ } device_change_state_event;
/* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
struct { struct {
u32 busCount; /*< indicates the max number of busses */ u32 bus_count; /* indicates the max number of busses */
u32 switchCount; /*< indicates the max number of u32 switch_count; /* indicates the max number of
* switches (applicable for service * switches if a service partition */
* partition only) */
enum ultra_chipset_feature features; enum ultra_chipset_feature features;
u32 platformNumber; /* Platform Number */ u32 platform_number; /* Platform Number */
} initChipset; /* for CONTROLVM_CHIPSET_INIT */ } init_chipset; /* for CONTROLVM_CHIPSET_INIT */
struct { struct {
u32 Options; /*< reserved */ u32 options; /* reserved */
u32 Test; /*< bit 0 set to run embedded selftest */ u32 test; /* bit 0 set to run embedded selftest */
} chipsetSelftest; /* for CONTROLVM_CHIPSET_SELFTEST */ } chipset_selftest; /* for CONTROLVM_CHIPSET_SELFTEST */
u64 addr; /* a physical address of something, that can be
/* END Request messages */ * dereferenced by the receiver of this
* ControlVm command (depends on command id) */
/* BEGIN Response messages */ u64 handle; /* a handle of something (depends on command
* id) */
/* END Response messages */
/* BEGIN Event messages */
/* END Event messages */
/* BEGIN Ack messages */
/* END Ack messages */
u64 addr; /*< a physical address of something, that
* can be dereferenced by the receiver of
* this ControlVm command (depends on
* command id) */
u64 handle; /*< a handle of something (depends on
* command id) */
}; };
} CONTROLVM_MESSAGE_PACKET; };
/* All messages in any ControlVm queue have this layout. */ /* All messages in any ControlVm queue have this layout. */
typedef struct _CONTROLVM_MESSAGE { typedef struct _CONTROLVM_MESSAGE {
CONTROLVM_MESSAGE_HEADER hdr; CONTROLVM_MESSAGE_HEADER hdr;
CONTROLVM_MESSAGE_PACKET cmd; struct controlvm_message_packet cmd;
} CONTROLVM_MESSAGE; } CONTROLVM_MESSAGE;
typedef struct _DEVICE_MAP { typedef struct _DEVICE_MAP {
......
...@@ -155,7 +155,8 @@ u64 uislib_storage_channel(int client_id); ...@@ -155,7 +155,8 @@ u64 uislib_storage_channel(int client_id);
#endif #endif
int uislib_get_owned_pdest(struct uisscsi_dest *pdest); int uislib_get_owned_pdest(struct uisscsi_dest *pdest);
int uislib_send_event(enum controlvm_id id, CONTROLVM_MESSAGE_PACKET *event); int uislib_send_event(enum controlvm_id id,
struct controlvm_message_packet *event);
/* structure used by vhba & vnic to keep track of queue & thread info */ /* structure used by vhba & vnic to keep track of queue & thread info */
struct chaninfo { struct chaninfo {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment