summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/i386ex
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2004-04-21 10:43:04 +0000
commit6128a4aa5e791ed4e0a655bfd346a52d92da7883 (patch)
treeaf53ca3f67ce405b6fbc6c98399c8e0c87e01a9e /c/src/lib/libbsp/i386/i386ex
parent2004-04-20 Ralf Corsepius <ralf_corsepius@rtems.org> (diff)
downloadrtems-6128a4aa5e791ed4e0a655bfd346a52d92da7883.tar.bz2
Remove stray white spaces.
Diffstat (limited to 'c/src/lib/libbsp/i386/i386ex')
-rw-r--r--c/src/lib/libbsp/i386/i386ex/clock/ckinit.c32
-rw-r--r--c/src/lib/libbsp/i386/i386ex/console/console.c92
-rw-r--r--c/src/lib/libbsp/i386/i386ex/include/bsp.h8
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/netexterns.h2
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/network.c738
-rw-r--r--c/src/lib/libbsp/i386/i386ex/network/uti596.h24
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/80386ex.h2
-rw-r--r--c/src/lib/libbsp/i386/i386ex/start/start.S218
-rw-r--r--c/src/lib/libbsp/i386/i386ex/startup/bspstart.c8
-rw-r--r--c/src/lib/libbsp/i386/i386ex/timer/timer.c4
10 files changed, 564 insertions, 564 deletions
diff --git a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c b/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
index 0bece0732a..20d50a35e0 100644
--- a/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
+++ b/c/src/lib/libbsp/i386/i386ex/clock/ckinit.c
@@ -41,7 +41,7 @@ void Clock_exit( void );
/*
* These are set by clock driver during its init
*/
-
+
rtems_device_major_number rtems_clock_major = ~0;
rtems_device_major_number rtems_clock_minor = 0;
@@ -91,28 +91,28 @@ rtems_device_driver Clock_initialize(
{
unsigned timer_counter_init_value;
unsigned char clock_lsb, clock_msb;
-
+
Clock_driver_ticks = 0;
- Clock_isrs =
- Clock_initial_isr_value =
+ Clock_isrs =
+ Clock_initial_isr_value =
BSP_Configuration.microseconds_per_tick / 1000; /* ticks per clock_isr */
-
+
/*
* configure the counter timer ( should be based on microsecs/tick )
* NB. The divisor(Clock_isrs) resolves the is the same number that appears in confdefs.h
* when setting the microseconds_per_tick value.
*/
ClockOff ( &clockIrqData );
-
+
timer_counter_init_value = BSP_Configuration.microseconds_per_tick / Clock_isrs;
clock_lsb = (unsigned char)timer_counter_init_value;
clock_msb = timer_counter_init_value >> 8;
-
- outport_byte ( TMRCON , 0x34 );
+
+ outport_byte ( TMRCON , 0x34 );
outport_byte ( TMR0 , clock_lsb ); /* load LSB first */
outport_byte ( TMR0 , clock_msb ); /* then MSB */
-
+
if (!BSP_install_rtems_irq_handler (&clockIrqData)) {
printk("Unable to initialize system clock\n");
rtems_fatal_error_occurred(1);
@@ -121,10 +121,10 @@ rtems_device_driver Clock_initialize(
/*
* make major/minor avail to others such as shared memory driver
*/
-
+
rtems_clock_major = major;
rtems_clock_minor = minor;
-
+
return RTEMS_SUCCESSFUL;
}
@@ -135,15 +135,15 @@ rtems_device_driver Clock_control(
)
{
rtems_libio_ioctl_args_t *args = pargp;
-
+
if (args == 0)
goto done;
-
+
/*
* This is hokey, but until we get a defined interface
* to do this, it will just be this simple...
*/
-
+
if (args->command == rtems_build_name('I', 'S', 'R', ' '))
{
Clock_isr();
@@ -159,13 +159,13 @@ rtems_device_driver Clock_control(
printk("Clock installed AGAIN\n");
#endif
}
-
+
done:
return RTEMS_SUCCESSFUL;
}
void Clock_exit()
{
- ClockOff(&clockIrqData);
+ ClockOff(&clockIrqData);
BSP_remove_rtems_irq_handler (&clockIrqData);
}
diff --git a/c/src/lib/libbsp/i386/i386ex/console/console.c b/c/src/lib/libbsp/i386/i386ex/console/console.c
index 651735cefa..628f0027b5 100644
--- a/c/src/lib/libbsp/i386/i386ex/console/console.c
+++ b/c/src/lib/libbsp/i386/i386ex/console/console.c
@@ -1,7 +1,7 @@
/*-------------------------------------------------------------------------+
| console.c v1.1 - i386ex BSP - 1997/08/07
+--------------------------------------------------------------------------+
-| This file contains the i386ex console I/O package. It is just a termios
+| This file contains the i386ex console I/O package. It is just a termios
| wrapper.
+--------------------------------------------------------------------------+
| (C) Copyright 1997 -
@@ -48,7 +48,7 @@
* Possible value for console input/output :
* BSP_UART_COM1
* BSP_UART_COM2
- * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
+ * BSP_CONSOLE_PORT_CONSOLE is not valid in this BSP.
* All references to either keyboard or video handling have been removed.
*/
@@ -67,7 +67,7 @@ static int isr_is_on(const rtems_irq_connect_data *);
* Change references to com2 if required.
*/
-static rtems_irq_connect_data console_isr_data =
+static rtems_irq_connect_data console_isr_data =
{ BSP_UART_COM2_IRQ,
BSP_uart_termios_isr_com2,
isr_on,
@@ -79,7 +79,7 @@ isr_on(const rtems_irq_connect_data *unused)
{
return;
}
-
+
static void
isr_off(const rtems_irq_connect_data *unused)
{
@@ -108,21 +108,21 @@ console_initialize(rtems_device_major_number major,
* Set up TERMIOS
*/
rtems_termios_initialize ();
-
+
/*
* Do device-specific initialization
*/
-
+
/* 9600-8-N-1, no hardware flow control */
BSP_uart_init(BSPConsolePort, 9600, CHR_8_BITS, 0, 0, 0);
-
-
+
+
/* Set interrupt handler */
if(BSPConsolePort == BSP_UART_COM1)
{
console_isr_data.name = BSP_UART_COM1_IRQ;
console_isr_data.hdl = BSP_uart_termios_isr_com1;
-
+
}
else
{
@@ -130,9 +130,9 @@ console_initialize(rtems_device_major_number major,
console_isr_data.name = BSP_UART_COM2_IRQ;
console_isr_data.hdl = BSP_uart_termios_isr_com2;
}
-
+
status = BSP_install_rtems_irq_handler(&console_isr_data);
-
+
if (!status){
printk("Error installing serial console interrupt handler!\n");
rtems_fatal_error_occurred(status);
@@ -146,7 +146,7 @@ console_initialize(rtems_device_major_number major,
printk("Error registering console device!\n");
rtems_fatal_error_occurred (status);
}
-
+
if(BSPConsolePort == BSP_UART_COM1)
{
printk("Initialized console on port COM1 9600-8-N-1\n\n");
@@ -176,7 +176,7 @@ console_open(rtems_device_major_number major,
void *arg)
{
rtems_status_code status;
- static rtems_termios_callbacks cb =
+ static rtems_termios_callbacks cb =
{
NULL, /* firstOpen */
console_last_close, /* lastClose */
@@ -204,9 +204,9 @@ console_open(rtems_device_major_number major,
/*
* Pass data area info down to driver
*/
- BSP_uart_termios_set(BSPConsolePort,
+ BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
-
+
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
@@ -223,10 +223,10 @@ console_close(rtems_device_major_number major,
{
return (rtems_termios_close (arg));
-
+
} /* console_close */
-
+
/*-------------------------------------------------------------------------+
| Console device driver READ entry point.
+--------------------------------------------------------------------------+
@@ -248,7 +248,7 @@ console_read(rtems_device_major_number major,
return sc;
} /* console_read */
-
+
/*-------------------------------------------------------------------------+
| Console device driver WRITE entry point.
@@ -261,20 +261,20 @@ console_write(rtems_device_major_number major,
void * arg)
{
return rtems_termios_write (arg);
-
+
} /* console_write */
-
+
/*
* Handle ioctl request.
*/
-rtems_device_driver
+rtems_device_driver
console_control(rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg
)
-{
+{
return rtems_termios_ioctl (arg);
}
@@ -283,45 +283,45 @@ conSetAttr(int minor, const struct termios *t)
{
int baud;
- switch (t->c_cflag & CBAUD)
+ switch (t->c_cflag & CBAUD)
{
- case B50:
+ case B50:
baud = 50;
break;
- case B75:
- baud = 75;
+ case B75:
+ baud = 75;
break;
- case B110:
- baud = 110;
+ case B110:
+ baud = 110;
break;
- case B134:
- baud = 134;
+ case B134:
+ baud = 134;
break;
- case B150:
- baud = 150;
+ case B150:
+ baud = 150;
break;
case B200:
- baud = 200;
+ baud = 200;
break;
- case B300:
+ case B300:
baud = 300;
break;
- case B600:
- baud = 600;
+ case B600:
+ baud = 600;
break;
- case B1200:
+ case B1200:
baud = 1200;
break;
- case B1800:
- baud = 1800;
+ case B1800:
+ baud = 1800;
break;
- case B2400:
+ case B2400:
baud = 2400;
break;
- case B4800:
+ case B4800:
baud = 4800;
break;
- case B9600:
+ case B9600:
baud = 9600;
break;
case B19200:
@@ -330,7 +330,7 @@ conSetAttr(int minor, const struct termios *t)
case B38400:
baud = 38400;
break;
- case B57600:
+ case B57600:
baud = 57600;
break;
case B115200:
@@ -351,13 +351,13 @@ conSetAttr(int minor, const struct termios *t)
* BSP initialization
*/
-BSP_output_char_function_type BSP_output_char =
+BSP_output_char_function_type BSP_output_char =
(BSP_output_char_function_type) BSP_output_char_via_serial;
-BSP_polling_getchar_function_type BSP_poll_char =
+BSP_polling_getchar_function_type BSP_poll_char =
(BSP_polling_getchar_function_type) BSP_poll_char_via_serial;
int BSP_poll_read(int ttyMinor){
-
+
return BSP_poll_char_via_serial();
}
diff --git a/c/src/lib/libbsp/i386/i386ex/include/bsp.h b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
index c7c41dfa99..535bc1f3bd 100644
--- a/c/src/lib/libbsp/i386/i386ex/include/bsp.h
+++ b/c/src/lib/libbsp/i386/i386ex/include/bsp.h
@@ -27,7 +27,7 @@ extern "C" {
#include <rtems/bspIo.h>
#include <libcpu/cpu.h>
#include <irq.h>
-
+
/*
* confdefs.h overrides for this BSP:
* - number of termios serial ports (defaults to 1)
@@ -120,15 +120,15 @@ extern "C" {
/*
* Device Driver Table Entries
*/
-
+
/*
* NOTE: Use the standard Console driver entry
*/
-
+
/*
* NOTE: Use the standard Clock driver entry
*/
-
+
/* miscellaneous stuff assumed to exist */
extern rtems_configuration_table BSP_Configuration;
diff --git a/c/src/lib/libbsp/i386/i386ex/network/netexterns.h b/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
index 76259b7bae..4ad43f2231 100644
--- a/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
+++ b/c/src/lib/libbsp/i386/i386ex/network/netexterns.h
@@ -11,7 +11,7 @@
extern int uti596_attach(struct rtems_bsdnet_ifconfig *);
extern int uti596dump(char * );
-extern void uti596reset(void);
+extern void uti596reset(void);
extern void uti596Diagnose(int);
extern void uti596_request_reset(void);
diff --git a/c/src/lib/libbsp/i386/i386ex/network/network.c b/c/src/lib/libbsp/i386/i386ex/network/network.c
index dc30a97703..f15873928d 100644
--- a/c/src/lib/libbsp/i386/i386ex/network/network.c
+++ b/c/src/lib/libbsp/i386/i386ex/network/network.c
@@ -7,7 +7,7 @@ void dump_scb(void);
void printk_time(void);
#ifdef DBG_VERSION
-#define BREAKPOINT() asm(" int $3");
+#define BREAKPOINT() asm(" int $3");
#else
#define BREAKPOINT()
#endif
@@ -16,7 +16,7 @@ void printk_time(void);
/*
-
+
EII: Oct 16 : Version 0.0
*/
@@ -25,9 +25,9 @@ void printk_time(void);
#define DMA_MASK_REG 0x0A
#define DMA_MODE_REG 0x0B
#define DMA_ENABLE 0x0
-#define DMA_DISABLE 0x4
+#define DMA_DISABLE 0x4
-struct i596_rfd *pISR_Rfd;
+struct i596_rfd *pISR_Rfd;
void show_buffers (void);
void show_queues(void);
@@ -111,7 +111,7 @@ char uti596initSetup[] = {
/* These are extern, and non-inline for testing purposes */
void uti596addCmd (struct i596_cmd *pCmd);
-void uti596_initMem (struct uti596_softc *);
+void uti596_initMem (struct uti596_softc *);
void uti596_init (void * );
int uti596initRxBufs (int num);
int uti596_initRFA (int num);
@@ -139,7 +139,7 @@ void uti596addPolledCmd(struct i596_cmd *);
void uti596supplyFD(struct i596_rfd *);
struct i596_rfd * uti596dequeue( struct i596_rfd ** );
-void uti596append( struct i596_rfd ** , struct i596_rfd * );
+void uti596append( struct i596_rfd ** , struct i596_rfd * );
#ifdef DEBUG_INIT
static void print_eth (unsigned char *);
@@ -167,7 +167,7 @@ void send_packet(struct ifnet *, struct mbuf *);
}
/*************************************************************************/
-void
+void
uti596_request_reset(void){
rtems_status_code sc;
@@ -225,7 +225,7 @@ int uti596_initRFA(int num)
printf ("%s: uti596_initRFA %d.\n", num);
#endif
- /*
+ /*
* Initialize the first rfd in the rfa
*/
pRfd = (struct i596_rfd *) calloc (1,sizeof (struct i596_rfd));
@@ -236,7 +236,7 @@ int uti596_initRFA(int num)
else {
uti596_softc.countRFD = 1;
uti596_softc.pBeginRFA = uti596_softc.pEndRFA = pRfd;
- printf ( "First Rfd allocated is: %p\n",
+ printf ( "First Rfd allocated is: %p\n",
uti596_softc.pBeginRFA);
}
@@ -244,31 +244,31 @@ int uti596_initRFA(int num)
pRfd = (struct i596_rfd *) calloc (1,sizeof (struct i596_rfd) );
if ( pRfd != NULL ) {
uti596_softc.countRFD++;
- uti596_softc.pEndRFA -> next = pRfd; /* link it in */
+ uti596_softc.pEndRFA -> next = pRfd; /* link it in */
uti596_softc.pEndRFA = pRfd; /* move the end */
#ifdef DBG_596_RFA
printf("Allocated RFD @ %p\n", pRfd);
#endif
}
- else {
+ else {
printf("Can't allocate all buffers: only %d allocated\n", i);
break;
}
} /* end for */
-
+
uti596_softc.pEndRFA -> next = I596_NULL;
- UTI_596_ASSERT(uti596_softc.countRFD == RX_BUF_COUNT,"INIT:WRONG RFD COUNT\n" );
-
+ UTI_596_ASSERT(uti596_softc.countRFD == RX_BUF_COUNT,"INIT:WRONG RFD COUNT\n" );
+
#ifdef DBG_596_RFA
- printf ( "Head of RFA is buffer %p\nEnd of RFA is buffer %p \n",
- uti596_softc.pBeginRFA,
+ printf ( "Head of RFA is buffer %p\nEnd of RFA is buffer %p \n",
+ uti596_softc.pBeginRFA,
uti596_softc.pEndRFA );
#endif
/* initialize the Rfd's */
for ( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL;
pRfd = pRfd -> next ) {
-
+
pRfd->cmd = 0x0000;
pRfd->stat = 0x0000;
pRfd->pRbd = I596_NULL;
@@ -278,7 +278,7 @@ int uti596_initRFA(int num)
printf("Can't allocate the RFD data buffer\n");
}
- /* mark the last FD */
+ /* mark the last FD */
uti596_softc.pEndRFA -> cmd = CMD_EOL; /* moved jan 13 from before the init stuff */
#ifdef DBG_596_RFA
@@ -286,15 +286,15 @@ int uti596_initRFA(int num)
#endif
- uti596_softc.pSavedRfdQueue =
+ uti596_softc.pSavedRfdQueue =
uti596_softc.pEndSavedQueue = I596_NULL; /* initially empty */
-
+
uti596_softc.savedCount = 0;
uti596_softc.nop.cmd.command = CmdNOp; /* initialize the nop command */
return (i); /* the number of allocated buffers */
-
+
}
/***********************************************************************
* Function: uti596supplyFD
@@ -316,10 +316,10 @@ void uti596supplyFD(struct i596_rfd * pRfd )
pRfd -> next = I596_NULL;
pRfd -> stat = 0x0000; /* clear STAT_C and STAT_B bits */
- /*
+ /*
* Check if the list is empty:
*/
- if ( uti596_softc.pBeginRFA == I596_NULL ) {
+ if ( uti596_softc.pBeginRFA == I596_NULL ) {
/* Init a list w/ one entry */
uti596_softc.pBeginRFA = uti596_softc.pEndRFA = pRfd;
UTI_596_ASSERT(uti596_softc.countRFD == 0, "Null begin, but non-zero count\n");
@@ -332,22 +332,22 @@ void uti596supplyFD(struct i596_rfd * pRfd )
* Check if the last RFD is used/read by the 596.
*/
pLastRfd = uti596_softc.pEndRFA;
-
- if ( pLastRfd != I596_NULL &&
+
+ if ( pLastRfd != I596_NULL &&
! (pLastRfd -> stat & ( STAT_C | STAT_B ) )) { /* C = complete, B = busy (prefetched) */
-
- /*
- * Not yet too late to add it
+
+ /*
+ * Not yet too late to add it
*/
pLastRfd -> next = pRfd;
pLastRfd -> cmd &= ~CMD_EOL; /* RESET_EL : reset EL bit to 0 */
- uti596_softc.countRFD++; /* Lets assume we add it successfully
+ uti596_softc.countRFD++; /* Lets assume we add it successfully
If not, the RFD may be used, and may decrement countRFD < 0 !!*/
/*
* Check if the last RFD was used while appending.
*/
if ( pLastRfd -> stat & ( STAT_C | STAT_B ) ) { /* completed or was prefetched */
- /*
+ /*
* Either the EL bit of the last rfd has been read by the 82596,
* and it will stop after reception,( true when RESET_EL not reached ) or
* the EL bit was NOT read by the 82596 and it will use the linked
@@ -356,7 +356,7 @@ void uti596supplyFD(struct i596_rfd * pRfd )
* Therefore, the end of list CANNOT be updated.
*/
UTI_596_ASSERT ( uti596_softc.pLastUnkRFD == I596_NULL, "Too many Unk RFD's\n" );
- uti596_softc.pLastUnkRFD = pRfd;
+ uti596_softc.pLastUnkRFD = pRfd;
return;
}
else {
@@ -364,20 +364,20 @@ void uti596supplyFD(struct i596_rfd * pRfd )
* The RFD being added was not touched by the 82596
*/
if (uti596_softc.pLastUnkRFD != I596_NULL ) {
-
+
uti596append(&uti596_softc.pSavedRfdQueue, pRfd); /* Only here! saved Q */
uti596_softc.pEndSavedQueue = pRfd;
uti596_softc.savedCount++;
uti596_softc.countRFD--;
-
+
}
else {
uti596_softc.pEndRFA = pRfd; /* the RFA has been extended */
- if ( ( uti596_softc.scb.status & SCB_STAT_RNR ||
+ if ( ( uti596_softc.scb.status & SCB_STAT_RNR ||
uti596_softc.scb.status & RU_NO_RESOURCES ) &&
uti596_softc.countRFD > 1 ) { /* was == 2 */
uti596_softc.pBeginRFA -> cmd &= ~CMD_EOL; /* Ensure that beginRFA is not EOL */
-
+
UTI_596_ASSERT(uti596_softc.pEndRFA -> next == I596_NULL, "supply: List buggered\n");
UTI_596_ASSERT(uti596_softc.pEndRFA -> cmd & CMD_EOL, "supply: No EOL at end.\n");
UTI_596_ASSERT(uti596_softc.scb.command == 0, "Supply: scb command must be zero\n");
@@ -389,24 +389,24 @@ void uti596supplyFD(struct i596_rfd * pRfd )
uti596_softc.scb.pRfd = uti596_softc.pBeginRFA;
uti596_softc.scb.command = RX_START | SCB_STAT_RNR; /* Don't ack RNR! The receiver should be stopped in this case */
UTI_596_ASSERT( !(uti596_softc.scb.status & SCB_STAT_FR),"FRAME RECEIVED INT COMING!\n");
- outport_byte(CHAN_ATTN, 0);
+ outport_byte(CHAN_ATTN, 0);
}
}
return;
-
+
}
- }
+ }
else {
- /*
- * too late , pLastRfd in use ( or NULL ),
- * in either case, EL bit has been read, and RNR condition will occur
+ /*
+ * too late , pLastRfd in use ( or NULL ),
+ * in either case, EL bit has been read, and RNR condition will occur
*/
uti596append( &uti596_softc.pSavedRfdQueue, pRfd); /* save it for RNR */
-
- uti596_softc.pEndSavedQueue = pRfd; /* reset end of saved queue */
+
+ uti596_softc.pEndSavedQueue = pRfd; /* reset end of saved queue */
uti596_softc.savedCount++;
-
-
+
+
return;
}
}
@@ -427,7 +427,7 @@ uti596_initialize_hardware(struct uti596_softc *sc)
rtems_status_code status_code;
printf("uti596_initialize_hardware\n");
-
+
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
@@ -442,12 +442,12 @@ uti596_initialize_hardware(struct uti596_softc *sc)
#ifdef DBG_INIT
printf("initialize_hardware:change scp address to : %p\n",sc->pScp);
#endif
-
+
/* change the scp address */
#ifdef DBG_INIT
printf("Change the SCP address\n");
#endif
-
+
/*
* Set the DMA mode to enable the 82596 to become a bus-master
*/
@@ -458,37 +458,37 @@ uti596_initialize_hardware(struct uti596_softc *sc)
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
-
+
outport_word(PORT_ADDR, ((((int)sc->pScp) & 0xffff) | 2 ));
outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
-
+
/* This is linear mode, LOCK function is disabled */
-
+
sc->pScp->sysbus = 0x00540000;
sc->pScp->iscp = &sc->iscp;
sc->iscp.scb = &sc->scb;
sc->iscp.stat = 0x0001;
-
+
sc->pCmdHead = sc->scb.pCmd = I596_NULL;
-
+
#ifdef DBG_596
printf("Starting i82596.\n");
#endif
-
+
/* Pass the scb address to the 596 */
outport_word(CHAN_ATTN,0);
-
+
while (sc->iscp.stat)
if (--boguscnt == 0)
{
- printf("initialize_hardware: timed out with status %4.4lx\n",
+ printf("initialize_hardware: timed out with status %4.4lx\n",
sc->iscp.stat );
break;
}
-
+
/* clear the command word */
sc->scb.command = 0;
-
+
/*
* Set up interrupts ( NEW irq style )
*/
@@ -497,7 +497,7 @@ uti596_initialize_hardware(struct uti596_softc *sc)
sc->irqInfo.on = uti596_maskOn;
sc->irqInfo.off = uti596_maskOff;
sc->irqInfo.isOn = uti596_isOn;
-
+
status_code = BSP_install_rtems_irq_handler (&sc->irqInfo);
if (!status_code)
rtems_panic ("Can't attach uti596 interrupt handler for irq %d\n",
@@ -505,7 +505,7 @@ uti596_initialize_hardware(struct uti596_softc *sc)
/* Initialize the 82596 memory ( Transmit buffers ) */
uti596_initMem(sc);
-
+
#ifdef DBG_INIT
printf("After attach, status of board = 0x%x\n", sc->scb.status );
#endif
@@ -519,11 +519,11 @@ uti596_reset_hardware(struct uti596_softc *sc)
int boguscnt = 1000;
rtems_status_code status_code;
struct i596_cmd *pCmd;
-
+
printf("uti596_reset_hardware\n");
pCmd = sc->pCmdHead; /* This is a tx command for sure (99.99999%) */
-
+
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
@@ -538,17 +538,17 @@ uti596_reset_hardware(struct uti596_softc *sc)
#endif
sc->pScp = (struct i596_scp *)
((((int)uti596_softc.pScp) + 0xf) & 0xfffffff0);
-
+
#ifdef DBG_RESET
printf("reset_hardware:change scp address to : %p\n",sc->pScp);
#endif
-
+
/* change the scp address */
#ifdef DBG_RESET
printf("Change the SCP address\n");
#endif
-
+
/*
* Set the DMA mode to enable the 82596 to become a bus-master
*/
@@ -559,52 +559,52 @@ uti596_reset_hardware(struct uti596_softc *sc)
/* reset the board */
outport_word( PORT_ADDR, 0 );
outport_word( PORT_ADDR, 0 );
-
+
/* outport_word(PORT_ADDR, ((((int)uti596_softc.pScp) & 0xffff) | 2 ));
outport_word(PORT_ADDR, (( (int)uti596_softc.pScp) >> 16 ) & 0xffff ); */
-
+
outport_word(PORT_ADDR, ((((int)sc->pScp) & 0xffff) | 2 ));
outport_word(PORT_ADDR, (( (int)sc->pScp) >> 16 ) & 0xffff );
-
+
/* This is linear mode, LOCK function is disabled */
-
+
sc->pScp->sysbus = 0x00540000;
sc->pScp->iscp = &sc->iscp;
sc->iscp.scb = &sc->scb;
sc->iscp.stat = 0x0001;
-
+
sc->pCmdHead = sc->scb.pCmd = I596_NULL;
/*
- * Wake the transmitter if needed.
+ * Wake the transmitter if needed.
*/
- if ( uti596_softc.txDaemonTid && pCmd != I596_NULL ){
+ if ( uti596_softc.txDaemonTid && pCmd != I596_NULL ){
printf("****RESET: wakes transmitter!\n");
- status_code = rtems_event_send (uti596_softc.txDaemonTid,
+ status_code = rtems_event_send (uti596_softc.txDaemonTid,
INTERRUPT_EVENT);
-
+
if ( status_code != RTEMS_SUCCESSFUL )
printk("****ERROR:Could NOT send event to tid 0x%x : %s\n",
uti596_softc.txDaemonTid, rtems_status_text (status_code) );
}
-
+
#ifdef DBG_596
printf("reset_hardware: starting i82596.\n");
#endif
-
+
/* Pass the scb address to the 596 */
outport_word(CHAN_ATTN,0);
-
+
while (sc->iscp.stat)
if (--boguscnt == 0)
{
- printf("reset_hardware: timed out with status %4.4lx\n",
+ printf("reset_hardware: timed out with status %4.4lx\n",
sc->iscp.stat );
break;
}
-
+
/* clear the command word */
sc->scb.command = 0;
-
+
#ifdef DBG_RESET
printf("After reset_hardware, status of board = 0x%x\n", sc->scb.status );
#endif
@@ -635,18 +635,18 @@ uti596_initMem(struct uti596_softc * sc)
sc->resetDone = 0; /* ??? */
/*
- * Set up receive frame area (RFA)
+ * Set up receive frame area (RFA)
*/
i = uti596_initRFA( sc->rxBdCount );
- if ( i < sc->rxBdCount )
+ if ( i < sc->rxBdCount )
printf("init_rfd: only able to allocate %d receive frame descriptors\n", i);
-
- sc->scb.pRfd = sc->pBeginRFA;
+
+ sc->scb.pRfd = sc->pBeginRFA;
#ifdef DBG_INIT
printf(" IRQ %d.\n", sc->irqInfo.name);
-#endif
-
+#endif
+
/*
* Diagnose the health of the board
*/
@@ -678,7 +678,7 @@ uti596_initMem(struct uti596_softc * sc)
/*******/
- /*
+ /*
* Create the IA setup command
*/
@@ -692,11 +692,11 @@ uti596_initMem(struct uti596_softc * sc)
sc->cmdOk = 0;
uti596addPolledCmd((struct i596_cmd *)&sc->set_add);
/*******/
-
+
count = 2000;
while( !(sc->set_add.cmd.status & STAT_C ) && --count)
printf(".");
-
+
if ( count )
printf ("Set Address OK, count= %d\n",count);
else
@@ -704,9 +704,9 @@ uti596_initMem(struct uti596_softc * sc)
/*******/
#ifdef DBG_INIT
- printf( "After initialization, status and command: 0x%x, 0x%x\n",
+ printf( "After initialization, status and command: 0x%x, 0x%x\n",
sc->scb.status, sc->scb.status);
-
+
#endif
/* initialize transmit buffer descriptors*/
@@ -716,19 +716,19 @@ uti596_initMem(struct uti596_softc * sc)
sc->pTxCmd -> pTbd = sc->pTbd;
sc->pTxCmd->cmd.command = CMD_FLEX|CmdTx;
sc->pTxCmd->pad = 0;
- sc->pTxCmd->size = 0; /* all bytes are in list of TBD's */
+ sc->pTxCmd->size = 0; /* all bytes are in list of TBD's */
pTbd = sc->pTbd;
for ( i=0; i<sc->txBdCount; i++)
pTbd = pTbd -> next = (struct i596_tbd *) calloc (1,sizeof (struct i596_tbd) );
-
+
pTbd -> next = I596_NULL;
- memset ( &sc->zeroes, 0, 64);
+ memset ( &sc->zeroes, 0, 64);
#ifdef DBG_596
- printf( "After receiver start, status and command: 0x%x, 0x%x\n",
+ printf( "After receiver start, status and command: 0x%x, 0x%x\n",
sc->scb.status, sc->scb.status);
#endif
printf("uti596_initMem allows ISR's\n");
@@ -743,7 +743,7 @@ uti596_initMem(struct uti596_softc * sc)
*
* Description: Dump 596 registers
*
- * Algorithm:
+ * Algorithm:
***********************************************************************/
/* static */ int
uti596dump(char * pDumpArea)
@@ -752,7 +752,7 @@ uti596dump(char * pDumpArea)
int boguscnt = 25000000; /* over a second! */
-#ifdef DBG_596
+#ifdef DBG_596
printf("uti596dump:\n");
#endif
@@ -770,8 +770,8 @@ printf("uti596dump:\n");
if ( uti596_softc.cmdOk )
return 1; /* successful completion */
}
-
-
+
+
}
/***********************************************************************
@@ -779,7 +779,7 @@ printf("uti596dump:\n");
*
* Description: Receiver task
*
- * Algorithm: Extract the packet from an RFD, and place into an
+ * Algorithm: Extract the packet from an RFD, and place into an
* mbuf chain. Place the mbuf chain in the network task
* queue. Assumes that the frame check sequence is removed
* by the 82596.
@@ -798,19 +798,19 @@ uti596_rxDaemon(void *arg)
int tid;
rtems_event_set events;
struct ether_header *eh;
-
+
int frames = 0;
-
+
#ifdef DBG_596
printf ("uti596_rxDaemon\n");
printf("&scb = %p, pRfd = %p\n", &sc->scb,sc->scb.pRfd);
-#endif
+#endif
rtems_task_ident (0, 0, &tid);
#ifdef DBG_596
printf("RX tid = 0x%x\n", tid);
-#endif
+#endif
for(;;) {
/*
@@ -824,16 +824,16 @@ uti596_rxDaemon(void *arg)
RTEMS_WAIT|RTEMS_EVENT_ANY,
RTEMS_NO_TIMEOUT,
&events);
-
+
#ifdef DBG_596
printf("Receiver wakes\n");
#endif
- /*
+ /*
* While received frames are available. Note that the frame may be
* a fragment, so it is NOT a complete packet.
*/
pRfd = uti596dequeue( &sc->pInboundFrameQueue);
- while ( pRfd &&
+ while ( pRfd &&
pRfd != I596_NULL &&
pRfd -> stat & STAT_C )
{
@@ -852,12 +852,12 @@ uti596_rxDaemon(void *arg)
#endif
frames++;
-
- /*
+
+ /*
* Allocate an mbuf to give to the stack
* The format of the data portion of the RFD is:
- * <ethernet header, payload>.
- * The FRAME CHECK SEQUENCE / CRC is stripped by the uti596.
+ * <ethernet header, payload>.
+ * The FRAME CHECK SEQUENCE / CRC is stripped by the uti596.
* This is to be optimized later.... should not have to memcopy!
*/
MGETHDR(m, M_WAIT, MT_DATA);
@@ -865,8 +865,8 @@ uti596_rxDaemon(void *arg)
m->m_pkthdr.rcvif = ifp;
/* move everything into an mbuf */
- memcpy(m->m_data,
- pRfd->data,
+ memcpy(m->m_data,
+ pRfd->data,
pkt_len);
m->m_len = m->m_pkthdr.len = pkt_len - sizeof(struct ether_header) - 4;
@@ -892,43 +892,43 @@ uti596_rxDaemon(void *arg)
ether_input (ifp, eh, m);
} /* end if STAT_OK */
-
+
else {
- /*
+ /*
* A bad frame is present: Note that this could be the last RFD!
*/
#ifdef DBG_596
printf("Bad frame\n");
#endif
- /*
+ /*
* FIX ME: use the statistics from the SCB
*/
sc->stats.rx_errors++;
- if ((sc->scb.pRfd->stat) & 0x0001)
+ if ((sc->scb.pRfd->stat) & 0x0001)
sc->stats.collisions++;
- if ((sc->scb.pRfd->stat) & 0x0080)
+ if ((sc->scb.pRfd->stat) & 0x0080)
sc->stats.rx_length_errors++;
- if ((sc->scb.pRfd->stat) & 0x0100)
+ if ((sc->scb.pRfd->stat) & 0x0100)
sc->stats.rx_over_errors++;
- if ((sc->scb.pRfd->stat) & 0x0200)
+ if ((sc->scb.pRfd->stat) & 0x0200)
sc->stats.rx_fifo_errors++;
- if ((sc->scb.pRfd->stat) & 0x0400)
+ if ((sc->scb.pRfd->stat) & 0x0400)
sc->stats.rx_frame_errors++;
- if ((sc->scb.pRfd->stat) & 0x0800)
+ if ((sc->scb.pRfd->stat) & 0x0800)
sc->stats.rx_crc_errors++;
- if ((sc->scb.pRfd->stat) & 0x1000)
+ if ((sc->scb.pRfd->stat) & 0x1000)
sc->stats.rx_length_errors++;
}
UTI_596_ASSERT(pRfd != I596_NULL, "Supplying NULL RFD\n");
-#ifdef DBG_SUPPLY_FD
+#ifdef DBG_SUPPLY_FD
printf("Supply FD Starting\n");
#endif
_ISR_Disable(level);
uti596supplyFD ( pRfd ); /* Return RFD to RFA. CAN WE REALLY?*/
_ISR_Enable(level);
-#ifdef DBG_SUPPLY_FD
+#ifdef DBG_SUPPLY_FD
printf("Supply FD Complete\n");
#endif
#ifdef DBG_VERSION
@@ -936,14 +936,14 @@ uti596_rxDaemon(void *arg)
#endif
pRfd = uti596dequeue( &sc->pInboundFrameQueue); /* grab next frame */
-
+
} /* end while */
} /* end for(;;)*/
-
+
#ifdef DBG_596
printf ("frames %d\n", frames);
#endif
-
+
}
/***********************************************************************
@@ -951,7 +951,7 @@ uti596_rxDaemon(void *arg)
*
* Description:
* Clear the stat fields for all rfd's
- * Algorithm:
+ * Algorithm:
*
***********************************************************************/
@@ -961,7 +961,7 @@ uti596clearListStatus(struct i596_rfd *pRfd)
while ( pRfd != I596_NULL ) {
pRfd -> stat = 0; /* clear the status field */
- pRfd = pRfd-> next;
+ pRfd = pRfd-> next;
}
}
@@ -978,15 +978,15 @@ void uti596reset(void)
sc->resetDone = 0;
sc->irqInfo.off(&sc->irqInfo);
- UTI_WAIT_COMMAND_ACCEPTED(10000, "reset: wait for previous command complete");
+ UTI_WAIT_COMMAND_ACCEPTED(10000, "reset: wait for previous command complete");
/* abort ALL of the current work */
- /* FEB 17 REMOVED
+ /* FEB 17 REMOVED
>>>>>
sc->scb.command = CUC_ABORT | RX_ABORT;
outport_word(CHAN_ATTN,0);
UTI_WAIT_COMMAND_ACCEPTED(4000, "reset: abort requested");
- <<<<<
+ <<<<<
*/
uti596_reset_hardware(&uti596_softc); /* reset the ethernet hardware. must re-config */
@@ -998,38 +998,38 @@ void uti596reset(void)
sc->set_conf.cmd.command = CmdConfigure;
memcpy (sc->set_conf.data, uti596initSetup, 14);
uti596addPolledCmd( (struct i596_cmd *) &sc->set_conf);
-
+
/****
* POLL
****/
-
+
count = 2000;
while( !( sc->set_conf.cmd.status & STAT_C ) && --count )
printf(".");
-
+
if ( count )
printf("Configure OK, count = %d\n",count);
else
printf("***reset: Configure failed\n");
-
- /*
+
+ /*
* Create the IA setup command
*/
-
+
#ifdef DBG_RESET
printf("reset: Setting Address\n");
#endif
sc->set_add.cmd.command = CmdSASetup;
for ( i=0; i<6; i++)
sc->set_add.data[i]=sc->arpcom.ac_enaddr[i];
-
+
sc->cmdOk = 0;
uti596addPolledCmd((struct i596_cmd *)&sc->set_add);
-
+
count = 2000;
while( !(sc->set_add.cmd.status & STAT_C ) && --count)
printf(".");
-
+
if ( count )
printf ("Reset Set Address OK, count= %d\n",count);
else
@@ -1039,11 +1039,11 @@ void uti596reset(void)
sc->pCmdHead = sc->pCmdTail = sc->scb.pCmd = I596_NULL; /* Feb 17. clear these out */
#ifdef DBG_RESET
- printf( "After reset, status and command: 0x%x, 0x%x\n",
+ printf( "After reset, status and command: 0x%x, 0x%x\n",
sc->scb.status, sc->scb.status);
-
+
#endif
-
+
/* restore the RFA */
@@ -1051,9 +1051,9 @@ void uti596reset(void)
if ( sc->pLastUnkRFD != I596_NULL ) {
sc-> pEndRFA = sc->pLastUnkRFD; /* The end position can be updated */
- sc-> pLastUnkRFD = I596_NULL;
+ sc-> pLastUnkRFD = I596_NULL;
}
-
+
sc->pEndRFA->next = sc->pSavedRfdQueue;
if ( sc->pSavedRfdQueue != I596_NULL ) {
sc->pEndRFA = sc->pEndSavedQueue;
@@ -1067,7 +1067,7 @@ void uti596reset(void)
sc->pEndRFA -> next = sc->pInboundFrameQueue;
sc->pInboundFrameQueue = pRfd;
} while( pRfd != I596_NULL ) ;
-
+
}
*/
@@ -1081,14 +1081,14 @@ void uti596reset(void)
sc->scb.command = RX_START;
sc->started = 1; /* we assume that the start works */
sc->resetDone = 1; /* moved here from after channel attn. */
- outport_word(CHAN_ATTN,0 );
+ outport_word(CHAN_ATTN,0 );
UTI_WAIT_COMMAND_ACCEPTED(4000, "reset");
printf("Reset:Start complete \n");
UTI_596_ASSERT(sc->pCmdHead == I596_NULL, "Reset: CMD not cleared\n");
sc->irqInfo.on(&sc->irqInfo); /* moved back here. Tried it before RX command issued. */
-
+
/* uti596addCmd(&uti506_softc.nop); */ /* just for fun */
-
+
#ifdef DBG_RESET
printf("reset: complete\n");
#endif
@@ -1117,7 +1117,7 @@ void uti596reset(void)
#endif
#ifdef DEBUG_ADD
-
+
switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */
case CmdConfigure:
printf("ADD: Configure Command 0x%x\n", pCmd->command);
@@ -1146,7 +1146,7 @@ void uti596reset(void)
printf("****Unknown Command encountered 0x%x\n", pCmd->command);
break;
} /* end switch */
-
+
#endif
@@ -1159,7 +1159,7 @@ void uti596reset(void)
_ISR_Disable(level);
if (uti596_softc.pCmdHead == I596_NULL)
{
- uti596_softc.pCmdHead =
+ uti596_softc.pCmdHead =
uti596_softc.pCmdTail =
uti596_softc.scb.pCmd = pCmd;
#ifdef DBG_596
@@ -1171,23 +1171,23 @@ void uti596reset(void)
outport_word (CHAN_ATTN,0);
_ISR_Enable(level);
}
- else
+ else
{
#ifdef DBG_596
printf("Chained Cmd\n");
#endif
- uti596_softc.pCmdTail->next = pCmd;
+ uti596_softc.pCmdTail->next = pCmd;
uti596_softc.pCmdTail = pCmd; /* added Jan 30 */
_ISR_Enable(level);
}
#ifdef DBG_596
- printf("Scb status & command 0x%x 0x%x\n",
+ printf("Scb status & command 0x%x 0x%x\n",
uti596_softc.scb.status,
uti596_softc.scb.command );
#endif
-
+
}
/***********************************************************************
@@ -1199,7 +1199,7 @@ void uti596reset(void)
*
* Algorithm:
* Give the command to the driver. ( CUC_START is ALWAYS required )
- * Poll for completion.
+ * Poll for completion.
*
***********************************************************************/
@@ -1211,7 +1211,7 @@ void uti596addPolledCmd(struct i596_cmd *pCmd)
#endif
#ifdef DBG_POLLED_CMD
-
+
switch ( pCmd -> command & 0x7 ){ /* check bottom 7 bits */
case CmdConfigure:
printf("PolledCMD: Configure Command 0x%x\n", pCmd->command);
@@ -1240,7 +1240,7 @@ void uti596addPolledCmd(struct i596_cmd *pCmd)
printf("PolledCMD: ****Unknown Command encountered 0x%x\n", pCmd->command);
break;
} /* end switch */
-
+
#endif
pCmd->status = 0;
@@ -1254,15 +1254,15 @@ void uti596addPolledCmd(struct i596_cmd *pCmd)
uti596_softc.scb.command = CUC_START;
outport_word (CHAN_ATTN,0);
- UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: start");
+ UTI_WAIT_COMMAND_ACCEPTED(10000,"Add Polled command: start");
uti596_softc.pCmdHead = uti596_softc.pCmdTail = uti596_softc.scb.pCmd = I596_NULL;
#ifdef DBG_POLLED_CMD
- printf("Scb status & command 0x%x 0x%x\n",
+ printf("Scb status & command 0x%x 0x%x\n",
uti596_softc.scb.status,
uti596_softc.scb.command );
#endif
-
+
}
/*
* Driver transmit daemon
@@ -1279,15 +1279,15 @@ uti596_txDaemon (void *arg)
/*
* Wait for packet from stack
*/
- rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
+ rtems_bsdnet_event_receive (START_TRANSMIT_EVENT,
+ RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events);
-
+
/*
* Send packets till queue is empty.
* Ensure that irq is on before sending.
*/
- for (;;) {
+ for (;;) {
/* Feb 17: No need to make sure a reset is in progress,
* Since reset daemon runs at same priority as this thread
*/
@@ -1297,7 +1297,7 @@ uti596_txDaemon (void *arg)
IF_DEQUEUE(&ifp->if_snd, m);
if (!m)
break;
-
+
send_packet (ifp, m); /* blocks */
} /* end for */
ifp->if_flags &= ~IFF_OACTIVE; /* no more to send, mark output inactive */
@@ -1321,8 +1321,8 @@ uti596_resetDaemon (void *arg)
/*
* Wait for reset event from ISR
*/
- rtems_bsdnet_event_receive (NIC_RESET_EVENT,
- RTEMS_EVENT_ANY | RTEMS_WAIT,
+ rtems_bsdnet_event_receive (NIC_RESET_EVENT,
+ RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events);
rtems_clock_get(RTEMS_CLOCK_GET_TOD, &tm_struct);
@@ -1344,7 +1344,7 @@ uti596_resetDaemon (void *arg)
* Function: send_packet
*
* Description: Send a raw ethernet packet
- *
+ *
* Algorithm:
* increment some stats counters,
* create the transmit command,
@@ -1359,22 +1359,22 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
*pRemainingTbdList,
*pTbd;
struct mbuf *n, *input_m = m;
-
+
struct uti596_softc *sc = ifp->if_softc; /* is this available from ifp ?*/
- struct mbuf *l = NULL;
+ struct mbuf *l = NULL;
unsigned int length = 0;
rtems_status_code status;
int bd_count = 0;
rtems_event_set events;
- /*
- * For all mbufs in the chain,
+ /*
+ * For all mbufs in the chain,
* fill a transmit buffer descriptor
*/
pTbd = sc->pTxCmd->pTbd;
- do {
+ do {
if (m->m_len) {
/*
* Fill in the buffer descriptor
@@ -1404,30 +1404,30 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
printf("TX ERROR:Too many mbufs in the packet!!!\n");
printf("Must coalesce!\n");
}
-
-
+
+
if ( length < UTI_596_ETH_MIN_SIZE ) {
pTbd->data = sc->zeroes; /* add padding to pTbd */
pTbd->size = UTI_596_ETH_MIN_SIZE - length; /* zeroes have no effect on the CRC */
}
else
pTbd = pPrev; /* Don't use pTbd in the send routine */
-
+
/* Disconnect the packet from the list of Tbd's */
pRemainingTbdList = pTbd->next;
- pTbd->next = I596_NULL;
- pTbd->size |= UTI_596_END_OF_FRAME;
-
+ pTbd->next = I596_NULL;
+ pTbd->size |= UTI_596_END_OF_FRAME;
+
#ifdef DBG_RAW
printf("RAW:Add cmd and sleep\n");
#endif
-
- sc->rawsndcnt++;
-
+
+ sc->rawsndcnt++;
+
#ifdef DBG_RAW
printf ("sending packet\n");
#endif
-
+
/* Sending Zero length packet: shouldn't happen */
if (pTbd->size <= 0) return ;
@@ -1445,23 +1445,23 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
/* add the command to the output command queue */
uti596addCmd ( (struct i596_cmd *) sc->pTxCmd );
-
+
/* sleep until the command has been processed or Timeout encountered. */
status= rtems_bsdnet_event_receive (INTERRUPT_EVENT,
RTEMS_WAIT|RTEMS_EVENT_ANY,
RTEMS_NO_TIMEOUT,
&events);
-
+
if ( status != RTEMS_SUCCESSFUL ) {
- printf("Could not sleep %s\n", rtems_status_text(status));
+ printf("Could not sleep %s\n", rtems_status_text(status));
}
-
+
#ifdef DBG_RAW
printf("RAW: wake\n");
#endif
-
+
sc->txInterrupts++;
-
+
#ifdef DEBUG_INIT
printf("\nTransmitter issued packet\n");
print_hdr ( sc->pTxCmd->pTbd -> data ); /* print the first part */
@@ -1476,23 +1476,23 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
printf("******Driver Error 0x%x\n", sc->pTxCmd -> cmd.status );
#endif
sc->stats.tx_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0020 )
+ if ( sc->pTxCmd->cmd.status & 0x0020 )
sc->stats.tx_retries_exceeded++;
- if (!(sc->pTxCmd->cmd.status & 0x0040))
+ if (!(sc->pTxCmd->cmd.status & 0x0040))
sc->stats.tx_heartbeat_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0400 )
+ if ( sc->pTxCmd->cmd.status & 0x0400 )
sc->stats.tx_carrier_errors++;
- if ( sc->pTxCmd->cmd.status & 0x0800 )
+ if ( sc->pTxCmd->cmd.status & 0x0800 )
sc->stats.collisions++;
- if ( sc->pTxCmd->cmd.status & 0x1000 )
+ if ( sc->pTxCmd->cmd.status & 0x1000 )
sc->stats.tx_aborted_errors++;
- } /* end if stat_ok */
-
- /*
+ } /* end if stat_ok */
+
+ /*
* Restore the transmited buffer descriptor chain.
*/
pTbd -> next = pRemainingTbdList;
-
+
/*
* Free the mbufs used by the sender.
*/
@@ -1502,7 +1502,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
m = n;
}
-
+
}
/***********************************************************************
@@ -1578,7 +1578,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
{ /* an IP packet */
printf("*********************IP HEADER******************\n");
printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
+ printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
add[18],add[19], add[20], add[21]);
printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
@@ -1706,7 +1706,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
{ /* an IP packet */
printf("*********************IP HEADER******************\n");
printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
+ printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
add[18],add[19], add[20], add[21]);
printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
@@ -1755,55 +1755,55 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
short int length;
if ( add[12] == 0x08 && add[13] == 0x00 ){ /* an IP packet */
-
+
printf("Packet Location %p\n", add);
-
+
printf ("Dest ");
-
+
for (i = 0; i < 6; i++)
printf(" %2.2X", add[i]);
-
+
printf ("\n");
-
+
printf ("Source");
-
+
for (i = 6; i < 12; i++)
printf(" %2.2X", add[i]);
-
+
printf ("\n");
-
+
printf ("frame type %2.2X%2.2X\n", add[12], add[13]);
-
+
printf("*********************IP HEADER******************\n");
printf("IP version/IPhdr length: %2.2X TOS: %2.2X\n", add[14] , add[15]);
- printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
+ printf("IP total length: %2.2X %2.2X, decimal %d\n", add[16], add[17], length = (add[16]<<8 | add[17] ));
printf("IP identification: %2.2X %2.2X, 3-bit flags and offset %2.2X %2.2X\n",
add[18],add[19], add[20], add[21]);
printf("IP TTL: %2.2X, protocol: %2.2X, checksum: %2.2X %2.2X \n",
add[22],add[23],add[24],add[25]);
printf("IP packet type: %2.2X code %2.2X\n", add[34],add[35]);
-
+
printf("Source IP address: ");
for ( i=0; i< 3 ; i++)
printf( "%u.", add[26 + i]);
-
+
printf("%u\n", add[29]);
-
+
printf("Destination IP address: ");
for ( i=0; i< 3 ; i++)
printf( "%u.", add[30 + i]);
printf("%u\n", add[33]);
-
+
printf("********************IP Packet Data*******************\n");
length -=20;
for ( i=0; i < length ; i++)
printf("0x%2.2x ", add[34+i]);
printf("\n");
-
+
printf("ICMP checksum: %2.2x %2.2x\n", add[36], add[37]);
printf("ICMP identifier: %2.2x %2.2x\n", add[38], add[39]);
printf("ICMP sequence nbr: %2.2x %2.2x\n", add[40], add[41]);
- }
+ }
}
#endif
@@ -1823,7 +1823,7 @@ void send_packet(struct ifnet *ifp, struct mbuf *m)
* initialize required rx and tx buffers
* hook interrupt
* issue start command and some diagnostics
- * return
+ * return
*
***********************************************************************/
@@ -1833,31 +1833,31 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
struct uti596_softc *sc = &uti596_softc; /* soft config */
struct ifnet * ifp = &sc->arpcom.ac_if;
int i = 0;
-
+
#ifdef DBG_ATTACH
printf("attach");
#endif
-
+
sc->started = 0; /* The NIC is not started yet */
sc->ioAddr = IO_ADDR;
- /* Indicate to ULCS that this is initialized */
- ifp->if_softc = sc;
+ /* Indicate to ULCS that this is initialized */
+ ifp->if_softc = sc;
sc -> pScp = NULL;
-
+
/* Assign the name */
ifp->if_name = "uti";
-
+
/* Assign the unit number */
ifp->if_unit = 1;
-
+
/* Assign mtu */
if ( pConfig -> mtu )
ifp->if_mtu = pConfig -> mtu;
else
ifp->if_mtu = ETHERMTU;
-
+
/* Assign and possibly override the hw address */
if ( !pConfig->hardware_address) { /* Read the ethernet address from the board */
@@ -1865,14 +1865,14 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
inport_byte(NIC_ADDR+i,sc->arpcom.ac_enaddr[i] );
}
else {
- /* hwaddr override */
+ /* hwaddr override */
memcpy (sc->arpcom.ac_enaddr, pConfig->hardware_address, ETHER_ADDR_LEN);
}
-
+
/* Test for valid hwaddr */
if(memcmp(sc->arpcom.ac_enaddr,"\xAA\x55\x01",3)!= 0)/* b0 of byte 0 != 0 => multicast */
return ENODEV;
-
+
/* Assign requested receive buffer descriptor count */
if (pConfig->rbuf_count)
sc->rxBdCount = pConfig->rbuf_count;
@@ -1894,15 +1894,15 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/* to init_hardware */
sc->started = 1;
sc->pInboundFrameQueue = I596_NULL;
-
-
+
+
ifp->if_ioctl = uti596_ioctl;
ifp->if_init = uti596_init;
ifp->if_start = uti596_start;
ifp->if_output = ether_output;
-
+
sc->scb.command = 0;
-
+
/*
* Attach the interface
*/
@@ -1945,8 +1945,8 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/* printk("***INFO: ACK %x\n", scbStatus);*/
uti596_softc.scb.command = scbStatus;
outport_word(CHAN_ATTN, 0);
-
- if( uti596_softc.resetDone ) {
+
+ if( uti596_softc.resetDone ) {
/* stack is attached */
UTI_WAIT_COMMAND_ACCEPTED(20000, "****ERROR:ACK");
}
@@ -1959,7 +1959,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("\n***ERROR: Spurious interrupt. Resetting...\n");
uti596_softc.nic_reset = 1;
}
-
+
if ( (scbStatus & SCB_STAT_CX) && !(scbStatus & SCB_STAT_CNA) ){
printk_time();
printk("\n*****ERROR: Command Complete, and CNA available: 0x%x\nResetting...", scbStatus);
@@ -1987,7 +1987,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.nic_reset = 1;
return;
}
-
+
if ( scbStatus & SCB_STAT_RNR ) {
printk_time();
printk("\n*****WARNING: RNR %x\n",scbStatus);
@@ -1995,13 +1995,13 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.pBeginRFA -> cmd,
uti596_softc.pBeginRFA -> stat);
}
-
- /*
+
+ /*
* Receive Unit Control
*/
if ( scbStatus & SCB_STAT_FR ) { /* a frame has been received */
uti596_softc.rxInterrupts++;
-
+
#ifdef DBG_FR
printk("\nISR:FR\n");
#endif
@@ -2010,9 +2010,9 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.nic_reset = 1;
}
else
- while ( uti596_softc.pBeginRFA != I596_NULL &&
+ while ( uti596_softc.pBeginRFA != I596_NULL &&
( uti596_softc.pBeginRFA -> stat & STAT_C)) {
-
+
#ifdef DBG_ISR
printk("ISR:pBeginRFA != NULL\n");
#endif
@@ -2020,19 +2020,19 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
if ( count_rx > 1)
printk("****WARNING: Received 2 frames on 1 interrupt \n");
- /*
- * Give Received Frame to the ULCS
- */
+ /*
+ * Give Received Frame to the ULCS
+ */
uti596_softc.countRFD--;
-
+
if ( uti596_softc.countRFD < 0 )
printk("Count < 0 !!!: count == %d, beginRFA = %p\n",
uti596_softc.countRFD, uti596_softc.pBeginRFA);
-
+
uti596_softc.stats.rx_packets++;
pIsrRfd = uti596_softc.pBeginRFA -> next; /* the append destroys the link */
uti596append( &uti596_softc.pInboundFrameQueue , uti596_softc.pBeginRFA );
-
+
/*
* if we have just received the a frame int he last unknown RFD,
* then it is certain that the RFA is empty.
@@ -2041,60 +2041,60 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
UTI_596_ASSERT(uti596_softc.pLastUnkRFD != I596_NULL,"****ERROR:LastUnk is NULL, begin ptr @ end!\n");
uti596_softc.pEndRFA = uti596_softc.pLastUnkRFD = I596_NULL;
}
-
+
#ifdef DBG_ISR
printk("Wake %#x\n",uti596_softc.rxDaemonTid);
#endif
sc = rtems_event_send(uti596_softc.rxDaemonTid, INTERRUPT_EVENT);
if ( sc != RTEMS_SUCCESSFUL )
- rtems_panic ("Can't notify rxDaemon: %s\n",
- rtems_status_text (sc));
+ rtems_panic ("Can't notify rxDaemon: %s\n",
+ rtems_status_text (sc));
#ifdef DBG_RAW_ISR
else
printk("Rx Wake: %#x\n",uti596_softc.rxDaemonTid);
#endif
-
+
uti596_softc.pBeginRFA = pIsrRfd;
} /* end while */
-
+
if ( uti596_softc.pBeginRFA == I596_NULL ){ /* adjust the pEndRFA to reflect an empty list */
if ( uti596_softc.pLastUnkRFD == I596_NULL && uti596_softc.countRFD != 0 )
printk("Last Unk is NULL, BeginRFA is null, and count == %d\n",uti596_softc.countRFD);
-
+
uti596_softc.pEndRFA = I596_NULL;
if ( uti596_softc.countRFD != 0 ) {
printk("****ERROR:Count is %d, but begin ptr is NULL\n",uti596_softc.countRFD );
}
}
-
+
} /* end scb_stat_fr */
-
+
/*
* Check For Command Complete
*/
if ( scbStatus & SCB_STAT_CX ){
#ifdef DBG_ISR
printk("ISR:CU\n");
-#endif
-
+#endif
+
pIsrCmd = uti596_softc.pCmdHead;
-
- /*
+
+ /*
* For ALL completed commands
*/
if ( pIsrCmd != I596_NULL && pIsrCmd->status & STAT_C ){
-
+
#ifdef DBG_RAW_ISR
printk("ISR:pIsrCmd != NULL\n");
#endif
-
- /*
- * Adjust the command block list
+
+ /*
+ * Adjust the command block list
*/
uti596_softc.pCmdHead = pIsrCmd -> next;
-
+
/*
- * If there are MORE commands to process,
+ * If there are MORE commands to process,
* the serialization in the raw routine has failed.
* ( Perhaps AddCmd is bad? )
*/
@@ -2110,9 +2110,9 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/* printk("****INFO:Configure OK\n"); */
uti596_softc.cmdOk = 1;
break;
-
+
case CmdDump:
-
+
#ifdef DBG_ISR
printk("dump!\n");
#endif
@@ -2120,13 +2120,13 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
break;
case CmdDiagnose:
-
+
#ifdef DBG_ISR
printk("diagnose!\n");
#endif
uti596_softc.cmdOk = 1;
break;
-
+
case CmdSASetup:
/* printk("****INFO:Set address interrupt\n"); */
@@ -2135,7 +2135,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
else
printk("****ERROR:SET ADD FAILED\n");
break;
-
+
case CmdTx:
{
UTI_596_ASSERT(uti596_softc.txDaemonTid, "****ERROR:Null txDaemonTid\n");
@@ -2143,7 +2143,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("wake TX:0x%x\n",uti596_softc.txDaemonTid);
#endif
if ( uti596_softc.txDaemonTid ){ /* Ensure that the transmitter is present */
- sc = rtems_event_send (uti596_softc.txDaemonTid,
+ sc = rtems_event_send (uti596_softc.txDaemonTid,
INTERRUPT_EVENT);
if ( sc != RTEMS_SUCCESSFUL )
@@ -2152,22 +2152,22 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
#ifdef DBG_RAW_ISR
else
printk("****INFO:Tx wake: %#x\n",uti596_softc.txDaemonTid);
-#endif
+#endif
}
} /* End case Cmd_Tx */
break;
-
+
case CmdMulticastList:
printk("***ERROR:Multicast?!\n");
pIsrCmd->next = I596_NULL;
break;
-
+
case CmdTDR:
{
unsigned long status = *( (unsigned long *)pIsrCmd)+1;
printk("****ERROR:TDR?!\n");
-
+
if (status & STAT_C)
{
/*
@@ -2183,47 +2183,47 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("****WARNING:Termination problem.\n");
if (status & 0x1000)
printk("****WARNING:Short circuit.\n");
-
+
/* printk("****INFO:Time %ld.\n", status & 0x07ff); */
}
}
break;
-
- default:
- /*
- * This should never be reached
+
+ default:
+ /*
+ * This should never be reached
*/
printk("CX but NO known command\n");
} /* end switch */
- pIsrCmd = uti596_softc.pCmdHead; /* next command */
+ pIsrCmd = uti596_softc.pCmdHead; /* next command */
if ( pIsrCmd != I596_NULL )
printk("****WARNING: more commands in list, but no start to NIC\n");
} /* end if pIsrCmd != NULL && pIsrCmd->stat & STAT_C */
else {
if ( pIsrCmd != I596_NULL ) { /* The command MAY be NULL from a RESET */
-
+
/* Reset the ethernet card, and wake the transmitter (if necessary) */
printk_time();
printk("****INFO: Request board reset ( tx )\n");
uti596_softc.nic_reset = 1;
if ( uti596_softc.txDaemonTid){ /* Ensure that a transmitter is present */
- sc = rtems_event_send (uti596_softc.txDaemonTid,
+ sc = rtems_event_send (uti596_softc.txDaemonTid,
INTERRUPT_EVENT);
-
+
if ( sc != RTEMS_SUCCESSFUL )
printk("****ERROR:Could NOT send event to tid 0x%x : %s\n",uti596_softc.txDaemonTid, rtems_status_text (sc) );
#ifdef DBG_RAW_ISR
else
printk("****INFO:Tx wake: %#x\n",uti596_softc.txDaemonTid);
-#endif
+#endif
}
}
- }
- } /* end if command complete */
-
-
- /* if the receiver has stopped,
- * check if this is a No Resources scenario,
+ }
+ } /* end if command complete */
+
+
+ /* if the receiver has stopped,
+ * check if this is a No Resources scenario,
* Try to add more RFD's ( no RBDs are used )
*/
if ( uti596_softc.started ) {
@@ -2234,16 +2234,16 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
/*
* THE RECEIVER IS OFF!
*/
- if ( uti596_softc.pLastUnkRFD != I596_NULL ){ /* We have an unknown RFD, it is not inbound*/
+ if ( uti596_softc.pLastUnkRFD != I596_NULL ){ /* We have an unknown RFD, it is not inbound*/
if ( uti596_softc.pLastUnkRFD -> stat & (STAT_C | STAT_B )) /* in use */
uti596_softc.pEndRFA = uti596_softc.pLastUnkRFD; /* update end */
- else {
- /*
+ else {
+ /*
* It is NOT in use, and since RNR, we know EL bit of pEndRFA was read!
* So, unlink it from the RFA and move it to the saved queue.
* But pBegin can equal LastUnk!
*/
-
+
if ( uti596_softc.pEndRFA != I596_NULL ){ /* check added feb24. */
#ifdef DEBUG_RFA
if (uti596_softc.pEndRFA -> next != uti596_softc.pLastUnkRFD){
@@ -2260,7 +2260,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.savedCount++;
uti596_softc.pEndSavedQueue = uti596_softc.pLastUnkRFD;
uti596_softc.countRFD--; /* It was not in the RFA */
- /*
+ /*
* The Begin pointer CAN advance this far. We must resynch the CPU side
* with the chip.
*/
@@ -2277,11 +2277,11 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
}
uti596_softc.pLastUnkRFD = I596_NULL;
-
+
} /* end if exists UnkRFD */
- /*
- * Append the saved queue to the RFA.
+ /*
+ * Append the saved queue to the RFA.
* Any further RFD's being supplied will be added to
* this new list.
*/
@@ -2292,11 +2292,11 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
printk("****ERROR:Begin pointer is NULL, but count == %d\n",uti596_softc.countRFD);
}
#endif
- uti596_softc.pBeginRFA = uti596_softc.pSavedRfdQueue;
+ uti596_softc.pBeginRFA = uti596_softc.pSavedRfdQueue;
uti596_softc.pEndRFA = uti596_softc.pEndSavedQueue;
uti596_softc.pSavedRfdQueue = uti596_softc.pEndSavedQueue = I596_NULL; /* Reset the End */
}
- else {
+ else {
#ifdef DEBUG_RFA
if ( uti596_softc.countRFD <= 0) {
printk("****ERROR:Begin pointer is not NULL, but count == %d\n",uti596_softc.countRFD);
@@ -2304,15 +2304,15 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
#endif
UTI_596_ASSERT( uti596_softc.pEndRFA != I596_NULL, "****WARNING: END RFA IS NULL\n");
UTI_596_ASSERT( uti596_softc.pEndRFA->next == I596_NULL, "****ERROR:END RFA -> next must be NULL\n");
-
- uti596_softc.pEndRFA->next = uti596_softc.pSavedRfdQueue;
- uti596_softc.pEndRFA->cmd &= ~CMD_EOL; /* clear the end of list */
+
+ uti596_softc.pEndRFA->next = uti596_softc.pSavedRfdQueue;
+ uti596_softc.pEndRFA->cmd &= ~CMD_EOL; /* clear the end of list */
uti596_softc.pEndRFA = uti596_softc.pEndSavedQueue;
uti596_softc.pSavedRfdQueue = uti596_softc.pEndSavedQueue = I596_NULL; /* Reset the End */
#ifdef DEBUG_ISR
printk("count: %d, saved: %d \n", uti596_softc.countRFD , uti596_softc.savedCount);
#endif
-
+
}
/* printk("Isr: countRFD = %d\n",uti596_softc.countRFD); */
uti596_softc.countRFD += uti596_softc.savedCount;
@@ -2320,15 +2320,15 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
uti596_softc.savedCount = 0;
}
-
+
#ifdef DBG_596_RFD
printk("The list starts here %p\n",uti596_softc.pBeginRFA );
#endif
-
+
if ( uti596_softc.countRFD > 1) {
/****REMOVED FEB 18.
- &&
- !( uti596_softc.pBeginRFA -> stat & (STAT_C | STAT_B ))) {
+ &&
+ !( uti596_softc.pBeginRFA -> stat & (STAT_C | STAT_B ))) {
*****/
printk_time();
printk("****INFO: pBeginRFA -> stat = 0x%x\n",uti596_softc.pBeginRFA -> stat);
@@ -2337,7 +2337,7 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
UTI_596_ASSERT(uti596_softc.scb.command == 0, "****ERROR:scb command must be zero\n");
uti596_softc.scb.pRfd = uti596_softc.pBeginRFA;
/* start RX here */
- printk("****INFO: ISR Starting receiver\n");
+ printk("****INFO: ISR Starting receiver\n");
uti596_softc.scb.command = RX_START; /* should this also be CU start? */
outport_word(CHAN_ATTN, 0);
}
@@ -2345,39 +2345,39 @@ int uti596_attach(struct rtems_bsdnet_ifconfig * pConfig )
else {
printk("****WARNING: Receiver NOT Started -- countRFD = %d\n", uti596_softc.countRFD);
printk("82596 cmd: 0x%x, status: 0x%x RFA len: %d\n",
- uti596_softc.scb.command,
+ uti596_softc.scb.command,
uti596_softc.scb.status,
uti596_softc.countRFD);
-
+
printk("\nRFA: \n");
for ( pISR_Rfd = uti596_softc.pBeginRFA;
pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
+ pISR_Rfd = pISR_Rfd->next)
printk("Frame @ %x, status: %x, cmd: %x\n",
pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
-
+
printk("\nInbound: \n");
for ( pISR_Rfd = uti596_softc.pInboundFrameQueue;
pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
+ pISR_Rfd = pISR_Rfd->next)
printk("Frame @ %x, status: %x, cmd: %x\n",
pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
-
-
+
+
printk("\nSaved: \n");
for ( pISR_Rfd = uti596_softc.pSavedRfdQueue;
pISR_Rfd != I596_NULL;
- pISR_Rfd = pISR_Rfd->next)
+ pISR_Rfd = pISR_Rfd->next)
printk("Frame @ %x, status: %x, cmd: %x\n",
pISR_Rfd, pISR_Rfd->stat, pISR_Rfd->cmd);
printk("\nUnknown: %p\n",uti596_softc.pLastUnkRFD);
}
*****/
- } /* end stat_rnr */
+ } /* end stat_rnr */
} /* end if receiver started */
/* UTI_596_ASSERT(uti596_softc.scb.status == scbStatus, "****WARNING:scbStatus change!\n"); */
-
+
#ifdef DBG_ISR
printk("X\n");
#endif
@@ -2413,13 +2413,13 @@ struct i596_rfd * uti596dequeue( struct i596_rfd ** ppQ )
struct i596_rfd * pRfd;
_ISR_Disable(level);
-
+
/* invalid address, or empty queue or emptied queue */
if( ppQ == NULL || *ppQ == NULL || *ppQ == I596_NULL) {
_ISR_Enable(level);
return I596_NULL;
}
-
+
pRfd = *ppQ; /* The dequeued buffer */
*ppQ = pRfd->next; /* advance the queue pointer */
pRfd->next = I596_NULL; /* unlink the rfd being returned */
@@ -2427,7 +2427,7 @@ struct i596_rfd * uti596dequeue( struct i596_rfd ** ppQ )
_ISR_Enable(level);
return pRfd;
-}
+}
/***********************************************************************
* Function: void uti596append
@@ -2435,13 +2435,13 @@ struct i596_rfd * uti596dequeue( struct i596_rfd ** ppQ )
* Description:
* adds an RFD to the end of the received frame queue,
* for processing by the rxproc.
- * Also removes this RFD from the RFA
+ * Also removes this RFD from the RFA
*
* Algorithm:
*
***********************************************************************/
-void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
+void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
{
struct i596_rfd *p;
@@ -2449,7 +2449,7 @@ void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
if ( pRfd != NULL && pRfd != I596_NULL) {
pRfd -> next = I596_NULL;
pRfd -> cmd |= CMD_EOL; /* set EL bit */
-
+
if ( *ppQ == NULL || *ppQ == I596_NULL ) {
/* Empty or emptied */
*ppQ = pRfd;
@@ -2458,7 +2458,7 @@ void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
{
for ( p=*ppQ; p -> next != I596_NULL; p=p->next)
;
-
+
p->cmd &= ~CMD_EOL; /* Clear EL bit at end */
p->next = pRfd;
}
@@ -2479,14 +2479,14 @@ void uti596append( struct i596_rfd ** ppQ , struct i596_rfd * pRfd )
* mark transmitter as busy
* abort any transmissions/receptions
* clean-up all buffers ( RFD's et. al. )
- *
- *
- *
+ *
+ *
+ *
*
***********************************************************************/
-/* static */
+/* static */
void uti596_stop(struct uti596_softc *sc)
{
sc->started = 0;
@@ -2546,7 +2546,7 @@ uti596_ioctl (struct ifnet *ifp, int command, caddr_t data)
printk("show stats\n");
uti596_stats (sc);
break;
-
+
/*
* FIXME: All sorts of multicast commands need to be added here!
*/
@@ -2571,7 +2571,7 @@ uti596_ioctl (struct ifnet *ifp, int command, caddr_t data)
***********************************************************************/
-void
+void
uti596_stats(struct uti596_softc *sc)
{
printf(" CPU Reports:\n");
@@ -2580,14 +2580,14 @@ uti596_stats(struct uti596_softc *sc)
printf ("Tx Interrupts:%-8lu\n", sc->txInterrupts);
printf ("Rx Packets:%-8u", sc->stats.rx_packets);
printf ("Tx Attempts:%-u\n", sc->stats.tx_packets);
-
+
printf ("Rx Dropped:%-8u", sc->stats.rx_dropped);
printf ("Rx IP Packets:%-8u", sc->stats.rx_packets);
printf ("Tx Errors:%-8u\n", sc->stats.tx_errors);
printf ("Tx aborted:%-8u", sc->stats.tx_aborted_errors);
printf ("Tx Dropped:%-8u\n", sc->stats.tx_dropped);
printf ("Tx IP packets:%-8u", sc->stats.tx_packets);
-
+
printf ("Collisions Detected:%-8u\n", sc->stats.collisions);
printf ("Tx Heartbeat Errors:%-8u", sc->stats.tx_heartbeat_errors);
printf ("Tx Carrier Errors:%-8u\n", sc->stats.tx_carrier_errors);
@@ -2614,19 +2614,19 @@ void dumpQ(void) {
printf("savedQ:\n");
for( pRfd = uti596_softc.pSavedRfdQueue;
pRfd != I596_NULL;
- pRfd = pRfd -> next)
+ pRfd = pRfd -> next)
printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
printf("Inbound:\n");
for( pRfd = uti596_softc.pInboundFrameQueue;
pRfd != I596_NULL;
- pRfd = pRfd -> next)
+ pRfd = pRfd -> next)
printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
printf("Last Unk: %p\n", uti596_softc.pLastUnkRFD );
-
+
printf("RFA:\n");
for( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL;
- pRfd = pRfd -> next)
+ pRfd = pRfd -> next)
printf("pRfd: %p, stat: 0x%x cmd: 0x%x\n",pRfd,pRfd -> stat,pRfd -> cmd);
}
@@ -2646,34 +2646,34 @@ void uti596Diagnose(int verbose){
printf("Status diagnostic: 0x%2.2x\n", diagnose.status);
}
-void show_buffers (void)
+void show_buffers (void)
{
struct i596_rfd *pRfd;
printf("82596 cmd: 0x%x, status: 0x%x RFA len: %d\n",
- uti596_softc.scb.command,
+ uti596_softc.scb.command,
uti596_softc.scb.status,
uti596_softc.countRFD);
-
+
printf("\nRFA: \n");
for ( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL;
- pRfd = pRfd->next)
+ pRfd = pRfd->next)
printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
pRfd, pRfd->stat, pRfd->cmd);
-
+
printf("\nInbound: \n");
for ( pRfd = uti596_softc.pInboundFrameQueue;
pRfd != I596_NULL;
- pRfd = pRfd->next)
+ pRfd = pRfd->next)
printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
pRfd, pRfd->stat, pRfd->cmd);
-
+
printf("\nSaved: \n");
for ( pRfd = uti596_softc.pSavedRfdQueue;
pRfd != I596_NULL;
- pRfd = pRfd->next)
+ pRfd = pRfd->next)
printf("Frame @ %p, status: %2.2x, cmd: %2.2x\n",
pRfd, pRfd->stat, pRfd->cmd);
printf("\nUnknown: %p\n",uti596_softc.pLastUnkRFD);
@@ -2684,26 +2684,26 @@ void show_queues(void)
struct i596_rfd *pRfd;
- printf("CMD: 0x%x, Status: 0x%x\n",
+ printf("CMD: 0x%x, Status: 0x%x\n",
uti596_softc.scb.command,
uti596_softc.scb.status);
printf("saved Q\n");
-
+
for ( pRfd = uti596_softc.pSavedRfdQueue;
pRfd != I596_NULL &&
pRfd != NULL;
pRfd = pRfd->next)
printf("0x%p\n", pRfd);
-
+
printf("End saved Q 0x%p\n", uti596_softc.pEndSavedQueue);
-
+
printf("\nRFA:\n");
for ( pRfd = uti596_softc.pBeginRFA;
pRfd != I596_NULL &&
pRfd != NULL;
pRfd = pRfd->next)
printf("0x%p\n", pRfd);
-
+
printf("uti596_softc.pEndRFA: %p\n",uti596_softc.pEndRFA);
}
@@ -2717,17 +2717,17 @@ void uti596_init(void * arg){
if (sc->txDaemonTid == 0) {
uti596_initialize_hardware(sc);
-
+
/*
* Start driver tasks
*/
-
+
sc->txDaemonTid = rtems_bsdnet_newproc ("UTtx", 2*4096, uti596_txDaemon, sc);
sc->rxDaemonTid = rtems_bsdnet_newproc ("UTrx", 2*4096, uti596_rxDaemon, sc);
- sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096,
+ sc->resetDaemonTid = rtems_bsdnet_newproc ("UTrt", 2*4096,
uti596_resetDaemon, sc);
-
-
+
+
#ifdef DBG_INIT
printf("After attach, status of board = 0x%x\n", sc->scb.status );
#endif
@@ -2735,25 +2735,25 @@ void uti596_init(void * arg){
}
- /*
+ /*
* Enable receiver
*/
- UTI_WAIT_COMMAND_ACCEPTED(4000, "init:Before RX_START");
+ UTI_WAIT_COMMAND_ACCEPTED(4000, "init:Before RX_START");
sc->scb.pRfd = sc -> pBeginRFA;
sc->scb.command = RX_START;
- outport_word(CHAN_ATTN,0 );
- UTI_WAIT_COMMAND_ACCEPTED(4000, "init:RX_START");
+ outport_word(CHAN_ATTN,0 );
+ UTI_WAIT_COMMAND_ACCEPTED(4000, "init:RX_START");
/*
* Tell the world that we're running.
*/
ifp->if_flags |= IFF_RUNNING;
-
+
}
void dump_scb(void){
printk("status 0x%x\n",uti596_softc.scb.status);
printk("command 0x%x\n",uti596_softc.scb.command);
printk("cmd 0x%x\n",(int)uti596_softc.scb.pCmd);
- printk("rfd 0x%x\n",(int)uti596_softc.scb.pRfd);
+ printk("rfd 0x%x\n",(int)uti596_softc.scb.pRfd);
printk("crc_err 0x%x\n",uti596_softc.scb.crc_err);
printk("align_err 0x%x\n",uti596_softc.scb.align_err);
printk("resource_err 0x%x\n",uti596_softc.scb.resource_err );
@@ -2768,5 +2768,5 @@ void printk_time(void){
rtems_time_of_day tm_struct;
rtems_clock_get(RTEMS_CLOCK_GET_TOD, &tm_struct);
- printk("Current time: %d:%d:%d \n", tm_struct.hour, tm_struct.minute, tm_struct.second);
+ printk("Current time: %d:%d:%d \n", tm_struct.hour, tm_struct.minute, tm_struct.second);
}
diff --git a/c/src/lib/libbsp/i386/i386ex/network/uti596.h b/c/src/lib/libbsp/i386/i386ex/network/uti596.h
index 5448362a22..8dc43cf86e 100644
--- a/c/src/lib/libbsp/i386/i386ex/network/uti596.h
+++ b/c/src/lib/libbsp/i386/i386ex/network/uti596.h
@@ -58,13 +58,13 @@ struct enet_statistics{
enum commands {
- CmdNOp = 0,
- CmdSASetup = 1,
- CmdConfigure = 2,
+ CmdNOp = 0,
+ CmdSASetup = 1,
+ CmdConfigure = 2,
CmdMulticastList = 3,
- CmdTx = 4,
- CmdTDR = 5,
- CmdDump = 6,
+ CmdTx = 4,
+ CmdTDR = 5,
+ CmdDump = 6,
CmdDiagnose = 7
};
@@ -142,7 +142,7 @@ struct i596_tbd {
unsigned short size;
unsigned short pad;
struct i596_tbd *next;
- char *data;
+ char *data;
};
/*
@@ -153,7 +153,7 @@ struct i596_rbd {
unsigned short count;
unsigned short offset;
struct i596_rbd *next;
- char *data;
+ char *data;
unsigned short size;
unsigned short pad;
};
@@ -176,10 +176,10 @@ struct i596_rfd {
volatile unsigned short stat;
volatile unsigned short cmd;
struct i596_rfd *next;
- struct i596_rbd *pRbd;
+ struct i596_rbd *pRbd;
unsigned short count;
unsigned short size;
- char data [1532 ];
+ char data [1532 ];
} ;
@@ -228,7 +228,7 @@ struct i596_scb {
};
-/*
+/*
* Intermediate System Control Block
*/
struct i596_iscp {
@@ -253,7 +253,7 @@ struct uti596_softc {
struct i596_set_add set_add;
struct i596_configure set_conf;
struct i596_tdr tdr;
- struct i596_nop nop;
+ struct i596_nop nop;
unsigned long stat;
struct tx_cmd *pTxCmd;
struct i596_tbd *pTbd;
diff --git a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h b/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
index 8c2c5caeff..a62f08f425 100644
--- a/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
+++ b/c/src/lib/libbsp/i386/i386ex/start/80386ex.h
@@ -8,7 +8,7 @@
* The license and distribution terms for this file may be
* found in the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
- *
+ *
* $Id$
*/
diff --git a/c/src/lib/libbsp/i386/i386ex/start/start.S b/c/src/lib/libbsp/i386/i386ex/start/start.S
index 1e32e33718..999c161b9b 100644
--- a/c/src/lib/libbsp/i386/i386ex/start/start.S
+++ b/c/src/lib/libbsp/i386/i386ex/start/start.S
@@ -2,14 +2,14 @@
* This file is the main boot and configuration file for the i386ex. It is
* solely responsible for initializing the internal register set to reflect
* the proper board configuration. This version is the "generic" i386ex
- * startup:
+ * startup:
*
* 1) 512K flask ROM @3f80000
* 2) 1 Mb RAM @ 0x0
* 3) Timer0 used as RTEMS clock ticker, 1 msec tick rate.
* 4) READY# is generated by CPU
*
- * The file is a multi-section file, with sections as follows:
+ * The file is a multi-section file, with sections as follows:
* 1) interrupt gates, in section "ints"
* 2) interrupt descriptor table, in section "idt"
* 3) global descriptor table, in section "gdt"
@@ -28,11 +28,11 @@
*
* $Id$
-
-changes:
+
+changes:
SetExRegByte(ICW3S , 0x02 ) # MUST be 0x02 according to intel
SetExRegByte(ICW3M , 0x04 ) # IR2 is cascaded internally: was 0x02 => IR1 is cascaded
-
+
*/
@@ -43,56 +43,56 @@ changes:
/*
* NEW_GAS Needed for binutils 2.9.1.0.7 and higher
- */
+ */
- EXTERN (boot_card) /* exits to bspstart */
+ EXTERN (boot_card) /* exits to bspstart */
EXTERN (stack_start) /* defined in startup/linkcmds */
EXTERN (Clock_exit)
PUBLIC (Interrupt_descriptor_table)
PUBLIC ( SYM(IDTR) )
/* PUBLIC( SYM(_initInternalRegisters) ) */
-
-BEGIN_DATA
+
+BEGIN_DATA
SYM(IDTR): DESC3( SYM(Interrupt_descriptor_table), 0x07ff );
-
+
SYM(Interrupt_descriptor_table): /* Now in data section */
.rept 256
.word 0,0,0,0
.endr
-END_DATA
-
+END_DATA
+
BEGIN_DATA
PUBLIC (_Global_descriptor_table)
-
+
SYM(GDTR): DESC3( GDT_TABLE, 0x1f ); # one less than the size
-SYM (_Global_descriptor_table):
+SYM (_Global_descriptor_table):
SYM(GDT_TABLE): DESC2(0,0,0,0,0,0);
-SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
+SYM(GDT_ALIAS): DESC2(32,0x1000,0x0,0x93,0,0x0);
SYM(GDT_CODE): DESC2(0xffff,0,0x0,0x9B,0xDF,0x00);
SYM(GDT_DATA): DESC2(0xffff,0,0x0,0x92,0xDF,0x00); # was CF
SYM(GDT_END):
END_DATA
-
+
/* This section is the section that is used by the interrupt
descriptor table. It is used to provide the IDT with the
correct vector offsets. It is for symbol definition only.
*/
-
+
.code16
.section .reset, "ax"
- PUBLIC ( SYM(reset) )
+ PUBLIC ( SYM(reset) )
SYM(reset):
nop
cli
-#ifdef NEW_GAS
+#ifdef NEW_GAS
data32 addr32 jmp SYM(_initInternalRegisters) /* different section in this file */
#else
jmp SYM(_initInternalRegisters) /* different section in this file */
-#endif
+#endif
/* .code32 in case this section moves */
nop /* required by CHIP LAB to pad out size */
nop
@@ -105,27 +105,27 @@ SYM(reset):
nop
nop
nop
-
+
.section .initial, "ax"
/* nop */ /* required for linker -- initial jump is to "label - 2" */
- /* nop */ /* ie. _initInternalRegisters -2 ( which now == .initial ) */
+ /* nop */ /* ie. _initInternalRegisters -2 ( which now == .initial ) */
/*
* Enable access to peripheral register at expanded I/O addresses
*/
-SYM(_initInternalRegisters):
+SYM(_initInternalRegisters):
/* .code16 */
- movw $0x8000 , ax
+ movw $0x8000 , ax
outb al , $REMAPCFGH
xchg al , ah
outb al,$REMAPCFGL
outw ax, $REMAPCFG ;
/*
* Configure operation of the A20 Address Line
- */
+ */
SYM(A20):
movw $PORT92 , dx
-
+
inb dx , al # clear A20 port reset
andb $0xfe , al # b0 Fast Reset(0)=disabled,(1)=reset triggered
orb $0x02 , al # Bit 1 Fast A20 = 0 (always 0) else enabled.
@@ -135,11 +135,11 @@ SYM(A20):
SYM(Watchdog):
movw $WDTSTATUS , dx # address the WDT status port
inb dx , al # get the WDT status
- orb $0x01 , al # set the CLKDIS bit
+ orb $0x01 , al # set the CLKDIS bit
outb al , dx # disable the clock to the WDT
/*
- * Initialize Refresh Control Unit for:
+ * Initialize Refresh Control Unit for:
* Refresh Address = 0x0000
* Refresh gate between rows is 15.6 uSec
@@ -148,20 +148,20 @@ SYM(Watchdog):
* The refresh pin is not used.
*/
-SYM(InitRCU):
+SYM(InitRCU):
SetExRegWord( RFSCIR , 390) # refresh interval was 390, tried 312
SetExRegWord( RFSBAD , 0x0) # base address
SetExRegWord( RFSADD , 0x0) # address register
SetExRegWord( RFSCON , 0x8000) # enable bit
/*
- * Initialize clock and power mgmt unit for:
+ * Initialize clock and power mgmt unit for:
* Clock Frequency = 50 Mhz
* Prescaled clock output = 1 Mhz
* Normal halt instructions
*/
-
-SYM(InitClk):
+
+SYM(InitClk):
SetExRegByte( PWRCON, 0x0 )
SetExRegWord( CLKPRS, 0x17) # 0x13 for 1.19318 MHz. 0x17 for 1MHz.
@@ -170,7 +170,7 @@ SYM(InitClk):
*************************************************************/
/*
- * Initialize I/O port 1 for:
+ * Initialize I/O port 1 for:
* PIN 0 = 1, DCD0# to package pin
* PIN 1 = 1, RTS0# to package pin
* PIN 2 = 1, DTR0# to package pin
@@ -181,15 +181,15 @@ SYM(InitClk):
* PIN 7 = 0, Outport (P17_HOLD to 386ex option header JP7 pin 3)
*/
-SYM(InitPort1):
+SYM(InitPort1):
SetExRegByte( P1LTC , 0xff )
SetExRegByte( P1DIR , 0x0 )
SetExRegByte( P1CFG , 0x1f)
-
+
/*
- * Initialize I/O port 2 for:
- * PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
- * PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
+ * Initialize I/O port 2 for:
+ * PIN 0 = 0, Outport (P20_CS0# to 386ex option header JP7 pin 11)
+ * PIN 1 = 0, Outport (P21_CS1# to 386ex option header JP7 pin 9)
* PIN 2 = 1, CS2# (SMRAM) If not using CS2 can be configured as.?
* PIN 3 = 0, Outport ( no connect )
* PIN 4 = 1, CS#4 (DRAM)
@@ -197,34 +197,34 @@ SYM(InitPort1):
* PIN 6 = 1, TXD0 output.
* PIN 7 = 1, CTS0# input.
*/
-
-SYM(InitPort2):
+
+SYM(InitPort2):
SetExRegByte( P2LTC , 0xff )
SetExRegByte( P2DIR , 0x0 )
SetExRegByte( P2CFG , 0xfe)
-
+
/*
- * Initialize I/O port 3 P3CFG
+ * Initialize I/O port 3 P3CFG
* PIN 0 = 1, TMROUT0 to package pin
- * PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
- * PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
- * PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
- * PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
- * PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
+ * PIN 1 = 0, (TMROUT1 to 386ex option header JP7 pin 23)
+ * PIN 2 = 0, INT0 (IR1) disabled, (P3.2 out to JP7 pin 21)
+ * PIN 3 = 0, INT1 (IR5) disbled (P3.3 to option header JP7 pin 19)
+ * PIN 4 = 0, INT2 (IR6) disbled (P3.4 to option header JP7 pin 17)
+ * PIN 5 = 0, INT2 (IR7) disabled (P3.5 to 386ex header JP7 pin 15)
* PIN 6 = 0, Inport (Debugger Break P3.6/PWRD to package pin )
* P3.6 selected
* PIN 7 = 0, COMCLK output disabled, 1.8432 Mhz OSC1 oscillator.
* ( Debbugger uses COMCLK as the clocking source )
* P3.7 connected to package pin.
*/
-
-SYM(InitPort3):
+
+SYM(InitPort3):
SetExRegByte( P3LTC , 0xff )
SetExRegByte( P3DIR , 0x41 )
SetExRegByte( P3CFG , 0x09 ) # can check TMROUT0
/*
- * Initialize Peripheral Pin Configurations:
- * PIN 0 = 1, RTS1# to package pin
+ * Initialize Peripheral Pin Configurations:
+ * PIN 0 = 1, RTS1# to package pin
* PIN 1 = 1, DTR1# to package pin
* PIN 2 = 1, TXD1 out to package pin
* PIN 3 = 0, EOP#/TC
@@ -233,20 +233,20 @@ SYM(InitPort3):
* PIN 6 = 0, 0 => CS6# connected to package pin
* PIN 7 = 0, Don't care
*/
-
-SYM(InitPeriph):
- SetExRegByte( PINCFG , 0x24)
-
+
+SYM(InitPeriph):
+ SetExRegByte( PINCFG , 0x24)
+
/*
- * Initialize the Asynchronous Serial Ports:
+ * Initialize the Asynchronous Serial Ports:
* BIT 7 = 1, Internal SIO1 modem signals
* BIT 6 = 1, Internal SIO0 modem signals
* BIT 2 = 0, PSCLK for SSIO clock
- * BIT 1 = 1, SERCLK for SIO1 clock
+ * BIT 1 = 1, SERCLK for SIO1 clock
* BIT 0 = 1, SERCLK for SIO0 clock
*/
-SYM(InitSIO):
+SYM(InitSIO):
SetExRegByte( SIOCFG, 0xC3 ) # SIOn clocked internally
SetExRegByte( LCR0, 0x80 ) # latch DLL0, DLH0
@@ -255,48 +255,48 @@ SYM(InitSIO):
SetExRegByte( LCR0, 0x03 ) # enable r/w buffers, IER0 accessible
# mode 8-n-1
SetExRegByte( IER0, 0x00 ) # was 0x0f All interrupts detected
-
- SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
+
+ SetExRegByte( LCR1, 0x80 ) # latch DLL0, DLH0
SetExRegByte( DLL1, 0x51 ) # 0x51 set to 9600 baud, 0x7 = 115200
SetExRegByte( DLH1, 0x00 ) # 0x145 is 2400 baud
SetExRegByte( LCR1, 0x03 ) # enable r/w buffers, IER1 accessible
# reg 8-n-1
SetExRegByte( IER1, 0x00 ) # was 0x0f - All interrupts detected
-SYM(InitMCR):
+SYM(InitMCR):
/*
- * Initialize Timer for:
+ * Initialize Timer for:
* BIT 7 = 1, Timer clocks disabled
* BIT 6 = 0, Reserved
* BIT 5 = 1, TMRCLK2 instead of Vcc to Gate2
* BIT 4 = 0, PSCLK to CLK2
* BIT 3 = 1, TMRCLK1 instead of Vcc to Gate1
* BIT 2 = 0, PSCLK to Gate1
- * BIT 1 = 0, Vcc to Gate0
+ * BIT 1 = 0, Vcc to Gate0
* BIT 0 = 0, PSCLK to Gate0
*/
-SYM(InitTimer):
- SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
+SYM(InitTimer):
+ SetExRegByte(TMRCFG , 0x80 ) # All counters disabled, Gates 0,1
# and 2 are set to Vcc
SetExRegByte(TMRCON , 0x34 ) # prepare to write counter 0 LSB,MSB
SetExRegByte(TMR0 , 0x00 ) # sfa
- SetExRegByte(TMR0 , 0x00 ) # sfa
+ SetExRegByte(TMR0 , 0x00 ) # sfa
+
-
SetExRegByte(TMRCON , 0x70 ) # mode 0 disables on Gate= Vcc
- SetExRegByte(TMR1 , 0x00 ) # sfa
SetExRegByte(TMR1 , 0x00 ) # sfa
-
+ SetExRegByte(TMR1 , 0x00 ) # sfa
+
SetExRegByte(TMRCON , 0xB0 ) # mode 0 disables on gate =Vcc
- SetExRegByte(TMR2 , 0x00 ) #
- SetExRegByte(TMR2 , 0x00 ) #
+ SetExRegByte(TMR2 , 0x00 ) #
+ SetExRegByte(TMR2 , 0x00 ) #
SetExRegByte(TMRCFG , 0x80 ) # Enable = 0x00
/*
- * Initialize the DMACFG register for:
+ * Initialize the DMACFG register for:
* BIT 7 = 1 , Disable DACK#1
* BITs 6:4 = 100, TMROUT2 connected to DRQ1
* BIT 3 = 1 , Disable DACK0#
@@ -316,17 +316,17 @@ SYM(InitTimer):
*/
SYM(InitInt):
-
+
cli # !
/* SetExRegByte(OCW3S, 0x20) # address the Slave status port
- movw $OCW3S , dx
+ movw $OCW3S , dx
inb dx , al # Read the IRR.
- SetExRegByte(OCW3M, 0x20) # address the Master status port
- movw $OCW3M , dx
+ SetExRegByte(OCW3M, 0x20) # address the Master status port
+ movw $OCW3M , dx
inb dx , al # Read the IRR.
-*/
-
+*/
+
SetExRegByte(ICW1S , 0x11 ) # EDGE TRIGGERED
SetExRegByte(ICW2S , 0x28 ) # Slave base vector after Master
SetExRegByte(ICW3S , 0x02 ) # slave cascaded to IR2 on master
@@ -336,65 +336,65 @@ SYM(InitInt):
SetExRegByte(ICW2M , 0x20 ) # base vector starts at byte 32
SetExRegByte(ICW3M , 0x04) # IR2 is cascaded internally
SetExRegByte(ICW4M , 0x01 ) # fully nested mode
-
- SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe.
+
+ SetExRegByte(OCW1M , 0xde ) # IR0 only = 0xfe.
# for IR5 and IR0 active use 0xde
# for IR0 and IR2 use 0xfa
SetExRegByte(INTCFG , 0x00 )
-
-
-SYM(SetCS4):
+
+
+SYM(SetCS4):
SetExRegWord(CS4ADL , 0x702) #Configure chip select 4
SetExRegWord(CS4ADH , 0x00)
- SetExRegWord(CS4MSKH, 0x03F)
- SetExRegWord(CS4MSKL, 0xFC01)
+ SetExRegWord(CS4MSKH, 0x03F)
+ SetExRegWord(CS4MSKL, 0xFC01)
-SYM(SetUCS1):
+SYM(SetUCS1):
SetExRegWord(UCSADL , 0x0304) # 512K block starting at 0x80000 until 0x3f80000
SetExRegWord(UCSADH , 0x03F8)
- SetExRegWord(UCSMSKH, 0x03F7)
+ SetExRegWord(UCSMSKH, 0x03F7)
SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
/******************************************************
* The GDT must be in RAM since it must be writeable,
* So, move the whole data section down.
********************************************************/
-
+
movw $ _ram_data_offset , di
- movw $ _ram_data_segment, cx
+ movw $ _ram_data_segment, cx
mov cx , es
- movw $ _data_size , cx
- movw $ _rom_data_segment, ax
- movw $ _rom_data_offset , si
+ movw $ _data_size , cx
+ movw $ _rom_data_segment, ax
+ movw $ _rom_data_offset , si
mov ax , ds
-
+
repne
movsb
-
+
/*****************************
* Load the Global Descriptor
* Table Register
****************************/
-
-#ifdef NEW_GAS
+
+#ifdef NEW_GAS
data32 addr32 lgdt SYM(GDTR) # location of GDT
#else
lgdt SYM(GDTR) # location of GDT
-#endif
+#endif
+
-
-SYM(SetUCS):
- SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
+SYM(SetUCS):
+ SetExRegWord(UCSADL, 0x0702) # now 512K starting at 0x3f80000.
SetExRegWord(UCSADH, 0x03f8)
- SetExRegWord(UCSMSKH, 0x0007)
+ SetExRegWord(UCSMSKH, 0x0007)
SetExRegWord(UCSMSKL, 0xFC01) # configure upper chip select
-
+
/*
* SRAM chip select: 16 bit bus size,starting 16Mb, size 512k,
* 4 waits
*/
-
+
#ifdef UT_I386EX
SYM(SetCS1):
@@ -411,7 +411,7 @@ SYM(SetCS2):
/*
* Real-time clock: 8 bit bus size, starting@16Mb+512K, size 32k
- * 4 waits
+ * 4 waits
*/
SYM(SetCS3):
SetExRegWord(CS3ADL, 0x0504)
@@ -427,25 +427,25 @@ SYM(SetCS3):
mov cr0, eax
orw $0x1, ax
mov eax, cr0
-
+
/**************************
* Flush prefetch queue,
* and load CS selector
*********************/
ljmpl $ GDT_CODE_PTR , $ SYM(_load_segment_registers) # sets the code selector
-
+
/*
* Load the segment registers
*/
-SYM(_load_segment_registers):
+SYM(_load_segment_registers):
.code32
pLOAD_SEGMENT( GDT_DATA_PTR, fs)
pLOAD_SEGMENT( GDT_DATA_PTR, gs)
pLOAD_SEGMENT( GDT_DATA_PTR, ss)
pLOAD_SEGMENT( GDT_DATA_PTR, ds)
pLOAD_SEGMENT( GDT_DATA_PTR, es)
-
+
/*
* Set up the stack
*/
@@ -481,7 +481,7 @@ SYM (zero_bss):
pushl $0 # argc
movw $0xFFFB, SYM(i8259s_cache) # ICU mask values reflect
- # initial ICU state
+ # initial ICU state
call SYM(boot_card)
addl $12,esp
diff --git a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
index 088796bdc5..bfb7b9cf99 100644
--- a/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
+++ b/c/src/lib/libbsp/i386/i386ex/startup/bspstart.c
@@ -13,10 +13,10 @@
*
* Ported to the i386ex and submitted by:
*
- * Erik Ivanenko
+ * Erik Ivanenko
* University of Toronto
* erik.ivanenko@utoronto.ca
- *
+ *
* $Id$
*/
@@ -46,7 +46,7 @@ extern uint32_t rdb_start;
/*
* Use the shared implementations of the following routines
*/
-
+
void bsp_postdriver_hook(void);
void bsp_libc_init( void *, uint32_t, int );
@@ -63,7 +63,7 @@ void bsp_libc_init( void *, uint32_t, int );
* not yet initialized.
*
*/
-
+
void bsp_pretasking_hook(void)
{
extern int heap_bottom;
diff --git a/c/src/lib/libbsp/i386/i386ex/timer/timer.c b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
index 555676e5e1..cf6e87d144 100644
--- a/c/src/lib/libbsp/i386/i386ex/timer/timer.c
+++ b/c/src/lib/libbsp/i386/i386ex/timer/timer.c
@@ -48,7 +48,7 @@ void TimerOn(const rtems_raw_irq_connect_data* used)
outport_byte ( TMRCON , 0xb0 ); /* select tmr2, stay in mode 0 */
outport_byte ( TMR1 , 0xfa ); /* set to 250 usec interval */
outport_byte ( TMR1 , 0x00 );
- outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
+ outport_byte ( TMRCON , 0x64 ); /* change to mode 2 ( starts timer ) */
/* interrupts ARE enabled */
/* outport_byte( IERA, 0x41 ); enable interrupt */
/*
@@ -116,7 +116,7 @@ int Read_timer()
/* outport_byte( TBCR, 0x00 ); stop the timer -- not needed on intel */
outport_byte ( TMRCON, 0x40 ); /* latch the count */
- inport_byte ( TMR1, clicks ); /* read the count */
+ inport_byte ( TMR1, clicks ); /* read the count */
total = Ttimer_val + 250 - clicks;