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

VxWorks

开发平台:

C/C++

  1. /* usrEndLib.c - End Init routines */
  2. /* Copyright 1992 - 1998 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01e,29may01,pch  Change type of pCookie to (void *), to match muxDevLoad()
  7. 01d,02mar01,rae  Corrected pCookie conversion
  8. 01c,30jul99,pul  replace arpresolve with ipEtherResolvRtn
  9. 01b,30sep98,ms   folded in INCLUDE_NT_ULIP hacks from usrNetwork.c
  10. 01a,18aug98,ann  created from usrNetwork.c
  11. */
  12. /*
  13. DESCRIPTION
  14. This configlette contains the initialization routine for the
  15. INCLUDE_END component.
  16. NOMANUAL
  17. */
  18. #ifdef INCLUDE_NT_ULIP
  19. extern int ntResolv ();
  20. #endif /* INCLUDE_NT_ULIP */
  21. STATUS usrEndLibInit()
  22.     {
  23.     
  24.     int count;
  25.     END_TBL_ENTRY * pDevTbl;
  26.     void * pCookie = NULL;
  27.     /* Add our default address resolution functions. */
  28. #ifdef INCLUDE_NT_ULIP
  29.     muxAddrResFuncAdd (M2_ifType_ethernet_csmacd, 0x800, ntResolv);
  30. #else
  31.     muxAddrResFuncAdd (M2_ifType_ethernet_csmacd, 0x800, ipEtherResolvRtn);
  32. #endif
  33.     /* Add in mux ENDs. */
  34.     for (count = 0, pDevTbl = endDevTbl; pDevTbl->endLoadFunc != END_TBL_END;
  35.          pDevTbl++, count++)
  36.         {
  37.         /* Make sure that WDB has not already installed the device. */
  38.         if (!pDevTbl->processed)
  39.             {
  40.             pCookie = muxDevLoad (pDevTbl->unit,
  41.                                   pDevTbl->endLoadFunc,
  42.                                   pDevTbl->endLoadString,
  43.                                   pDevTbl->endLoan, pDevTbl->pBSP);
  44.             if (pCookie == NULL)
  45.                 {
  46.                 printf("muxDevLoad failed for device entry %d!n", count);
  47.                 }
  48.             else
  49.                 {
  50.                 pDevTbl->processed = TRUE;
  51.                 if (muxDevStart(pCookie) == ERROR)
  52.                     {
  53.                     printf("muxDevStart failed for device entry %d!n", count);
  54.                     }
  55.                 }
  56.             }
  57.         }
  58.     return (OK);
  59.     }