eth0rtl.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. * Copyright (C) 2001-2003 by egnite Software GmbH. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. Neither the name of the copyright holders nor the names of
  14. * contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  18. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  19. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  20. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  21. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  23. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  24. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  25. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  26. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  27. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. * SUCH DAMAGE.
  29. *
  30. * For additional information see http://www.ethernut.de/
  31. *
  32. */
  33. /*!
  34. * \file arch/avr/dev/eth0rtl.c
  35. * \brief AVR network device for RTL8019AS.
  36. *
  37. * \verbatim
  38. * $Id: eth0rtl.c 5472 2013-12-06 00:16:28Z olereinhardt $
  39. * \endverbatim
  40. */
  41. #include <netinet/if_ether.h>
  42. #include <net/ether.h>
  43. #include <net/if_var.h>
  44. #include <dev/nicrtl.h>
  45. /*!
  46. * \addtogroup xgEth0Dev
  47. */
  48. /*@{*/
  49. static NICINFO dcb_eth0;
  50. /*!
  51. * \brief Network interface information structure.
  52. *
  53. * Used to call.
  54. */
  55. static IFNET ifn_eth0 = {
  56. IFT_ETHER, /*!< \brief Interface type. */
  57. 0, /*!< \brief Interface flags, if_flags. */
  58. {0, 0, 0, 0, 0, 0}, /*!< \brief Hardware net address. */
  59. 0, /*!< \brief IP address. */
  60. 0, /*!< \brief Remote IP address for point to point. */
  61. 0, /*!< \brief IP network mask. */
  62. ETHERMTU, /*!< \brief Maximum size of a transmission unit. */
  63. 0, /*!< \brief Packet identifier. */
  64. 0, /*!< \brief Linked list of arp entries. */
  65. 0, /*!< \brief Linked list of multicast address entries, if_mcast. */
  66. NutEtherInput, /*!< \brief Routine to pass received data to, if_recv(). */
  67. NicOutput, /*!< \brief Driver output routine, if_send(). */
  68. NutEtherOutput, /*!< \brief Media output routine, if_output(). */
  69. NULL /*!< \brief Interface specific control function, if_ioctl(). */
  70. #ifdef NUT_PERFMON
  71. , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  72. #endif
  73. };
  74. /*!
  75. * \brief Device information structure.
  76. *
  77. * A pointer to this structure must be passed to NutRegisterDevice()
  78. * to bind this Ethernet device driver to the Nut/OS kernel.
  79. * An application may then call NutNetIfConfig() with the name \em eth0
  80. * of this driver to initialize the network interface.
  81. *
  82. */
  83. NUTDEVICE devEth0 = {
  84. 0, /* Pointer to next device. */
  85. {'e', 't', 'h', '0', 0, 0, 0, 0, 0}, /* Unique device name. */
  86. IFTYP_NET, /* Type of device. */
  87. 0, /* Base address. */
  88. 0, /* First interrupt number. */
  89. &ifn_eth0, /* Interface control block. */
  90. &dcb_eth0, /* Driver control block. */
  91. NicInit, /* Driver initialization routine. */
  92. 0, /* Driver specific control function. */
  93. 0, /* Read from device. */
  94. 0, /* Write to device. */
  95. 0, /* Write from program space data to device. */
  96. 0, /* Open a device or file. */
  97. 0, /* Close a device or file. */
  98. 0, /* Request file size. */
  99. 0, /* Select function, optional, not yet implemented */
  100. };
  101. /*@}*/