/* if non-zero, there is a payload to copy. */
};
-typedef struct _CONTROLVM_PACKET_DEVICE_CREATE {
- u32 busNo; /**< 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 */
- u64 channelAddr; /**< Guest physical address of the channel, which
- * can be dereferenced by the receiver
- * of this ControlVm command */
- u64 channelBytes; /**< specifies size of the channel in bytes */
- uuid_le dataTypeGuid;/**< specifies format of data in channel */
- uuid_le devInstGuid; /**< instance guid for the device */
- struct irq_info intr; /**< specifies interrupt information */
-} CONTROLVM_PACKET_DEVICE_CREATE; /* for CONTROLVM_DEVICE_CREATE */
+struct controlvm_packet_device_create {
+ u32 bus_no; /* bus # (0..n-1) from the msg receiver's end */
+ u32 dev_no; /* bus-relative (0..n-1) device number */
+ u64 channel_addr; /* Guest physical address of the channel, which
+ * can be dereferenced by the receiver of this
+ * ControlVm command */
+ u64 channel_bytes; /* specifies size of the channel in bytes */
+ uuid_le data_type_uuid; /* specifies format of data in channel */
+ uuid_le dev_inst_uuid; /* instance guid for the device */
+ struct irq_info intr; /* specifies interrupt information */
+}; /* for CONTROLVM_DEVICE_CREATE */
typedef struct _CONTROLVM_PACKET_DEVICE_CONFIGURE {
u32 busNo; /**< bus # (0..n-1) from the msg
typedef struct _CONTROLVM_MESSAGE_DEVICE_CREATE {
struct controlvm_message_header Header;
- CONTROLVM_PACKET_DEVICE_CREATE Packet;
+ struct controlvm_packet_device_create Packet;
} CONTROLVM_MESSAGE_DEVICE_CREATE; /* total 128 bytes */
typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE {
* sendBusInterruptHandle is kept in CP. */
} configure_bus; /* for CONTROLVM_BUS_CONFIGURE */
/* for CONTROLVM_DEVICE_CREATE */
- CONTROLVM_PACKET_DEVICE_CREATE create_device;
+ struct controlvm_packet_device_create create_device;
struct {
u32 bus_no; /* bus # (0..n-1) from the msg
* receiver's perspective */
u64 minSize = MIN_IO_CHANNEL_SIZE;
struct req_handler_info *pReqHandler;
- busNo = msg->cmd.create_device.busNo;
- devNo = msg->cmd.create_device.devNo;
+ busNo = msg->cmd.create_device.bus_no;
+ devNo = msg->cmd.create_device.dev_no;
POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo,
POSTCODE_SEVERITY_INFO);
return CONTROLVM_RESP_ERROR_KMALLOC_FAILED;
}
- dev->channel_uuid = msg->cmd.create_device.dataTypeGuid;
+ dev->channel_uuid = msg->cmd.create_device.data_type_uuid;
dev->intr = msg->cmd.create_device.intr;
- dev->channel_addr = msg->cmd.create_device.channelAddr;
+ dev->channel_addr = msg->cmd.create_device.channel_addr;
dev->bus_no = busNo;
dev->dev_no = devNo;
sema_init(&dev->interrupt_callback_lock, 1); /* unlocked */
* channel
*/
minSize = pReqHandler->min_channel_bytes;
- if (minSize > msg->cmd.create_device.channelBytes) {
+ if (minSize > msg->cmd.create_device.channel_bytes) {
LOGERR("CONTROLVM_DEVICE_CREATE Failed: channel size is too small, channel size:0x%lx, required size:0x%lx",
- (ulong) msg->cmd.create_device.channelBytes,
+ (ulong) msg->cmd.create_device.channel_bytes,
(ulong) minSize);
POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo,
POSTCODE_SEVERITY_ERR);
}
dev->chanptr =
uislib_ioremap_cache(dev->channel_addr,
- msg->cmd.create_device.channelBytes);
+ msg->cmd.create_device.channel_bytes);
if (!dev->chanptr) {
LOGERR("CONTROLVM_DEVICE_CREATE Failed: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed",
dev->channel_addr,
- msg->cmd.create_device.channelBytes);
+ msg->cmd.create_device.channel_bytes);
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.create_device.devInstGuid;
- dev->channel_bytes = msg->cmd.create_device.channelBytes;
+ dev->instance_uuid = msg->cmd.create_device.dev_inst_uuid;
+ dev->channel_bytes = msg->cmd.create_device.channel_bytes;
read_lock(&BusListLock);
for (bus = BusListHead; bus; bus = bus->next) {
* need to be ioremap()ed
*/
msg.hdr.flags.test_message = 1;
- msg.cmd.create_device.busNo = bus_no;
- msg.cmd.create_device.devNo = dev_no;
- msg.cmd.create_device.devInstGuid = inst_uuid;
+ msg.cmd.create_device.bus_no = bus_no;
+ msg.cmd.create_device.dev_no = dev_no;
+ msg.cmd.create_device.dev_inst_uuid = inst_uuid;
if (intr)
msg.cmd.create_device.intr = *intr;
else
memset(&msg.cmd.create_device.intr, 0,
sizeof(struct irq_info));
- msg.cmd.create_device.channelAddr = phys_chan_addr;
+ msg.cmd.create_device.channel_addr = 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);
MIN_IO_CHANNEL_SIZE, POSTCODE_SEVERITY_ERR);
return 0;
}
- msg.cmd.create_device.channelBytes = chan_bytes;
- msg.cmd.create_device.dataTypeGuid = spar_vhba_channel_protocol_uuid;
+ msg.cmd.create_device.channel_bytes = chan_bytes;
+ msg.cmd.create_device.data_type_uuid = 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,
* need to be ioremap()ed
*/
msg.hdr.flags.test_message = 1;
- msg.cmd.create_device.busNo = bus_no;
- msg.cmd.create_device.devNo = dev_no;
- msg.cmd.create_device.devInstGuid = inst_uuid;
+ msg.cmd.create_device.bus_no = bus_no;
+ msg.cmd.create_device.dev_no = dev_no;
+ msg.cmd.create_device.dev_inst_uuid = inst_uuid;
if (intr)
msg.cmd.create_device.intr = *intr;
else
memset(&msg.cmd.create_device.intr, 0,
sizeof(struct irq_info));
- msg.cmd.create_device.channelAddr = phys_chan_addr;
+ msg.cmd.create_device.channel_addr = 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);
MIN_IO_CHANNEL_SIZE, POSTCODE_SEVERITY_ERR);
return 0;
}
- msg.cmd.create_device.channelBytes = chan_bytes;
- msg.cmd.create_device.dataTypeGuid = spar_vnic_channel_protocol_uuid;
+ msg.cmd.create_device.channel_bytes = chan_bytes;
+ msg.cmd.create_device.data_type_uuid = 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,
init_msg_header(&msg, CONTROLVM_DEVICE_CREATE, 0, 0);
msg.hdr.flags.test_message = 1;
- msg.cmd.create_device.busNo = busNo;
- msg.cmd.create_device.devNo = devNo;
- msg.cmd.create_device.devInstGuid = NULL_UUID_LE;
+ msg.cmd.create_device.bus_no = busNo;
+ msg.cmd.create_device.dev_no = devNo;
+ msg.cmd.create_device.dev_inst_uuid = 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;
+ msg.cmd.create_device.channel_addr = PhysicalDataChan;
+ msg.cmd.create_device.channel_bytes = MIN_IO_CHANNEL_SIZE;
+ msg.cmd.create_device.data_type_uuid = spar_vnic_channel_protocol_uuid;
if (create_device(&msg, NULL) != CONTROLVM_RESP_SUCCESS) {
LOGERR("client create_device failed");
goto AwayCleanup;
my_device_create(CONTROLVM_MESSAGE *inmsg)
{
struct controlvm_message_packet *cmd = &inmsg->cmd;
- ulong busNo = cmd->create_device.busNo;
- ulong devNo = cmd->create_device.devNo;
+ ulong busNo = cmd->create_device.bus_no;
+ ulong devNo = cmd->create_device.dev_no;
VISORCHIPSET_DEVICE_INFO *pDevInfo = NULL;
VISORCHIPSET_BUS_INFO *pBusInfo = NULL;
int rc = CONTROLVM_RESP_SUCCESS;
INIT_LIST_HEAD(&pDevInfo->entry);
pDevInfo->busNo = busNo;
pDevInfo->devNo = devNo;
- pDevInfo->devInstGuid = cmd->create_device.devInstGuid;
+ pDevInfo->devInstGuid = cmd->create_device.dev_inst_uuid;
POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo,
POSTCODE_SEVERITY_INFO);
pDevInfo->chanInfo.addrType = ADDRTYPE_localTest;
else
pDevInfo->chanInfo.addrType = ADDRTYPE_localPhysical;
- pDevInfo->chanInfo.channelAddr = cmd->create_device.channelAddr;
- pDevInfo->chanInfo.nChannelBytes = cmd->create_device.channelBytes;
- pDevInfo->chanInfo.channelTypeGuid = cmd->create_device.dataTypeGuid;
+ pDevInfo->chanInfo.channelAddr = cmd->create_device.channel_addr;
+ pDevInfo->chanInfo.nChannelBytes = cmd->create_device.channel_bytes;
+ pDevInfo->chanInfo.channelTypeGuid = cmd->create_device.data_type_uuid;
pDevInfo->chanInfo.intr = cmd->create_device.intr;
list_add(&pDevInfo->entry, &DevInfoList);
POSTCODE_LINUX_4(DEVICE_CREATE_EXIT_PC, devNo, busNo,
break;
case CONTROLVM_DEVICE_CREATE:
LOGINF("DEVICE_CREATE(%lu,%lu)",
- (ulong) cmd->create_device.busNo,
- (ulong) cmd->create_device.devNo);
+ (ulong) cmd->create_device.bus_no,
+ (ulong) cmd->create_device.dev_no);
my_device_create(&inmsg);
break;
case CONTROLVM_DEVICE_CHANGESTATE:
}
/* reuse create device message for storage device */
- if (localCrashCreateDevMsg.cmd.create_device.channelAddr != 0)
+ if (localCrashCreateDevMsg.cmd.create_device.channel_addr != 0)
my_device_create(&localCrashCreateDevMsg);
else {
LOGERR("CrashCreateDevMsg is null, no dump will be taken");