您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

nullnet.c 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (C) 2006 Michael Brown <mbrown@fensystems.co.uk>.
  3. *
  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.
  8. *
  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.
  13. *
  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.
  17. */
  18. #include <stdint.h>
  19. #include <gpxe/iobuf.h>
  20. #include <gpxe/netdevice.h>
  21. /** @file
  22. *
  23. * Null network device
  24. *
  25. */
  26. static int null_open ( struct net_device *netdev __unused ) {
  27. return -ENODEV;
  28. };
  29. static void null_close ( struct net_device *netdev __unused ) {
  30. /* Do nothing */
  31. };
  32. static int null_transmit ( struct net_device *netdev __unused,
  33. struct io_buffer *iobuf __unused ) {
  34. return -ENODEV;
  35. };
  36. static void null_poll ( struct net_device *netdev __unused ) {
  37. /* Do nothing */
  38. }
  39. static void null_irq ( struct net_device *netdev __unused,
  40. int enable __unused ) {
  41. /* Do nothing */
  42. }
  43. struct net_device_operations null_netdev_operations = {
  44. .open = null_open,
  45. .close = null_close,
  46. .transmit = null_transmit,
  47. .poll = null_poll,
  48. .irq = null_irq,
  49. };