diff options
Diffstat (limited to 'drivers/staging/unisys/visorchipset/parser.c')
-rw-r--r-- | drivers/staging/unisys/visorchipset/parser.c | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/drivers/staging/unisys/visorchipset/parser.c b/drivers/staging/unisys/visorchipset/parser.c index 661aaae9b154..9edbd3bbd186 100644 --- a/drivers/staging/unisys/visorchipset/parser.c +++ b/drivers/staging/unisys/visorchipset/parser.c @@ -47,8 +47,8 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal, int allocbytes = sizeof(PARSER_CONTEXT) + bytes; PARSER_CONTEXT *rc = NULL; PARSER_CONTEXT *ctx = NULL; - MEMREGION *rgn = NULL; - ULTRA_CONTROLVM_PARAMETERS_HEADER *phdr = NULL; + struct memregion *rgn = NULL; + struct spar_controlvm_parameters_header *phdr = NULL; if (tryAgain) *tryAgain = FALSE; @@ -110,27 +110,29 @@ parser_init_guts(u64 addr, u32 bytes, BOOL isLocal, rc = ctx; goto Away; } - phdr = (ULTRA_CONTROLVM_PARAMETERS_HEADER *) (ctx->data); - if (phdr->TotalLength != bytes) { + phdr = (struct spar_controlvm_parameters_header *)(ctx->data); + if (phdr->total_length != bytes) { ERRDRV("%s - bad total length %lu (should be %lu)", __func__, - (ulong) (phdr->TotalLength), (ulong) (bytes)); + (ulong) (phdr->total_length), (ulong) (bytes)); rc = NULL; goto Away; } - if (phdr->TotalLength < phdr->HeaderLength) { + if (phdr->total_length < phdr->header_length) { ERRDRV("%s - total length < header length (%lu < %lu)", __func__, - (ulong) (phdr->TotalLength), - (ulong) (phdr->HeaderLength)); + (ulong) (phdr->total_length), + (ulong) (phdr->header_length)); rc = NULL; goto Away; } - if (phdr->HeaderLength < sizeof(ULTRA_CONTROLVM_PARAMETERS_HEADER)) { + if (phdr->header_length < + sizeof(struct spar_controlvm_parameters_header)) { ERRDRV("%s - header is too small (%lu < %lu)", __func__, - (ulong) (phdr->HeaderLength), - (ulong) (sizeof(ULTRA_CONTROLVM_PARAMETERS_HEADER))); + (ulong) (phdr->header_length), + (ulong)(sizeof( + struct spar_controlvm_parameters_header))); rc = NULL; goto Away; } @@ -159,7 +161,7 @@ parser_init(u64 addr, u32 bytes, BOOL isLocal, BOOL *tryAgain) } /* Call this instead of parser_init() if the payload area consists of just - * a sequence of bytes, rather than a ULTRA_CONTROLVM_PARAMETERS_HEADER + * a sequence of bytes, rather than a struct spar_controlvm_parameters_header * structures. Afterwards, you can call parser_simpleString_get() or * parser_byteStream_get() to obtain the data. */ @@ -196,44 +198,44 @@ parser_byteStream_get(PARSER_CONTEXT *ctx, ulong *nbytes) uuid_le parser_id_get(PARSER_CONTEXT *ctx) { - ULTRA_CONTROLVM_PARAMETERS_HEADER *phdr = NULL; + struct spar_controlvm_parameters_header *phdr = NULL; if (ctx == NULL) { ERRDRV("%s (%s:%d) - no context", __func__, __FILE__, __LINE__); return NULL_UUID_LE; } - phdr = (ULTRA_CONTROLVM_PARAMETERS_HEADER *) (ctx->data); - return phdr->Id; + phdr = (struct spar_controlvm_parameters_header *)(ctx->data); + return phdr->id; } void parser_param_start(PARSER_CONTEXT *ctx, PARSER_WHICH_STRING which_string) { - ULTRA_CONTROLVM_PARAMETERS_HEADER *phdr = NULL; + struct spar_controlvm_parameters_header *phdr = NULL; if (ctx == NULL) { ERRDRV("%s (%s:%d) - no context", __func__, __FILE__, __LINE__); goto Away; } - phdr = (ULTRA_CONTROLVM_PARAMETERS_HEADER *) (ctx->data); + phdr = (struct spar_controlvm_parameters_header *)(ctx->data); switch (which_string) { case PARSERSTRING_INITIATOR: - ctx->curr = ctx->data + phdr->InitiatorOffset; - ctx->bytes_remaining = phdr->InitiatorLength; + ctx->curr = ctx->data + phdr->initiator_offset; + ctx->bytes_remaining = phdr->initiator_length; break; case PARSERSTRING_TARGET: - ctx->curr = ctx->data + phdr->TargetOffset; - ctx->bytes_remaining = phdr->TargetLength; + ctx->curr = ctx->data + phdr->target_offset; + ctx->bytes_remaining = phdr->target_length; break; case PARSERSTRING_CONNECTION: - ctx->curr = ctx->data + phdr->ConnectionOffset; - ctx->bytes_remaining = phdr->ConnectionLength; + ctx->curr = ctx->data + phdr->connection_offset; + ctx->bytes_remaining = phdr->connection_length; break; case PARSERSTRING_NAME: - ctx->curr = ctx->data + phdr->NameOffset; - ctx->bytes_remaining = phdr->NameLength; + ctx->curr = ctx->data + phdr->name_offset; + ctx->bytes_remaining = phdr->name_length; break; default: ERRDRV("%s - bad which_string %d", __func__, which_string); |