staging: fsl-mc: convert mc command build/parse to use C structs
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Wed, 22 Jun 2016 21:40:52 +0000 (16:40 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2016 00:14:03 +0000 (17:14 -0700)
commit9989b59961a8ad55d92df4588b556f0c6c838ec7
treea12fadd0caa275487bd87fcde3b8786fc01c3f48
parentadf72b5ba372ca9006f8cdcf9c0b902579f7da9f
staging: fsl-mc: convert mc command build/parse to use C structs

The layer abstracting the building of commands and extracting
responses is currently based on macros that shift and mask the command
fields and requires exposing offset/size values as macro parameters
and makes the code harder to read.

For clarity and maintainability, instead use an implementation based on
mapping the MC command definitions to C structures. These structures
contain the hardware command fields (which are naturally-aligned)
and individual fields are little-endian ordering (the byte ordering
of the hardware).

As such, there is no need to perform the conversion between core and
hardware (LE) endianness in mc_send_command(), but instead each
individual field in a command will be converted separately if needed
by the function building the command or extracting the response.

This patch does not introduce functional changes, both the hardware
ABIs and the APIs exposed for the DPAA2 objects remain the same.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-mc/bus/dpbp.c
drivers/staging/fsl-mc/bus/dpmcp-cmd.h
drivers/staging/fsl-mc/bus/dpmcp.c
drivers/staging/fsl-mc/bus/dpmng-cmd.h
drivers/staging/fsl-mc/bus/dpmng.c
drivers/staging/fsl-mc/bus/dprc-cmd.h
drivers/staging/fsl-mc/bus/dprc.c
drivers/staging/fsl-mc/bus/mc-sys.c
drivers/staging/fsl-mc/include/dpbp-cmd.h
drivers/staging/fsl-mc/include/mc-cmd.h