📄 drv_conf.c
字号:
#error "SC_DEV_IDE cannot be > SC_DEVMAX" #endif InstallDriver(SC_DEV_IDE, IDEInit, NULLF, NULLF, IDERead, IDEWrite, IDECntrl, 0, 0, 0); PsosNumDntEnts += (4*5);#endif/*---------------------------------------------------------------------*//* Install the pSOSystem TFTP driver. *//* NOTE: This driver must be called from a task it cannot use the *//* auto initialization freature of pSOS+ *//*---------------------------------------------------------------------*/#if (SC_DEV_TFTP) #if(SC_DEV_TFTP > SC_DEVMAX) #error "SC_DEV_TFTP cannot be > SC_DEVMAX" #endif InstallDriver(SC_DEV_TFTP, TftpInit, TftpOpen, TftpClose, TftpRead, NULLF, TftpCntl, 0, 0, 0); PsosNumDntEnts += SC_MAX_TFTP_CHAN;#endif/*---------------------------------------------------------------------*//* Install the SPI driver *//* NOTE: This driver must be called from a task it cannot use the *//* auto initialization freature of pSOS+ *//*---------------------------------------------------------------------*/#if (SC_DEV_SPI) #if(SC_DEV_SPI > SC_DEVMAX) #error "SC_DEV_SPI cannot be > SC_DEVMAX" #endif InstallDriver(SC_DEV_SPI, SPI_init, SPI_open, SPI_close, NULLF, NULLF, SPI_io, 0, 0, 0); PsosNumDntEnts++;#endif/*---------------------------------------------------------------------*//* Install DLPI drivers *//*---------------------------------------------------------------------*/#if (SC_DEV_DLPI || SC_DEV_PPP || SC_DEV_SLIP) {#include "enetcfg.h"int dlpi_setinitroutine = 0;int dlpi_nicount = 0; /* number of ni's below this DLPI */ void (*init_fn)(); /* Ethernet driver initialization routine */ /* Call this function only once */char *DlpiErrMsg = "DlpiAddNI failed: NI Error";#if (SC_DEV_DLPI) { #if(SC_DEV_DLPI> SC_DEVMAX) #error "SC_DEV_DLPI cannot be > SC_DEVMAX" #endif static const psedrvparam_t eth0param = {"eth0", DT_CLONE, &enetinfo, 0, 0}; init_fn = NULLF; if (!dlpi_setinitroutine) { init_fn = (void (*)())enetinit; dlpi_setinitroutine = 1; } InstallDriver(SC_DEV_DLPI, init_fn, NULLF, NULLF, NULLF, NULLF, NULLF, (long)ð0param, 0, 0); dlpi_nicount++; PsosNumDntEnts++; }#endif /* SC_DEV_DLPI */#if SC_DEV_DLPI_PPP { #if(SC_DEV_DLPI_PPP > SC_DEVMAX) #error "SC_DEV_DLPI_PPP cannot be > SC_DEVMAX" #endif static const psedrvparam_t pppparam = {"ppp", DT_CLONE, &enetinfo, 0, 0}; init_fn = NULLF; if (!dlpi_setinitroutine) { init_fn = (void (*)())enetinit; dlpi_setinitroutine = 1; } InstallDriver(SC_DEV_DLPI_PPP, init_fn, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&pppparam, 0, 0); dlpi_nicount++; PsosNumDntEnts++; }#endif /* SC_DEV_DLPI_PPP */#if SC_DEV_DLPI_SLIP { #if(SC_DEV_DLPI_SLIP > SC_DEVMAX) #error "SC_DEV_DLPI_SLIP cannot be > SC_DEVMAX" #endif static const psedrvparam_t slipparam = {"slip", DT_CLONE, &enetinfo, 0, 0}; init_fn = NULLF; if (!dlpi_setinitroutine) { init_fn = (void (*)())enetinit; dlpi_setinitroutine = 1; } InstallDriver(SC_DEV_DLPI_SLIP, init_fn, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&slipparam, 0, 0, 0); dlpi_nicount++; PsosNumDntEnts++; }#endif /* SC_DEV_DLPI_SLIP *//* * User has defined other DLPI drivers locally. Include user * file drv_conf.idl that installs user's own ENETDLPI drivers */#if SC_DEV_DLPI_OTHER#include "drv_conf.idl"#endif /*-------------------------------------------------------------*/ /* Call DlpiInit to initialize the Streams DLPI driver */ /* Arguments passed to DlpiInit are: */ /* 1. Free memory address */ /* 2. Maximum NI interface number */ /* 3. Maximum number of streams per interface */ /*-------------------------------------------------------------*/ FreeMemPtr = DlpiInit(FreeMemPtr, dlpi_nicount, SE_DLPI_MAXSTR_PERNI); /*-------------------------------------------------------------*/ /* Call DlpiAddNI to add an NI interface to the Streams DLPI */ /* driver. DlpiAddNI must be called for each NI driver */ /* interface used with the Streams DLPI driver. */ /* Arguments passed to DlpiAddNI are: */ /* 1. NI interface number (should correspond to the pNA+ */ /* interface number if driver is shared with pNA+) */ /* 2. NI entry point */ /* 3. NI flags */ /* DLPI_IFF_SELFLOOP 0x0001 loopback for selfaddress */ /* DLPI_IFF_POLL_NI 0x0002 driver must be polled */ /* DLPI_IFF_RAWMEM 0x2000 driver accepts mblk */ /* DLPI_IFF_NONIINIT 0x4000 Don't send NI_INIT */ /* during enetinit() call */ /* 4. NI major device number */ /* 5. NI multicast address (NOT SUPPORTED) */ /* 6. NI poll frequency (every # of elapsed ticks) */ /*-------------------------------------------------------------*/#if (SC_DEV_DLPI) /* * If this lan NI is not shared, use a loopback DLPI with interface * number 0. NI entry point is set to DlpiNullNI(). */#if (SE_SHARE_NI) if (DlpiAddNI(SE_DLPI_ETH_IFNO, (long(*)())BSP_LAN1_ENTRY, SE_DLPI_ETH_IFFLAGS, SC_DEV_DLPI, 0, SE_DLPI_ETH_POLLFREQ)) SysInitFail(DlpiErrMsg);#else if (DlpiAddNI(0, (long(*)())DlpiNullNI, 0, SC_DEV_DLPI, 0, 0)) SysInitFail(DlpiErrMsg);#endif /* SE_SHARE_NI */#endif /* SC_DEV_DLPI */#if (SC_DEV_DLPI_PPP) if (DlpiAddNI(SE_DLPI_PPP_IFNO, SE_DLPI_PPP_ENTRY, SE_DLPI_PPP_IFFLAGS, SC_DEV_DLPI_PPP, 0, SE_DLPI_PPP_POLLFREQ)) SysInitFail(DlpiErrMsg); if (DlpiAddParams(SE_DLPI_PPP_IFNO, SE_DLPI_PPP_ADDRSIZE, SE_DLPI_PPP_MAXMTU, SE_DLPI_PPP_MINMTU, (char *)NULL)) SysInitFail(DlpiErrMsg);#endif /* SC_DEV_DLPI_PPP */#if (SC_DEV_DLPI_SLIP) if (DlpiAddNI(SE_DLPI_SLIP_IFNO,SE_DLPI_SLIP_ENTRY, SE_DLPI_SLIP_IFFLAGS, SC_DEV_DLPI_SLIP, 0, SE_DLPI_SLIP_POLLFREQ)) SysInitFail(DlpiErrMsg); if (DlpiAddParams(SE_DLPI_SLIP_IFNO, SE_DLPI_SLIP_ADDRSIZE, SE_DLPI_SLIP_MAXMTU, SE_DLPI_SLIP_MINMTU, (char *)NULL)) SysInitFail(DlpiErrMsg);#endif /* SC_DEV_DLPI_SLIP *//* * User has defined other DLPI drivers locally. Include user * file drv_conf.adl that adds user Dlpi drivers to the system. */#if SC_DEV_DLPI_OTHER#include "drv_conf.adl"#endif }#endif /* (SC_DEV_DLPI || SC_DEV_PPP || SC_DEV_SLIP) */#if (SC_DEV_LOG) { extern void loginit(); extern struct streamtab loginfo; static const psedrvparam_t log_drv = {"log", DT_CLONE, &loginfo, 0, 0}; InstallDriver(SC_DEV_LOG, loginit, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&log_drv, 0, 0); PsosNumDntEnts++; }#endif/*-------------------------------------------------------------------*//* Install pSOSystem Watchdog driver *//*-------------------------------------------------------------------*/#if (SC_DEV_WATCHDOG) #if(SC_DEV_WATCHDOG > SC_DEVMAX) #error "SC_DEV_WATCHDOG cannot be > SC_DEVMAX" #endif InstallDriver(SC_DEV_WATCHDOG, WdtInit, NULLF, NULLF, NULLF, NULLF, NULLF, 0, 0, 0); PsosNumDntEnts++;#endif#if (SC_DEV_OTCP) {extern void otcp_ipspace_init(), otcp_arpspace_init(), otcp_rawspace_init(), otcp_udpspace_init(), otcp_tcpspace_init(), otcp_loopspace_init();extern struct streamtab otcp_ipinfo, otcp_arpinfo, otcp_rawinfo, otcp_udpinfo, otcp_tcpinfo, otcp_loopinfo;#if (SC_IP) static const psedrvparam_t ip_drv = {"ip", DT_CLONE, &otcp_ipinfo, 0, 0};#endif#if (SC_ARP) static const psedrvparam_t arp_drv = {"arp", DT_CLONE, &otcp_arpinfo, 0, 0};#endif#if (SC_TCP) static const psedrvparam_t tcp_drv = {"tcp", DT_CLONE, &otcp_tcpinfo, 0, 0};#endif#if (SC_UDP) static const psedrvparam_t udp_drv = {"udp", DT_CLONE, &otcp_udpinfo, 0, 0};#endif#if (SC_RAW) static const psedrvparam_t raw_drv = {"raw", DT_CLONE, &otcp_rawinfo, 0, 0};#endif#if (SC_LOOP) static const psedrvparam_t loop_drv = {"loop", DT_CLONE, &otcp_loopinfo, 0, 0};#endif#if (SC_IP) InstallDriver(SC_IP, otcp_ipspace_init, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&ip_drv, 0, 0); PsosNumDntEnts++;#endif#if (SC_ARP) InstallDriver(SC_ARP, otcp_arpspace_init, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&arp_drv, 0, 0); PsosNumDntEnts++;#endif#if (SC_RAW) InstallDriver(SC_RAW, otcp_rawspace_init, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&raw_drv, 0, 0); PsosNumDntEnts++;#endif#if (SC_UDP) InstallDriver(SC_UDP, otcp_udpspace_init, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&udp_drv, 0, 0); PsosNumDntEnts++;#endif#if (SC_TCP) InstallDriver(SC_TCP, otcp_tcpspace_init, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&tcp_drv, 0, 0); PsosNumDntEnts++;#endif#if (SC_LOOP) InstallDriver(SC_LOOP, otcp_loopspace_init, NULLF, NULLF, NULLF, NULLF, NULLF, (long)&loop_drv, 0, 0); PsosNumDntEnts++;#endif }#endif /* (SC_DEV_OTCP) */#if (SC_DEV_OLAP) { extern struct streamtab phpiinfo, twfrinfo ; extern void phpiinit(), twfrinit();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -