|
|
1.1 root 1: /* netinit.c - netinit */
2:
3: #include <conf.h>
4: #include <kernel.h>
1.1.1.2 ! root 5: #include <frame.h>
! 6:
! 7: #ifndef RING0IN
! 8: #define RING0IN -1
! 9: #endif
! 10: #ifndef RING0OUT
! 11: #define RING0OUT -1
! 12: #endif
! 13: #ifndef RING1IN
! 14: #define RING1IN -1
! 15: #endif
! 16: #ifndef RING1OUT
! 17: #define RING1OUT -1
! 18: #endif
! 19: #ifndef NNETS
! 20: #define NNETS 0
! 21: #endif
! 22:
! 23: #define MAXNETS 2 /* maximum nets assigned in netdevs */
! 24: static int netdevs[][MAXNETS]
! 25: = {RING0IN,RING0OUT,RING1IN,RING1OUT};
1.1 root 26:
27: /*------------------------------------------------------------------------
1.1.1.2 ! root 28: * netinit -- iniitalize networks by starting frame level I/O
1.1 root 29: *------------------------------------------------------------------------
30: */
31: netinit()
32: {
1.1.1.2 ! root 33: int netid;
1.1 root 34:
1.1.1.2 ! root 35: if (NNETS > MAXNETS)
! 36: panic("netinit - too few devices to netdevs table");
! 37: frbpool = mkpool(FRLEN, NFRAMES);
! 38: for (netid=0 ; netid<NNETS ; netid++)
! 39: frinit(netid, netdevs[netid][0] , netdevs[netid][1]);
1.1 root 40: return(OK);
41: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.