Commit db7d12b3 authored by Lucas Russo's avatar Lucas Russo

sm_io/protocols/*: remove flags parameter as higher-level objects will do this

The idea here is to have SPI/I2C-obj objects
to customize the objects dynamically, instead
of having a "flags" parameter that needs knowledge
of the inner protocol.
parent 34683de3
......@@ -24,21 +24,21 @@ typedef int (*proto_open_fp) (smpr_t *self, uint64_t base, void *args);
/* Release protocol */
typedef int (*proto_release_fp) (smpr_t *self);
/* Read data from protocol */
typedef ssize_t (*proto_read_16_fp) (smpr_t *self, uint64_t offs, uint16_t *data, uint32_t flags);
typedef ssize_t (*proto_read_32_fp) (smpr_t *self, uint64_t offs, uint32_t *data, uint32_t flags);
typedef ssize_t (*proto_read_64_fp) (smpr_t *self, uint64_t offs, uint64_t *data, uint32_t flags);
typedef ssize_t (*proto_read_16_fp) (smpr_t *self, uint64_t offs, uint16_t *data);
typedef ssize_t (*proto_read_32_fp) (smpr_t *self, uint64_t offs, uint32_t *data);
typedef ssize_t (*proto_read_64_fp) (smpr_t *self, uint64_t offs, uint64_t *data);
/* Write data to protocol */
typedef ssize_t (*proto_write_16_fp) (smpr_t *self, uint64_t offs, const uint16_t *data, uint32_t flags);
typedef ssize_t (*proto_write_32_fp) (smpr_t *self, uint64_t offs, const uint32_t *data, uint32_t flags);
typedef ssize_t (*proto_write_64_fp) (smpr_t *self, uint64_t offs, const uint64_t *data, uint32_t flags);
typedef ssize_t (*proto_write_16_fp) (smpr_t *self, uint64_t offs, const uint16_t *data);
typedef ssize_t (*proto_write_32_fp) (smpr_t *self, uint64_t offs, const uint32_t *data);
typedef ssize_t (*proto_write_64_fp) (smpr_t *self, uint64_t offs, const uint64_t *data);
/* Read data block from protocol, size in bytes */
typedef ssize_t (*proto_read_block_fp) (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags);
typedef ssize_t (*proto_read_block_fp) (smpr_t *self, uint64_t offs, size_t size, uint32_t *data);
/* Write data block from protocol, size in bytes */
typedef ssize_t (*proto_write_block_fp) (smpr_t *self, uint64_t offs, size_t size, const uint32_t *data, uint32_t flags);
typedef ssize_t (*proto_write_block_fp) (smpr_t *self, uint64_t offs, size_t size, const uint32_t *data);
/* Read data block via DMA from protocol, size in bytes */
typedef ssize_t (*proto_read_dma_fp) (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags);
typedef ssize_t (*proto_read_dma_fp) (smpr_t *self, uint64_t offs, size_t size, uint32_t *data);
/* Write data block via DMA from protocol, size in bytes */
typedef ssize_t (*proto_write_dma_fp) (smpr_t *self, uint64_t offs, size_t size, const uint32_t *data, uint32_t flags);
typedef ssize_t (*proto_write_dma_fp) (smpr_t *self, uint64_t offs, size_t size, const uint32_t *data);
typedef struct {
const char *proto_name; /* Protocol name */
......@@ -89,21 +89,21 @@ int smpr_open (smpr_t *self, uint64_t base, void *args);
/* Release protocol */
int smpr_release (smpr_t *self);
/* Read data from protocol */
ssize_t smpr_read_16 (smpr_t *self, uint64_t offs, uint16_t *data, uint32_t flags);
ssize_t smpr_read_32 (smpr_t *self, uint64_t offs, uint32_t *data, uint32_t flags);
ssize_t smpr_read_64 (smpr_t *self, uint64_t offs, uint64_t *data, uint32_t flags);
ssize_t smpr_read_16 (smpr_t *self, uint64_t offs, uint16_t *data);
ssize_t smpr_read_32 (smpr_t *self, uint64_t offs, uint32_t *data);
ssize_t smpr_read_64 (smpr_t *self, uint64_t offs, uint64_t *data);
/* Write data to protocol */
ssize_t smpr_write_16 (smpr_t *self, uint64_t offs, const uint16_t *data, uint32_t flags);
ssize_t smpr_write_32 (smpr_t *self, uint64_t offs, const uint32_t *data, uint32_t flags);
ssize_t smpr_write_64 (smpr_t *self, uint64_t offs, const uint64_t *data, uint32_t flags);
ssize_t smpr_write_16 (smpr_t *self, uint64_t offs, const uint16_t *data);
ssize_t smpr_write_32 (smpr_t *self, uint64_t offs, const uint32_t *data);
ssize_t smpr_write_64 (smpr_t *self, uint64_t offs, const uint64_t *data);
/* Read data block from protocol, size in bytes */
ssize_t smpr_read_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags);
ssize_t smpr_read_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data);
/* Write data block from protocol, size in bytes */
ssize_t smpr_write_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags);
ssize_t smpr_write_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data);
/* Read data block via DMA from protocol, size in bytes */
ssize_t smpr_read_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags);
ssize_t smpr_read_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data);
/* Write data block via DMA from protocol, size in bytes */
ssize_t smpr_write_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags);
ssize_t smpr_write_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data);
#ifdef __cplusplus
}
......
......@@ -212,33 +212,33 @@ int smpr_release (smpr_t *self)
SMPR_FUNC_WRAPPER (proto_release)
/**** Read data from device ****/
ssize_t smpr_read_16 (smpr_t *self, uint64_t offs, uint16_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_read_16, offs, data, flags)
ssize_t smpr_read_32 (smpr_t *self, uint64_t offs, uint32_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_read_32, offs, data, flags)
ssize_t smpr_read_64 (smpr_t *self, uint64_t offs, uint64_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_read_64, offs, data, flags)
ssize_t smpr_read_16 (smpr_t *self, uint64_t offs, uint16_t *data)
SMPR_FUNC_WRAPPER (proto_read_16, offs, data)
ssize_t smpr_read_32 (smpr_t *self, uint64_t offs, uint32_t *data)
SMPR_FUNC_WRAPPER (proto_read_32, offs, data)
ssize_t smpr_read_64 (smpr_t *self, uint64_t offs, uint64_t *data)
SMPR_FUNC_WRAPPER (proto_read_64, offs, data)
/**** Write data to device ****/
ssize_t smpr_write_16 (smpr_t *self, uint64_t offs, const uint16_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_write_16, offs, data, flags)
ssize_t smpr_write_32 (smpr_t *self, uint64_t offs, const uint32_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_write_32, offs, data, flags)
ssize_t smpr_write_64 (smpr_t *self, uint64_t offs, const uint64_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_write_64, offs, data, flags)
ssize_t smpr_write_16 (smpr_t *self, uint64_t offs, const uint16_t *data)
SMPR_FUNC_WRAPPER (proto_write_16, offs, data)
ssize_t smpr_write_32 (smpr_t *self, uint64_t offs, const uint32_t *data)
SMPR_FUNC_WRAPPER (proto_write_32, offs, data)
ssize_t smpr_write_64 (smpr_t *self, uint64_t offs, const uint64_t *data)
SMPR_FUNC_WRAPPER (proto_write_64, offs, data)
/**** Read data block from device function pointer, size in bytes ****/
ssize_t smpr_read_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_read_block, offs, size, data, flags)
ssize_t smpr_read_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data)
SMPR_FUNC_WRAPPER (proto_read_block, offs, size, data)
/**** Write data block from device function pointer, size in bytes ****/
ssize_t smpr_write_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_write_block, offs, size, data, flags)
ssize_t smpr_write_block (smpr_t *self, uint64_t offs, size_t size, uint32_t *data)
SMPR_FUNC_WRAPPER (proto_write_block, offs, size, data)
/**** Read data block from via DMA from protocol function pointer, size in bytes ****/
ssize_t smpr_read_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_read_dma, offs, size, data, flags)
ssize_t smpr_read_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data)
SMPR_FUNC_WRAPPER (proto_read_dma, offs, size, data)
/**** Write data block via DMA from protocol function pointer, size in bytes ****/
ssize_t smpr_write_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data, uint32_t flags)
SMPR_FUNC_WRAPPER (proto_write_dma, offs, size, data, flags)
ssize_t smpr_write_dma (smpr_t *self, uint64_t offs, size_t size, uint32_t *data)
SMPR_FUNC_WRAPPER (proto_write_dma, offs, size, data)
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