Browse Source

Add XFER_INIT() macro.

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
a2b4252d5a
2 changed files with 14 additions and 7 deletions
  1. 1
    7
      src/core/xfer.c
  2. 13
    0
      src/include/gpxe/xfer.h

+ 1
- 7
src/core/xfer.c View File

402
  * connected when unplugged.  It will never generate messages, and
402
  * connected when unplugged.  It will never generate messages, and
403
  * will silently absorb all received messages.
403
  * will silently absorb all received messages.
404
  */
404
  */
405
-struct xfer_interface null_xfer = {
406
-	.intf = {
407
-		.dest = &null_xfer.intf,
408
-		.refcnt = NULL,
409
-	},
410
-	.op = &null_xfer_ops,
411
-};
405
+struct xfer_interface null_xfer = XFER_INIT ( &null_xfer_ops );

+ 13
- 0
src/include/gpxe/xfer.h View File

183
 	xfer->op = op;
183
 	xfer->op = op;
184
 }
184
 }
185
 
185
 
186
+/**
187
+ * Initialise a static data transfer interface
188
+ *
189
+ * @v operations		Data transfer interface operations
190
+ */
191
+#define XFER_INIT( operations ) {			\
192
+		.intf = {				\
193
+			.dest = &null_xfer.intf,	\
194
+			.refcnt = NULL,			\
195
+		},					\
196
+		.op = operations,			\
197
+	}
198
+
186
 /**
199
 /**
187
  * Get data transfer interface from generic object communication interface
200
  * Get data transfer interface from generic object communication interface
188
  *
201
  *

Loading…
Cancel
Save