2 * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <gpxe/xfer.h>
24 * Data transfer interfaces
31 * @v xfer Data-transfer interface
32 * @v iobuf Datagram I/O buffer
33 * @ret rc Return status code
35 int deliver ( struct xfer_interface *xfer, struct io_buffer *iobuf ) {
36 struct xfer_interface *dest = xfer_dest ( xfer );
38 return dest->op->deliver ( dest, xfer, iobuf );
42 * Null deliver datagram
44 * @v xfer Data-transfer interface
45 * @v src Source interface
46 * @v iobuf Datagram I/O buffer
47 * @ret rc Return status code
49 static int null_deliver ( struct xfer_interface *xfer __unused,
50 struct xfer_interface *src __unused,
51 struct io_buffer *iobuf ) {
56 /** Null data transfer interface operations */
57 struct xfer_interface_operations null_xfer_ops = {
58 .deliver = null_deliver,
62 * Null data transfer interface
64 * This is the interface to which data transfer interfaces are
65 * connected when unplugged. It will never generate messages, and
66 * will silently absorb all received messages.
68 struct xfer_interface null_xfer = {
70 .dest = &null_xfer.intf,
71 .refcnt = null_refcnt,