Cleanup patch from John Cotton <John.Cotton@nrc.ca>.

This commit is contained in:
Joel Sherrill
2000-04-07 19:10:44 +00:00
parent f50952c9d3
commit 09652b9ff2
4 changed files with 2331 additions and 2114 deletions

View File

@@ -9,8 +9,6 @@ PGM = $(ARCH)/network.rel
C_FILES = network.c C_FILES = network.c
C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o) C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.o)
H_FILES = netexterns.h uti596.h
OBJS = $(C_O_FILES) OBJS = $(C_O_FILES)
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
@@ -33,6 +31,6 @@ endif
.PRECIOUS: $(PGM) .PRECIOUS: $(PGM)
EXTRA_DIST = network.c netexterns.h uti596.h EXTRA_DIST = network.c
include $(top_srcdir)/../../../../../../automake/local.am include $(top_srcdir)/../../../../../../automake/local.am

View File

@@ -1,18 +0,0 @@
/*
* $Id$
*/
#ifndef NET_EXTERNS_H
#define NET_EXTERNS_H
/*
* External entry points
*/
extern int uti596_attach(struct rtems_bsdnet_ifconfig *);
extern int uti596dump(char * );
extern void uti596reset(void);
extern void uti596Diagnose(int);
extern void uti596_request_reset(void);
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,8 @@
/* uti596.h: Contains the defines and structures used by the uti596 driver */ /* uti596.h: Contains the defines and structures used by the uti596 driver */
/* /*
* EII: March 11: Created v. 0.0 * EII: March 11: Created v. 0.0
* Jan 12/98 Added STAT bits, s11-=s5 and max_colls.
* *
* $Id$ * $Id$
*/ */
@@ -56,9 +54,6 @@ struct enet_statistics{
int nic_reset_count; /* The number of times uti596reset() has been called. */ int nic_reset_count; /* The number of times uti596reset() has been called. */
}; };
#define UTI596_MUTEX 1
#define CMD_EOL 0x8000 /* The last command of the list, stop. */ #define CMD_EOL 0x8000 /* The last command of the list, stop. */
#define CMD_SUSP 0x4000 /* Suspend after doing cmd. */ #define CMD_SUSP 0x4000 /* Suspend after doing cmd. */
#define CMD_INTR 0x2000 /* Interrupt after doing cmd. */ #define CMD_INTR 0x2000 /* Interrupt after doing cmd. */
@@ -73,7 +68,6 @@ struct enet_statistics{
#define SCB_CUS_SUSPENDED 0x0100 #define SCB_CUS_SUSPENDED 0x0100
#define SCB_CUS_ACTIVE 0x0200 #define SCB_CUS_ACTIVE 0x0200
#define STAT_C 0x8000 /* Set to 1 after execution */ #define STAT_C 0x8000 /* Set to 1 after execution */
#define STAT_B 0x4000 /* 1 : Cmd being executed, 0 : Cmd done. */ #define STAT_B 0x4000 /* 1 : Cmd being executed, 0 : Cmd done. */
#define STAT_OK 0x2000 /* 1: Command executed ok 0 : Error */ #define STAT_OK 0x2000 /* 1: Command executed ok 0 : Error */
@@ -88,8 +82,6 @@ struct enet_statistics{
#define STAT_S5 0x0020 #define STAT_S5 0x0020
#define STAT_MAX_COLLS 0x000F #define STAT_MAX_COLLS 0x000F
#define RBD_STAT_P 0x4000 /* prefetch */ #define RBD_STAT_P 0x4000 /* prefetch */
#define RBD_STAT_F 0x4000 /* used */ #define RBD_STAT_F 0x4000 /* used */
@@ -106,17 +98,11 @@ struct enet_statistics{
#define RU_NO_RESOURCES 0x0020 #define RU_NO_RESOURCES 0x0020
#define RU_READY 0x0040 #define RU_READY 0x0040
#define IO_ADDR 0x360
#define PORT_ADDR IO_ADDR
#define CHAN_ATTN PORT_ADDR + 4
#define NIC_ADDR PORT_ADDR + 8
#define I596_NULL ( ( void * ) 0xffffffff) #define I596_NULL ( ( void * ) 0xffffffff)
#define UTI_596_END_OF_FRAME 0x8000 #define UTI_596_END_OF_FRAME 0x8000
#define SIZE_MASK 0x3fff
struct i596_tbd;
struct i596_tbd; /* necessary forward declaration */
enum commands { enum commands {
CmdNOp = 0, CmdNOp = 0,
@@ -129,14 +115,100 @@ enum commands {
CmdDiagnose = 7 CmdDiagnose = 7
}; };
/*
* 82596 Dump Command Result
*/
typedef volatile struct i596_dump_result {
unsigned char bf;
unsigned char config_bytes[11];
unsigned char reserved1[2];
unsigned char ia_bytes[6];
unsigned short last_tx_status;
unsigned short tx_crc_byte01;
unsigned short tx_crc_byte23;
unsigned short rx_crc_byte01;
unsigned short rx_crc_byte23;
unsigned short rx_temp_mem01;
unsigned short rx_temp_mem23;
unsigned short rx_temp_mem45;
unsigned short last_rx_status;
unsigned short hash_reg01;
unsigned short hash_reg23;
unsigned short hash_reg45;
unsigned short hash_reg67;
unsigned short slot_time_counter;
unsigned short wait_time_counter;
unsigned short rx_frame_length;
unsigned long reserved2;
unsigned long cb_in3;
unsigned long cb_in2;
unsigned long cb_in1;
unsigned long la_cb_addr;
unsigned long rdb_pointer;
unsigned long int_memory;
unsigned long rfd_size;
unsigned long tbd_pointer;
unsigned long base_addr;
unsigned long ru_temp_reg;
unsigned long tcb_count;
unsigned long next_rb_size;
unsigned long next_rb_addr;
unsigned long curr_rb_size;
unsigned long la_rbd_addr;
unsigned long next_rbd_addr;
unsigned long curr_rbd_addr;
unsigned long curr_rb_count;
unsigned long next_fd_addr;
unsigned long curr_fd_add;
unsigned long temp_cu_reg;
unsigned long next_tb_count;
unsigned long buffer_addr;
unsigned long la_tbd_addr;
unsigned long next_tbd_addr;
unsigned long cb_command;
unsigned long next_cb_addr;
unsigned long curr_cb_addr;
unsigned long scb_cmd_word;
unsigned long scb_pointer;
unsigned long cb_stat_word;
unsigned long mm_lfsr;
unsigned char micro_machine_bit_array[28];
unsigned char cu_port[16];
unsigned long mm_alu;
unsigned long reserved3;
unsigned long mm_temp_a_rr;
unsigned long mm_temp_a;
unsigned long tx_dma_b_cnt;
unsigned long mm_input_port_addr_reg;
unsigned long tx_dma_addr;
unsigned long mm_port_reg1;
unsigned long rx_dma_b_cnt;
unsigned long mm_port_reg2;
unsigned long rx_dma_addr;
unsigned long reserved4;
unsigned long bus_t_timers;
unsigned long diu_cntrl_reg;
unsigned long reserved5;
unsigned long sysbus;
unsigned long biu_cntrl_reg;
unsigned long mm_disp_reg;
unsigned long mm_status_reg;
unsigned short dump_status;
} i596_dump_result;
typedef volatile struct i596_selftest {
unsigned long rom_signature;
unsigned long results;
} i596_selftest;
/* /*
* Action commands * Action commands
* (big endian, linear mode) * (big endian, linear mode)
*/ */
typedef volatile struct i596_cmd { typedef volatile struct i596_cmd {
volatile unsigned short status; unsigned short status;
volatile unsigned short command; unsigned short command;
volatile struct i596_cmd *next; struct i596_cmd *next;
} i596_cmd; } i596_cmd;
typedef volatile struct i596_nop { typedef volatile struct i596_nop {
@@ -155,7 +227,7 @@ typedef volatile struct i596_configure {
typedef volatile struct i596_tx { typedef volatile struct i596_tx {
i596_cmd cmd; i596_cmd cmd;
volatile struct i596_tbd *pTbd; struct i596_tbd *pTbd;
unsigned short count; unsigned short count;
unsigned short pad; unsigned short pad;
char data[6]; char data[6];
@@ -178,7 +250,7 @@ typedef volatile struct i596_dump {
typedef volatile struct i596_tbd { typedef volatile struct i596_tbd {
unsigned short size; unsigned short size;
unsigned short pad; unsigned short pad;
volatile struct i596_tbd *next; struct i596_tbd *next;
char *data; char *data;
} i596_tbd; } i596_tbd;
@@ -189,7 +261,7 @@ typedef volatile struct i596_tbd {
typedef volatile struct i596_rbd { typedef volatile struct i596_rbd {
unsigned short count; unsigned short count;
unsigned short offset; unsigned short offset;
volatile struct i596_rbd *next; struct i596_rbd *next;
char *data; char *data;
unsigned short size; unsigned short size;
unsigned short pad; unsigned short pad;
@@ -199,33 +271,31 @@ typedef volatile struct i596_rbd {
* Receive Frame Descriptor * Receive Frame Descriptor
*/ */
typedef volatile struct i596_rfd { typedef volatile struct i596_rfd {
volatile unsigned short stat; unsigned short stat;
volatile unsigned short cmd; unsigned short cmd;
volatile struct i596_rfd *next; struct i596_rfd *next;
i596_rbd *pRbd; i596_rbd *pRbd;
unsigned short count; unsigned short count;
unsigned short size; unsigned short size;
char data [1532]; char data [1532];
} i596_rfd; } i596_rfd;
#define RX_RING_SIZE 8
/* /*
* System Control Block * System Control Block
*/ */
typedef volatile struct i596_scb { typedef volatile struct i596_scb {
volatile unsigned short status; unsigned short status;
volatile unsigned short command; unsigned short command;
volatile unsigned long Cmd_val; unsigned long cmd_pointer;
volatile unsigned long Rfd_val; unsigned long rfd_pointer;
volatile unsigned long crc_err; unsigned long crc_err;
volatile unsigned long align_err; unsigned long align_err;
volatile unsigned long resource_err; unsigned long resource_err;
volatile unsigned long over_err; unsigned long over_err;
volatile unsigned long rcvdt_err; unsigned long rcvdt_err;
volatile unsigned long short_err; unsigned long short_err;
volatile unsigned short t_off; unsigned short t_off;
volatile unsigned short t_on; unsigned short t_on;
i596_cmd *pCmd; i596_cmd *pCmd;
i596_rfd *pRfd; i596_rfd *pRfd;
} i596_scb; } i596_scb;
@@ -234,36 +304,39 @@ typedef volatile struct i596_scb {
* Intermediate System Configuration Pointer * Intermediate System Configuration Pointer
*/ */
typedef volatile struct i596_iscp { typedef volatile struct i596_iscp {
volatile unsigned long stat; unsigned8 null1; /* Always zero */
volatile unsigned long scb_val; unsigned8 busy; /* Busy byte */
i596_scb *scb; unsigned short scb_offset; /* Not used in linear mode */
unsigned long scb_pointer; /* Swapped pointer to scb */
i596_scb *scb; /* Real pointer to scb */
} i596_iscp; } i596_iscp;
/* /*
* System Configuration Pointer * System Configuration Pointer
*/ */
typedef volatile struct i596_scp { typedef volatile struct i596_scp {
unsigned long sysbus; unsigned long sysbus; /* Only low 8 bits are used */
unsigned long pad; unsigned long pad; /* Must be zero */
unsigned long iscp_val; unsigned long iscp_pointer; /* Swapped pointer to iscp */
i596_iscp *iscp; i596_iscp *iscp; /* Real pointer to iscp */
} i596_scp; } i596_scp;
/*
* Device Dependent Data Structure
*/
typedef volatile struct uti596_softc { typedef volatile struct uti596_softc {
struct arpcom arpcom; struct arpcom arpcom;
i596_scp *pScp; i596_scp *pScp; /* Block aligned on 16 byte boundary */
i596_scp *base_scp; /* Unaligned block. Need for free() */
i596_iscp iscp; i596_iscp iscp;
i596_scb scb; i596_scb scb;
i596_set_add set_add; i596_set_add set_add;
i596_configure set_conf; i596_configure set_conf;
i596_tdr tdr; i596_tdr tdr;
i596_nop nop; i596_nop nop;
unsigned long stat;
i596_tx *pTxCmd; i596_tx *pTxCmd;
i596_tbd *pTbd; i596_tbd *pTbd;
int ioAddr;
i596_rfd *pBeginRFA; i596_rfd *pBeginRFA;
i596_rfd *pEndRFA; i596_rfd *pEndRFA;
i596_rfd *pLastUnkRFD; i596_rfd *pLastUnkRFD;
@@ -281,6 +354,7 @@ typedef volatile struct uti596_softc {
unsigned long rxInterrupts; unsigned long rxInterrupts;
unsigned long txInterrupts; unsigned long txInterrupts;
volatile int cmdOk; volatile int cmdOk;
unsigned short * pCurrent_command_status;
int resetDone; int resetDone;
unsigned long txRawWait; unsigned long txRawWait;
i596_rfd *pInboundFrameQueue; i596_rfd *pInboundFrameQueue;
@@ -293,8 +367,7 @@ typedef volatile struct uti596_softc {
rtems_id semaphore_id; rtems_id semaphore_id;
char zeroes[64]; char zeroes[64];
unsigned long rawsndcnt; unsigned long rawsndcnt;
int nic_reset; /* flag is for requesting that ISR issue a reset quest */ int nic_reset; /* flag for requesting that ISR issue a reset quest */
} uti596_softc_; } uti596_softc_;
#endif /* UTI596_H */ #endif /* UTI596_H */