Commit 1cb3b9de authored by Benjamin Romer's avatar Benjamin Romer Committed by Greg Kroah-Hartman

staging: unisys: refactor ULTRA_VBUS_HEADERINFO

Remove the typedef and rename to struct spar_vbus_headerinfo. Fix CamelCase
member names:

structBytes => struct_bytes
deviceInfoStructBytes => device_info_struct_bytes
devInfoCount => dev_info_count
chpInfoByteOffset => chp_info_offset
busInfoByteOffset => bus_info_offset
devInfoByteOffset => dev_info_offset

Update all references to changed names.
Signed-off-by: default avatarBenjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9b8a8a96
...@@ -58,23 +58,23 @@ static const uuid_le spar_vbus_channel_protocol_uuid = ...@@ -58,23 +58,23 @@ static const uuid_le spar_vbus_channel_protocol_uuid =
actual_bytes)) actual_bytes))
#pragma pack(push, 1) /* both GCC and VC now allow this pragma */ #pragma pack(push, 1) /* both GCC and VC now allow this pragma */
typedef struct _ULTRA_VBUS_HEADERINFO { struct spar_vbus_headerinfo {
u32 structBytes; /* size of this struct in bytes */ u32 struct_bytes; /* size of this struct in bytes */
u32 deviceInfoStructBytes; /* sizeof(ULTRA_VBUS_DEVICEINFO) */ u32 device_info_struct_bytes; /* sizeof(ULTRA_VBUS_DEVICEINFO) */
u32 devInfoCount; /* num of items in DevInfo member */ u32 dev_info_count; /* num of items in DevInfo member */
/* (this is the allocated size) */ /* (this is the allocated size) */
u32 chpInfoByteOffset; /* byte offset from beginning of this struct */ u32 chp_info_offset; /* byte offset from beginning of this struct */
/* to the ChpInfo struct (below) */ /* to the ChpInfo struct (below) */
u32 busInfoByteOffset; /* byte offset from beginning of this struct */ u32 bus_info_offset; /* byte offset from beginning of this struct */
/* to the BusInfo struct (below) */ /* to the BusInfo struct (below) */
u32 devInfoByteOffset; /* byte offset from beginning of this struct */ u32 dev_info_offset; /* byte offset from beginning of this struct */
/* to the DevInfo array (below) */ /* to the DevInfo array (below) */
u8 reserved[104]; u8 reserved[104];
} ULTRA_VBUS_HEADERINFO; };
struct ultra_vbus_channel_protocol { struct ultra_vbus_channel_protocol {
struct channel_header ChannelHeader; /* initialized by server */ struct channel_header ChannelHeader; /* initialized by server */
ULTRA_VBUS_HEADERINFO HdrInfo; /* initialized by server */ struct spar_vbus_headerinfo HdrInfo; /* initialized by server */
/* the remainder of this channel is filled in by the client */ /* the remainder of this channel is filled in by the client */
struct ultra_vbus_deviceinfo ChpInfo; struct ultra_vbus_deviceinfo ChpInfo;
/* describes client chipset device and driver */ /* describes client chipset device and driver */
......
...@@ -195,9 +195,9 @@ static int write_vbus_chpInfo(struct ultra_vbus_channel_protocol *chan, ...@@ -195,9 +195,9 @@ static int write_vbus_chpInfo(struct ultra_vbus_channel_protocol *chan,
LOGERR("vbus channel not present"); LOGERR("vbus channel not present");
return -1; return -1;
} }
off = sizeof(struct channel_header) + chan->HdrInfo.chpInfoByteOffset; off = sizeof(struct channel_header) + chan->HdrInfo.chp_info_offset;
if (chan->HdrInfo.chpInfoByteOffset == 0) { if (chan->HdrInfo.chp_info_offset == 0) {
LOGERR("vbus channel not used, because chpInfoByteOffset == 0"); LOGERR("vbus channel not used, because chp_info_offset == 0");
return -1; return -1;
} }
memcpy(((u8 *) (chan)) + off, info, sizeof(*info)); memcpy(((u8 *) (chan)) + off, info, sizeof(*info));
...@@ -214,9 +214,9 @@ static int write_vbus_busInfo(struct ultra_vbus_channel_protocol *chan, ...@@ -214,9 +214,9 @@ static int write_vbus_busInfo(struct ultra_vbus_channel_protocol *chan,
LOGERR("vbus channel not present"); LOGERR("vbus channel not present");
return -1; return -1;
} }
off = sizeof(struct channel_header) + chan->HdrInfo.busInfoByteOffset; off = sizeof(struct channel_header) + chan->HdrInfo.bus_info_offset;
if (chan->HdrInfo.busInfoByteOffset == 0) { if (chan->HdrInfo.bus_info_offset == 0) {
LOGERR("vbus channel not used, because busInfoByteOffset == 0"); LOGERR("vbus channel not used, because bus_info_offset == 0");
return -1; return -1;
} }
memcpy(((u8 *) (chan)) + off, info, sizeof(*info)); memcpy(((u8 *) (chan)) + off, info, sizeof(*info));
...@@ -238,10 +238,10 @@ write_vbus_devInfo(struct ultra_vbus_channel_protocol *chan, ...@@ -238,10 +238,10 @@ write_vbus_devInfo(struct ultra_vbus_channel_protocol *chan,
} }
off = off =
(sizeof(struct channel_header) + (sizeof(struct channel_header) +
chan->HdrInfo.devInfoByteOffset) + chan->HdrInfo.dev_info_offset) +
(chan->HdrInfo.deviceInfoStructBytes * devix); (chan->HdrInfo.device_info_struct_bytes * devix);
if (chan->HdrInfo.devInfoByteOffset == 0) { if (chan->HdrInfo.dev_info_offset == 0) {
LOGERR("vbus channel not used, because devInfoByteOffset == 0"); LOGERR("vbus channel not used, because dev_info_offset == 0");
return -1; return -1;
} }
memcpy(((u8 *) (chan)) + off, info, sizeof(*info)); memcpy(((u8 *) (chan)) + off, info, sizeof(*info));
......
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