From 3f833b54f1bea153bbbeaf485d11789f42f6e9a3 Mon Sep 17 00:00:00 2001 From: Benjamin Romer Date: Thu, 23 Oct 2014 14:30:12 -0400 Subject: [PATCH] staging: unisys: refactor ultra_segment_state Rename the struct to spar_segment_state and fix CamelCase names: Enabled => enabled Active => active Alive => alive Revoked => revoked Allocated => allocated Known => known Ready => ready Operating => operating Fix all references to modified names to use the new names. Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- .../include/channels/controlframework.h | 27 +++++++------- .../include/channels/controlvmchannel.h | 6 ++-- .../unisys/visorchipset/visorchipset_main.c | 42 +++++++++++----------- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/drivers/staging/unisys/common-spar/include/channels/controlframework.h b/drivers/staging/unisys/common-spar/include/channels/controlframework.h index e718557..9f01f40 100644 --- a/drivers/staging/unisys/common-spar/include/channels/controlframework.h +++ b/drivers/staging/unisys/common-spar/include/channels/controlframework.h @@ -36,31 +36,34 @@ /* Define Ki scale page to be traditional 4KB page */ #define ULTRA_MEMORY_PAGE_Ki (ULTRA_MEMORY_PAGE_WORD * ULTRA_MEMORY_COUNT_Ki) -struct ultra_segment_state { - u16 Enabled:1; /* Bit 0: May enter other states */ - u16 Active:1; /* Bit 1: Assigned to active partition */ - u16 Alive:1; /* Bit 2: Configure message sent to +struct spar_segment_state { + u16 enabled:1; /* Bit 0: May enter other states */ + u16 active:1; /* Bit 1: Assigned to active partition */ + u16 alive:1; /* Bit 2: Configure message sent to * service/server */ - u16 Revoked:1; /* Bit 3: similar to partition state + u16 revoked:1; /* Bit 3: similar to partition state * ShuttingDown */ - u16 Allocated:1; /* Bit 4: memory (device/port number) + u16 allocated:1; /* Bit 4: memory (device/port number) * has been selected by Command */ - u16 Known:1; /* Bit 5: has been introduced to the + u16 known:1; /* Bit 5: has been introduced to the * service/guest partition */ - u16 Ready:1; /* Bit 6: service/Guest partition has + u16 ready:1; /* Bit 6: service/Guest partition has * responded to introduction */ - u16 Operating:1; /* Bit 7: resource is configured and + u16 operating:1; /* Bit 7: resource is configured and * operating */ /* Note: don't use high bit unless we need to switch to ushort * which is non-compliant */ }; -static const struct ultra_segment_state SegmentStateRunning = { + +static const struct spar_segment_state SegmentStateRunning = { 1, 1, 1, 0, 1, 1, 1, 1 }; -static const struct ultra_segment_state SegmentStatePaused = { + +static const struct spar_segment_state SegmentStatePaused = { 1, 1, 1, 0, 1, 1, 1, 0 }; -static const struct ultra_segment_state SegmentStateStandby = { + +static const struct spar_segment_state SegmentStateStandby = { 1, 1, 0, 0, 1, 1, 1, 0 }; diff --git a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h index ce601ae..e638f8a 100644 --- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h +++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h @@ -389,13 +389,13 @@ typedef struct _CONTROLVM_MESSAGE_PACKET { } reconfigureDevice; /* for CONTROLVM_DEVICE_RECONFIGURE */ struct { u32 busNo; - struct ultra_segment_state state; + struct spar_segment_state state; u8 reserved[2]; /* Natural alignment purposes */ } busChangeState; /* for CONTROLVM_BUS_CHANGESTATE */ struct { u32 busNo; u32 devNo; - struct ultra_segment_state state; + struct spar_segment_state state; struct { u32 physicalDevice:1; /* =1 if message is for * a physical device */ @@ -406,7 +406,7 @@ typedef struct _CONTROLVM_MESSAGE_PACKET { struct { u32 busNo; u32 devNo; - struct ultra_segment_state state; + struct spar_segment_state state; u8 reserved[6]; /* Natural alignment purposes */ } deviceChangeStateEvent; /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */ struct { diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c index c94d655..4f27392 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c @@ -348,9 +348,8 @@ static void controlvm_respond(CONTROLVM_MESSAGE_HEADER *msgHdr, int response); static void controlvm_respond_chipset_init(CONTROLVM_MESSAGE_HEADER *msgHdr, int response, ULTRA_CHIPSET_FEATURE features); -static void controlvm_respond_physdev_changestate( - CONTROLVM_MESSAGE_HEADER *msgHdr, int response, - struct ultra_segment_state state); +static void controlvm_respond_physdev_changestate(CONTROLVM_MESSAGE_HEADER * + msgHdr, int response, struct spar_segment_state state); static ssize_t toolaction_show(struct device *dev, struct device_attribute *attr, @@ -743,8 +742,7 @@ controlvm_respond_chipset_init(CONTROLVM_MESSAGE_HEADER *msgHdr, int response, static void controlvm_respond_physdev_changestate(CONTROLVM_MESSAGE_HEADER *msgHdr, - int response, struct ultra_segment_state - state) + int response, struct spar_segment_state state) { CONTROLVM_MESSAGE outmsg; @@ -860,7 +858,7 @@ bus_responder(enum control_vm_id cmdId, ulong busNo, int response) static void device_changestate_responder(enum control_vm_id cmdId, ulong busNo, ulong devNo, int response, - struct ultra_segment_state responseState) + struct spar_segment_state responseState) { VISORCHIPSET_DEVICE_INFO *p = NULL; CONTROLVM_MESSAGE outmsg; @@ -994,7 +992,7 @@ bus_epilog(u32 busNo, } static void -device_epilog(u32 busNo, u32 devNo, struct ultra_segment_state state, u32 cmd, +device_epilog(u32 busNo, u32 devNo, struct spar_segment_state state, u32 cmd, CONTROLVM_MESSAGE_HEADER *msgHdr, int response, BOOL needResponse, BOOL for_visorbus) { @@ -1033,8 +1031,8 @@ device_epilog(u32 busNo, u32 devNo, struct ultra_segment_state state, u32 cmd, break; case CONTROLVM_DEVICE_CHANGESTATE: /* ServerReady / ServerRunning / SegmentStateRunning */ - if (state.Alive == SegmentStateRunning.Alive && - state.Operating == SegmentStateRunning.Operating) { + if (state.alive == SegmentStateRunning.alive && + state.operating == SegmentStateRunning.operating) { if (notifiers->device_resume) { (*notifiers->device_resume) (busNo, devNo); @@ -1042,9 +1040,9 @@ device_epilog(u32 busNo, u32 devNo, struct ultra_segment_state state, u32 cmd, } } /* ServerNotReady / ServerLost / SegmentStateStandby */ - else if (state.Alive == SegmentStateStandby.Alive && - state.Operating == - SegmentStateStandby.Operating) { + else if (state.alive == SegmentStateStandby.alive && + state.operating == + SegmentStateStandby.operating) { /* technically this is standby case * where server is lost */ @@ -1053,9 +1051,9 @@ device_epilog(u32 busNo, u32 devNo, struct ultra_segment_state state, u32 cmd, devNo); notified = TRUE; } - } else if (state.Alive == SegmentStatePaused.Alive && - state.Operating == - SegmentStatePaused.Operating) { + } else if (state.alive == SegmentStatePaused.alive && + state.operating == + SegmentStatePaused.operating) { /* this is lite pause where channel is * still valid just 'pause' of it */ @@ -1306,7 +1304,7 @@ my_device_changestate(CONTROLVM_MESSAGE *inmsg) CONTROLVM_MESSAGE_PACKET *cmd = &inmsg->cmd; ulong busNo = cmd->deviceChangeState.busNo; ulong devNo = cmd->deviceChangeState.devNo; - struct ultra_segment_state state = cmd->deviceChangeState.state; + struct spar_segment_state state = cmd->deviceChangeState.state; VISORCHIPSET_DEVICE_INFO *pDevInfo = NULL; int rc = CONTROLVM_RESP_SUCCESS; @@ -1631,7 +1629,7 @@ parahotplug_request_kickoff(struct parahotplug_request *req) sprintf(env_cmd, "SPAR_PARAHOTPLUG=1"); sprintf(env_id, "SPAR_PARAHOTPLUG_ID=%d", req->id); sprintf(env_state, "SPAR_PARAHOTPLUG_STATE=%d", - cmd->deviceChangeState.state.Active); + cmd->deviceChangeState.state.active); sprintf(env_bus, "SPAR_PARAHOTPLUG_BUS=%d", cmd->deviceChangeState.busNo); sprintf(env_dev, "SPAR_PARAHOTPLUG_DEVICE=%d", @@ -1640,7 +1638,7 @@ parahotplug_request_kickoff(struct parahotplug_request *req) cmd->deviceChangeState.devNo & 0x7); LOGINF("parahotplug_request_kickoff: state=%d, bdf=%d/%d/%d, id=%u\n", - cmd->deviceChangeState.state.Active, + cmd->deviceChangeState.state.active, cmd->deviceChangeState.busNo, cmd->deviceChangeState.devNo >> 3, cmd->deviceChangeState.devNo & 7, req->id); @@ -1700,7 +1698,7 @@ parahotplug_request_complete(int id, u16 active) */ list_del(pos); spin_unlock(&Parahotplug_request_list_lock); - req->msg.cmd.deviceChangeState.state.Active = active; + req->msg.cmd.deviceChangeState.state.active = active; if (req->msg.hdr.Flags.responseExpected) controlvm_respond_physdev_changestate( &req->msg.hdr, CONTROLVM_RESP_SUCCESS, @@ -1729,7 +1727,7 @@ parahotplug_process_message(CONTROLVM_MESSAGE *inmsg) return; } - if (inmsg->cmd.deviceChangeState.state.Active) { + if (inmsg->cmd.deviceChangeState.state.active) { /* For enable messages, just respond with success * right away. This is a bit of a hack, but there are * issues with the early enable messages we get (with @@ -1853,13 +1851,13 @@ handle_command(CONTROLVM_MESSAGE inmsg, HOSTADDRESS channel_addr) LOGINF("DEVICE_CHANGESTATE for physical device (%lu,%lu, active=%lu)", (ulong) cmd->deviceChangeState.busNo, (ulong) cmd->deviceChangeState.devNo, - (ulong) cmd->deviceChangeState.state.Active); + (ulong) cmd->deviceChangeState.state.active); parahotplug_process_message(&inmsg); } else { LOGINF("DEVICE_CHANGESTATE for virtual device (%lu,%lu, state.Alive=0x%lx)", (ulong) cmd->deviceChangeState.busNo, (ulong) cmd->deviceChangeState.devNo, - (ulong) cmd->deviceChangeState.state.Alive); + (ulong) cmd->deviceChangeState.state.alive); /* save the hdr and cmd structures for later use */ /* when sending back the response to Command */ my_device_changestate(&inmsg); -- 2.7.4