diff options
author | Chris Johns <chrisj@rtems.org> | 2009-10-15 06:30:08 +0000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2009-10-15 06:30:08 +0000 |
commit | 4c397641a8c4b10e5e2cdb291d98edd90a0b18e7 (patch) | |
tree | 5cde6d7af83415c8d1be2d5e426ad84b1cc54149 /c/src/lib/libbsp/i386/pc386/ne2000 | |
parent | Remove (Moved to c/src/lib/libbsp/<cpu>/<bsp>). (diff) | |
download | rtems-4c397641a8c4b10e5e2cdb291d98edd90a0b18e7.tar.bz2 |
2009-10-15 Chris Johns <chrisj@rtems.org>
* ne2000/ne2000.c: Add --ne2k-irq and --ne2k-port boot command
line configure options.
* ide/ide.c: Fix a bug which left 4 words in the buffer of the
disk. Some devices do not follow the standard and terminate the
command which a new command occurs and/or low data ready when data
is still to be read.
Diffstat (limited to 'c/src/lib/libbsp/i386/pc386/ne2000')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c index 2c5484cd01..6abec3d12e 100644 --- a/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c +++ b/c/src/lib/libbsp/i386/pc386/ne2000/ne2000.c @@ -33,6 +33,7 @@ #include <wd80x3.h> #include <stdio.h> +#include <stdlib.h> #include <assert.h> #include <errno.h> @@ -1189,15 +1190,31 @@ rtems_ne_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach) if (config->irno != 0) sc->irno = config->irno; else { - /* We use 5 as the default IRQ. */ - sc->irno = 5; + const char* opt; + opt = bsp_cmdline_arg ("--ne2k-irq="); + if (opt) { + opt += sizeof ("--ne2k-irq=") - 1; + sc->irno = strtoul (opt, 0, 0); + } + if (sc->irno == 0) { + /* We use 5 as the default IRQ. */ + sc->irno = 5; + } } if (config->port != 0) sc->port = config->port; else { - /* We use 0x300 as the default IO port number. */ - sc->port = 0x300; + const char* opt; + opt = bsp_cmdline_arg ("--ne2k-port="); + if (opt) { + opt += sizeof ("--ne2k-port=") - 1; + sc->port = strtoul (opt, 0, 0); + } + if (config->port != 0) { + /* We use 0x300 as the default IO port number. */ + sc->port = 0x300; + } } sc->accept_broadcasts = ! config->ignore_broadcast; |