Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

nullnet.c 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 <errno.h>
  20. #include <gpxe/iobuf.h>
  21. #include <gpxe/netdevice.h>
  22. /** @file
  23. *
  24. * Null network device
  25. *
  26. */
  27. static int null_open ( struct net_device *netdev __unused ) {
  28. return -ENODEV;
  29. };
  30. static void null_close ( struct net_device *netdev __unused ) {
  31. /* Do nothing */
  32. };
  33. static int null_transmit ( struct net_device *netdev __unused,
  34. struct io_buffer *iobuf __unused ) {
  35. return -ENODEV;
  36. };
  37. static void null_poll ( struct net_device *netdev __unused ) {
  38. /* Do nothing */
  39. }
  40. static void null_irq ( struct net_device *netdev __unused,
  41. int enable __unused ) {
  42. /* Do nothing */
  43. }
  44. struct net_device_operations null_netdev_operations = {
  45. .open = null_open,
  46. .close = null_close,
  47. .transmit = null_transmit,
  48. .poll = null_poll,
  49. .irq = null_irq,
  50. };