iPXE
nullnet.c
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2006 Michael Brown <mbrown@fensystems.co.uk>.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License as
00006  * published by the Free Software Foundation; either version 2 of the
00007  * License, or any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful, but
00010  * WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301, USA.
00018  *
00019  * You can also choose to distribute this program under the terms of
00020  * the Unmodified Binary Distribution Licence (as given in the file
00021  * COPYING.UBDL), provided that you have satisfied its requirements.
00022  */
00023 
00024 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00025 
00026 #include <stdint.h>
00027 #include <errno.h>
00028 #include <ipxe/iobuf.h>
00029 #include <ipxe/netdevice.h>
00030 
00031 /** @file
00032  *
00033  * Null network device
00034  *
00035  */
00036 
00037 static int null_open ( struct net_device *netdev __unused ) {
00038         return -ENODEV;
00039 };
00040 
00041 static void null_close ( struct net_device *netdev __unused ) {
00042         /* Do nothing */
00043 };
00044 
00045 static int null_transmit ( struct net_device *netdev __unused,
00046                            struct io_buffer *iobuf __unused ) {
00047         return -ENODEV;
00048 };
00049 
00050 static void null_poll ( struct net_device *netdev __unused ) {
00051         /* Do nothing */
00052 }
00053 
00054 static void null_irq ( struct net_device *netdev __unused,
00055                        int enable __unused ) {
00056         /* Do nothing */
00057 }
00058 
00059 struct net_device_operations null_netdev_operations = {
00060         .open           = null_open,
00061         .close          = null_close,
00062         .transmit       = null_transmit,
00063         .poll           = null_poll,
00064         .irq            = null_irq,
00065 };