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

VxWorks

开发平台:

C/C++

  1. /* wdbVisionDriver.c - Wind River Vision Driver WDB_COMM initialization library */
  2. /* Copyright 1986-2002 Wind River Systems Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01j,13jul02,tcr  Added support for the 440.
  7. 02c,30nov01,g_h  Cleaning for T2.2
  8. 02b,12nov01,g_h  Add support for ColdFire
  9. 02a,04jun01,g_h  Changed to wdbVisionDriver based version of for the TMD mode
  10. 01c,09apr01,rnr  Changed to vDriver based version of for the TMD mode
  11. 01b,07feb01,g_h  renaming module name and cleaning
  12. 01a,24dec99,est  adapted from wdbNETROM.c
  13. */
  14. /*
  15. DESCRIPTION
  16. Initializes the Wind River Vision Tools connection for the WDB agent.
  17. NOMANUAL
  18. */
  19. /* Include main packet driver source module */
  20. #include "wdb/vision/wdbVisionDrv.c"
  21. #include "drv/wdb/vision/wdbVisionPktDrv.h"
  22. #include "wdb/vision/wdbVisionPktDrv.c"
  23. #if defined (INCLUDE_WDB_COMM_VTMD)
  24. #include "wdb/vision/visionTmdDrv.c"
  25. #if   ((CPU == PPC603) || (CPU == PPC860) || (CPU == PPC604) || (CPU == PPC405) || (CPU == PPC440))
  26. #include "wdb/vision/visionTmdAsmPpc.c"
  27. #elif (CPU == MIPS32)
  28. #include "wdb/vision/visionTmdAsmMips.c"
  29. #elif (CPU == ARMARCH4)
  30. #include "wdb/vision/visionTmdAsmArm.c"
  31. #elif (CPU == XSCALE)
  32. #include "wdb/vision/visionTmdAsmXscale.c"
  33. #elif ((CPU == SH7700) || (CPU == SH7750) || (CPU == SH7600))
  34. #include "wdb/vision/visionTmdAsmSh.c"
  35. #elif (CPU == MCF5200)
  36. #include "wdb/vision/visionTmdAsmCfire.c"
  37. #else
  38. #error "This CPU is not supported !!!"
  39. #endif
  40. #endif /* (INCLUDE_WDB_COMM_VTMD) */
  41. /* Check MTU */
  42. #if     WDB_MTU > WDB_VISION_PKT_MTU
  43. #undef  WDB_MTU
  44. #define WDB_VISION_PKT_MTU
  45. #endif  /* WDB_MTU > WDB_VISION_PKT_MTU */
  46. /***************************************************************************
  47. *
  48. * wdbCommDevInit - initialize the vision connection
  49. *
  50. * This routine initialize the vision connection
  51. *
  52. * RETURN: OK or ERROR
  53. */
  54. STATUS wdbCommDevInit
  55.     (
  56.     WDB_COMM_IF  * pCommIf,
  57.     char        ** ppWdbInBuf,
  58.     char        ** ppWdbOutBuf
  59.     )
  60.     {
  61.     LOCAL WDB_VISION_PKT_DEV wdbVisionPktDev;  
  62.     LOCAL uint_t             wdbInBuf [WDB_MTU/4];
  63.     LOCAL uint_t             wdbOutBuf [WDB_MTU/4];
  64.     /* update input & output buffer pointers */
  65.     *ppWdbInBuf  = (char *) wdbInBuf;
  66.     *ppWdbOutBuf = (char *) wdbOutBuf;
  67.     /* update communication interface mtu */
  68.     wdbCommMtu = WDB_MTU;
  69.     wdbVisionPktDevInit (&wdbVisionPktDev, udpRcv);
  70.     if (udpCommIfInit (pCommIf, &wdbVisionPktDev.wdbDrvIf) == ERROR)
  71. return (ERROR);
  72.     return (OK);
  73.     }