From b0a26dddd7ec52bb8a5b25e75638b493b69d02c3 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 20 Oct 2000 13:07:29 +0000 Subject: 2000-10-20 Joel Sherrill * include/bsp.h: Cleaned up network driver name and attach defines. --- c/src/lib/libbsp/i386/pc386/ChangeLog | 42 +++++++++++++++++++++++++++++++ c/src/lib/libbsp/i386/pc386/include/bsp.h | 22 ++++++++-------- 2 files changed, 54 insertions(+), 10 deletions(-) diff --git a/c/src/lib/libbsp/i386/pc386/ChangeLog b/c/src/lib/libbsp/i386/pc386/ChangeLog index f6c2295cc4..c7d3fa7edb 100644 --- a/c/src/lib/libbsp/i386/pc386/ChangeLog +++ b/c/src/lib/libbsp/i386/pc386/ChangeLog @@ -1,3 +1,45 @@ +2000-10-20 Joel Sherrill + + * include/bsp.h: Cleaned up network driver name and attach defines. + +2000-10-20 Dmitry Kargapolov + + * ne2000/ne2000.c: Fix some errors in the driver. + 1. There was no sufficient check of data in ethernet header. + The code in ne_rx_daemon() was: + inport_word (dport, len); + ... + len -= 4; + ... + if (len > 0) + ne_read_data (sc, startaddr, len, p); + Unfortunately, sometimes my NIC gave me too big len value, + the result was memory override. To fix this, I added ethernet + header data checking. + + 2. The way overrides were serviced was not good. It was complex + but sometimes did not provide reliable continuing of NIC working. + I had the situation of an endless loop in ne_check_status() + after override processing. + + 3. There was conceptual error of porting. The old method of + overrides curing was ported from the OS-s, where override-processing + did start immediately. But RTEMS-version uses events, and cleaning + of the overrides can start later. + + I selected the way of ne2000 programming that is used + in freebsd kernel (v4.0). + + Because of both problems, incorrect data in header of raw packet + and receiver override, it went through ne_reset() and fully + reset the ne2000. + + So, in summary + - added detecting of the incorrect data in ethernet header; + - replaced handling of receiver overrides with new scheme, + via resetting of NIC, this method is used also in case of + invalid header detecting. + 2000-10-18 Charles-Antoine Gauthier * console/console.c, console/serial_mouse.c, include/bsp.h: diff --git a/c/src/lib/libbsp/i386/pc386/include/bsp.h b/c/src/lib/libbsp/i386/pc386/include/bsp.h index 90d5e407b1..c152152fb7 100644 --- a/c/src/lib/libbsp/i386/pc386/include/bsp.h +++ b/c/src/lib/libbsp/i386/pc386/include/bsp.h @@ -72,19 +72,21 @@ extern "C" { */ struct rtems_bsdnet_ifconfig; -extern int rtems_wd_driver_attach (struct rtems_bsdnet_ifconfig *config); -extern int rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config); -#if 0 -#define RTEMS_BSP_NETWORK_DRIVER_NAME "wd1" -#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_wd_driver_attach -#endif +extern int rtems_ne_driver_attach(struct rtems_bsdnet_ifconfig *, int); +#define BSP_NE2000_NETWORK_DRIVER_NAME "ne1" +#define BSP_NE2000_NETWORK_DRIVER_ATTACH rtems_ne_driver_attach -#if 1 -#define RTEMS_BSP_NETWORK_DRIVER_NAME "dc1" -#define RTEMS_BSP_NETWORK_DRIVER_ATTACH rtems_dec21140_driver_attach -#endif +extern int rtems_wd_driver_attach(struct rtems_bsdnet_ifconfig *, int); +#define BSP_WD8003_NETWORK_DRIVER_NAME "wd1" +#define BSP_WD8003_NETWORK_DRIVER_ATTACH rtems_wd_driver_attach + +extern int rtems_dec21140_driver_attach(struct rtems_bsdnet_ifconfig *, int); +#define BSP_DEC21140_NETWORK_DRIVER_NAME "dc1" +#define BSP_DEC21140_NETWORK_DRIVER_ATTACH rtems_dec21140_driver_attach +#define RTEMS_BSP_NETWORK_DRIVER_NAME BSP_DEC21140_NETWORK_DRIVER_NAME +#define RTEMS_BSP_NETWORK_DRIVER_ATTACH BSP_DEC21140_NETWORK_DRIVER_ATTACH /*-------------------------------------------------------------------------+ | Constants -- cgit v1.2.3