Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add XFER_INIT() macro.
  • Loading branch information
Michael Brown committed Jan 22, 2008
1 parent f6a8158 commit a2b4252
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
8 changes: 1 addition & 7 deletions src/core/xfer.c
Expand Up @@ -402,10 +402,4 @@ struct xfer_interface_operations null_xfer_ops = {
* connected when unplugged. It will never generate messages, and
* will silently absorb all received messages.
*/
struct xfer_interface null_xfer = {
.intf = {
.dest = &null_xfer.intf,
.refcnt = NULL,
},
.op = &null_xfer_ops,
};
struct xfer_interface null_xfer = XFER_INIT ( &null_xfer_ops );
13 changes: 13 additions & 0 deletions src/include/gpxe/xfer.h
Expand Up @@ -183,6 +183,19 @@ static inline void xfer_init ( struct xfer_interface *xfer,
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
*
Expand Down

0 comments on commit a2b4252

Please sign in to comment.