usrNetBsd.c
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:5k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usrNetBsd.c - Support for BSD network devices */
  2. /* Copyright 1992 - 1999 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01f,08oct01,mas  changed smNetAttach to smNetAttach2 (SPR 4547)
  7. 01e,10mar99,yh   changed component name INCLUDE_USR_ENTRIES (25331)
  8. 01d,08mar99,spm  added missing prototype for feiattach routine (SPR #23818)
  9. 01c,10feb99,dat  added FEI driver, made usrNetIfTbl global (SPR 23818)
  10. 01b,08oct98,ms   added prototypes for pcmciaattach and usrSmAttach
  11. 01a,05dec97,spm  added DHCP code review modifications
  12. */
  13. /*
  14. DESCRIPTION
  15. This file is used to include support for network devices using the BSD
  16. interface. The file contents are included in the project configuration 
  17. file when INCLUDE_BSD is defined. This file creates all necessary data
  18. structures so that any BSD-style network device can be attached by the 
  19. INCLUDE_NET_INIT component or manually by the user.
  20. NOMANUAL
  21. */
  22. /* Network interface table. */
  23. IMPORT int dcattach ();
  24. IMPORT int feiattach ();
  25. IMPORT int eglattach ();
  26. IMPORT int eiattach ();
  27. IMPORT int exattach ();
  28. IMPORT int enpattach ();
  29. IMPORT int ieattach ();
  30. IMPORT int ilacattach ();
  31. IMPORT int lnattach ();
  32. IMPORT int lnsgiattach ();
  33. IMPORT int nicattach ();
  34. IMPORT int nicEvbattach ();
  35. IMPORT int medattach ();
  36. IMPORT int loattach ();
  37. IMPORT int snattach ();
  38. IMPORT int fnattach ();
  39. IMPORT int elcattach ();
  40. IMPORT int ultraattach ();
  41. IMPORT int eexattach ();
  42. IMPORT int eltattach ();
  43. IMPORT int eneattach ();
  44. IMPORT int esmcattach ();
  45. IMPORT int quattach ();
  46. IMPORT int slattach ();
  47. IMPORT int pppattach ();
  48. IMPORT STATUS pcmciaattach ();
  49. IMPORT STATUS smNetAttach2 ();
  50. #ifdef INCLUDE_USR_ENTRIES
  51.     NETIF_USR_DECL
  52. #endif
  53. #ifdef INCLUDE_IF_USR
  54. IMPORT int IF_USR_ATTACH ();
  55. #endif /* INCLUDE_IF_USR */
  56. /* local variables */
  57. NETIF usrNetIfTbl [] = /* network interfaces */
  58.     {
  59. #ifdef INCLUDE_USR_ENTRIES /* Additional entries, from BSP */
  60. NETIF_USR_ENTRIES
  61. #endif
  62. #ifdef INCLUDE_IF_USR /* obsolete, do not use. use NETIF_USR_ENTRIES */
  63. { IF_USR_NAME, IF_USR_ATTACH, IF_USR_ARG1, IF_USR_ARG2, IF_USR_ARG3,
  64.   IF_USR_ARG4, IF_USR_ARG5, IF_USR_ARG6, IF_USR_ARG7, IF_USR_ARG8 },
  65. #endif /* INCLUDE_IF_USR */
  66. #ifdef INCLUDE_DC
  67. { "dc", dcattach, (char*)IO_ADRS_DC, INT_VEC_DC, INT_LVL_DC,
  68.   DC_POOL_ADRS, DC_POOL_SIZE, DC_DATA_WIDTH, DC_RAM_PCI_ADRS,
  69.   DC_MODE },
  70. #endif  /* INCLUDE_DC */
  71. #ifdef  INCLUDE_EGL
  72. { "egl", eglattach, (char*)IO_ADRS_EGL, INT_VEC_EGL, INT_LVL_EGL },
  73. #endif  /* INCLUDE_EGL */
  74. #ifdef INCLUDE_EI
  75. { "ei", eiattach, (char*)INT_VEC_EI, EI_SYSBUS, EI_POOL_ADRS, 0, 0},
  76. #endif /* INCLUDE_EI */
  77. #ifdef INCLUDE_FEI
  78. { "fei", feiattach, (char *)FEI_POOL_ADRS, 0, 0, 0, 0},
  79. #endif /* INCLUDE_FEI */
  80. #ifdef INCLUDE_EX
  81. { "ex", exattach, (char*)IO_ADRS_EX, INT_VEC_EX, INT_LVL_EX,
  82.   IO_AM_EX_MASTER, IO_AM_EX },
  83. #endif /* INCLUDE_EX */
  84. #ifdef INCLUDE_ENP
  85. { "enp", enpattach, (char*)IO_ADRS_ENP, INT_VEC_ENP, INT_LVL_ENP,
  86.   IO_AM_ENP },
  87. #endif /* INCLUDE_ENP */
  88. #ifdef INCLUDE_IE
  89. { "ie", ieattach, (char*)IO_ADRS_IE, INT_VEC_IE, INT_LVL_IE },
  90. #endif /* INCLUDE_IE */
  91. #ifdef INCLUDE_ILAC
  92. { "ilac", ilacattach, (char*)IO_ADRS_ILAC, INT_VEC_ILAC},
  93. #endif /* INCLUDE_ILAC */
  94. #ifdef INCLUDE_LN
  95. { "ln", lnattach, (char*)IO_ADRS_LN, INT_VEC_LN, INT_LVL_LN,
  96.   LN_POOL_ADRS, LN_POOL_SIZE, LN_DATA_WIDTH, LN_PADDING,
  97.   LN_RING_BUF_SIZE },
  98. #endif /* INCLUDE_LN */
  99. #ifdef  INCLUDE_LNSGI
  100.         { "lnsgi", lnsgiattach, (char*)IO_ADRS_LNSGI, INT_VEC_LNSGI,
  101.           INT_LVL_LNSGI, LNSGI_POOL_ADRS, LNSGI_POOL_SIZE, LNSGI_DATA_WIDTH,
  102.           LNSGI_PADDING, LNSGI_RING_BUF_SIZE },
  103. #endif  /* INCLUDE_LNSGI */
  104. #ifdef  INCLUDE_NIC
  105.         { "nic", nicattach, (char*)IO_ADRS_NIC, INT_VEC_NIC, INT_LVL_NIC },
  106. #endif /* INCLUDE_NIC */
  107. #ifdef  INCLUDE_NIC_EVB
  108.         { "nicEvb", nicEvbattach, (char*)IO_ADRS_NIC,INT_VEC_NIC,INT_LVL_NIC },
  109. #endif  /* INCLUDE_NIC_EVB */
  110. #ifdef  INCLUDE_MED
  111.         { "med", medattach, (char*)IO_ADRS_DBETH, INT_VEC_DBETH, INT_LVL_DBETH},
  112. #endif /* INCLUDE_MED */
  113. #ifdef  INCLUDE_ELC
  114. { "elc", elcattach, (char*)IO_ADRS_ELC, INT_VEC_ELC, INT_LVL_ELC,
  115.   MEM_ADRS_ELC, MEM_SIZE_ELC, CONFIG_ELC},
  116. #endif  /* INCLUDE_ELC */
  117. #ifdef  INCLUDE_ULTRA
  118. { "ultra", ultraattach, (char*)IO_ADRS_ULTRA, INT_VEC_ULTRA,
  119.   INT_LVL_ULTRA, MEM_ADRS_ULTRA, MEM_SIZE_ULTRA, CONFIG_ULTRA},
  120. #endif  /* INCLUDE_ULTRA */
  121. #ifdef  INCLUDE_EEX
  122. { "eex", eexattach, (char*)IO_ADRS_EEX, INT_VEC_EEX, INT_LVL_EEX,
  123.   NTFDS_EEX, CONFIG_EEX},
  124. #endif  /* INCLUDE_EEX */
  125. #ifdef  INCLUDE_ELT
  126. { "elt", eltattach, (char*)IO_ADRS_ELT, INT_VEC_ELT, INT_LVL_ELT,
  127.   NRF_ELT, CONFIG_ELT},
  128. #endif  /* INCLUDE_ELT */
  129. #ifdef  INCLUDE_QU
  130. { "qu", quattach, (char*)IO_ADRS_QU_EN, INT_VEC_QU_EN, QU_EN_SCC,
  131.   QU_EN_TX_BD, QU_EN_RX_BD, QU_EN_TX_OFF, QU_EN_RX_OFF, QU_EN_MEM},
  132. #endif  /* INCLUDE_QU */
  133. #ifdef  INCLUDE_ENE
  134. { "ene", eneattach, (char*)IO_ADRS_ENE, INT_VEC_ENE, INT_LVL_ENE},
  135. #endif  /* INCLUDE_ENE */
  136. #ifdef  INCLUDE_ESMC
  137. { "esmc", esmcattach, (char*)IO_ADRS_ESMC, INT_VEC_ESMC, INT_LVL_ESMC,
  138.   CONFIG_ESMC, RX_MODE_ESMC},
  139. #endif  /* INCLUDE_ESMC */
  140. #ifdef  INCLUDE_SN
  141.         { "sn", snattach, (char*)IO_ADRS_SN, INT_VEC_SN },
  142. #endif /* INCLUDE_SN */
  143. #ifdef  INCLUDE_FN
  144.         { "fn", fnattach },
  145. #endif /* INCLUDE_FN */
  146. #ifdef  INCLUDE_SM_NET
  147.         { "sm", smNetAttach2, 0, 0, 0, 0, 0, 0, 0, 0 },
  148. #endif  /* INCLUDE_SM_NET */
  149. #ifdef INCLUDE_PCMCIA
  150. { "pcmcia", pcmciaattach, 0, 0, 0, 0, 0, 0 },
  151. #endif /* INCLUDE_PCMCIA */
  152. #ifdef INCLUDE_PPP
  153. {"ppp", 0, 0, 0, 0, 0},
  154. #endif /* INCLUDE_PPP */
  155. #ifdef INCLUDE_SLIP
  156. {"sl", 0, 0, 0, 0, 0},
  157. #endif /* INCLUDE_SLIP */
  158. { "lo", loattach  },
  159. { 0, 0, 0, 0, 0, 0 },
  160.     };