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

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
Loading
Loading
Loading
Loading
+65 −100
Original line number Diff line number Diff line
@@ -251,135 +251,100 @@ typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE {
} CONTROLVM_MESSAGE_DEVICE_CONFIGURE;	/* total 56 bytes */

/* This is the format for a message in any ControlVm queue. */
typedef struct _CONTROLVM_MESSAGE_PACKET  {
struct controlvm_message_packet  {
	union  {

		/* BEGIN Request messages */
		struct  {
			u32 busNo;	      /*< bus # (0..n-1) from the msg
			u32 bus_no;	/* bus # (0..n-1) from the msg
					 * receiver's perspective */

	    /* Control uses header SegmentIndex field to access bus number... */
			u32 deviceCount;      /*< indicates the max number of
			u32 dev_count;	/* indicates the max number of
					 * devices on this bus */
			u64 channelAddr;     /*< Guest physical address of the
					      *   channel, which can be
			u64 channel_addr;	/* Guest physical address of
						 * the channel, which can be
						 * dereferenced by the receiver
						 * of this ControlVm command */
			u64 channelBytes;    /*< size of the channel in bytes */
			uuid_le busDataTypeGuid;/*< indicates format of data in
						    bus channel */
			uuid_le busInstGuid;    /*< instance guid for the bus */
		} createBus;	/* for CONTROLVM_BUS_CREATE */
			u64 channel_bytes;	/* size of the channel */
			uuid_le bus_data_type_uuid;	/* indicates format of
							 * data in bus channel*/
			uuid_le bus_inst_uuid;	/* instance uuid for the bus */
		} create_bus;	/* for CONTROLVM_BUS_CREATE */
		struct  {
			u32 busNo;	      /*< bus # (0..n-1) from the msg
			u32 bus_no;	/* bus # (0..n-1) from the msg
					 * receiver's perspective */

	    /* Control uses header SegmentIndex field to access bus number... */
			u32 reserved;	/* Natural alignment purposes */
		} destroyBus;	/* for CONTROLVM_BUS_DESTROY */
		} destroy_bus;	/* for CONTROLVM_BUS_DESTROY */
		struct  {
			u32 busNo;		    /*< bus # (0..n-1) from the
						     * msg receiver's
			u32 bus_no;	/* bus # (0..n-1) from the receiver's
					 * perspective */

	    /* Control uses header SegmentIndex field to access bus number... */
			u32 reserved1;	/* for alignment purposes */
			u64 guestHandle;	    /* This is used to convert
					 *  guest physical address to real
					 *  physical address for DMA, for ex. */
			u64 recvBusInterruptHandle;/*< specifies interrupt
					 *   info. It is used by SP to register
					 *   to receive interrupts from the CP.
					 *   This interrupt is used for bus
					 *   level notifications.  The
					 *   corresponding
					 *   sendBusInterruptHandle is kept in
					 *   CP. */
		} configureBus;	/* for CONTROLVM_BUS_CONFIGURE */

			u64 guest_handle;	/* This is used to convert
						 * guest physical address to
						 * physical address */
			u64 recv_bus_irq_handle;
				/* specifies interrupt info. It is used by SP
				 * to register to receive interrupts from the
				 * CP. This interrupt is used for bus level
				 * notifications.  The corresponding
				 * sendBusInterruptHandle is kept in CP. */
		} configure_bus;	/* for CONTROLVM_BUS_CONFIGURE */
		/* for CONTROLVM_DEVICE_CREATE */
		CONTROLVM_PACKET_DEVICE_CREATE createDevice;
		CONTROLVM_PACKET_DEVICE_CREATE create_device;
		struct  {
			u32 busNo;	      /*< bus # (0..n-1) from the msg
			u32 bus_no;	/* bus # (0..n-1) from the msg
					 * receiver's perspective */

	    /* Control uses header SegmentIndex field to access bus number... */
			u32 devNo;	      /*< bus-relative (0..n-1) device
					       * number */
		} destroyDevice;	/* for CONTROLVM_DEVICE_DESTROY */

			u32 dev_no;	/* bus-relative (0..n-1) device # */
		} destroy_device;	/* for CONTROLVM_DEVICE_DESTROY */
		/* for CONTROLVM_DEVICE_CONFIGURE */
		CONTROLVM_PACKET_DEVICE_CONFIGURE configureDevice;
		CONTROLVM_PACKET_DEVICE_CONFIGURE configure_device;
		struct  {
			u32 busNo;	      /*< bus # (0..n-1) from the msg
			u32 bus_no;	/* bus # (0..n-1) from the msg
					 * receiver's perspective */

	    /* Control uses header SegmentIndex field to access bus number... */
			u32 devNo;	      /*< bus-relative (0..n-1) device
					       * number */
		} reconfigureDevice;	/* for CONTROLVM_DEVICE_RECONFIGURE */
			u32 dev_no;	/* bus-relative (0..n-1) device # */
		} reconfigure_device;	/* for CONTROLVM_DEVICE_RECONFIGURE */
		struct  {
			u32 busNo;
			u32 bus_no;
			struct spar_segment_state state;
			u8 reserved[2];	/* Natural alignment purposes */
		} busChangeState;	/* for CONTROLVM_BUS_CHANGESTATE */
		} bus_change_state;	/* for CONTROLVM_BUS_CHANGESTATE */
		struct  {
			u32 busNo;
			u32 devNo;
			u32 bus_no;
			u32 dev_no;
			struct spar_segment_state state;
			struct  {
				u32 physicalDevice:1;	/* =1 if message is for
				u32 phys_device:1;	/* =1 if message is for
							 * a physical device */
			/* remaining bits in this 32-bit word are available */
			} flags;
			u8 reserved[2];	/* Natural alignment purposes */
		} deviceChangeState;	/* for CONTROLVM_DEVICE_CHANGESTATE */
		} device_change_state;	/* for CONTROLVM_DEVICE_CHANGESTATE */
		struct  {
			u32 busNo;
			u32 devNo;
			u32 bus_no;
			u32 dev_no;
			struct spar_segment_state state;
			u8 reserved[6];	/* Natural alignment purposes */
		} deviceChangeStateEvent; /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
		} device_change_state_event;
			/* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
		struct  {
			u32 busCount; /*< indicates the max number of busses */
			u32 switchCount; /*< indicates the max number of
					  *   switches (applicable for service
					  *   partition only) */
			u32 bus_count;	/* indicates the max number of busses */
			u32 switch_count; /* indicates the max number of
					   * switches if a service partition */
			enum ultra_chipset_feature features;
			u32 platformNumber;	/* Platform Number */
		} initChipset;	/* for CONTROLVM_CHIPSET_INIT */
			u32 platform_number;	/* Platform Number */
		} init_chipset;	/* for CONTROLVM_CHIPSET_INIT */
		struct  {
			u32 Options; /*< reserved */
			u32 Test;    /*< bit 0 set to run embedded selftest */
		} chipsetSelftest;	/* for CONTROLVM_CHIPSET_SELFTEST */

		    /* END Request messages */

		    /* BEGIN Response messages */

		    /* 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) */
			u32 options;	/* reserved */
			u32 test;	/* bit 0 set to run embedded selftest */
		} chipset_selftest;	/* for CONTROLVM_CHIPSET_SELFTEST */
		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. */
typedef struct _CONTROLVM_MESSAGE  {
	CONTROLVM_MESSAGE_HEADER hdr;
	CONTROLVM_MESSAGE_PACKET cmd;
	struct controlvm_message_packet cmd;
} CONTROLVM_MESSAGE;

typedef struct _DEVICE_MAP  {
+2 −1
Original line number Diff line number Diff line
@@ -155,7 +155,8 @@ u64 uislib_storage_channel(int client_id);
#endif
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 */
struct chaninfo {
+82 −82
Original line number Diff line number Diff line
@@ -168,8 +168,8 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
		return CONTROLVM_RESP_ERROR_MAX_BUSES;
	}

	busNo = msg->cmd.createBus.busNo;
	deviceCount = msg->cmd.createBus.deviceCount;
	busNo = msg->cmd.create_bus.bus_no;
	deviceCount = msg->cmd.create_bus.dev_count;

	POSTCODE_LINUX_4(BUS_CREATE_ENTRY_PC, busNo, deviceCount,
			 POSTCODE_SEVERITY_INFO);
@@ -199,7 +199,7 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
	bus->device_count = deviceCount;
	bus->device =
	    (struct device_info **) ((char *) bus + sizeof(struct bus_info));
	bus->bus_inst_uuid = msg->cmd.createBus.busInstGuid;
	bus->bus_inst_uuid = msg->cmd.create_bus.bus_inst_uuid;
	bus->bus_channel_bytes = 0;
	bus->bus_channel = NULL;

@@ -221,12 +221,12 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
		kfree(bus);
		return CONTROLVM_RESP_ERROR_ALREADY_DONE;
	}
	if ((msg->cmd.createBus.channelAddr != 0)
	    && (msg->cmd.createBus.channelBytes != 0)) {
		bus->bus_channel_bytes = msg->cmd.createBus.channelBytes;
	if ((msg->cmd.create_bus.channel_addr != 0)
	    && (msg->cmd.create_bus.channel_bytes != 0)) {
		bus->bus_channel_bytes = msg->cmd.create_bus.channel_bytes;
		bus->bus_channel =
		    init_vbus_channel(msg->cmd.createBus.channelAddr,
				      msg->cmd.createBus.channelBytes);
		    init_vbus_channel(msg->cmd.create_bus.channel_addr,
				      msg->cmd.create_bus.channel_bytes);
	}
	/* the msg is bound for virtpci; send guest_msgs struct to callback */
	if (!msg->hdr.Flags.server) {
@@ -236,8 +236,8 @@ create_bus(CONTROLVM_MESSAGE *msg, char *buf)
		cmd.add_vbus.bus_no = busNo;
		cmd.add_vbus.chanptr = bus->bus_channel;
		cmd.add_vbus.dev_count = deviceCount;
		cmd.add_vbus.bus_uuid = msg->cmd.createBus.busDataTypeGuid;
		cmd.add_vbus.instance_uuid = msg->cmd.createBus.busInstGuid;
		cmd.add_vbus.bus_uuid = msg->cmd.create_bus.bus_data_type_uuid;
		cmd.add_vbus.instance_uuid = msg->cmd.create_bus.bus_inst_uuid;
		if (!virt_control_chan_func) {
			LOGERR("CONTROLVM_BUS_CREATE Failed: virtpci callback not registered.");
			POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus->bus_no,
@@ -279,7 +279,7 @@ destroy_bus(CONTROLVM_MESSAGE *msg, char *buf)
	struct guest_msgs cmd;
	u32 busNo;

	busNo = msg->cmd.destroyBus.busNo;
	busNo = msg->cmd.destroy_bus.bus_no;

	read_lock(&BusListLock);

@@ -354,8 +354,8 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
	u64 minSize = MIN_IO_CHANNEL_SIZE;
	struct req_handler_info *pReqHandler;

	busNo = msg->cmd.createDevice.busNo;
	devNo = msg->cmd.createDevice.devNo;
	busNo = msg->cmd.create_device.busNo;
	devNo = msg->cmd.create_device.devNo;

	POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo,
			 POSTCODE_SEVERITY_INFO);
@@ -368,9 +368,9 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
		return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
	}

	dev->channel_uuid = msg->cmd.createDevice.dataTypeGuid;
	dev->intr = msg->cmd.createDevice.intr;
	dev->channel_addr = msg->cmd.createDevice.channelAddr;
	dev->channel_uuid = msg->cmd.create_device.dataTypeGuid;
	dev->intr = msg->cmd.create_device.intr;
	dev->channel_addr = msg->cmd.create_device.channelAddr;
	dev->bus_no = busNo;
	dev->dev_no = devNo;
	sema_init(&dev->interrupt_callback_lock, 1);	/* unlocked */
@@ -385,9 +385,9 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
			 * channel
			 */
			minSize = pReqHandler->min_channel_bytes;
		if (minSize > msg->cmd.createDevice.channelBytes) {
		if (minSize > msg->cmd.create_device.channelBytes) {
			LOGERR("CONTROLVM_DEVICE_CREATE Failed: channel size is too small, channel size:0x%lx, required size:0x%lx",
			     (ulong) msg->cmd.createDevice.channelBytes,
			     (ulong) msg->cmd.create_device.channelBytes,
			     (ulong) minSize);
			POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
					 POSTCODE_SEVERITY_ERR);
@@ -396,19 +396,19 @@ create_device(CONTROLVM_MESSAGE *msg, char *buf)
		}
		dev->chanptr =
		    uislib_ioremap_cache(dev->channel_addr,
					 msg->cmd.createDevice.channelBytes);
					 msg->cmd.create_device.channelBytes);
		if (!dev->chanptr) {
			LOGERR("CONTROLVM_DEVICE_CREATE Failed: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed",
			     dev->channel_addr,
			     msg->cmd.createDevice.channelBytes);
			     msg->cmd.create_device.channelBytes);
			result = CONTROLVM_RESP_ERROR_IOREMAP_FAILED;
			POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
					 POSTCODE_SEVERITY_ERR);
			goto Away;
		}
	}
	dev->instance_uuid = msg->cmd.createDevice.devInstGuid;
	dev->channel_bytes = msg->cmd.createDevice.channelBytes;
	dev->instance_uuid = msg->cmd.create_device.devInstGuid;
	dev->channel_bytes = msg->cmd.create_device.channelBytes;

	read_lock(&BusListLock);
	for (bus = BusListHead; bus; bus = bus->next) {
@@ -552,8 +552,8 @@ pause_device(CONTROLVM_MESSAGE *msg)
	struct guest_msgs cmd;
	int retval = CONTROLVM_RESP_SUCCESS;

	busNo = msg->cmd.deviceChangeState.busNo;
	devNo = msg->cmd.deviceChangeState.devNo;
	busNo = msg->cmd.device_change_state.bus_no;
	devNo = msg->cmd.device_change_state.dev_no;

	read_lock(&BusListLock);
	for (bus = BusListHead; bus; bus = bus->next) {
@@ -620,8 +620,8 @@ resume_device(CONTROLVM_MESSAGE *msg)
	struct guest_msgs cmd;
	int retval = CONTROLVM_RESP_SUCCESS;

	busNo = msg->cmd.deviceChangeState.busNo;
	devNo = msg->cmd.deviceChangeState.devNo;
	busNo = msg->cmd.device_change_state.bus_no;
	devNo = msg->cmd.device_change_state.dev_no;

	read_lock(&BusListLock);
	for (bus = BusListHead; bus; bus = bus->next) {
@@ -689,8 +689,8 @@ destroy_device(CONTROLVM_MESSAGE *msg, char *buf)
	struct guest_msgs cmd;
	int retval = CONTROLVM_RESP_SUCCESS;

	busNo = msg->cmd.destroyDevice.busNo;
	devNo = msg->cmd.destroyDevice.devNo;
	busNo = msg->cmd.destroy_device.bus_no;
	devNo = msg->cmd.destroy_device.bus_no;

	read_lock(&BusListLock);
	LOGINF("destroy_device called for busNo=%u, devNo=%u", busNo, devNo);
@@ -773,8 +773,8 @@ init_chipset(CONTROLVM_MESSAGE *msg, char *buf)
{
	POSTCODE_LINUX_2(CHIPSET_INIT_ENTRY_PC, POSTCODE_SEVERITY_INFO);

	MaxBusCount = msg->cmd.initChipset.busCount;
	PlatformNumber = msg->cmd.initChipset.platformNumber;
	MaxBusCount = msg->cmd.init_chipset.bus_count;
	PlatformNumber = msg->cmd.init_chipset.platform_number;
	PhysicalDataChan = 0;

	/* We need to make sure we have our functions registered
@@ -799,7 +799,7 @@ delete_bus_glue(u32 busNo)
	CONTROLVM_MESSAGE msg;

	init_msg_header(&msg, CONTROLVM_BUS_DESTROY, 0, 0);
	msg.cmd.destroyBus.busNo = busNo;
	msg.cmd.destroy_bus.bus_no = busNo;
	if (destroy_bus(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		LOGERR("destroy_bus failed. busNo=0x%x\n", busNo);
		return 0;
@@ -813,8 +813,8 @@ delete_device_glue(u32 busNo, u32 devNo)
	CONTROLVM_MESSAGE msg;

	init_msg_header(&msg, CONTROLVM_DEVICE_DESTROY, 0, 0);
	msg.cmd.destroyDevice.busNo = busNo;
	msg.cmd.destroyDevice.devNo = devNo;
	msg.cmd.destroy_device.bus_no = busNo;
	msg.cmd.destroy_device.dev_no = devNo;
	if (destroy_device(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		LOGERR("destroy_device failed. busNo=0x%x devNo=0x%x\n", busNo,
		       devNo);
@@ -843,8 +843,8 @@ uislib_client_inject_add_bus(u32 bus_no, uuid_le inst_uuid,
		* after number 4, then the add_vnic will fail, and the
		* ultraboot will fail.
		*/
		msg.cmd.initChipset.busCount = 23;
		msg.cmd.initChipset.switchCount = 0;
		msg.cmd.init_chipset.bus_count = 23;
		msg.cmd.init_chipset.switch_count = 0;
		if (init_chipset(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
			LOGERR("init_chipset failed.\n");
			return 0;
@@ -858,10 +858,10 @@ uislib_client_inject_add_bus(u32 bus_no, uuid_le inst_uuid,
	POSTCODE_LINUX_3(BUS_CREATE_ENTRY_PC, bus_no,
			 POSTCODE_SEVERITY_WARNING);
	init_msg_header(&msg, CONTROLVM_BUS_CREATE, 0, 0);
	msg.cmd.createBus.busNo = bus_no;
	msg.cmd.createBus.deviceCount = 23;	/* devNo+1; */
	msg.cmd.createBus.channelAddr = channel_addr;
	msg.cmd.createBus.channelBytes = n_channel_bytes;
	msg.cmd.create_bus.bus_no = bus_no;
	msg.cmd.create_bus.dev_count = 23;	/* devNo+1; */
	msg.cmd.create_bus.channel_addr = channel_addr;
	msg.cmd.create_bus.channel_bytes = n_channel_bytes;
	if (create_bus(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		LOGERR("create_bus failed.\n");
		POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no,
@@ -889,9 +889,9 @@ uislib_client_inject_pause_vhba(u32 bus_no, u32 dev_no)
	int rc;

	init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
	msg.cmd.deviceChangeState.busNo = bus_no;
	msg.cmd.deviceChangeState.devNo = dev_no;
	msg.cmd.deviceChangeState.state = segment_state_standby;
	msg.cmd.device_change_state.bus_no = bus_no;
	msg.cmd.device_change_state.dev_no = dev_no;
	msg.cmd.device_change_state.state = segment_state_standby;
	rc = pause_device(&msg);
	if (rc != CONTROLVM_RESP_SUCCESS) {
		LOGERR("VHBA pause_device failed. busNo=0x%x devNo=0x%x\n",
@@ -909,9 +909,9 @@ uislib_client_inject_resume_vhba(u32 bus_no, u32 dev_no)
	int rc;

	init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
	msg.cmd.deviceChangeState.busNo = bus_no;
	msg.cmd.deviceChangeState.devNo = dev_no;
	msg.cmd.deviceChangeState.state = segment_state_running;
	msg.cmd.device_change_state.bus_no = bus_no;
	msg.cmd.device_change_state.dev_no = dev_no;
	msg.cmd.device_change_state.state = segment_state_running;
	rc = resume_device(&msg);
	if (rc != CONTROLVM_RESP_SUCCESS) {
		LOGERR("VHBA resume_device failed. busNo=0x%x devNo=0x%x\n",
@@ -945,15 +945,15 @@ uislib_client_inject_add_vhba(u32 bus_no, u32 dev_no,
		 * need to be ioremap()ed
		 */
		msg.hdr.Flags.testMessage = 1;
	msg.cmd.createDevice.busNo = bus_no;
	msg.cmd.createDevice.devNo = dev_no;
	msg.cmd.createDevice.devInstGuid = inst_uuid;
	msg.cmd.create_device.busNo = bus_no;
	msg.cmd.create_device.devNo = dev_no;
	msg.cmd.create_device.devInstGuid = inst_uuid;
	if (intr)
		msg.cmd.createDevice.intr = *intr;
		msg.cmd.create_device.intr = *intr;
	else
		memset(&msg.cmd.createDevice.intr, 0,
		memset(&msg.cmd.create_device.intr, 0,
		       sizeof(struct irq_info));
	msg.cmd.createDevice.channelAddr = phys_chan_addr;
	msg.cmd.create_device.channelAddr = phys_chan_addr;
	if (chan_bytes < MIN_IO_CHANNEL_SIZE) {
		LOGERR("wrong channel size.chan_bytes = 0x%x IO_CHANNEL_SIZE= 0x%x\n",
		     chan_bytes, (unsigned int) MIN_IO_CHANNEL_SIZE);
@@ -961,8 +961,8 @@ uislib_client_inject_add_vhba(u32 bus_no, u32 dev_no,
				 MIN_IO_CHANNEL_SIZE, POSTCODE_SEVERITY_ERR);
		return 0;
	}
	msg.cmd.createDevice.channelBytes = chan_bytes;
	msg.cmd.createDevice.dataTypeGuid = spar_vhba_channel_protocol_uuid;
	msg.cmd.create_device.channelBytes = chan_bytes;
	msg.cmd.create_device.dataTypeGuid = spar_vhba_channel_protocol_uuid;
	if (create_device(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		LOGERR("VHBA create_device failed.\n");
		POSTCODE_LINUX_4(VHBA_CREATE_FAILURE_PC, dev_no, bus_no,
@@ -1004,15 +1004,15 @@ uislib_client_inject_add_vnic(u32 bus_no, u32 dev_no,
		 * need to be ioremap()ed
		 */
		msg.hdr.Flags.testMessage = 1;
	msg.cmd.createDevice.busNo = bus_no;
	msg.cmd.createDevice.devNo = dev_no;
	msg.cmd.createDevice.devInstGuid = inst_uuid;
	msg.cmd.create_device.busNo = bus_no;
	msg.cmd.create_device.devNo = dev_no;
	msg.cmd.create_device.devInstGuid = inst_uuid;
	if (intr)
		msg.cmd.createDevice.intr = *intr;
		msg.cmd.create_device.intr = *intr;
	else
		memset(&msg.cmd.createDevice.intr, 0,
		memset(&msg.cmd.create_device.intr, 0,
		       sizeof(struct irq_info));
	msg.cmd.createDevice.channelAddr = phys_chan_addr;
	msg.cmd.create_device.channelAddr = phys_chan_addr;
	if (chan_bytes < MIN_IO_CHANNEL_SIZE) {
		LOGERR("wrong channel size.chan_bytes = 0x%x IO_CHANNEL_SIZE= 0x%x\n",
		     chan_bytes, (unsigned int) MIN_IO_CHANNEL_SIZE);
@@ -1020,8 +1020,8 @@ uislib_client_inject_add_vnic(u32 bus_no, u32 dev_no,
				 MIN_IO_CHANNEL_SIZE, POSTCODE_SEVERITY_ERR);
		return 0;
	}
	msg.cmd.createDevice.channelBytes = chan_bytes;
	msg.cmd.createDevice.dataTypeGuid = spar_vnic_channel_protocol_uuid;
	msg.cmd.create_device.channelBytes = chan_bytes;
	msg.cmd.create_device.dataTypeGuid = spar_vnic_channel_protocol_uuid;
	if (create_device(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		LOGERR("VNIC create_device failed.\n");
		POSTCODE_LINUX_4(VNIC_CREATE_FAILURE_PC, dev_no, bus_no,
@@ -1042,9 +1042,9 @@ uislib_client_inject_pause_vnic(u32 bus_no, u32 dev_no)
	int rc;

	init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
	msg.cmd.deviceChangeState.busNo = bus_no;
	msg.cmd.deviceChangeState.devNo = dev_no;
	msg.cmd.deviceChangeState.state = segment_state_standby;
	msg.cmd.device_change_state.bus_no = bus_no;
	msg.cmd.device_change_state.dev_no = dev_no;
	msg.cmd.device_change_state.state = segment_state_standby;
	rc = pause_device(&msg);
	if (rc != CONTROLVM_RESP_SUCCESS) {
		LOGERR("VNIC pause_device failed. busNo=0x%x devNo=0x%x\n",
@@ -1062,9 +1062,9 @@ uislib_client_inject_resume_vnic(u32 bus_no, u32 dev_no)
	int rc;

	init_msg_header(&msg, CONTROLVM_DEVICE_CHANGESTATE, 0, 0);
	msg.cmd.deviceChangeState.busNo = bus_no;
	msg.cmd.deviceChangeState.devNo = dev_no;
	msg.cmd.deviceChangeState.state = segment_state_running;
	msg.cmd.device_change_state.bus_no = bus_no;
	msg.cmd.device_change_state.dev_no = dev_no;
	msg.cmd.device_change_state.state = segment_state_running;
	rc = resume_device(&msg);
	if (rc != CONTROLVM_RESP_SUCCESS) {
		LOGERR("VNIC resume_device failed. busNo=0x%x devNo=0x%x\n",
@@ -1093,10 +1093,10 @@ uislib_client_add_vnic(u32 busNo)

	init_msg_header(&msg, CONTROLVM_BUS_CREATE, 0, 0);
	msg.hdr.Flags.testMessage = 1;
	msg.cmd.createBus.busNo = busNo;
	msg.cmd.createBus.deviceCount = 4;
	msg.cmd.createBus.channelAddr = 0;
	msg.cmd.createBus.channelBytes = 0;
	msg.cmd.create_bus.bus_no = busNo;
	msg.cmd.create_bus.dev_count = 4;
	msg.cmd.create_bus.channel_addr = 0;
	msg.cmd.create_bus.channel_bytes = 0;
	if (create_bus(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		LOGERR("client create_bus failed");
		return 0;
@@ -1105,13 +1105,13 @@ uislib_client_add_vnic(u32 busNo)

	init_msg_header(&msg, CONTROLVM_DEVICE_CREATE, 0, 0);
	msg.hdr.Flags.testMessage = 1;
	msg.cmd.createDevice.busNo = busNo;
	msg.cmd.createDevice.devNo = devNo;
	msg.cmd.createDevice.devInstGuid = NULL_UUID_LE;
	memset(&msg.cmd.createDevice.intr, 0, sizeof(struct irq_info));
	msg.cmd.createDevice.channelAddr = PhysicalDataChan;
	msg.cmd.createDevice.channelBytes = MIN_IO_CHANNEL_SIZE;
	msg.cmd.createDevice.dataTypeGuid = spar_vnic_channel_protocol_uuid;
	msg.cmd.create_device.busNo = busNo;
	msg.cmd.create_device.devNo = devNo;
	msg.cmd.create_device.devInstGuid = NULL_UUID_LE;
	memset(&msg.cmd.create_device.intr, 0, sizeof(struct irq_info));
	msg.cmd.create_device.channelAddr = PhysicalDataChan;
	msg.cmd.create_device.channelBytes = MIN_IO_CHANNEL_SIZE;
	msg.cmd.create_device.dataTypeGuid = spar_vnic_channel_protocol_uuid;
	if (create_device(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		LOGERR("client create_device failed");
		goto AwayCleanup;
@@ -1123,7 +1123,7 @@ uislib_client_add_vnic(u32 busNo)
	if (busCreated) {
		init_msg_header(&msg, CONTROLVM_BUS_DESTROY, 0, 0);
		msg.hdr.Flags.testMessage = 1;
		msg.cmd.destroyBus.busNo = busNo;
		msg.cmd.destroy_bus.bus_no = busNo;
		if (destroy_bus(&msg, NULL) != CONTROLVM_RESP_SUCCESS)
			LOGERR("client destroy_bus failed.\n");
	}
@@ -1141,8 +1141,8 @@ uislib_client_delete_vnic(u32 busNo)

	init_msg_header(&msg, CONTROLVM_DEVICE_DESTROY, 0, 0);
	msg.hdr.Flags.testMessage = 1;
	msg.cmd.destroyDevice.busNo = busNo;
	msg.cmd.destroyDevice.devNo = devNo;
	msg.cmd.destroy_device.bus_no = busNo;
	msg.cmd.destroy_device.dev_no = devNo;
	if (destroy_device(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
		/* Don't error exit - try to see if bus can be destroyed... */
		LOGERR("client destroy_device failed.\n");
@@ -1150,7 +1150,7 @@ uislib_client_delete_vnic(u32 busNo)

	init_msg_header(&msg, CONTROLVM_BUS_DESTROY, 0, 0);
	msg.hdr.Flags.testMessage = 1;
	msg.cmd.destroyBus.busNo = busNo;
	msg.cmd.destroy_bus.bus_no = busNo;
	if (destroy_bus(&msg, NULL) != CONTROLVM_RESP_SUCCESS)
		LOGERR("client destroy_bus failed.\n");

+77 −77

File changed.

Preview size limit exceeded, changes collapsed.