⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 drv_conf.c

📁 有线电视系统前端设备复用器原代码。 用语接受卫星信号
💻 C
📖 第 1 页 / 共 4 页
字号:
    dnt_add("pipe", DEV_PIPE);
#endif /* SC_DEV_PIPE */

/*-----------------------------------------------------------------*/
/* Add the name for the SCSI driver as "scsi".                     */
/*-----------------------------------------------------------------*/
#if (SC_DEV_SCSI && BSP_SCSI)
    dnt_add("scsi", DEV_SCSI);
#endif /* SC_DEV_SCSI && BSP_SCSI */

/*-----------------------------------------------------------------*/
/* Add the name for the SCSI-TAPE driver as "tape".                */
/*-----------------------------------------------------------------*/
#if (SC_DEV_SCSI_TAPE && BSP_SCSI_TAPE)
    dnt_add("tape", DEV_SCSI_TAPE);
#endif /* SC_DEV_SCSI_TAPE && BSP_SCSI_TAPE */

/*-----------------------------------------------------------------*/
/* Add the name for the IDE driver as "ide".                       */
/*-----------------------------------------------------------------*/
#if (SC_DEV_IDE && BSP_IDE)
    dnt_add("ide", DEV_IDE);
#endif /* SC_DEV_IDE && BSP_IDE */

/*-----------------------------------------------------------------*/
/* There is only one parallel driver in the system. Make a name    */
/* for it.                                                         */
/*-----------------------------------------------------------------*/
#if SC_DEV_PARALLEL
    dnt_add("printer", DEV_PARALLEL);
#endif /* SC_DEV_PARALLEL */

/*-----------------------------------------------------------------*/
/* Add the name for the floppy driver in the system.               */
/*-----------------------------------------------------------------*/
#if (SC_DEV_FLOPPY && BSP_FLOPPY)
    dnt_add("floppy", DEV_FLOPPY);
#endif /* SC_DEV_FLOPPY */

/*-----------------------------------------------------------------*/
/* There is only one watchdog driver in the system. Make a name    */
/* for it.                                                         */
/*-----------------------------------------------------------------*/
#if SC_DEV_WATCHDOG
    dnt_add("watchdog", DEV_WATCHDOG);
#endif /* SC_DEV_WATCHDOG */

/*-----------------------------------------------------------------*/
/* There is only one cmos driver in the system. Make a name for it.*/
/*-----------------------------------------------------------------*/
#if SC_DEV_CMOS
    dnt_add("cmos", DEV_CMOS);
#endif /* SC_DEV_CMOS */

/*-----------------------------------------------------------------*/
/* Make the name for TFTP driver as "tftp".                        */
/*-----------------------------------------------------------------*/
#if (SC_DEV_TFTP)
    dnt_add("tftp", DEV_TFTP);
#endif /* SC_DEV_TFTP */

/*-----------------------------------------------------------------*/
/* Make the name for NTFTP driver as "ntftp".                      */
/*-----------------------------------------------------------------*/
#if (SC_DEV_NTFTP)
    dnt_add("ntftp", DEV_NTFTP);
#endif /* SC_DEV_NTFTP */

/*-----------------------------------------------------------------*/
/* Make default name for the HTTP pseudo device.                   */
/*-----------------------------------------------------------------*/
#if SC_DEV_HTTP
    dnt_add("http" , DEV_HTTP);
#endif /* SC_DEV_HTTP */

#if (SC_DEV_DLPI || SC_DEV_PPP || SC_DEV_SLIP)
/*-----------------------------------------------------------------*/
/* There is only one enetdlpi driver in the system.                */
/* Make a name for it.                                             */
/*-----------------------------------------------------------------*/
#if SC_DEV_DLPI
    dnt_add("dlpi", DEV_DLPI);
#endif /* SC_DEV_DLPI */

/*-----------------------------------------------------------------*/
/* There is only one enetslip driver in the system. Make a name for it.*/
/*-----------------------------------------------------------------*/
#if SC_DEV_DLPI_SLIP
    dnt_add("dlslip", DEV_DLPI_SLIP);
#endif /* SC_DEV_DLPI_SLIP */

/*-----------------------------------------------------------------*/
/* There is only one enetppp driver in the system. Make a name for it.*/
/*-----------------------------------------------------------------*/
#if SC_DEV_DLPI_PPP
    dnt_add("dlppp", DEV_DLPI_PPP);
#endif /* SC_DEV_DLPI_PPP */

#endif

#if (SC_DEV_LOG)
    dnt_add("log", DEV_LOG);
#endif

#if (SC_DEV_OTCP)

#if (SC_IP)
    dnt_add("ip", DEV_IP);
#endif
#if (SC_ARP)
    dnt_add("arp", DEV_ARP);
#endif
#if (SC_TCP)
    dnt_add("tcp", DEV_TCP);
#endif
#if (SC_UDP)
    dnt_add("udp", DEV_UDP);
#endif
#if (SC_RAW)
    dnt_add("raw", DEV_RAW);
#endif
#if (SC_LOOP)
    dnt_add("loop", DEV_LOOP);
#endif

#endif


#if (SC_DEV_OLAP)

#if (SC_PHPI)
    dnt_add("phpi", DEV_PHPI);
#endif

#if (SC_LAPB)
    dnt_add("lapb", DEV_LAPB);
#endif

#endif

#if (SC_DEV_OX25)

#if (SC_X25)
    dnt_add("x25", DEV_X25);
#endif

#if (SC_SNDCF)
    dnt_add("sndcf", DEV_SNDCF);
#endif

#if (SC_IPCONV)
    dnt_add("ipconv", DEV_IPCONV);
#endif

#endif

#if (SC_DEV_ISDN)

#if (SC_PH)
    dnt_add("ph", DEV_PH);
#endif

#if (SC_LAPD)
    dnt_add("q921", DEV_LAPD);
#endif

#if (SC_IPCD)
    dnt_add("ipcd", DEV_IPCD);
#endif

#endif

#if (SC_DEV_MLPP)

#if (SC_FRMUX)
    dnt_add("cfmux", DEV_FRMUX);
#endif

#if (SC_PIM)
    dnt_add("cpim", DEV_PIM);
#endif

#if (SC_PPP)
    dnt_add("cppp", DEV_PPP);
#endif

#endif
/*-----------------------------------------------------------------*/
/* Names for additional drivers may be added here.                 */
/*-----------------------------------------------------------------*/

}
#endif /* SC_PSOS || SC_PSOSM */

#if (SC_PNA || SC_PNET)
/***********************************************************************/
/*     SetUpNI: Set up Network Interfaces for pNA+                     */
/*                                                                     */
/*       INPUT: FreeMemPtr = A pointer to unused memory that can be    */
/*                           used to allocate space for a driver.      */
/*                           NOTE: Be sure to advance FreeMemPtr if    */
/*                           memory is allocates!                      */
/*                                                                     */
/*     RETURNS: The new address of free memory after the drivers have  */
/*              allocated space.                                       */
/*                                                                     */
/*       NOTES: This function does many precompile checks so errors    */
/*              can be found during compile-time rather then at run-   */
/*              time.                                                  */
/*                                                                     */
/*              Also, the Network Interface Table must be allocated    */
/*              before this function can be called.  There cannot be   */
/*              more then NC_NNI entries in this table.  NC_NNI is set */
/*              in sys_conf.h.  Before adding another interface, be    */
/*              sure to check sys_conf.h to see if NC_NNI is set to    */
/*              accommodate another one!                               */
/*                                                                     */
/*              See the pSOSystem Programmers Reference Manual         */
/*              for more information.                                  */
/*                                                                     */
/* To add a Network driver to pSOSystem, call InstallNi().  This adds  */
/* the Network Interface to the pNA+ Network Interface Table.          */
/* InstallNi() takes the following arguments:                          */
/*                                                                     */
/*     int (*entry)();        address of NI entry point                */
/*     int ipadd;             IP address                               */
/*     int mtu;               maximum transmission length              */
/*     int hwalen;            length of hardware address               */
/*     int flags;             intErface flags                          */
/*     int subnetaddr;        subnet mask                              */
/*     int dstipaddr;         destination ip address                   */
/*                                                                     */
/* See pSOSystem Programmer`s Reference Manual, Configuration Tables   */
/* Section, for more information about the Network Interface Table.    */
/* InstallNi() does not return a value.                                */
/*                                                                     */
/* If you are adding a driver that needs to be initialized before      */
/* either pSOS+ is initialized or the driver's init function is        */
/* called, then you can call a setup function (that you create) for    */
/* the driver. If your initialization function needs to allocate       */
/* memory, you may pass it the FreeMemPtr.  The function should return */
/* a new FreeMemPtr which points to the end of the memory it has       */
/* allocated.                                                          */
/*                                                                     */
/* When adding code to install a new driver, it is a good idea to add  */
/* precompile checks so errors can be found during compile-time rather */
/* then at run-time.  Precompile checks are used, for example, in the  */
/* code that installs the pSOSystem serial device driver below.        */
/*                                                                     */
/***********************************************************************/
UCHAR *SetUpNI(UCHAR *FreeMemPtr)
{
int IPaddr;
unsigned char B1,B2,B3,B4;

/*---------------------------------------------------------------------*/
/* Install the pSOSystem NI.                                           */
/*---------------------------------------------------------------------*/
#if BSP_LAN1
    if (SysVars.Lan1)
        {
        /*-------------------------------------------------------------*/
        /* If RARP is specified for the IP address, use it now to      */
        /* obtain the IP address for this interface.                   */
        /*-------------------------------------------------------------*/
        if (SysVars.Lan1IP == USE_RARP)
            {
            #if (SC_DEV_DLPI && SE_SHARE_NI)
                IPaddr = RarpEth((long (*)())DlpiEnet);
            #else
                IPaddr = RarpEth((long (*)())BSP_LAN1_ENTRY);
            #endif
            if (IPaddr == 0)
                SysInitFail(RarpErrTimeout);
            if (IPaddr == -1)
               SysInitFail(RarpErrNet);
            }
        else
		{
			/*---------------------------------------------------------*/
			/* 从FLASH中读出IP地址                                     */
			/*---------------------------------------------------------*/
			IPaddr=*(unsigned long *)(BD_FLASH_ADDR + 0xC);

			B1=(IPaddr&0xFF000000)>>24;
			B2=(IPaddr&0x00FF0000)>>16;
			B3=(IPaddr&0x0000FF00)>>8;
			B4=IPaddr&0x000000FF;

			/*----------------------------------------------------------*/
			/* 如果从FLASH中得到的IP地址是无效的,就取默认值            */
			/*----------------------------------------------------------*/
			if(((B1==0xFF)||(B2==0xFF)||(B3==0xFF))||IPaddr==0x00000000)
	            IPaddr = SysVars.Lan1IP;
	         
		}
 
        #if (SC_DEV_DLPI && SE_SHARE_NI)
            InstallNi((int (*)())DlpiEnet, IPaddr,
        #else
            InstallNi((int (*)())BSP_LAN1_ENTRY, IPaddr,
        #endif
                  BSP_LAN1_MTU, BSP_LAN1_HWALEN, BSP_LAN1_FLAGS,
                  SysVars.Lan1SubnetMask, 0);
        }
#endif

/*---------------------------------------------------------------------*/
/* Install the shared memory NI.                                       */
/*---------------------------------------------------------------------*/
#if BSP_SMEM
    #if ((SC_NISM_LEVEL != 1) && (SC_NISM_LEVEL != 2))
        #error "Illegal value for SC_NISM_LEVEL"
    #endif

    if (SysVars.Nism)
        {
        InstallNi((int (*)())NiSmem, SysVars.NismIP, NISM_MTU, 4, 0x8002,
                  SysVars.NismSubnetMask, 0);
        }
#endif
/*---------------------------------------------------------------------*/
/* Additional Network drivers may be installed here.                   */
/*---------------------------------------------------------------------*/

return FreeMemPtr;
}

#endif /* (SC_PNA || SC_PNET) */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -