From: Alan Cox Date: Fri, 7 Sep 2018 01:32:56 +0000 (+0100) Subject: sbcv2: turn on networking support options X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b95eec0ddb25ee060c72c1497a45d3c719d0da43;p=FUZIX.git sbcv2: turn on networking support options --- diff --git a/Kernel/platform-sbcv2/Makefile b/Kernel/platform-sbcv2/Makefile index 46109a8a..2b8e51b9 100644 --- a/Kernel/platform-sbcv2/Makefile +++ b/Kernel/platform-sbcv2/Makefile @@ -1,4 +1,4 @@ -CROSS_CCOPTS += -I../dev/ +CROSS_CCOPTS += -I../dev/ -I../dev/net/ CSRCS = devtty.c @@ -13,11 +13,10 @@ DISCARD_DSRCS = ../dev/devide_discard.c DSRCS = ../dev/blkdev.c ../dev/devide.c ../dev/mbr.c ../dev/ds1302_discard.c DSRCS += ../dev/propio2.c ../dev/ds1302.c DSRCS += ../dev/devfd.c ../dev/ppide_rbc.c +NSRCS = ../dev/net/net_wiznet.c ../dev/net/net_native.c DASRCS = ../dev/rbcfd9266_hw.s ../dev/ds1302_rbc.s -NSRCS = - COBJS = $(CSRCS:.c=.rel) AOBJS = $(ASRCS:.s=.rel) NOBJS = $(patsubst ../dev/net/%.c,%.rel, $(NSRCS)) diff --git a/Kernel/platform-sbcv2/config.h b/Kernel/platform-sbcv2/config.h index 7f804c9f..91e8fe80 100644 --- a/Kernel/platform-sbcv2/config.h +++ b/Kernel/platform-sbcv2/config.h @@ -98,6 +98,13 @@ extern unsigned int swap_dev; */ #define TICKSPERSEC 10 /* Ticks per second */ +/* Core networking support */ +#define CONFIG_NET +/* With a WizNet card */ +#define CONFIG_NET_WIZNET +/* Or native (eg SLIP) */ +//#define CONFIG_NET_NATIVE + /* * The device (major/minor) for the console and boot up tty attached to * init at start up. 512 is the major 2, so all the tty devices are diff --git a/Kernel/platform-sbcv2/discard.c b/Kernel/platform-sbcv2/discard.c index 2df9d4b2..127dcf5b 100644 --- a/Kernel/platform-sbcv2/discard.c +++ b/Kernel/platform-sbcv2/discard.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include extern int strcmp(const char *, const char *); @@ -90,4 +90,5 @@ void device_init(void) devide_init(); prop_sd_probe(); ds1302_init(); + sock_init(); } diff --git a/Kernel/platform-sbcv2/fuzix.lnk b/Kernel/platform-sbcv2/fuzix.lnk index 853a4ff1..2cbf8aab 100644 --- a/Kernel/platform-sbcv2/fuzix.lnk +++ b/Kernel/platform-sbcv2/fuzix.lnk @@ -27,6 +27,7 @@ syscall_fs2.rel syscall_fs3.rel syscall_proc.rel syscall_other.rel +syscall_net.rel tty.rel mm.rel swap.rel @@ -44,4 +45,6 @@ platform-sbcv2/ds1302_discard.rel platform-sbcv2/ds1302_rbc.rel platform-sbcv2/devfd.rel platform-sbcv2/rbcfd9266_hw.rel +platform-sbcv2/net_native.rel +platform-sbcv2/net_wiznet.rel -e diff --git a/Kernel/platform-sbcv2/main.c b/Kernel/platform-sbcv2/main.c index fdb4e2f0..e4df431f 100644 --- a/Kernel/platform-sbcv2/main.c +++ b/Kernel/platform-sbcv2/main.c @@ -5,6 +5,7 @@ #include #include #include +#include uint16_t ramtop = PROGTOP; uint16_t swap_dev = 0xFFFF; @@ -42,6 +43,9 @@ void platform_idle(void) void platform_interrupt(void) { tty_poll(); +#ifdef CONFIG_NET_WIZNET + wiz_poll(); +#endif } /* This points to the last buffer in the disk buffers. There must be at least