Remove stray white spaces.

This commit is contained in:
Ralf Corsepius
2004-04-20 10:43:39 +00:00
parent c8e8f119a9
commit a3d3d9aeda
51 changed files with 788 additions and 788 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
/*
* ata.h
*
* ATA RTEMS driver header file. This file should be included from an
* ATA RTEMS driver header file. This file should be included from an
* application.
*
* Copyright (C) 2002 OKTET Ltd., St.-Petersburg, Russia
@@ -10,7 +10,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$
*/
#ifndef __ATA_H__
@@ -29,20 +29,20 @@ rtems_device_driver ata_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *args);
#define ATA_DRIVER_TABLE_ENTRY \
{ata_initialize, GENERIC_BLOCK_DEVICE_DRIVER_ENTRIES}
/* ATA IOCTL request codes */
#define ATAIO_SET_MULTIPLE_MODE _IO('A', 1)
/*
* ATA driver configuration parameters
/*
* ATA driver configuration parameters
* FIXME: should be configured more easy...
*/
#define ATA_DRIVER_MESSAGE_QUEUE_SIZE 50
#define ATA_DRIVER_TASK_PRIORITY 140
#define ATA_DRIVER_TASK_STACK_SIZE 16*1024
#define ATA_DRIVER_TASK_STACK_SIZE 16*1024
#ifdef __cplusplus
}

View File

@@ -1,7 +1,7 @@
/*
* ata_internal.h
*
* ATA RTEMS driver internal header file
* ATA RTEMS driver internal header file
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
* Authors: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
@@ -10,7 +10,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$
*
*/
@@ -82,9 +82,9 @@
#define ATA_COMMAND_TYPE_DMA 3
/* ATA commands opcodes */
/*
* Commands present in both ATA-2 and ATA-4 specs.
* Some commands have two values in ATA-2,
/*
* Commands present in both ATA-2 and ATA-4 specs.
* Some commands have two values in ATA-2,
* in such case value from ATA-4 used.
* Some commands have slightly different names in these specifications,
* so names from ATA-4 are used.
@@ -223,11 +223,11 @@ typedef struct ata_req_s {
uint32_t cnt; /* Number of sectors to be exchanged */
uint32_t cbuf; /* number of current buffer from breq in use */
uint32_t pos; /* current position in 'cbuf' */
blkdev_request *breq; /* blkdev_request which corresponds to the
blkdev_request *breq; /* blkdev_request which corresponds to the
* ata request
*/
rtems_id sema; /* semaphore which is used if synchronous
* processing of the ata request is required
rtems_id sema; /* semaphore which is used if synchronous
* processing of the ata request is required
*/
rtems_status_code status; /* status of ata request processing */
int error; /* device error code */
@@ -274,8 +274,8 @@ typedef struct ata_queue_msg_s {
} while (0)
/*
* Array of such structures is indexed by interrupt vecotrs and used for
* mapping of IDE controllers and interrupt vectors
* Array of such structures is indexed by interrupt vecotrs and used for
* mapping of IDE controllers and interrupt vectors
*/
typedef struct ata_int_st_s {
Chain_Node link;
@@ -313,9 +313,9 @@ typedef struct ata_dev_s {
} ata_dev_t;
/*
* This structure describes controller state, devices configuration on the
* controller and chain of ATA requests to the controller. Array of such
* structures is indexed by controller minor number
* This structure describes controller state, devices configuration on the
* controller and chain of ATA requests to the controller. Array of such
* structures is indexed by controller minor number
*/
typedef struct ata_ide_ctrl_s {
rtems_boolean present; /* controller state */

View File

@@ -1,6 +1,6 @@
/*
* ide_controller.c
*
*
* This is generic rtems driver for IDE controllers.
*
* Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia
@@ -10,7 +10,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$
*
*/
@@ -23,7 +23,7 @@
/*
* ide_controller_initialize --
* Initializes all configured IDE controllers. Controllers configuration
* Initializes all configured IDE controllers. Controllers configuration
* table is provided by BSP
*
* PARAMETERS:
@@ -35,7 +35,7 @@
* RTEMS_SUCCESSFUL on success, or error code if
* error occured
*/
rtems_device_driver
rtems_device_driver
ide_controller_initialize(rtems_device_major_number major,
rtems_device_minor_number minor_arg,
void *args)
@@ -46,22 +46,22 @@ ide_controller_initialize(rtems_device_major_number major,
/* FIXME: may be it should be done on compilation phase */
if (IDE_Controller_Count > IDE_CTRL_MAX_MINOR_NUMBER)
rtems_fatal_error_occurred(RTEMS_TOO_MANY);
for (minor=0; minor < IDE_Controller_Count; minor++)
{
IDE_Controller_Table[minor].status = IDE_CTRL_NON_INITIALIZED;
if ((IDE_Controller_Table[minor].probe != NULL &&
if ((IDE_Controller_Table[minor].probe != NULL &&
IDE_Controller_Table[minor].probe(minor)) ||
IDE_Controller_Table[minor].fns->ctrl_probe(minor))
{
status = rtems_io_register_name(IDE_Controller_Table[minor].name,
status = rtems_io_register_name(IDE_Controller_Table[minor].name,
major, minor);
if (status != RTEMS_SUCCESSFUL)
if (status != RTEMS_SUCCESSFUL)
rtems_fatal_error_occurred(status);
IDE_Controller_Table[minor].fns->ctrl_initialize(minor);
IDE_Controller_Table[minor].status = IDE_CTRL_INITIALIZED;
}
}
@@ -133,7 +133,7 @@ ide_controller_write_data_block(rtems_device_minor_number minor,
*/
void
ide_controller_read_register(rtems_device_minor_number minor,
int reg,
int reg,
uint16_t *value)
{
IDE_Controller_Table[minor].fns->ctrl_reg_read(minor, reg, value);
@@ -152,7 +152,7 @@ ide_controller_read_register(rtems_device_minor_number minor,
* NONE
*/
void
ide_controller_write_register(rtems_device_minor_number minor, int reg,
ide_controller_write_register(rtems_device_minor_number minor, int reg,
uint16_t value)
{
IDE_Controller_Table[minor].fns->ctrl_reg_write(minor, reg, value);
@@ -170,10 +170,10 @@ ide_controller_write_register(rtems_device_minor_number minor, int reg,
* RTEMS_SUCCESSFUL on success, or error code if
* error occured
*/
rtems_status_code
rtems_status_code
ide_controller_config_io_speed(int minor, uint8_t modes_avaible)
{
return IDE_Controller_Table[minor].fns->ctrl_config_io_speed(
minor,
minor,
modes_avaible);
}

View File

@@ -23,11 +23,11 @@ rtems_device_driver ide_controller_initialize(
rtems_device_major_number major,
rtems_device_minor_number minor,
void *args);
#define IDE_CONTROLLER_DRIVER_TABLE_ENTRY \
{ide_controller_initialize, NULL, NULL, NULL, NULL, NULL}
#ifdef __cplusplus
}

View File

@@ -1,7 +1,7 @@
/*
* ide_ctrl_cfg.h
*
* LibChip library IDE controller header file - structuers used for
* LibChip library IDE controller header file - structuers used for
* configuration and plugin interface definition.
*
* Copyright (C) 2002 OKTET Ltd., St.-Petersburg, Russia
@@ -33,38 +33,38 @@ typedef enum {
/*
* Each driver for a particular controller have to provide following
* functions in such a structure. The only field which should not be NULL
* is contInit.
* is contInit.
*/
typedef struct ide_ctrl_fns_s {
boolean (*ctrl_probe)(int minor); /* probe routine */
void (*ctrl_initialize)(int minor);
int (*ctrl_control)(int minor, uint32_t command,
int (*ctrl_control)(int minor, uint32_t command,
void *arg);
/*
* Functions which allow read/write registers of a particular controller.
* (these functions may be used from ide_controller_read_register,
* (these functions may be used from ide_controller_read_register,
* ide_controller_write_register)
*/
void (*ctrl_reg_read)(int minor, int regist, uint16_t *value);
void (*ctrl_reg_write)(int minor, int regist, uint16_t value);
/*
* The function allows to escape overhead for read/write register
/*
* The function allows to escape overhead for read/write register
* functions calls
*/
void (*ctrl_read_block)(int minor, uint16_t block_size,
void (*ctrl_read_block)(int minor, uint16_t block_size,
blkdev_sg_buffer *bufs, uint32_t *cbuf,
uint32_t *pos);
void (*ctrl_write_block)(int minor, uint16_t block_size,
blkdev_sg_buffer *bufs, uint32_t *cbuf,
uint32_t *pos);
rtems_status_code (*ctrl_config_io_speed)(int minor,
rtems_status_code (*ctrl_config_io_speed)(int minor,
uint8_t modes_available);
} ide_ctrl_fns_t;
/*
* IDE Controller configuration. Table of such configurations is provided
/*
* IDE Controller configuration. Table of such configurations is provided
* by BSP
*/
typedef struct ide_controller_bsp_table_s {
@@ -72,14 +72,14 @@ typedef struct ide_controller_bsp_table_s {
ide_ctrl_devs_t type; /* chip type */
ide_ctrl_fns_t *fns; /* pointer to the set of driver routines */
boolean (*probe)(int minor); /* general probe routine */
uint8_t status; /* initialized/non initialized. Should be set
* to zero by static initialization
uint8_t status; /* initialized/non initialized. Should be set
* to zero by static initialization
*/
uint32_t port1; /* port number for the port of the device */
rtems_boolean int_driven; /* interrupt/poll driven */
rtems_vector_number int_vec; /* the interrupt vector of the device */
void *params; /* contains either device specific data or a
* pointer to s device specific information
void *params; /* contains either device specific data or a
* pointer to s device specific information
* table
*/
} ide_controller_bsp_table_t;

View File

@@ -1,8 +1,8 @@
/*
* ide_ctrl_io.h
*
* LibChip library IDE controller header file - IO operations defined for
* IDE controllers.
* LibChip library IDE controller header file - IO operations defined for
* IDE controllers.
*
* Copyright (C) 2002 OKTET Ltd., St.-Petersburg, Russia
* Author: Eugeny S. Mints <Eugeny.Mints@oktet.ru>
@@ -28,7 +28,7 @@ extern "C" {
#define IDE_REGISTER_FEATURES IDE_REGISTER_ERROR
#define IDE_REGISTER_SECTOR_COUNT 2
#define IDE_REGISTER_SECTOR_NUMBER 3
#define IDE_REGISTER_LBA0 IDE_REGISTER_SECTOR_NUMBER
#define IDE_REGISTER_LBA0 IDE_REGISTER_SECTOR_NUMBER
#define IDE_REGISTER_CYLINDER_LOW 4
#define IDE_REGISTER_LBA1 IDE_REGISTER_CYLINDER_LOW
#define IDE_REGISTER_CYLINDER_HIGH 5
@@ -42,7 +42,7 @@ extern "C" {
#define IDE_REGISTER_ALTERNATE_STATUS 6
#define IDE_REGISTER_DEVICE_CONTROL IDE_REGISTER_ALTERNATE_STATUS
/* offsets used to access registers */
/* offsets used to access registers */
#define IDE_REGISTER_DEVICE_CONTROL_OFFSET 8
#define IDE_REGISTER_ALTERNATE_STATUS_OFFSET IDE_REGISTER_DEVICE_CONTROL_OFFSET
#define IDE_REGISTER_DATA_BYTE 9
@@ -143,7 +143,7 @@ ide_controller_write_data_block(rtems_device_minor_number minor,
*/
void
ide_controller_read_register(rtems_device_minor_number minor,
int reg,
int reg,
uint16_t *value);
/*
@@ -174,7 +174,7 @@ ide_controller_write_register(rtems_device_minor_number minor,
* RTEMS_SUCCESSFUL on success, or error code if
* error occured
*/
rtems_status_code
rtems_status_code
ide_controller_config_io_speed(int minor, uint8_t modes_avaible);
#ifdef __cplusplus

View File

@@ -23,7 +23,7 @@
CS8900 RTEMS driver.
See the header file for details.
*/
#include <errno.h>

View File

@@ -2,10 +2,10 @@
------------------------------------------------------------------------
cs8900.h,v 1.3 2002/09/07 23:09:47 joel Exp
------------------------------------------------------------------------
Copyright Cybertec Pty Ltd, 2000
All rights reserved Cybertec Pty Ltd, 2000
Port to the DIMM PC copyright (c) 2004 Angelo Fraietta
This project has been assisted by the Commonwealth Government
through the Australia Council, its arts funding and advisory body.
@@ -16,7 +16,7 @@
The license and distribution terms for this file may be
found in the file LICENSE in this distribution or at
http://www.OARcorp.com/rtems/license.html.
------------------------------------------------------------------------
CS8900 RTEMS driver.
@@ -27,7 +27,7 @@
completely different bus, byte order and interrupt structures.
An example BSP backend is provided in the pci386 BSP.
The BSP provides the following functions:
cs8900_io_set_reg
@@ -70,7 +70,7 @@
attached to the networking stack. It also creates a
'struct rtems_bsdnet_ifconfig' which is used to attach the interface
to the networking stack. The following code declares the BSD config:
static cs8900_device cs8900;
static struct rtems_bsdnet_ifconfig cs8900_ifconfig =
@@ -113,9 +113,9 @@
#define ETHERNET_IRQ_LEVEL 0
cs8900_device *cs = &cs8900;
memset (cs, 0, sizeof (cs8900_device));
cs->dev = 0;
cs->io_base = ETHERNET_IO_BASE;
cs->mem_base = ETHERNET_MEM_BASE;
@@ -123,11 +123,11 @@
cs->rx_queue_size = 30;
cs8900_ifconfig.drv_ctrl = &cs8900;
printf ("CS8900 initialisation\n");
rtems_bsdnet_attach (&cs8900_ifconfig);
flags = IFF_UP;
if (rtems_bsdnet_ifconfig (cs8900_ifconfig.name,
SIOCSIFFLAGS,
@@ -422,7 +422,7 @@
#define CS8900_SELF_STATUS_3_3_V (1 << 6)
#define CS8900_SELF_STATUS_INITD (1 << 7)
#define CS8900_SELF_STATUS_SIBUST (1 << 8)
#define CS8900_SELF_STATUS_EEPROM_PRESENT (1 << 9)
#define CS8900_SELF_STATUS_EEPROM_PRESENT (1 << 9)
#define CS8900_SELF_STATUS_EEPROM_OK (1 << 10)
#define CS8900_SELF_STATUS_EL_PRESENT (1 << 11)
#define CS8900_SELF_STATUS_EE_SIZE (1 << 12)
@@ -453,7 +453,7 @@
#define CS8900_TRACE_SIZE (400)
/*
* The default receive queue size. If the BSP sets this field to
* The default receive queue size. If the BSP sets this field to
* 0 this default is used.
*/
#define CS8900_RX_QUEUE_SIZE (30)
@@ -489,12 +489,12 @@ typedef struct
unsigned long tx_underrun_errors;
unsigned long tx_dropped;
unsigned long tx_resends;
/* interrupt watch dog */
unsigned long int_swint_req;
unsigned long int_swint_res;
unsigned long int_lockup;
unsigned long interrupts;
} eth_statistics;
@@ -538,7 +538,7 @@ typedef struct
unsigned char mac_address[6];
/*
* The bsdnet information structure.
* The bsdnet information structure.
*/
struct arpcom arpcom;
@@ -549,29 +549,29 @@ typedef struct
int accept_bcast;
int tx_active;
rtems_id rx_task;
rtems_id tx_task;
/*
/*
* The queues. FIXME : these should be changed to be mbuf lists.
*/
struct mbuf *rx_ready_head;
struct mbuf *rx_ready_tail;
int rx_ready_len;
struct mbuf *rx_loaded_head;
struct mbuf *rx_loaded_tail;
int rx_loaded_len;
/*
* Number of mbufs queued for the interrupt handler to
* Number of mbufs queued for the interrupt handler to
* loop reading.
*/
int rx_queue_size;
#if CS8900_TRACE
unsigned short trace_key[CS8900_TRACE_SIZE];
unsigned long trace_var[CS8900_TRACE_SIZE];
@@ -580,11 +580,11 @@ typedef struct
#endif
/**
* Standard(!) ethernet statistics
* Standard(!) ethernet statistics
*/
eth_statistics eth_stats;
} cs8900_device;
/*
@@ -611,7 +611,7 @@ int cs8900_link_active (cs8900_device *cs);
int cs8900_driver_attach (struct rtems_bsdnet_ifconfig *config,
int attaching);
/**
* The BSP specific interrupt wrapper calls this function when a device
* interrupt occurs.
@@ -700,7 +700,7 @@ unsigned short cs8900_io_get_reg (cs8900_device *cs, unsigned short reg);
* @param data The data to be written to the register.
*/
void cs8900_mem_set_reg (cs8900_device *cs,
void cs8900_mem_set_reg (cs8900_device *cs,
unsigned long reg, unsigned short data);
/**

View File

@@ -82,7 +82,7 @@
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
#if defined(__i386__)
#include <irq.h>
#endif
@@ -94,7 +94,7 @@
#undef malloc
#endif
#ifdef free
#undef free
#undef free
#endif
#define DEC_DEBUG
@@ -158,12 +158,12 @@
#define CSR0_MODE 0x0020e002 /* 01b08000 */
#endif
#define ROM_ADDRESS 0x00004800
#define CSR6_INIT 0x022cc000 /* 022c0000 020c0000 */
#define CSR6_TX 0x00002000
#define CSR6_TXRX 0x00002002
#define CSR6_INIT 0x022cc000 /* 022c0000 020c0000 */
#define CSR6_TX 0x00002000
#define CSR6_TXRX 0x00002002
#define IT_SETUP 0x000100c0 /* 000100e0 */
#define CLEAR_IT 0xFFFFFFFF
#define NO_IT 0x00000000
#define CLEAR_IT 0xFFFFFFFF
#define NO_IT 0x00000000
@@ -172,7 +172,7 @@ struct MD {
/* used by hardware */
volatile uint32_t status;
volatile uint32_t counts;
volatile uint32_t buf1, buf2;
volatile uint32_t buf1, buf2;
/* used by software */
volatile struct mbuf *m;
volatile struct MD *next;
@@ -222,13 +222,13 @@ struct MD {
** events so only requesting units are serviced.
*/
static rtems_event_set unit_signals[NDECDRIVER]= { RTEMS_EVENT_1,
static rtems_event_set unit_signals[NDECDRIVER]= { RTEMS_EVENT_1,
RTEMS_EVENT_2,
RTEMS_EVENT_3,
RTEMS_EVENT_3,
RTEMS_EVENT_4,
RTEMS_EVENT_5,
RTEMS_EVENT_5,
RTEMS_EVENT_6,
RTEMS_EVENT_7,
RTEMS_EVENT_7,
RTEMS_EVENT_8 };
@@ -279,7 +279,7 @@ struct dec21140_softc {
volatile struct MD *nextRxMD;
volatile unsigned char *bufferBase;
int acceptBroadcast;
volatile struct MD *TxMD;
volatile struct MD *SentTxMD;
int PendingTxCount;
@@ -300,7 +300,7 @@ struct dec21140_softc {
unsigned long rxBadCRC;
unsigned long rxOverrun;
unsigned long rxCollision;
unsigned long txInterrupts;
unsigned long txDeferred;
unsigned long txHeartbeat;
@@ -353,10 +353,10 @@ static int eeget16(volatile unsigned int *ioaddr, int location)
int i;
unsigned short retval = 0;
int read_cmd = location | EE_READ_CMD;
st_le32(ioaddr, EE_ENB & ~EE_CS);
st_le32(ioaddr, EE_ENB);
/* Shift the read command bits out. */
for (i = 10; i >= 0; i--) {
short dataval = (read_cmd & (1 << i)) ? EE_DATA_WRITE : 0;
@@ -368,7 +368,7 @@ static int eeget16(volatile unsigned int *ioaddr, int location)
rtems_bsp_delay_in_bus_cycles(200);
}
st_le32(ioaddr, EE_ENB);
for (i = 16; i > 0; i--) {
st_le32(ioaddr, EE_ENB | EE_SHIFT_CLK);
rtems_bsp_delay_in_bus_cycles(200);
@@ -481,7 +481,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
{
int i,st;
volatile unsigned int *tbase;
volatile unsigned char *cp, *setup_frm, *eaddrs;
volatile unsigned char *cp, *setup_frm, *eaddrs;
volatile unsigned char *buffer;
volatile struct MD *rmd;
@@ -503,16 +503,16 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
* WARNING : First write in CSR6
* Then Reset the chip ( 1 in CSR0)
*/
st_le32( (tbase+memCSR6), CSR6_INIT);
st_le32( (tbase+memCSR0), RESET_CHIP);
st_le32( (tbase+memCSR6), CSR6_INIT);
st_le32( (tbase+memCSR0), RESET_CHIP);
rtems_bsp_delay_in_bus_cycles(200);
st_le32( (tbase+memCSR7), NO_IT);
st_le32( (tbase+memCSR7), NO_IT);
/*
* Init CSR0
*/
st_le32( (tbase+memCSR0), CSR0_MODE);
st_le32( (tbase+memCSR0), CSR0_MODE);
/*
* Init RX ring
@@ -523,7 +523,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
sc->bufferBase = cp;
cp += (CPU_CACHE_ALIGNMENT_FOR_BUFFER - (int)cp) & (CPU_CACHE_ALIGNMENT_FOR_BUFFER - 1);
#if defined(__i386__)
#ifdef PCI_BRIDGE_DOES_NOT_ENSURE_CACHE_COHERENCY_FOR_DMA
#ifdef PCI_BRIDGE_DOES_NOT_ENSURE_CACHE_COHERENCY_FOR_DMA
if (_CPU_is_paging_enabled())
_CPU_change_memory_mapping_attribute
(NULL, cp,
@@ -542,7 +542,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
for (i=0 ; i<sc->numRxbuffers; i++)
{
struct mbuf *m;
/* allocate an mbuf for each receive descriptor */
MGETHDR (m, M_WAIT, MT_DATA);
MCLGET (m, M_WAIT);
@@ -550,7 +550,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
rmd->m = m;
rmd->buf2 = phys_to_bus(rmd+1);
rmd->buf1 = phys_to_bus(mtod(m, void *));
rmd->buf1 = phys_to_bus(mtod(m, void *));
rmd->status = 0x80000000;
rmd->counts = 0xfdc00000 | (RBUF_SIZE);
rmd->next = rmd+1;
@@ -576,7 +576,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
(rmd+i)->status = 0x0;
(rmd+i)->next = rmd+i+1;
(rmd+i)->m = 0;
}
}
/*
* mark last TX buffer.
@@ -614,7 +614,7 @@ dec21140Enet_initialize_hardware (struct dec21140_softc *sc)
st_le32( (tbase+memCSR1), 1);
while (rmd->status != 0x7fffffff);
rmd->counts = 0x01000000;
rmd->counts = 0x01000000;
sc->TxMD = rmd+1;
@@ -680,7 +680,7 @@ dec21140_rxDaemon (void *arg)
while((rmd->status & 0x80000000) == 0)
{
/* printk("unit %i rx\n", ifp->if_unit ); */
/* pass on the packet in the mbuf */
len = (rmd->status >> 16) & 0x7ff;
m = (struct mbuf *)(rmd->m);
@@ -698,7 +698,7 @@ dec21140_rxDaemon (void *arg)
/* mark the descriptor as ready to receive */
rmd->status = 0x80000000;
rmd=rmd->next;
}
@@ -729,7 +729,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
tbase = dp->base;
/*
* Waiting for Transmitter ready
*/
*/
tmd = dp->TxMD;
n = m;
@@ -741,7 +741,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
len = 0;
temp = (volatile unsigned char *)(bus_to_phys(tmd->buf1));
for (;;)
{
len += m->m_len;
@@ -752,7 +752,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
}
if (len < ET_MINLEN) len = ET_MINLEN;
tmd->counts = 0xe1000000 | (len & 0x7ff);
tmd->counts = 0xe1000000 | (len & 0x7ff);
tmd->status = 0x80000000;
st_le32( (tbase+memCSR1), 0x1);
@@ -778,13 +778,13 @@ dec21140_txDaemon (void *arg)
int i;
rtems_event_set events;
for (;;)
for (;;)
{
/*
* Wait for packets bound for any of the dec units
*/
rtems_bsdnet_event_receive( RTEMS_ALL_EVENTS,
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events);
for(i=0; i< NDECDRIVER; i++ )
@@ -799,7 +799,7 @@ dec21140_txDaemon (void *arg)
/*
* Send packets till queue is empty
*/
for(;;)
for(;;)
{
IF_DEQUEUE(&ifp->if_snd, m);
if( !m ) break;
@@ -853,7 +853,7 @@ dec21140_init (void *arg)
*/
tbase = sc->base;
st_le32( (tbase+memCSR5), IT_SETUP);
st_le32( (tbase+memCSR7), IT_SETUP);
st_le32( (tbase+memCSR7), IT_SETUP);
st_le32( (unsigned int*)(tbase+memCSR6), CSR6_INIT | CSR6_TXRX);
/*
@@ -957,7 +957,7 @@ dec21140_ioctl (struct ifnet *ifp, int command, caddr_t data)
case SIO_RTEMS_SHOW_STATS:
dec21140_stats (sc);
break;
/*
* FIXME: All sorts of multicast commands need to be added here!
*/
@@ -1044,7 +1044,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
if (pcib_init() == PCIB_ERR_NOTPRESENT)
rtems_panic("PCI BIOS not found !!");
/*
* Try to find the network card on the PCI bus. Probe for a DEC 21140
* card first. If not found probe the bus for a DEC/Intel 21143 card.
@@ -1063,7 +1063,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
else
rtems_panic("DEC PCI network card not found !!\n");
}
#endif
#endif
#if defined(__PPC__)
/*
* Find the board
@@ -1074,7 +1074,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
if( BSP_pciFindDevice( PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21143,
unitNumber-1, &pbus, &pdev, &pfun) != -1 )
{
printk("dec21143 : found device '%s', PPC support has not been tested. Using it anyway.\n",
printk("dec21143 : found device '%s', PPC support has not been tested. Using it anyway.\n",
config->name );
pci_write_config_dword(pbus,
@@ -1092,9 +1092,9 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
}
#ifdef DEC_DEBUG
else
else
{
printk("dec21140 : found device '%s', bus 0x%02x, dev 0x%02x, func 0x%02x\n",
printk("dec21140 : found device '%s', bus 0x%02x, dev 0x%02x, func 0x%02x\n",
config->name, pbus, pdev, pfun);
}
#endif
@@ -1112,7 +1112,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
sc = &dec21140_softc[unitNumber - 1];
ifp = &sc->arpcom.ac_if;
if (ifp->if_softc != NULL)
if (ifp->if_softc != NULL)
{
printk("dec2114x : unit %i already in use.\n", unitNumber );
return 0;
@@ -1125,7 +1125,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
sc->ioevent = unit_signals[unitNumber-1];
/*
** Save the buffer counts
** Save the buffer counts
*/
sc->numRxbuffers = (config->rbuf_count) ? config->rbuf_count : NRXBUFS;
sc->numTxbuffers = (config->xbuf_count) ? config->xbuf_count : NTXBUFS;
@@ -1142,7 +1142,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
pcib_conf_read32(signature, 16, &value);
sc->port = value & ~IO_MASK;
pcib_conf_read32(signature, 20, &value);
if (_CPU_is_paging_enabled())
_CPU_map_phys_address((void **) &(sc->base),
@@ -1151,7 +1151,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
PTE_CACHE_DISABLE | PTE_WRITABLE);
else
sc->base = (unsigned int *)(value & ~MEM_MASK);
pcib_conf_read8(signature, 60, &interrupt);
cvalue = interrupt;
#endif
@@ -1163,14 +1163,14 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
&lvalue);
sc->port = lvalue & (unsigned int)(~IO_MASK);
(void)pci_read_config_dword(pbus,
pdev,
pfun,
PCI_BASE_ADDRESS_1,
&lvalue);
tmp = (unsigned int)(lvalue & (unsigned int)(~MEM_MASK))
tmp = (unsigned int)(lvalue & (unsigned int)(~MEM_MASK))
+ (unsigned int)PCI_MEM_BASE;
sc->base = (unsigned int *)(tmp);
@@ -1191,8 +1191,8 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
pci_write_config_word(pbus, pdev, pfun,
PCI_COMMAND,
(uint16_t) ( PCI_COMMAND_MEMORY |
PCI_COMMAND_MASTER |
PCI_COMMAND_INVALIDATE |
PCI_COMMAND_MASTER |
PCI_COMMAND_INVALIDATE |
PCI_COMMAND_WAIT |
PCI_COMMAND_FAST_BACK ) );
#endif
@@ -1230,7 +1230,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
for (i=0 ; i<(ETHER_ADDR_LEN/2); i++){
sc->arpcom.ac_enaddr[2*i] = rombuf.c[20+2*i+1];
sc->arpcom.ac_enaddr[2*i+1] = rombuf.c[20+2*i];
}
}
#endif
#if defined(__PPC__)
memcpy (sc->arpcom.ac_enaddr, rombuf.c+20, ETHER_ADDR_LEN);
@@ -1276,11 +1276,11 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
/*
* Start driver tasks if this is the first dec unit initialized
*/
if (txDaemonTid == 0)
if (txDaemonTid == 0)
{
rxDaemonTid = rtems_bsdnet_newproc( "DCrx", 4096,
dec21140_rxDaemon, NULL);
txDaemonTid = rtems_bsdnet_newproc( "DCtx", 4096,
dec21140_txDaemon, NULL);
#ifdef DEC_DEBUG

View File

@@ -127,7 +127,7 @@
#undef malloc
#endif
#ifdef free
#undef free
#undef free
#endif
#define ELNK_DEBUG
@@ -181,13 +181,13 @@
** events so only requesting units are serviced.
*/
static rtems_event_set unit_signals[NUM_UNITS]= { RTEMS_EVENT_1,
static rtems_event_set unit_signals[NUM_UNITS]= { RTEMS_EVENT_1,
RTEMS_EVENT_2,
RTEMS_EVENT_3,
RTEMS_EVENT_3,
RTEMS_EVENT_4,
RTEMS_EVENT_5,
RTEMS_EVENT_5,
RTEMS_EVENT_6,
RTEMS_EVENT_7,
RTEMS_EVENT_7,
RTEMS_EVENT_8 };
@@ -757,7 +757,7 @@ struct xl_mii_frame {
struct xl_stats
struct xl_stats
{
/* accumulated stats */
u_int16_t xl_carrier_lost;
@@ -797,7 +797,7 @@ struct xl_stats
struct xl_type
struct xl_type
{
u_int16_t xl_vid;
u_int16_t xl_did;
@@ -876,7 +876,7 @@ static struct xl_type xl_devs[] = {
/* rx message descriptor entry, ensure the struct is aligned to 8 bytes */
struct RXMD
struct RXMD
{
/* used by hardware */
volatile uint32_t next;
@@ -894,7 +894,7 @@ struct RXMD
#define NUM_FRAGS 6
/*
/*
* tx message descriptor entry, ensure the struct is aligned to 8 bytes
*/
@@ -904,7 +904,7 @@ struct tfrag
volatile uint32_t length;
} __attribute__ ((packed));
struct TXMD
struct TXMD
{
/* used by hardware */
volatile uint32_t next;
@@ -926,7 +926,7 @@ struct TXMD
/*
* Per-device data
*/
struct elnk_softc
struct elnk_softc
{
struct arpcom arpcom;
@@ -1043,7 +1043,7 @@ xl_wait(sc)
{
register int i;
for(i = 0; i < XL_TIMEOUT; i++)
for(i = 0; i < XL_TIMEOUT; i++)
{
if (!(CSR_READ_2(sc, XL_STATUS) & XL_STAT_CMDBUSY))
break;
@@ -1130,7 +1130,7 @@ static int
xl_mii_readreg(sc, frame)
struct elnk_softc *sc;
struct xl_mii_frame *frame;
{
int i, ack;
@@ -1141,7 +1141,7 @@ xl_mii_readreg(sc, frame)
frame->mii_opcode = XL_MII_READOP;
frame->mii_turnaround = 0;
frame->mii_data = 0;
/*
* Select register window 4.
*/
@@ -1214,7 +1214,7 @@ static int
xl_mii_writereg(sc, frame)
struct elnk_softc *sc;
struct xl_mii_frame *frame;
{
/*
* Set up frame for TX.
@@ -1223,7 +1223,7 @@ xl_mii_writereg(sc, frame)
frame->mii_stdelim = XL_MII_STARTDELIM;
frame->mii_opcode = XL_MII_WRITEOP;
frame->mii_turnaround = XL_MII_TURNAROUND;
/*
* Select the window 4.
*/
@@ -1371,7 +1371,7 @@ xl_read_eeprom(sc, dest, off, cnt, swap)
for (i = 0; i < cnt; i++) {
if (sc->xl_flags & XL_FLAG_8BITROM)
CSR_WRITE_2(sc, XL_W0_EE_CMD,
CSR_WRITE_2(sc, XL_W0_EE_CMD,
XL_EE_8BIT_READ | EEPROM_8BIT_OFFSET(off + i));
else
CSR_WRITE_2(sc, XL_W0_EE_CMD,
@@ -1384,7 +1384,7 @@ xl_read_eeprom(sc, dest, off, cnt, swap)
if (swap)
*ptr = ntohs(word);
else
*ptr = word;
*ptr = word;
}
return(err ? 1 : 0);
@@ -1403,12 +1403,12 @@ xl_stats_update(timerid,xsc)
u_int32_t t1;
sc->xl_stats.intstatus = CSR_READ_2(sc, XL_STATUS);
sc->xl_stats.miianr = xl_miibus_readreg(sc, 0x18, MII_ANAR );
sc->xl_stats.miipar = xl_miibus_readreg(sc, 0x18, MII_ANLPAR );
sc->xl_stats.miistatus = xl_miibus_readreg(sc, 0x18, MII_BMSR );
sc->xl_stats.miicmd = xl_miibus_readreg(sc, 0x18, MII_BMCR );
XL_SEL_WIN(1);
sc->xl_stats.rxstatus = CSR_READ_2(sc, XL_W1_RX_STATUS );
sc->xl_stats.txstatus = CSR_READ_1(sc, XL_W1_TX_STATUS );
@@ -1418,7 +1418,7 @@ xl_stats_update(timerid,xsc)
sc->xl_stats.internalconfig = CSR_READ_4(sc, XL_W3_INTERNAL_CFG);
sc->xl_stats.mac_control = CSR_READ_2(sc, XL_W3_MAC_CTRL);
sc->xl_stats.txfree = CSR_READ_2(sc, XL_W3_FREE_TX );
/* Read all the stats registers. */
XL_SEL_WIN(6);
@@ -1486,7 +1486,7 @@ xl_reset(sc)
register int i;
XL_SEL_WIN(0);
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RESET |
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RESET |
((sc->xl_flags & XL_FLAG_WEIRDRESET) ?
XL_RESETOPT_DISADVFD:0));
@@ -1512,12 +1512,12 @@ xl_reset(sc)
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_TX_RESET);
xl_wait(sc);
if (sc->xl_flags & XL_FLAG_INVERT_LED_PWR ||
sc->xl_flags & XL_FLAG_INVERT_MII_PWR)
if (sc->xl_flags & XL_FLAG_INVERT_LED_PWR ||
sc->xl_flags & XL_FLAG_INVERT_MII_PWR)
{
XL_SEL_WIN(2);
CSR_WRITE_2(sc, XL_W2_RESET_OPTIONS, CSR_READ_2(sc,
XL_W2_RESET_OPTIONS)
XL_W2_RESET_OPTIONS)
| ((sc->xl_flags & XL_FLAG_INVERT_LED_PWR)?XL_RESETOPT_INVERT_LED:0)
| ((sc->xl_flags & XL_FLAG_INVERT_MII_PWR)?XL_RESETOPT_INVERT_MII:0)
);
@@ -1896,7 +1896,7 @@ static int elnkIsOn(const rtems_irq_connect_data* irq)
static void
static void
elnk_start_txchain( struct elnk_softc *sc, struct TXMD *chainhead )
{
xl_wait(sc);
@@ -1935,7 +1935,7 @@ elnk_interrupt_handler ( struct elnk_softc *sc )
printk("etherlink : unit elnk%d intstatus %04x\n", sc->xl_unit, status );
#endif
if (status & XL_STAT_UP_COMPLETE)
if (status & XL_STAT_UP_COMPLETE)
{
#if 0
printk("etherlink : unit elnk%d rx\n", sc->xl_unit );
@@ -1990,7 +1990,7 @@ elnk_interrupt_handler ( struct elnk_softc *sc )
*/
if( (int)sc->last_txchain_head->chainptr == -1 )
{
/*
/*
** single packet was sent so no indirection to the last
** entry in the chain. since chainptr is != 0, then
** another chain is ready starting from the packet AFTER
@@ -2032,18 +2032,18 @@ elnk_interrupt_handler ( struct elnk_softc *sc )
}
if (status & XL_STAT_ADFAIL)
if (status & XL_STAT_ADFAIL)
{
printk("etherlink : unit elnk%d Catastrophic bus failure\n", sc->xl_unit );
}
if (status & XL_STAT_STATSOFLOW)
if (status & XL_STAT_STATSOFLOW)
{
sc->xl_stats_no_timeout = 1;
xl_stats_update(sc->stat_timer_id,sc);
sc->xl_stats_no_timeout = 0;
}
}
#if 0
{
@@ -2102,13 +2102,13 @@ elnk_initialize_hardware (struct elnk_softc *sc)
/*
* Init RX ring
*/
cp = (unsigned char *)malloc( (ringsize = ((rxsize = (sc->numRxbuffers * sizeof(struct RXMD))) +
cp = (unsigned char *)malloc( (ringsize = ((rxsize = (sc->numRxbuffers * sizeof(struct RXMD))) +
(txsize = (sc->numTxbuffers * sizeof(struct TXMD)))) ) +
+ CPU_CACHE_ALIGNMENT_FOR_BUFFER);
sc->bufferBase = cp;
cp += (CPU_CACHE_ALIGNMENT_FOR_BUFFER - (int)cp) & (CPU_CACHE_ALIGNMENT_FOR_BUFFER - 1);
#if defined(__i386__)
#ifdef PCI_BRIDGE_DOES_NOT_ENSURE_CACHE_COHERENCY_FOR_DMA
#ifdef PCI_BRIDGE_DOES_NOT_ENSURE_CACHE_COHERENCY_FOR_DMA
if (_CPU_is_paging_enabled())
_CPU_change_memory_mapping_attribute
(NULL, cp, ringsize, PTE_CACHE_DISABLE | PTE_WRITABLE);
@@ -2124,7 +2124,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)
{
struct mbuf *m;
struct RXMD *nxtmd;
/*
/*
* The rx ring is easy as its just an array of RXMD structs. New
* mbuf entries are allocated from the stack whenever the rx
* daemon forwards an incoming packet into it. Here, we
@@ -2136,7 +2136,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)
{
rtems_panic ("etherlink : unit elnk%d rx ring entry %d not aligned to 8 bytes\n", sc->xl_unit, i );
}
/* allocate an mbuf for each receive descriptor */
MGETHDR (m, M_WAIT, MT_DATA);
MCLGET (m, M_WAIT);
@@ -2161,7 +2161,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)
{
struct TXMD *thismd, *nxtmd;
/*
/*
* The tx ring is more complex. Each MD has an array of fragment
* descriptors that are loaded from each packet as they arrive
* from the stack. Each packet gets one ring entry, this allows
@@ -2217,7 +2217,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)
sc->arpcom.ac_enaddr[0], sc->arpcom.ac_enaddr[1],
sc->arpcom.ac_enaddr[2], sc->arpcom.ac_enaddr[3],
sc->arpcom.ac_enaddr[4], sc->arpcom.ac_enaddr[5],
sc->xl_unit,
sc->xl_unit,
(unsigned)sc->ioaddr, sc->irqInfo.name );
#endif
@@ -2291,13 +2291,13 @@ elnk_rxDaemon (void *arg)
*/
while( (rxstat = ld_le32(&rmd->status)) )
{
if (rxstat & XL_RXSTAT_UP_ERROR)
if (rxstat & XL_RXSTAT_UP_ERROR)
{
printk("unit %i up error\n", sc->xl_unit );
ifp->if_ierrors++;
}
if( (rxstat & XL_RXSTAT_UP_CMPLT) )
if( (rxstat & XL_RXSTAT_UP_CMPLT) )
{
#if 0
@@ -2337,7 +2337,7 @@ elnk_rxDaemon (void *arg)
}
/* clear descriptor status */
rmd->status = 0;
rmd = rmd->next_md;
}
@@ -2377,13 +2377,13 @@ elnk_txDaemon (void *arg)
int chainCount,i;
rtems_event_set events;
for (;;)
for (;;)
{
/*
* Wait for any unit's signal to wake us up
*/
rtems_bsdnet_event_receive( RTEMS_ALL_EVENTS,
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_EVENT_ANY | RTEMS_WAIT,
RTEMS_NO_TIMEOUT, &events);
for(i=0; i< NUM_UNITS; i++ )
@@ -2401,10 +2401,10 @@ elnk_txDaemon (void *arg)
chainCount = 0;
firstmd = NULL;
lastmd = sc->last_tx_md;
for(;;)
for(;;)
{
/*
** Check the chain recovery queue whenever the tx
@@ -2462,7 +2462,7 @@ elnk_txDaemon (void *arg)
break;
}
IF_DEQUEUE(&ifp->if_snd, m);
if( !m ) break;
@@ -2482,7 +2482,7 @@ elnk_txDaemon (void *arg)
if( m )
{
printk("etherlink : unit elnk%d tx fragments exhausted, truncating packet!\n", sc->xl_unit);
st_le32( &nextmd->txfrags[NUM_FRAGS-1].length, XL_LAST_FRAG |
st_le32( &nextmd->txfrags[NUM_FRAGS-1].length, XL_LAST_FRAG |
ld_le32( &nextmd->txfrags[NUM_FRAGS-1].length) );
}
}
@@ -2493,7 +2493,7 @@ elnk_txDaemon (void *arg)
int i;
printk("unit %d queued pkt (%08x) ", sc->xl_unit, (uint32_t)pkt );
for(delim="", i=0; i < sizeof(struct ether_header); i++, delim=":")
printk("%s%02x", delim, (char) pkt[i] );
printk("%s%02x", delim, (char) pkt[i] );
printk("\n");
}
#endif
@@ -2504,7 +2504,7 @@ elnk_txDaemon (void *arg)
st_le32( &nextmd->status, 0);
if( !firstmd )
{
{
/* keep track of the first packet we add to the chain */
firstmd = nextmd;
@@ -2540,21 +2540,21 @@ elnk_txDaemon (void *arg)
/* save the last descriptor we set up in the chain */
sc->last_tx_md = lastmd;
/*
/*
* We've added one or more packets to a chain, flag
* the last packet so we get an dnComplete interrupt
* when the card finishes accepting the chain
*/
st_le32( &lastmd->status, XL_TXSTAT_DL_INTR );
/*
/*
* point the chain head's chainptr to the tail so we
* can jump to the next chain to send inside the isr.
* If we're only sending one packet, then don't bother
* with the link, as the chainptr value will either be
* 0 if theres no next chain or -1 if there is.
*/
if( chainCount > 1 )
if( chainCount > 1 )
{
firstmd->chainptr = lastmd;
@@ -2562,7 +2562,7 @@ elnk_txDaemon (void *arg)
if( ++sc->chlenIndex == NUM_CHAIN_LENGTHS ) sc->chlenIndex = 0;
}
/*
/*
** clear the last packet's chainptr flag. If another
** chain is added later but before this chain is
** finished being sent, this flag on this packet will
@@ -2571,19 +2571,19 @@ elnk_txDaemon (void *arg)
lastmd->chainptr = NULL;
#if 0
printk("unit %d queued %d pkts, lastpkt status %08X\n",
sc->xl_unit,
chainCount,
printk("unit %d queued %d pkts, lastpkt status %08X\n",
sc->xl_unit,
chainCount,
(uint32_t)ld_le32( &lastmd->status) );
#endif
if( sc->tx_idle == 0 && CSR_READ_4(sc, XL_DOWNLIST_PTR) == 0 )
if( sc->tx_idle == 0 && CSR_READ_4(sc, XL_DOWNLIST_PTR) == 0 )
{
printk("etherlink : unit elnk%d tx forced!\n", sc->xl_unit);
sc->tx_idle = -1;
}
/*
/*
** start sending this chain of packets if tx isn't
** busy, else the dnComplete interrupt will see there
** is another chain waiting and begin it immediately.
@@ -2660,7 +2660,7 @@ elnk_init (void *arg)
uint32_t cr,sr;
xl_miibus_writereg(sc, 0x18, MII_BMCR, BMCR_RESET );
while( (cr = xl_miibus_readreg(sc, 0x18, MII_BMCR )) & BMCR_RESET )
{
DELAY(100000);
@@ -2669,7 +2669,7 @@ elnk_init (void *arg)
xl_miibus_writereg(sc, 0x18, MII_ANAR, ANAR_10 | ANAR_TX | ANAR_10_FD | ANAR_TX_FD ); /* ANAR_T4 */
xl_miibus_writereg(sc, 0x18, MII_BMCR, BMCR_STARTNEG | BMCR_AUTOEN );
while( ((sr = xl_miibus_readreg(sc, 0x18, MII_BMSR)) & BMSR_ACOMP) == 0 );
while( ((sr = xl_miibus_readreg(sc, 0x18, MII_BMSR)) & BMSR_ACOMP) == 0 );
}
@@ -2689,7 +2689,7 @@ elnk_init (void *arg)
/* Init our MAC address */
XL_SEL_WIN(2);
for (i = 0; i < ETHER_ADDR_LEN; i++)
for (i = 0; i < ETHER_ADDR_LEN; i++)
{
CSR_WRITE_1(sc, XL_W2_STATION_ADDR_LO + i, sc->arpcom.ac_enaddr[i]);
}
@@ -2852,7 +2852,7 @@ elnk_init (void *arg)
CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_COAX_STOP);
/* increase packet size to allow reception of 802.1q or ISL packets */
if (sc->xl_type == XL_TYPE_905B)
if (sc->xl_type == XL_TYPE_905B)
CSR_WRITE_2(sc, XL_W3_MAXPKTSIZE, XL_PACKET_SIZE);
/* Clear out the stats counters. */
@@ -2960,13 +2960,13 @@ elnk_stop (struct elnk_softc *sc)
static void
elnk_stats (struct elnk_softc *sc)
{
printf(" MII PHY data { anr:%04x lpar:%04x stat:%04x ctl:%04x }\n",
sc->xl_stats.miianr,
sc->xl_stats.miipar,
printf(" MII PHY data { anr:%04x lpar:%04x stat:%04x ctl:%04x }\n",
sc->xl_stats.miianr,
sc->xl_stats.miipar,
sc->xl_stats.miistatus,
sc->xl_stats.miicmd);
printf(" internalcfg:%08x macctl:%04x dmactl:%08x\n",
printf(" internalcfg:%08x macctl:%04x dmactl:%08x\n",
sc->xl_stats.internalconfig,
sc->xl_stats.mac_control,
sc->xl_stats.dmactl);
@@ -3000,27 +3000,27 @@ elnk_stats (struct elnk_softc *sc)
(totalLengths / numLengths) );
}
printf(" carrier_lost:%-5d sqe_errs:%-5d\n",
sc->xl_stats.xl_carrier_lost,
printf(" carrier_lost:%-5d sqe_errs:%-5d\n",
sc->xl_stats.xl_carrier_lost,
sc->xl_stats.xl_sqe_errs);
printf(" tx_multi_collision:%-5d tx_single_collision:%-5d\n",
sc->xl_stats.xl_tx_multi_collision,
printf(" tx_multi_collision:%-5d tx_single_collision:%-5d\n",
sc->xl_stats.xl_tx_multi_collision,
sc->xl_stats.xl_tx_single_collision);
printf(" tx_late_collision:%-5d rx_overrun:%-5d\n",
sc->xl_stats.xl_tx_late_collision,
printf(" tx_late_collision:%-5d rx_overrun:%-5d\n",
sc->xl_stats.xl_tx_late_collision,
sc->xl_stats.xl_rx_overrun);
printf(" tx_deferred:%-5d badssd:%-5d\n",
sc->xl_stats.xl_tx_deferred,
printf(" tx_deferred:%-5d badssd:%-5d\n",
sc->xl_stats.xl_tx_deferred,
sc->xl_stats.xl_badssd);
printf(" rx_frames_ok:%-9d tx_frames_ok:%-9d\n",
printf(" rx_frames_ok:%-9d tx_frames_ok:%-9d\n",
sc->xl_stats.xl_rx_frames_ok,
sc->xl_stats.xl_tx_frames_ok);
printf(" rx_bytes_ok:%-9d tx_bytes_ok:%-9d\n",
printf(" rx_bytes_ok:%-9d tx_bytes_ok:%-9d\n",
sc->xl_stats.xl_rx_bytes_ok,
sc->xl_stats.xl_tx_bytes_ok );
}
@@ -3069,7 +3069,7 @@ elnk_ioctl (struct ifnet *ifp, int command, caddr_t data)
case SIO_RTEMS_SHOW_STATS:
elnk_stats (sc);
break;
/*
* FIXME: All sorts of multicast commands need to be added here!
*/
@@ -3095,12 +3095,12 @@ static int iftap(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m )
char *delim, *pkt;
printk("unit %i, src ", ifp->if_unit );
for(delim= "", i=0; i< ETHER_ADDR_LEN; i++, delim=":")
for(delim= "", i=0; i< ETHER_ADDR_LEN; i++, delim=":")
printk("%s%02x", delim, (char) eh->ether_shost[i] );
printk(" dest ");
for(delim= "", i=0; i< ETHER_ADDR_LEN; i++, delim=":")
for(delim= "", i=0; i< ETHER_ADDR_LEN; i++, delim=":")
printk("%s%02x", delim, (char) eh->ether_dhost[i] );
printk(" pkt ");
@@ -3108,7 +3108,7 @@ static int iftap(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m )
for(delim="", i=0; i < sizeof(struct ether_header); i++, delim=":")
printk("%s%02x", delim, (char) pkt[i] );
printk("\n");
printk("\n");
return 0;
}
#endif
@@ -3179,9 +3179,9 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
*/
for( i=0; !done && xl_devs[i].xl_vid; i++)
{
for(unum= 1; !done && BSP_pciFindDevice( xl_devs[i].xl_vid, xl_devs[i].xl_did, unum-1,
&sysboards[numFound].pbus,
&sysboards[numFound].pdev,
for(unum= 1; !done && BSP_pciFindDevice( xl_devs[i].xl_vid, xl_devs[i].xl_did, unum-1,
&sysboards[numFound].pbus,
&sysboards[numFound].pdev,
&sysboards[numFound].pfun)==0; unum++)
{
if( numFound == NUM_UNITS )
@@ -3254,7 +3254,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
sc = &elnk_softc[unitNumber - 1];
ifp = &sc->arpcom.ac_if;
if (ifp->if_softc != NULL)
if (ifp->if_softc != NULL)
{
printk("etherlink : unit %i already in use.\n", unitNumber );
return 0;
@@ -3287,9 +3287,9 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
#ifdef ELNK_DEBUG
printk("etherlink : device '%s', name 'elnk%d', pci %02x:%02x.%02x, %d rx/%d tx buffers\n",
xl_devs[sc->xl_type].xl_name, sc->xl_unit,
pbus, pdev, pfun,
printk("etherlink : device '%s', name 'elnk%d', pci %02x:%02x.%02x, %d rx/%d tx buffers\n",
xl_devs[sc->xl_type].xl_name, sc->xl_unit,
pbus, pdev, pfun,
sc->numRxbuffers, sc->numTxbuffers);
#endif
@@ -3329,9 +3329,9 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
*/
pci_write_config_word(pbus, pdev, pfun,
PCI_COMMAND,
(uint16_t)( PCI_COMMAND_IO |
PCI_COMMAND_MASTER |
PCI_COMMAND_INVALIDATE |
(uint16_t)( PCI_COMMAND_IO |
PCI_COMMAND_MASTER |
PCI_COMMAND_INVALIDATE |
PCI_COMMAND_WAIT ) );
/*
* Get the device's base address
@@ -3348,7 +3348,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
pci_read_config_byte(pbus, pdev, pfun,
PCI_INTERRUPT_LINE,
&cvalue);
#endif
#endif
memset(&sc->irqInfo,0,sizeof(rtems_irq_connect_data));
sc->irqInfo.name = cvalue;
@@ -3373,7 +3373,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
#if defined(__PPC__)
pci_read_config_byte(pbus,pdev,pfun, PCI_LATENCY_TIMER, &pci_latency);
#endif
if (pci_latency < new_latency)
if (pci_latency < new_latency)
{
printk("etherlink : unit elnk%d Overriding PCI latency, timer (CFLT) setting of %d, new value is %d.\n", sc->xl_unit, pci_latency, new_latency );
#if defined(__i386__)
@@ -3429,8 +3429,8 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
if (sc->deviceID == TC_DEVICEID_TORNADO_10_100BT_920B)
sc->xl_flags |= XL_FLAG_PHYOK;
if (config->hardware_address)
if (config->hardware_address)
{
memcpy(sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
}
@@ -3441,7 +3441,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
printk("etherlink : unit elnk%d Failed to read station address\n", sc->xl_unit );
return 0;
}
memcpy((char *)&sc->arpcom.ac_enaddr, eaddr, ETHER_ADDR_LEN);
memcpy((char *)&sc->arpcom.ac_enaddr, eaddr, ETHER_ADDR_LEN);
}
/*
@@ -3500,7 +3500,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
printk("etherlink : unit elnk%d available media : %s\n", sc->xl_unit, &msg[1]);
}
XL_SEL_WIN(7);
}
@@ -3538,7 +3538,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
/*
* Start driver tasks if this is the first unit initialized
*/
if (txDaemonTid == 0)
if (txDaemonTid == 0)
{
if( rtems_message_queue_create( rtems_build_name('X','L','c','r'),
sc->numTxbuffers+1,
@@ -3548,11 +3548,11 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
{
rtems_panic( "etherlink : Unable to create TX buffer recovery queue\n" );
}
rxDaemonTid = rtems_bsdnet_newproc( "XLrx", 4096,
elnk_rxDaemon, NULL);
txDaemonTid = rtems_bsdnet_newproc( "XLtx", 4096,
elnk_txDaemon, NULL);
#ifdef ELNK_DEBUG

View File

@@ -237,12 +237,12 @@ char *bitmask_snprintf(unsigned long value, const char *format, char *buf, int b
{
char *b = buf;
int bit = 31;
while (bit-- > *format)
value <<= 1;
format++;
while (*format)
{
if (value & 0x80000000)
@@ -252,13 +252,13 @@ char *bitmask_snprintf(unsigned long value, const char *format, char *buf, int b
*b++ = '0';
*b++ = ',';
while (bit-- > *format)
value <<= 1;
format++;
}
*b = '\0';
return buf;
}
@@ -268,7 +268,7 @@ char *ether_sprintf(unsigned char *addr)
static char buf[32];
char *b = buf;
int i;
for (i = 0; i < ETHER_ADDR_LEN; i++)
{
sprintf(b, "%02x:", *addr++);
@@ -309,17 +309,17 @@ i82586_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
char *name;
int unit;
int mtu;
/*
* Parse driver name
*/
if ((unit = rtems_bsdnet_parse_driver_name (config, &name)) < 0)
return 0;
sc = config->drv_ctrl;
sc = config->drv_ctrl;
ifp = &sc->arpcom.ac_if;
#if I82586_DEBUG
sc->sc_debug = 0; //IED_TINT | IED_XMIT;
#endif
@@ -331,18 +331,18 @@ i82586_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
printf ("Driver `%s' already in use.\n", config->name);
return 0;
}
/*
* Process options
*/
memcpy (sc->arpcom.ac_enaddr, config->hardware_address, ETHER_ADDR_LEN);
if (config->mtu)
mtu = config->mtu;
else
mtu = ETHERMTU;
ifp->if_softc = sc;
ifp->if_unit = unit;
ifp->if_name = name;
@@ -514,7 +514,7 @@ iexmit(struct ie_softc *sc)
#if I82586_DEBUG
I82586_TRACE(sc, I82586_TX_EMIT, cur);
#endif
#if I82586_DEBUG
if (sc->sc_debug & IED_XMIT)
printf("%s: xmit buffer %d\n", sc->arpcom.ac_if.if_name, cur);
@@ -611,7 +611,7 @@ i82586_cmd_wait(struct ie_softc *sc)
off = IE_SCB_STATUS(sc->scb);
printf("i82586_cmd_wait: timo(%ssync): scb status: 0x%x, cmd: 0x%x\n",
sc->async_cmd_inprogress?"a":"",
sc->async_cmd_inprogress?"a":"",
sc->ie_bus_read16(sc, off), cmd);
return (1); /* Timeout */
@@ -726,7 +726,7 @@ i82586_intr(rtems_vector_number vec, void *arg)
static unsigned long icnt = 0;
I82586_TRACE(sc, I82586_INTS_REQ, icnt++);
#endif
/*
* Implementation dependent interrupt handling. It must at least
* disabled interrupts from the i82586. It is hoped this can
@@ -756,7 +756,7 @@ i82586_intr_task(void *arg)
u_int status;
int off;
int reset;
/*
* Not sure this is a good idea but as a out path exists and
* roads lead to it, it seems ok.
@@ -775,14 +775,14 @@ i82586_intr_task(void *arg)
#endif
reset = 0;
while ((status & IE_ST_WHENCE) != 0) {
#if I82586_DEBUG
if (sc->sc_debug)
printf ("%s: -------\n%s: scbstatus=0x%x\n",
sc->arpcom.ac_if.if_name, sc->arpcom.ac_if.if_name, status);
#endif
#if 1
/* Ack interrupts FIRST in case we receive more during the ISR. */
ie_ack(sc, status & IE_ST_WHENCE);
@@ -816,7 +816,7 @@ i82586_intr_task(void *arg)
/*
* Interrupt ACK was posted asynchronously; wait for
* completion here before reading SCB status again.
*
*
* If ACK fails, try to reset the chip, in hopes that
* it helps.
*/
@@ -825,14 +825,14 @@ i82586_intr_task(void *arg)
break;
}
#endif
IE_BUS_BARRIER(sc, off, 2, BUS_SPACE_BARRIER_READ);
status = sc->ie_bus_read16(sc, off);
#if I82586_DEBUG
I82586_TRACE(sc, I82586_INTS_LOOPS, status);
#endif
}
if (reset) {
#if I82586_DEBUG
printf("%s: intr reset; status=0x%x\n", sc->arpcom.ac_if.if_name, status);
@@ -840,11 +840,11 @@ i82586_intr_task(void *arg)
i82586_cmd_wait(sc);
i82586_reset(sc, 1);
}
#if I82586_DEBUG
I82586_TRACE(sc, I82586_INTS_OUT, status);
#endif
if (sc->intrhook)
(sc->intrhook)(sc, INTR_EXIT);
}
@@ -861,7 +861,7 @@ i82586_rint(struct ie_softc *sc, int scbstatus)
#if I82586_DEBUG
I82586_TRACE(sc, I82586_RX_INT, scbstatus);
if (sc->sc_debug & IED_RINT)
printf("%s: rint: status 0x%x\n",
sc->arpcom.ac_if.if_name, scbstatus);
@@ -904,7 +904,7 @@ i82586_rint(struct ie_softc *sc, int scbstatus)
*/
i82586_rx_errors(sc, i, status);
drop = 1;
#if I82586_DEBUG
I82586_TRACE(sc, I82586_RX_DROP, status);
#endif
@@ -1294,7 +1294,7 @@ ie_readframe(struct ie_softc *sc, int num) /* frame number to read */
*/
ether_input (&sc->arpcom.ac_if, eh, m);
sc->arpcom.ac_if.if_ipackets++;
#if I82586_DEBUG
I82586_TRACE(sc, I82586_RX_OK, sc->arpcom.ac_if.if_ipackets);
#endif
@@ -1309,14 +1309,14 @@ void
i82586_start(struct ifnet *ifp)
{
struct ie_softc *sc = ifp->if_softc;
if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
return;
#if I82586_DEBUG
I82586_TRACE(sc, I82586_TX_REQ, sc->xmit_busy);
#endif
rtems_event_send (sc->tx_task, i82586_TX_EVENT);
}
@@ -1330,10 +1330,10 @@ i82586_tx_task(void *arg)
rtems_bsdnet_event_receive (i82586_TX_EVENT,
RTEMS_WAIT | RTEMS_EVENT_ANY,
0, &events);
#if I82586_DEBUG
I82586_TRACE(sc, I82586_TX_EVT, sc->xmit_busy);
if (sc->sc_debug)
printf ("%s: =======\n", sc->arpcom.ac_if.if_name);
#endif
@@ -1350,11 +1350,11 @@ i82586_start_tx(struct ie_softc *sc)
int buffer, head, xbase;
u_short len;
int s;
#if I82586_DEBUG
I82586_TRACE(sc, I82586_START_TX, sc->xmit_busy);
#endif
if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
{
#if I82586_DEBUG
@@ -1362,7 +1362,7 @@ i82586_start_tx(struct ie_softc *sc)
#endif
return;
}
for (;;) {
if (sc->xmit_busy == NTXBUF) {
ifp->if_flags |= IFF_OACTIVE;
@@ -1421,14 +1421,14 @@ i82586_start_tx(struct ie_softc *sc)
#if I82586_DEBUG
I82586_TRACE(sc, I82586_TX_START, sc->xmit_busy);
#endif
s = splnet();
/* Start the first packet transmitting. */
if (sc->xmit_busy == 0)
iexmit(sc);
sc->xmit_busy++;
splx(s);
}
}
@@ -1770,7 +1770,7 @@ ie_ia_setup(struct ie_softc *sc, int cmdbuf)
(sc->memcopyout)(sc, sc->arpcom.ac_enaddr,
IE_CMD_IAS_EADDR(cmdbuf), ETHER_ADDR_LEN);
cmdresult = i82586_start_cmd(sc, IE_CUC_START, cmdbuf, IE_STAT_COMPL, 0);
status = sc->ie_bus_read16(sc, IE_CMD_COMMON_STATUS(cmdbuf));
if (cmdresult != 0) {
@@ -1852,13 +1852,13 @@ i82586_init(void *arg)
sc->trace_flow_wrap = 0;
#endif
sc->trace_flow_in = 0;
cmd = sc->buf_area;
#if I82586_DEBUG
printf ("%s: sc_debug at 0x%08x\n", sc->arpcom.ac_if.if_name, (unsigned int) &sc->sc_debug);
#endif
/*
* Send the configure command first.
*/
@@ -1923,7 +1923,7 @@ i82586_start_transceiver(struct ie_softc *sc)
#if I82586_DEBUG
I82586_TRACE(sc, I82586_RX_START, 0);
#endif
/*
* Start RU at current position in frame & RBD lists.
*/
@@ -2075,7 +2075,7 @@ void
i82586_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr)
{
struct ie_softc *sc = ifp->if_softc;
if (sc->sc_mediastatus)
(*sc->sc_mediastatus)(sc, ifmr);
}
@@ -2104,13 +2104,13 @@ print_softie(struct ie_softc *sc)
"TX_ACTIVE",
"TRACE_CNT"
};
int i;
printf("i82586 %s:\n", sc->arpcom.ac_if.if_name);
printf(" iobase=%p\n", sc->sc_iobase);
printf(" scp=0x%08x\t\tiscp=0x%08x\t\tscb=0x%08x\n",
sc->scp, sc->iscp, sc->scb);
printf(" buf_area=0x%08x\tbuf_area_sz=0x%08x\n",
@@ -2139,7 +2139,7 @@ print_softie(struct ie_softc *sc)
int in;
int lfdone = 0;
char *tabs;
if (!sc->trace_flow_wrap) {
cnt = sc->trace_flow_in;
in = 0;
@@ -2152,7 +2152,7 @@ print_softie(struct ie_softc *sc)
sc->trace_flow_in = sc->trace_flow_wrap = 0;
cnt /= 2;
for (i = 0; i < cnt; i++) {
if (!lfdone) {
switch (sc->trace_flow[in]) {
@@ -2168,7 +2168,7 @@ print_softie(struct ie_softc *sc)
tabs = "\t\t";
else
tabs = "\t";
printf(" %d\t%s%s0x%08x (%d)\n",
i, trace_labels[sc->trace_flow[in]], tabs,
sc->trace_flow[in + 1], sc->trace_flow[in + 1]);
@@ -2179,9 +2179,9 @@ print_softie(struct ie_softc *sc)
lfdone = 1;
printf("\n");
}
in += 2;
if (in >= I82586_TRACE_FLOW)
in = 0;
}

View File

@@ -260,7 +260,7 @@ struct __ie_recv_buf_desc {
* All commands share this in common.
*-
struct __ie_cmd_common {
u_int16_t ie_cmd_status; // status of this command
u_int16_t ie_cmd_status; // status of this command
u_int16_t ie_cmd_cmd; // command word
u_int16_t ie_cmd_link; // link to next command
};

View File

@@ -199,7 +199,7 @@ struct ie_softc {
struct arpcom arpcom;
/*
* For RTEMS we run the tx and rx handlers under a task due to the
* For RTEMS we run the tx and rx handlers under a task due to the
* network semaphore stuff.
*/
@@ -225,7 +225,7 @@ struct ie_softc {
u_int16_t value);
void (*ie_bus_write24) (struct ie_softc *, int offset,
int addr);
void (*ie_bus_barrier) (struct ie_softc *, int offset,
void (*ie_bus_barrier) (struct ie_softc *, int offset,
int length, int flags);
/* Media management */
@@ -296,9 +296,9 @@ do { rtems_interrupt_level level; rtems_interrupt_disable (level); \
int sc_debug;
unsigned int trace_flow[I82586_TRACE_FLOW * 2];
unsigned int trace_flow_wrap;
unsigned int trace_flow_wrap;
#endif
unsigned int trace_flow_in;
unsigned int trace_flow_in;
};
/* Exported functions */

View File

@@ -427,7 +427,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
*/
if ((unitNumber = rtems_bsdnet_parse_driver_name (config, &unitName)) < 0)
return 0;
/*
* Is driver free?
*/
@@ -448,7 +448,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
callout_handle_init(&sc->stat_ch);
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE);
#endif
s = splimp();
s = splimp();
/*
* init PCI Bios interface...
@@ -459,10 +459,10 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
device_printf(dev, "could not initialize pci bios interface\n");
return 0;
}
/*
* find device on pci bus
*/
*/
{ int j;
for (j=0; fxp_ident_table[j].devid; j++ ) {
@@ -475,7 +475,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
i,sc->pci_signature);
if (PCIB_ERR_SUCCESS == i)
break;
}
}
}
/*
@@ -485,7 +485,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
device_printf(dev, "could not find 82559ER device\n");
return 0;
}
/*
* Enable bus mastering. Enable memory space too, in case
@@ -572,7 +572,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
sc->pci_regs_are_io = TRUE;
pcib_conf_read32(sc->pci_signature,
PCI_BASE_ADDRESS_1,
&val32);
&val32);
sc->pci_regs_base = val32 & PCI_BASE_ADDRESS_IO_MASK;
}
else {
@@ -599,7 +599,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
sc->irqInfo.hdl = (rtems_irq_hdl)fxp_intr;
sc->irqInfo.on = nopOn;
sc->irqInfo.off = nopOn;
sc->irqInfo.isOn = fxpIsOn;
sc->irqInfo.isOn = fxpIsOn;
s = BSP_install_rtems_irq_handler (&sc->irqInfo);
if (!s)
rtems_panic ("Can't attach fxp interrupt handler for irq %d\n",
@@ -616,7 +616,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
DBGLVL_PRINTK(3,"fxp_attach: sc->cbl_base = 0x%x\n",sc->cbl_base);
if (sc->cbl_base == NULL)
goto failmem;
else
else
memset(sc->cbl_base, 0, sizeof(struct fxp_cb_tx) * FXP_NTXCB);
sc->fxp_stats = malloc(sizeof(struct fxp_stats), M_DEVBUF,
@@ -669,7 +669,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
*
* Systems based on the ICH2/ICH2-M chip from Intel have a defect
* where the chip can cause a PCI protocol violation if it receives
* a CU_RESUME command when it is entering the IDLE state. The
* a CU_RESUME command when it is entering the IDLE state. The
* workaround is to disable Dynamic Standby Mode, so the chip never
* deasserts CLKRUN#, and always remains in an active state.
*
@@ -706,7 +706,7 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
"EEPROM checksum @ 0x%x: 0x%x -> 0x%x\n",
i, data, cksum);
/*
* We need to do a full PCI reset here. A software
* We need to do a full PCI reset here. A software
* reset to the port doesn't cut it, but let's try
* anyway.
*/
@@ -951,7 +951,7 @@ fxp_stats(struct fxp_softc *sc)
printf (" Input errors:%-8lu\n", ifp->if_ierrors);
}
static void
static void
fxp_eeprom_shiftin(struct fxp_softc *sc, int data, int length)
{
u_int16_t reg;
@@ -1236,7 +1236,7 @@ tbdinit:
ifp->if_timer = 5;
}
txp->tx_threshold = tx_threshold;
/*
* Advance the end of list forward.
*/
@@ -1290,7 +1290,7 @@ tbdinit:
static rtems_isr fxp_intr(rtems_vector_number v)
{
/*
* FIXME: currently only works with one interface...
* FIXME: currently only works with one interface...
*/
struct fxp_softc *sc = &(fxp_softc[0]);
@@ -1333,11 +1333,11 @@ static void fxp_daemon(void *xsc)
#ifdef NOTUSED
/*
* It should not be possible to have all bits set; the
* FXP_SCB_INTR_SWI bit always returns 0 on a read. If
* FXP_SCB_INTR_SWI bit always returns 0 on a read. If
* all bits are set, this may indicate that the card has
* been physically ejected, so ignore it.
*/
if (statack == 0xff)
*/
if (statack == 0xff)
return;
#endif
@@ -1516,7 +1516,7 @@ fxp_tick(void *xsc)
* with external storage to be released in a timely manner rather
* than being defered for a potentially long time. This limits
* the delay to a maximum of one second.
*/
*/
for (txp = sc->cbl_first; sc->tx_queued &&
(txp->cb_status & FXP_CB_STATUS_C) != 0;
txp = txp->next) {
@@ -1579,7 +1579,7 @@ fxp_tick(void *xsc)
}
else if (sc->stat_ch == fxp_timeout_stop_rq) {
sc->stat_ch = fxp_timeout_stopped;
}
}
}
/*

View File

@@ -226,7 +226,7 @@ struct fxp_cb_mcs {
* chosen to make the total struct size an even power of two. It's
* critical that no TxCB be split across a page boundry since
* no attempt is made to allocate physically contiguous memory.
*
*
*/
#ifdef __alpha__ /* XXX - should be conditional on pointer size */
#define FXP_NTXSEG 28
@@ -251,7 +251,7 @@ struct fxp_cb_tx {
/*
* The following structure isn't actually part of the TxCB,
* unless the extended TxCB feature is being used. In this
* case, the first two elements of the structure below are
* case, the first two elements of the structure below are
* fetched along with the TxCB.
*/
volatile struct fxp_tbd tbd[FXP_NTXSEG];
@@ -331,7 +331,7 @@ struct fxp_stats {
};
#define FXP_STATS_DUMP_COMPLETE 0xa005
#define FXP_STATS_DR_COMPLETE 0xa007
/*
* Serial EEPROM control register bits
*/

View File

@@ -1,13 +1,13 @@
/*
/*
* Copyright (c) 1995, David Greenman
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice unmodified, this list of conditions, and the following
* disclaimer.
* disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
@@ -119,7 +119,7 @@ struct fxp_softc {
struct fxp_cb_tx *cbl_last; /* last active TxCB in list */
struct fxp_stats *fxp_stats; /* Pointer to interface stats */
int rx_idle_secs; /* # of seconds RX has been idle */
enum {fxp_timeout_stopped,fxp_timeout_running,fxp_timeout_stop_rq}
enum {fxp_timeout_stopped,fxp_timeout_running,fxp_timeout_stop_rq}
stat_ch; /* status of status updater */
struct fxp_cb_tx *cbl_base; /* base of TxCB list */
struct fxp_cb_mcs *mcsp; /* Pointer to mcast setup descriptor */
@@ -194,7 +194,7 @@ struct fxp_softc {
*((u_int32_t*)((u_int8_t*)((sc)->pci_regs_base)+(reg))) = val; \
}while (0)
#endif
#endif
#define sc_if arpcom.ac_if

View File

@@ -1,5 +1,5 @@
/* $NetBSD: mii.h,v 1.9 2001/05/31 03:07:14 thorpej Exp $ */
/*
* Copyright (c) 1997 Manuel Bouyer. All rights reserved.
*

View File

@@ -240,13 +240,13 @@ open_eth_initialize_hardware (struct open_eth_softc *sc)
#ifdef OETH_RATE_10MHZ
mii_cr = 0;
#endif
write_mii(0, mii_cr | 0x8000);
write_mii(0, mii_cr | 0x8000);
while (read_mii(0) & 0x8000) {}
write_mii(20, 0x1422);
#ifdef OETH_RATE_10MHZ
mii_cr = 0;
#endif
write_mii(0, mii_cr);
write_mii(0, mii_cr);
printf("open_eth: driver attached, PHY config : 0x%04x\n", read_mii(0));
#ifdef OPEN_ETH_DEBUG

View File

@@ -52,14 +52,14 @@ typedef struct _oeth_regs {
#define OETH_TOTAL_BD 128
#define OETH_MAXBUF_LEN 0x610
/* Tx BD */
/* Tx BD */
#define OETH_TX_BD_READY 0x8000 /* Tx BD Ready */
#define OETH_TX_BD_IRQ 0x4000 /* Tx BD IRQ Enable */
#define OETH_TX_BD_WRAP 0x2000 /* Tx BD Wrap (last BD) */
#define OETH_TX_BD_PAD 0x1000 /* Tx BD Pad Enable */
#define OETH_TX_BD_CRC 0x0800 /* Tx BD CRC Enable */
#define OETH_TX_BD_UNDERRUN 0x0100 /* Tx BD Underrun Status */
#define OETH_TX_BD_RETRY 0x00F0 /* Tx BD Retry Status */
#define OETH_TX_BD_RETLIM 0x0008 /* Tx BD Retransmission Limit Status */
@@ -72,12 +72,12 @@ typedef struct _oeth_regs {
OETH_TX_BD_LATECOL | \
OETH_TX_BD_DEFER | \
OETH_TX_BD_CARRIER)
/* Rx BD */
/* Rx BD */
#define OETH_RX_BD_EMPTY 0x8000 /* Rx BD Empty */
#define OETH_RX_BD_IRQ 0x4000 /* Rx BD IRQ Enable */
#define OETH_RX_BD_WRAP 0x2000 /* Rx BD Wrap (last BD) */
#define OETH_RX_BD_MISS 0x0080 /* Rx BD Miss Status */
#define OETH_RX_BD_OVERRUN 0x0040 /* Rx BD Overrun Status */
#define OETH_RX_BD_INVSIMB 0x0020 /* Rx BD Invalid Symbol Status */
@@ -113,7 +113,7 @@ typedef struct _oeth_regs {
#define OETH_MODER_HUGEN 0x00004000 /* Huge Enable */
#define OETH_MODER_PAD 0x00008000 /* Pad Enable */
#define OETH_MODER_RECSMALL 0x00010000 /* Receive Small */
/* Interrupt Source Register */
#define OETH_INT_TXB 0x00000001 /* Transmit Buffer IRQ */
#define OETH_INT_TXE 0x00000002 /* Transmit Error IRQ */
@@ -131,26 +131,26 @@ typedef struct _oeth_regs {
#define OETH_INT_MASK_BUSY 0x00000010 /* Busy IRQ Mask */
#define OETH_INT_MASK_TXC 0x00000020 /* Transmit Control Frame IRQ Mask */
#define OETH_INT_MASK_RXC 0x00000040 /* Received Control Frame IRQ Mask */
/* Control Module Mode Register */
#define OETH_CTRLMODER_PASSALL 0x00000001 /* Pass Control Frames */
#define OETH_CTRLMODER_RXFLOW 0x00000002 /* Receive Control Flow Enable */
#define OETH_CTRLMODER_TXFLOW 0x00000004 /* Transmit Control Flow Enable */
/* MII Mode Register */
/* MII Mode Register */
#define OETH_MIIMODER_CLKDIV 0x000000FF /* Clock Divider */
#define OETH_MIIMODER_NOPRE 0x00000100 /* No Preamble */
#define OETH_MIIMODER_RST 0x00000200 /* MIIM Reset */
/* MII Command Register */
#define OETH_MIICOMMAND_SCANSTAT 0x00000001 /* Scan Status */
#define OETH_MIICOMMAND_RSTAT 0x00000002 /* Read Status */
#define OETH_MIICOMMAND_WCTRLDATA 0x00000004 /* Write Control Data */
/* MII Address Register */
#define OETH_MIIADDRESS_FIAD 0x0000001F /* PHY Address */
#define OETH_MIIADDRESS_RGAD 0x00001F00 /* RGAD Address */
/* MII Status Register */
#define OETH_MIISTATUS_LINKFAIL 0x00000001 /* Link Fail */
#define OETH_MIISTATUS_BUSY 0x00000002 /* MII Busy */

View File

@@ -27,9 +27,9 @@
* which had a 100 Mhz PPC603e.
*
* This driver also works with DP83934CVUL-20/25 MHz, tested on
* Tharsys ERC32 VME board.
* Tharsys ERC32 VME board.
*
* Rehaul to fix lost interrupts and buffers, and to use to use
* Rehaul to fix lost interrupts and buffers, and to use to use
* interrupt-free transmission by Jiri, 22/03/1999.
*/
@@ -55,7 +55,7 @@
#include <netinet/if_ether.h>
/*
* XXX fix this
* XXX fix this
*/
void *set_vector(void *, uint32_t, uint32_t);
@@ -68,7 +68,7 @@ void *set_vector(void *, uint32_t, uint32_t);
* Use the top line if you want more symbols.
*/
#define SONIC_STATIC
#define SONIC_STATIC
/* #define SONIC_STATIC static */
/*
@@ -79,7 +79,7 @@ void *set_vector(void *, uint32_t, uint32_t);
#endif
/*
*
*
* As suggested by National Application Note 746, make the
* receive resource area bigger than the receive descriptor area.
*
@@ -138,11 +138,11 @@ struct sonic_softc {
void *sonic;
/*
* Register access routines
* Register access routines
*/
sonic_write_register_t write_register;
sonic_read_register_t read_register;
/*
* Interrupt vector
*/
@@ -480,7 +480,7 @@ SONIC_STATIC void sonic_retire_tda (struct sonic_softc *sc)
#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS)
/*
* If there is an error that was not a collision,
* If there is an error that was not a collision,
* then someone may want to see it.
*/
@@ -588,13 +588,13 @@ SONIC_STATIC void sonic_sendpacket (struct ifnet *ifp, struct mbuf *m)
*/
while (sc->tdaHead->next->status != 0) {
/*
* Free up transmit descriptors
*/
sonic_retire_tda (sc);
if (sc->tdaHead->next->status == 0)
if (sc->tdaHead->next->status == 0)
break;
#if (SONIC_DEBUG & SONIC_DEBUG_ERRORS)
@@ -893,12 +893,12 @@ SONIC_STATIC void sonic_rda_wait(
* Routine to align the received packet so that the ip header
* is on a 32-bit boundary. Necessary for cpu's that do not
* allow unaligned loads and stores and when the 32-bit DMA
* mode is used.
*
* Transfers are done on word basis to avoid possibly slow byte
* mode is used.
*
* Transfers are done on word basis to avoid possibly slow byte
* and half-word writes.
*/
void ipalign(struct mbuf *m)
{
unsigned int *first, *last, data;
@@ -979,7 +979,7 @@ SONIC_STATIC void sonic_rxDaemon (void *arg)
sonic_print_rx_descriptor( rdp );
if ((LSW(rdp->mbufp->m_data) != rdp->pkt_lsw)
|| (MSW(rdp->mbufp->m_data) != rdp->pkt_msw))
printf ("SONIC RDA/RRA %p, %08x\n",rdp->mbufp->m_data,(rdp->pkt_msw << 16) |
printf ("SONIC RDA/RRA %p, %08x\n",rdp->mbufp->m_data,(rdp->pkt_msw << 16) |
(rdp->pkt_lsw & 0x0ffff));
#endif
rdp->byte_count &= 0x0ffff; /* ERC32 pollutes msb of byte_count */
@@ -989,7 +989,7 @@ SONIC_STATIC void sonic_rxDaemon (void *arg)
sizeof(struct ether_header);
eh = mtod (m, struct ether_header *);
m->m_data += sizeof(struct ether_header);
#ifdef CPU_U32_FIX
ipalign(m); /* Align packet on 32-bit boundary */
#endif
@@ -1122,7 +1122,7 @@ SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
if ( (*sc->read_register)( rp, SONIC_REG_SR ) <= SONIC_REVISION_B ) {
rtems_fatal_error_occurred( 0x0BADF00D ); /* don't eat this part :) */
}
/*
* Set up circular linked list in Transmit Descriptor Area.
* Use the PINT bit in the transmit configuration field to
@@ -1138,11 +1138,11 @@ SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
tdp = sc->tdaTail;
for (i = 0 ; i < sc->tdaCount ; i++) {
/*
* Start off with the table of outstanding mbuf's
* Start off with the table of outstanding mbuf's
*/
/*
* status, pkt_config, pkt_size, and all fragment fields
* status, pkt_config, pkt_size, and all fragment fields
* are set to zero by sonic_allocate.
*/
@@ -1176,7 +1176,7 @@ SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
*/
sc->rda = sonic_allocate(
(sc->rdaCount * sizeof(ReceiveDescriptor_t)) +
(sc->rdaCount * sizeof(ReceiveDescriptor_t)) +
sizeof(CamDescriptor_t) );
sc->cdp = (CamDescriptorPointer_t) ((unsigned char *)sc->rda +
(sc->rdaCount * sizeof(ReceiveDescriptor_t)));
@@ -1204,7 +1204,7 @@ SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
ordp->next = sc->rda;
ordp->link = LSW(sc->rda) | RDA_LINK_EOL;
sc->rdp_last = ordp;
/*
* Allocate the receive resource area.
* In accordance with National Application Note 746, make the
@@ -1232,7 +1232,7 @@ SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
* so we can find the mbuf when the SONIC returns the buffer
* to the driver.
*/
MGETHDR (m, M_WAIT, MT_DATA);
MCLGET (m, M_WAIT);
m->m_pkthdr.rcvif = &sc->arpcom.ac_if;
@@ -1374,7 +1374,7 @@ SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
(*sc->write_register)( rp, SONIC_REG_CEP, 0 ); /* Select first entry in CAM */
printf ("Loaded Ethernet address into SONIC CAM.\n"
" Wrote %04x%04x%04x - %#x\n"
" Read %04x%04x%04x - %#x\n",
" Read %04x%04x%04x - %#x\n",
cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce,
(*sc->read_register)( rp, SONIC_REG_CAP2 ),
(*sc->read_register)( rp, SONIC_REG_CAP1 ),
@@ -1388,7 +1388,7 @@ SONIC_STATIC void sonic_initialize_hardware(struct sonic_softc *sc)
|| ((*sc->read_register)( rp, SONIC_REG_CE ) != cdp->ce)) {
printf ("Failed to load Ethernet address into SONIC CAM.\n"
" Wrote %04x%04x%04x - %#x\n"
" Read %04x%04x%04x - %#x\n",
" Read %04x%04x%04x - %#x\n",
cdp->cap2, cdp->cap1, cdp->cap0, cdp->ce,
(*sc->read_register)( rp, SONIC_REG_CAP2 ),
(*sc->read_register)( rp, SONIC_REG_CAP1 ),
@@ -1511,7 +1511,7 @@ sonic_ioctl (struct ifnet *ifp, int command, caddr_t data)
case SIO_RTEMS_SHOW_STATS:
sonic_stats (sc);
break;
/*
* FIXME: All sorts of multicast commands need to be added here!
*/

View File

@@ -323,7 +323,7 @@ struct TransmitDescriptor {
uint32_t link_pad;
/*
* Extra RTEMS stuff
* Extra RTEMS stuff
*/
struct TransmitDescriptor *next; /* Circularly-linked list */
struct mbuf *mbufp; /* First mbuf in packet */
@@ -400,7 +400,7 @@ struct ReceiveDescriptor {
uint32_t in_use;
/*
* Extra RTEMS stuff
* Extra RTEMS stuff
*/
volatile struct ReceiveDescriptor *next; /* Circularly-linked list */
struct mbuf *mbufp; /* First mbuf in packet */
@@ -443,7 +443,7 @@ typedef volatile CamDescriptor_t *CamDescriptorPointer_t;
#define RDA_IN_USE 0x0000 /* SONIC has finished with the packet */
/* and the driver can process it */
#define RDA_FREE 0xFFFF /* SONIC can use it */
/*
* Attach routine
*/

View File

@@ -1,5 +1,5 @@
/*
* This file interfaces with the real-time clock found in
* This file interfaces with the real-time clock found in
* a Harris ICM7170
*
* Year 2K Notes:
@@ -42,7 +42,7 @@ void icm7170_initialize(
)
{
uint32_t icm7170;
setRegister_f setReg;
setRegister_f setReg;
uint32_t clock;
icm7170 = RTC_Table[ minor ].ulCtrlPort1;
@@ -97,7 +97,7 @@ int icm7170_get_time(
time->hour = (*getReg)( icm7170, ICM7170_HOUR );
time->minute = (*getReg)( icm7170, ICM7170_MINUTE );
time->second = (*getReg)( icm7170, ICM7170_SECOND );
time->ticks = 0;
/*
@@ -147,7 +147,7 @@ int icm7170_set_time(
(*setReg)( icm7170, ICM7170_HOUR, time->hour );
(*setReg)( icm7170, ICM7170_MINUTE, time->minute );
(*setReg)( icm7170, ICM7170_SECOND, time->second );
/*
* This is not really right.
*/

View File

@@ -20,13 +20,13 @@
#ifndef _ICM7170_MULTIPLIER
#define _ICM7170_MULTIPLIER 1
#define _ICM7170_NAME(_X) _X
#define _ICM7170_TYPE uint8_t
#define _ICM7170_TYPE uint8_t
#endif
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
(_ICM7170_TYPE *)((_base) + ((_reg) * _ICM7170_MULTIPLIER ))
/*
/*
* ICM7170 Get Register Routine
*/

View File

@@ -17,6 +17,6 @@
#define _ICM7170_MULTIPLIER 2
#define _ICM7170_NAME(_X) _X##_2
#define _ICM7170_TYPE uint8_t
#define _ICM7170_TYPE uint8_t
#include "icm7170_reg.c"

View File

@@ -17,6 +17,6 @@
#define _ICM7170_MULTIPLIER 4
#define _ICM7170_NAME(_X) _X##_4
#define _ICM7170_TYPE uint8_t
#define _ICM7170_TYPE uint8_t
#include "icm7170_reg.c"

View File

@@ -17,6 +17,6 @@
#define _ICM7170_MULTIPLIER 8
#define _ICM7170_NAME(_X) _X##_8
#define _ICM7170_TYPE uint8_t
#define _ICM7170_TYPE uint8_t
#include "icm7170_reg.c"

View File

@@ -1,5 +1,5 @@
/*
* This file interfaces with the real-time clock found in
* This file interfaces with the real-time clock found in
* a Mostek M48T08 or M48T18 or compatibles.
*
* Year 2K Notes:
@@ -74,7 +74,7 @@ int m48t08_get_time(
controlReg = (*getReg)( m48t08, M48T08_CONTROL );
(*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_READ );
value1 = (*getReg)( m48t08, M48T08_YEAR );
value2 = From_BCD( value1 );
if ( value2 < 88 )
@@ -96,7 +96,7 @@ int m48t08_get_time(
value1 = (*getReg)( m48t08, M48T08_SECOND );
time->second = From_BCD( value1 );
time->ticks = 0;
/*
@@ -132,7 +132,7 @@ int m48t08_set_time(
controlReg = (*getReg)( m48t08, M48T08_CONTROL );
(*setReg)( m48t08, M48T08_CONTROL, controlReg | M48T08_CONTROL_WRITE );
if ( time->year >= 2088 )
rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER );
@@ -142,7 +142,7 @@ int m48t08_set_time(
(*setReg)( m48t08, M48T08_HOUR, To_BCD(time->hour) );
(*setReg)( m48t08, M48T08_MINUTE, To_BCD(time->minute) );
(*setReg)( m48t08, M48T08_SECOND, To_BCD(time->second) );
/*
* Put the RTC back into normal mode.
*/

View File

@@ -2,7 +2,7 @@
* This file contains the definitions for the following real-time clocks:
*
* + Mostek M48T08
* + Mostek M48T18
* + Mostek M48T18
* + Dallas Semiconductor DS1643
*
* COPYRIGHT (c) 1989-1999.
@@ -30,7 +30,7 @@
#define M48T08_DATE 5
#define M48T08_MONTH 6
#define M48T08_YEAR 7
/*
* Driver function table
*/

View File

@@ -20,13 +20,13 @@
#ifndef _M48T08_MULTIPLIER
#define _M48T08_MULTIPLIER 1
#define _M48T08_NAME(_X) _X
#define _M48T08_TYPE uint8_t
#define _M48T08_TYPE uint8_t
#endif
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
(_M48T08_TYPE *)((_base) + ((_reg) * _M48T08_MULTIPLIER ))
/*
/*
* M48T08 Get Register Routine
*/

View File

@@ -17,6 +17,6 @@
#define _M48T08_MULTIPLIER 2
#define _M48T08_NAME(_X) _X##_2
#define _M48T08_TYPE uint8_t
#define _M48T08_TYPE uint8_t
#include "m48t08_reg.c"

View File

@@ -17,6 +17,6 @@
#define _M48T08_MULTIPLIER 4
#define _M48T08_NAME(_X) _X##_4
#define _M48T08_TYPE uint8_t
#define _M48T08_TYPE uint8_t
#include "m48t08_reg.c"

View File

@@ -17,6 +17,6 @@
#define _M48T08_MULTIPLIER 8
#define _M48T08_NAME(_X) _X##_8
#define _M48T08_TYPE uint8_t
#define _M48T08_TYPE uint8_t
#include "m48t08_reg.c"

View File

@@ -37,8 +37,8 @@ typedef enum {
/*
* Each field is interpreted thus:
*
* sDeviceName This is the name of the device.
*
* sDeviceName This is the name of the device.
*
* deviceType This indicates the chip type.
*

View File

@@ -84,7 +84,7 @@ MC68681_STATIC int mc68681_baud_rate(
* port settings.
*/
MC68681_STATIC int mc68681_set_attributes(
MC68681_STATIC int mc68681_set_attributes(
int minor,
const struct termios *t
)
@@ -147,7 +147,7 @@ MC68681_STATIC int mc68681_set_attributes(
/*
* Stop Bits
*/
if (t->c_cflag & CSTOPB) {
mode2 |= 0x0F; /* 2 stop bits */
} else {
@@ -194,14 +194,14 @@ MC68681_STATIC void mc68681_initialize_context(
int port;
unsigned int pMC68681;
unsigned int pMC68681_port;
pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
pmc68681Context->mate = -1;
for (port=0 ; port<Console_Port_Count ; port++ ) {
if ( Console_Port_Tbl[port].ulCtrlPort1 == pMC68681 &&
if ( Console_Port_Tbl[port].ulCtrlPort1 == pMC68681 &&
Console_Port_Tbl[port].ulCtrlPort2 != pMC68681_port ) {
pmc68681Context->mate = port;
pmc68681Context->imr = 0;
@@ -282,13 +282,13 @@ MC68681_STATIC int mc68681_open(
rtems_interrupt_level Irql;
setRegister_f setReg;
unsigned int status;
pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
setReg = Console_Port_Tbl[minor].setRegister;
vector = Console_Port_Tbl[minor].ulIntVector;
/* XXX default baud rate should be from configuration table */
status = mc68681_baud_rate( minor, B9600, &baud, &acr_bit, &command );
@@ -350,14 +350,14 @@ MC68681_STATIC int mc68681_close(
return(RTEMS_SUCCESSFUL);
}
/*
/*
* mc68681_write_polled
*
* This routine polls out the requested character.
*/
MC68681_STATIC void mc68681_write_polled(
int minor,
int minor,
char cChar
)
{
@@ -417,7 +417,7 @@ MC68681_STATIC rtems_isr mc68681_isr(
int minor;
for(minor=0 ; minor<Console_Port_Count ; minor++) {
if(Console_Port_Tbl[minor].ulIntVector == vector &&
if(Console_Port_Tbl[minor].ulIntVector == vector &&
Console_Port_Tbl[minor].deviceType == SERIAL_MC68681 ) {
mc68681_process(minor);
}
@@ -442,15 +442,15 @@ MC68681_STATIC void mc68681_initialize_interrupts(int minor)
mc68681_enable_interrupts(minor,MC68681_IMR_ENABLE_ALL_EXCEPT_TX);
}
/*
/*
* mc68681_write_support_int
*
* Console Termios output entry point when using interrupt driven output.
*/
MC68681_STATIC int mc68681_write_support_int(
int minor,
const char *buf,
int minor,
const char *buf,
int len
)
{
@@ -484,7 +484,7 @@ MC68681_STATIC int mc68681_write_support_int(
return 1;
}
/*
/*
* mc68681_write_support_polled
*
* Console Termios output entry point when using polled output.
@@ -492,8 +492,8 @@ MC68681_STATIC int mc68681_write_support_int(
*/
MC68681_STATIC int mc68681_write_support_polled(
int minor,
const char *buf,
int minor,
const char *buf,
int len
)
{
@@ -516,14 +516,14 @@ MC68681_STATIC int mc68681_write_support_polled(
return nwrite;
}
/*
* mc68681_inbyte_nonblocking_polled
/*
* mc68681_inbyte_nonblocking_polled
*
* Console Termios polling input entry point.
*/
MC68681_STATIC int mc68681_inbyte_nonblocking_polled(
int minor
MC68681_STATIC int mc68681_inbyte_nonblocking_polled(
int minor
)
{
uint32_t pMC68681_port;
@@ -589,7 +589,7 @@ MC68681_STATIC int mc68681_baud_rate(
baud_requested = baud & CBAUD;
if (!baud_requested)
baud_requested = B9600; /* default to 9600 baud */
baud_requested = termios_baud_to_index( baud_requested );
baud_tbl = (mc68681_baud_table_t *) Console_Port_Tbl[minor].ulClock;
@@ -625,8 +625,8 @@ MC68681_STATIC void mc68681_process(
{
uint32_t pMC68681;
uint32_t pMC68681_port;
volatile uint8_t ucLineStatus;
volatile uint8_t ucISRStatus;
volatile uint8_t ucLineStatus;
volatile uint8_t ucISRStatus;
unsigned char cChar;
getRegister_f getReg;
setRegister_f setReg;
@@ -636,14 +636,14 @@ MC68681_STATIC void mc68681_process(
getReg = Console_Port_Tbl[minor].getRegister;
setReg = Console_Port_Tbl[minor].setRegister;
/* Get ISR at the beginning of the IT routine */
/* Get ISR at the beginning of the IT routine */
ucISRStatus = (*getReg)(pMC68681, MC68681_INTERRUPT_STATUS_REG);
/* Get good ISR a or b channel */
if (pMC68681 != pMC68681_port){
ucISRStatus >>= 4;
}
/* See if is usefull to call rtems_termios_dequeue */
if(Console_Port_Data[minor].bActive == FALSE) {
ucISRStatus = ucISRStatus & ~MC68681_IR_TX_READY;
@@ -668,10 +668,10 @@ MC68681_STATIC void mc68681_process(
continue;
}
cChar = (*getReg)(pMC68681_port, MC68681_RX_BUFFER);
rtems_termios_enqueue_raw_characters(
rtems_termios_enqueue_raw_characters(
Console_Port_Data[minor].termios_data,
&cChar,
1
&cChar,
1
);
}
@@ -710,7 +710,7 @@ MC68681_STATIC unsigned int mc68681_build_imr(
unsigned int pMC68681_port;
mc68681_context *pmc68681Context;
mc68681_context *mateContext;
pMC68681 = Console_Port_Tbl[minor].ulCtrlPort1;
pMC68681_port = Console_Port_Tbl[minor].ulCtrlPort2;
pmc68681Context = (mc68681_context *) Console_Port_Data[minor].pDeviceContext;
@@ -720,14 +720,14 @@ MC68681_STATIC unsigned int mc68681_build_imr(
mate_mask = 0;
is_a = (pMC68681 == pMC68681_port);
/*
* If there is a mate for this port, get its IMR mask.
*/
if ( mate != -1 ) {
mateContext = Console_Port_Data[mate].pDeviceContext;
if (mateContext)
mate_mask = mateContext->imr;
}

View File

@@ -55,7 +55,7 @@ typedef mc68681_baud_t mc68681_baud_table_t[RTEMS_TERMIOS_NUMBER_BAUD_RATES];
#define MC68681_BAUD_NOT_VALID 0xFF
extern mc68681_baud_t
extern mc68681_baud_t
mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES];

View File

@@ -253,7 +253,7 @@ typedef struct _mc68681_context
*/
MC68681_STATIC boolean mc68681_probe(int minor);
MC68681_STATIC int mc68681_set_attributes(
MC68681_STATIC int mc68681_set_attributes(
int minor,
const struct termios *t
);
@@ -273,7 +273,7 @@ MC68681_STATIC int mc68681_close(
);
MC68681_STATIC void mc68681_write_polled(
int minor,
int minor,
char cChar
);

View File

@@ -20,13 +20,13 @@
#ifndef _MC68681_MULTIPLIER
#define _MC68681_MULTIPLIER 1
#define _MC68681_NAME(_X) _X
#define _MC68681_TYPE uint8_t
#define _MC68681_TYPE uint8_t
#endif
#define CALCULATE_REGISTER_ADDRESS( _base, _reg ) \
(_MC68681_TYPE *)((_base) + ((_reg) * _MC68681_MULTIPLIER ))
/*
/*
* MC68681 Get Register Routine
*/

View File

@@ -17,6 +17,6 @@
#define _MC68681_MULTIPLIER 2
#define _MC68681_NAME(_X) _X##_2
#define _MC68681_TYPE uint8_t
#define _MC68681_TYPE uint8_t
#include "mc68681_reg.c"

View File

@@ -17,6 +17,6 @@
#define _MC68681_MULTIPLIER 4
#define _MC68681_NAME(_X) _X##_4
#define _MC68681_TYPE uint8_t
#define _MC68681_TYPE uint8_t
#include "mc68681_reg.c"

View File

@@ -17,6 +17,6 @@
#define _MC68681_MULTIPLIER 8
#define _MC68681_NAME(_X) _X##_8
#define _MC68681_TYPE uint8_t
#define _MC68681_TYPE uint8_t
#include "mc68681_reg.c"

View File

@@ -1,7 +1,7 @@
/*
* This file contains the TTY driver for the National Semiconductor NS16550.
*
* This part is widely cloned and second sourced. It is found in a number
* This part is widely cloned and second sourced. It is found in a number
* of "Super IO" controllers.
*
* COPYRIGHT (c) 1998 by Radstone Technology
@@ -176,12 +176,12 @@ NS16550_STATIC int ns16550_close(
return(RTEMS_SUCCESSFUL);
}
/*
/*
* ns16550_write_polled
*/
NS16550_STATIC void ns16550_write_polled(
int minor,
int minor,
char cChar
)
{
@@ -415,7 +415,7 @@ NS16550_STATIC int ns16550_set_attributes(
rtems_interrupt_disable(Irql);
/*
* Set the baud rate
* Set the baud rate
*/
(*setReg)(pNS16550, NS16550_LINE_CONTROL, SP_LINE_DLAB);
@@ -444,7 +444,7 @@ NS16550_STATIC void ns16550_process(
)
{
uint32_t pNS16550;
volatile uint8_t ucLineStatus;
volatile uint8_t ucLineStatus;
volatile uint8_t ucInterruptId;
unsigned char cChar;
getRegister_f getReg;
@@ -464,10 +464,10 @@ NS16550_STATIC void ns16550_process(
break;
}
cChar = (*getReg)(pNS16550, NS16550_RECEIVE_BUFFER);
rtems_termios_enqueue_raw_characters(
rtems_termios_enqueue_raw_characters(
Console_Port_Data[minor].termios_data,
&cChar,
1
&cChar,
1
);
}
@@ -521,7 +521,7 @@ NS16550_STATIC rtems_isr ns16550_isr(
int minor;
for(minor=0;minor<Console_Port_Count;minor++) {
if(Console_Port_Tbl[minor].ulIntVector == vector &&
if(Console_Port_Tbl[minor].ulIntVector == vector &&
Console_Port_Tbl[minor].deviceType == SERIAL_NS16550 ) {
ns16550_process(minor);
}
@@ -552,7 +552,7 @@ NS16550_STATIC void ns16550_enable_interrupts(
* ns16550_initialize_interrupts
*
* This routine initializes the port to operate in interrupt driver mode.
*/
*/
NS16550_STATIC void ns16550_initialize_interrupts(int minor)
{
@@ -565,15 +565,15 @@ NS16550_STATIC void ns16550_initialize_interrupts(int minor)
ns16550_enable_interrupts(minor, NS16550_ENABLE_ALL_INTR);
}
/*
/*
* ns16550_write_support_int
*
* Console Termios output entry point.
*/
NS16550_STATIC int ns16550_write_support_int(
int minor,
const char *buf,
int minor,
const char *buf,
int len
)
{
@@ -607,7 +607,7 @@ NS16550_STATIC int ns16550_write_support_int(
return 1;
}
/*
/*
* ns16550_write_support_polled
*
* Console Termios output entry point.
@@ -615,8 +615,8 @@ NS16550_STATIC int ns16550_write_support_int(
*/
NS16550_STATIC int ns16550_write_support_polled(
int minor,
const char *buf,
int minor,
const char *buf,
int len
)
{
@@ -639,14 +639,14 @@ NS16550_STATIC int ns16550_write_support_polled(
return nwrite;
}
/*
* ns16550_inbyte_nonblocking_polled
/*
* ns16550_inbyte_nonblocking_polled
*
* Console Termios polling input entry point.
*/
NS16550_STATIC int ns16550_inbyte_nonblocking_polled(
int minor
NS16550_STATIC int ns16550_inbyte_nonblocking_polled(
int minor
)
{
uint32_t pNS16550;

View File

@@ -184,7 +184,7 @@ NS16550_STATIC int ns16550_close(
);
NS16550_STATIC void ns16550_write_polled(
int minor,
int minor,
char cChar
);

View File

@@ -54,8 +54,8 @@ typedef enum {
/*
* Each field is interpreted thus:
*
* sDeviceName This is the name of the device.
*
* sDeviceName This is the name of the device.
*
* deviceType This indicates the chip type. It is especially important when
* multiple devices share the same interrupt vector and must be
@@ -75,7 +75,7 @@ typedef enum {
* flow control routine used to stop the remote transmitter will
* be called. This figure should be greater than or equal to
* the number of stages of FIFO between the transmitter and
* receiver.
* receiver.
*
* NOTE: At the current time, this parameter is hard coded
* in termios and this number is ignored.
@@ -90,7 +90,7 @@ typedef enum {
*
* pDeviceParams This contains either device specific data or a pointer to a
* device specific structure containing additional information
* not provided in this table.
* not provided in this table.
*
* ulCtrlPort1 This is the primary control port number for the device. This
* may be used to specify different instances of the same device

View File

@@ -82,7 +82,7 @@ console_fns z85c30_fns_polled = {
extern void set_vector( rtems_isr_entry, rtems_vector_number, int );
/*
/*
* z85c30_initialize_port
*
* initialize a z85c30 Port
@@ -132,11 +132,11 @@ Z85C30_STATIC void z85c30_initialize_port(
(*setReg)(
ulCtrlPort,
SCC_WR0_SEL_WR11,
SCC_WR11_OUT_BR_GEN | SCC_WR11_TRXC_OI |
SCC_WR11_OUT_BR_GEN | SCC_WR11_TRXC_OI |
SCC_WR11_TX_BR_GEN | SCC_WR11_RX_BR_GEN
);
ulBaudDivisor = Z85C30_Baud(
ulBaudDivisor = Z85C30_Baud(
(uint32_t) Console_Port_Tbl[minor].ulClock,
(uint32_t) Console_Port_Tbl[minor].pDeviceParams
);
@@ -153,7 +153,7 @@ Z85C30_STATIC void z85c30_initialize_port(
* Setup the upper 8 bits time constant
*/
(*setReg)( ulCtrlPort, SCC_WR0_SEL_WR13, (ulBaudDivisor>>8) & 0xff );
/*
* Enable the baud rate generator enable with clock from the
* SCC's PCLK input via register 14.
@@ -310,7 +310,7 @@ Z85C30_STATIC int z85c30_assert_RTS(int minor)
setReg = Console_Port_Tbl[minor].setRegister;
pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
/*
* Assert RTS
*/
@@ -339,7 +339,7 @@ Z85C30_STATIC int z85c30_negate_RTS(int minor)
setReg = Console_Port_Tbl[minor].setRegister;
pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
/*
* Negate RTS
*/
@@ -373,7 +373,7 @@ Z85C30_STATIC int z85c30_assert_DTR(int minor)
setReg = Console_Port_Tbl[minor].setRegister;
pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
/*
* Assert DTR
*/
@@ -402,7 +402,7 @@ Z85C30_STATIC int z85c30_negate_DTR(int minor)
setReg = Console_Port_Tbl[minor].setRegister;
pz85c30Context = (z85c30_context *) Console_Port_Data[minor].pDeviceContext;
/*
* Negate DTR
*/
@@ -450,7 +450,7 @@ Z85C30_STATIC int z85c30_set_attributes(
if (!baud_requested)
baud_requested = B9600; /* default to 9600 baud */
ulBaudDivisor = Z85C30_Baud(
ulBaudDivisor = Z85C30_Baud(
(uint32_t) Console_Port_Tbl[minor].ulClock,
(uint32_t) termios_baud_to_number( baud_requested )
);
@@ -467,7 +467,7 @@ Z85C30_STATIC int z85c30_set_attributes(
wr4 |= SCC_WR4_PAR_EN;
if (!(t->c_cflag & PARODD))
wr4 |= SCC_WR4_PAR_EVEN;
}
}
/*
* Character Size
@@ -588,7 +588,7 @@ Z85C30_STATIC void z85c30_process(
*/
break;
}
#if 0
if (!Z85C30_Status_Is_CTS_asserted(z85c30_status)) {
/*
@@ -601,7 +601,7 @@ Z85C30_STATIC void z85c30_process(
break;
}
#endif
rtems_termios_dequeue_characters(Console_Port_Data[minor].termios_data, 1);
if (rtems_termios_dequeue_characters(
Console_Port_Data[minor].termios_data, 1)) {
@@ -647,7 +647,7 @@ Z85C30_STATIC rtems_isr z85c30_isr(
getRegister_f getReg;
for (minor=0;minor<Console_Port_Count;minor++) {
if(Console_Port_Tbl[minor].ulIntVector == vector &&
if(Console_Port_Tbl[minor].ulIntVector == vector &&
Console_Port_Tbl[minor].deviceType == SERIAL_Z85C30 ) {
ulCtrlPort = Console_Port_Tbl[minor].ulCtrlPort2;
getReg = Console_Port_Tbl[minor].getRegister;
@@ -736,7 +736,7 @@ Z85C30_STATIC void z85c30_initialize_interrupts(
(*setReg)(ulCtrlPort1, SCC_WR0_SEL_WR0, SCC_WR0_RST_INT);
}
/*
/*
* z85c30_write_support_int
*
* Console Termios output entry point.
@@ -744,8 +744,8 @@ Z85C30_STATIC void z85c30_initialize_interrupts(
*/
Z85C30_STATIC int z85c30_write_support_int(
int minor,
const char *buf,
int minor,
const char *buf,
int len)
{
uint32_t Irql;
@@ -781,7 +781,7 @@ Z85C30_STATIC int z85c30_write_support_int(
return 1;
}
/*
/*
* z85c30_inbyte_nonblocking_polled
*
* This routine polls for a character.
@@ -813,7 +813,7 @@ Z85C30_STATIC int z85c30_inbyte_nonblocking_polled(
return (*getReg)(ulCtrlPort, SCC_WR0_SEL_RD8);
}
/*
/*
* z85c30_write_support_polled
*
* Console Termios output entry point.
@@ -841,7 +841,7 @@ Z85C30_STATIC int z85c30_write_support_polled(
return nwrite;
}
/*
/*
* z85c30_write_polled
*
* This routine transmits a character using polling.

View File

@@ -22,7 +22,7 @@
* the file LICENSE in this distribution or at
* http://www.rtems.com/license/LICENSE.
*
* $Id:
* $Id:
*/
#ifndef __Z85C30_H

View File

@@ -359,7 +359,7 @@ Z85C30_STATIC int z85c30_close(
);
Z85C30_STATIC void z85c30_write_polled(
int minor,
int minor,
char cChar
);

View File

@@ -19,7 +19,7 @@
#ifndef _Z85C30_MULTIPLIER
#define _Z85C30_MULTIPLIER 1
#define _Z85C30_NAME(_X) _X
#define _Z85C30_TYPE uint8_t
#define _Z85C30_TYPE uint8_t
#endif
/*

View File

@@ -30,7 +30,7 @@
* User extension to install MPCI_Fatal as a fatal error
* handler extension
*/
rtems_extensions_table MPCI_Shm_extensions;
rtems_mpci_entry Shm_Initialization( void )
@@ -69,11 +69,11 @@ rtems_mpci_entry Shm_Initialization( void )
* Set the Node Status indicators
*/
Shm_Pending_initialization =
Shm_Pending_initialization =
Shm_Convert(rtems_build_name( 'P', 'E', 'N', 'D' ));
Shm_Initialization_complete =
Shm_Initialization_complete =
Shm_Convert(rtems_build_name( 'C', 'O', 'M', 'P' ));
Shm_Active_node =
Shm_Active_node =
Shm_Convert(rtems_build_name( 'A', 'C', 'T', 'V' ));
/*

View File

@@ -39,7 +39,7 @@ void Shm_Poll()
* This avoids a race condition where we may get a clock
* interrupt before MPCI has completed its init
*/
if (_System_state_Is_up(_System_state_Get()))
{
tmpfront = Shm_Local_receive_queue->front;

View File

@@ -190,14 +190,14 @@ extern "C" {
* size of stuff before preamble in envelope.
* It must be a constant since we will use it to generate MAX_PACKET_SIZE
*/
#define SHM_ENVELOPE_PREFIX_OVERHEAD (4 * sizeof(vol_u32))
/*
* The following is adjusted so envelopes are MAX_ENVELOPE_SIZE bytes long.
* It must be >= RTEMS_MINIMUM_PACKET_SIZE in mppkt.h.
*/
#ifndef MAX_ENVELOPE_SIZE
#define MAX_ENVELOPE_SIZE 0x180
#endif