Add XFER_INIT() macro.
This commit is contained in:
parent
f6a8158eed
commit
a2b4252d5a
@ -402,10 +402,4 @@ struct xfer_interface_operations null_xfer_ops = {
|
|||||||
* connected when unplugged. It will never generate messages, and
|
* connected when unplugged. It will never generate messages, and
|
||||||
* will silently absorb all received messages.
|
* will silently absorb all received messages.
|
||||||
*/
|
*/
|
||||||
struct xfer_interface null_xfer = {
|
struct xfer_interface null_xfer = XFER_INIT ( &null_xfer_ops );
|
||||||
.intf = {
|
|
||||||
.dest = &null_xfer.intf,
|
|
||||||
.refcnt = NULL,
|
|
||||||
},
|
|
||||||
.op = &null_xfer_ops,
|
|
||||||
};
|
|
||||||
|
@ -183,6 +183,19 @@ static inline void xfer_init ( struct xfer_interface *xfer,
|
|||||||
xfer->op = op;
|
xfer->op = op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialise a static data transfer interface
|
||||||
|
*
|
||||||
|
* @v operations Data transfer interface operations
|
||||||
|
*/
|
||||||
|
#define XFER_INIT( operations ) { \
|
||||||
|
.intf = { \
|
||||||
|
.dest = &null_xfer.intf, \
|
||||||
|
.refcnt = NULL, \
|
||||||
|
}, \
|
||||||
|
.op = operations, \
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get data transfer interface from generic object communication interface
|
* Get data transfer interface from generic object communication interface
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user