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

VxWorks

开发平台:

C/C++

  1. /* usrNetSmnetBoot.c - start a shared memory network boot device */
  2. /* Copyright 1992 - 1998 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 04r,05dec97,spm  added DHCP code review modifications
  7. */
  8. /*
  9. DESCRIPTION
  10. This file is included by the configuration tool to initialize a shared memory
  11. network device according to the parameters in the boot line. It contains the 
  12. initialization routine for the INCLUDE_SMNET_BOOT component.
  13. NOMANUAL
  14. */
  15. /*******************************************************************************
  16. *
  17. * usrNetSmnetStart - start the shared memory or backplane device
  18. *
  19. * This routine creates a shared memory device as specified in the boot 
  20. * parameters if it is selected as the boot device. It is the 
  21. * initialization routine for the INCLUDE_SMNET_BOOT component which is 
  22. * automatically added when both the INCLUDE_ULIP and INCLUDE_NET_INIT 
  23. * components are used. The device is attached to the protocol stack
  24. * by a later routine unless an error occurs.
  25. * RETURNS: N/A
  26. *
  27. * NOMANUAL
  28. */
  29. void usrNetSmnetStart (void)
  30.     {
  31.     STATUS result;
  32.     /* 
  33.      * Do nothing if another device is already initialized or an
  34.      * error was detected in the boot parameters.
  35.      */
  36.     if (netDevBootFlag)
  37.         return;
  38.     if ((strncmp (sysBootParams.bootDev, "bp", 2) == 0) ||
  39.         (strncmp (sysBootParams.bootDev, "sm", 2) == 0))
  40.         {
  41.         result = usrBpInit (sysBootParams.bootDev, sysBootParams.unitNum, 0);
  42.         if (result == ERROR)
  43.             netDevBootFlag = TRUE;  /* Prevents further processing. */
  44.         }
  45.     return;
  46.     }
  47. /*******************************************************************************
  48. *
  49. * usrSmNetAddrGet - use backplane address field if necessary
  50. *
  51. * This routine resets the network-related boot parameter processing to
  52. * use the field containing the address for the backplane or shared memory
  53. * device. It is the initialization routine for the INCLUDE_SMNET_ADDRGET
  54. * component which is automatically added when both the INCLUDE_SM_NET and
  55. * INCLUDE_NET_INIT components are used.
  56. *
  57. * RETURNS: N/A
  58. *
  59. * NOMANUAL
  60. */
  61. void usrSmNetAddrGet (void)
  62.     {
  63.     /* change the address string if a related boot device is used */
  64.     if ((strncmp (sysBootParams.bootDev, "bp", 2) == 0) ||
  65.             (strncmp (sysBootParams.bootDev, "sm", 2) == 0))
  66.         {
  67.         /* booting via backplane */
  68.         pAddrString = sysBootParams.bad;
  69.         }
  70.     return;
  71.     }