forked from Imagelibrary/rtems
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
* libchip/ide/ata.c, libchip/network/dec21140.c, libchip/network/elnk.c, libchip/network/i82586.c, libchip/network/if_fxp.c, libchip/network/if_fxpvar.h, libchip/network/open_eth.c, libchip/network/sonic.c, libchip/rtc/icm7170.c, libchip/serial/ns16550.c, libchip/serial/z85c30.c, libchip/shmdr/cnvpkt.c, libchip/shmdr/init.c, libchip/shmdr/intr.c, libchip/shmdr/shm_driver.h: Cosmetics.
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
|
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||||
|
|
||||||
|
* libchip/ide/ata.c, libchip/network/dec21140.c,
|
||||||
|
libchip/network/elnk.c, libchip/network/i82586.c,
|
||||||
|
libchip/network/if_fxp.c, libchip/network/if_fxpvar.h,
|
||||||
|
libchip/network/open_eth.c, libchip/network/sonic.c,
|
||||||
|
libchip/rtc/icm7170.c, libchip/serial/ns16550.c,
|
||||||
|
libchip/serial/z85c30.c, libchip/shmdr/cnvpkt.c,
|
||||||
|
libchip/shmdr/init.c, libchip/shmdr/intr.c,
|
||||||
|
libchip/shmdr/shm_driver.h: Cosmetics.
|
||||||
|
|
||||||
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
|
2004-03-31 Ralf Corsepius <ralf_corsepius@rtems.org>
|
||||||
|
|
||||||
* optman/rtems/no-dpmem.c, optman/rtems/no-mp.c,
|
* optman/rtems/no-dpmem.c, optman/rtems/no-mp.c,
|
||||||
|
|||||||
@@ -217,10 +217,10 @@ ata_io_data_request(dev_t device, blkdev_request *req)
|
|||||||
*/
|
*/
|
||||||
if (ATA_DEV_INFO(ctrl_minor, dev).lba_avaible)
|
if (ATA_DEV_INFO(ctrl_minor, dev).lba_avaible)
|
||||||
{
|
{
|
||||||
areq->regs.regs[IDE_REGISTER_LBA0] = (uint8_t )req->start;
|
areq->regs.regs[IDE_REGISTER_LBA0] = (uint8_t)req->start;
|
||||||
areq->regs.regs[IDE_REGISTER_LBA1] = (uint8_t )(req->start >> 8);
|
areq->regs.regs[IDE_REGISTER_LBA1] = (uint8_t)(req->start >> 8);
|
||||||
areq->regs.regs[IDE_REGISTER_LBA2] = (uint8_t )(req->start >> 16);
|
areq->regs.regs[IDE_REGISTER_LBA2] = (uint8_t)(req->start >> 16);
|
||||||
areq->regs.regs[IDE_REGISTER_LBA3] |= (uint8_t ) (req->start >> 24);
|
areq->regs.regs[IDE_REGISTER_LBA3] |= (uint8_t) (req->start >> 24);
|
||||||
areq->regs.regs[IDE_REGISTER_LBA3] |= IDE_REGISTER_LBA3_L;
|
areq->regs.regs[IDE_REGISTER_LBA3] |= IDE_REGISTER_LBA3_L;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -237,8 +237,8 @@ ata_io_data_request(dev_t device, blkdev_request *req)
|
|||||||
|
|
||||||
/* now count = number of cylinders */
|
/* now count = number of cylinders */
|
||||||
count %= ATA_DEV_INFO(ctrl_minor, dev).cylinders;
|
count %= ATA_DEV_INFO(ctrl_minor, dev).cylinders;
|
||||||
areq->regs.regs[IDE_REGISTER_CYLINDER_LOW] = (uint8_t )count;
|
areq->regs.regs[IDE_REGISTER_CYLINDER_LOW] = (uint8_t)count;
|
||||||
areq->regs.regs[IDE_REGISTER_CYLINDER_HIGH] = (uint8_t )(count >> 8);
|
areq->regs.regs[IDE_REGISTER_CYLINDER_HIGH] = (uint8_t)(count >> 8);
|
||||||
areq->regs.regs[IDE_REGISTER_DEVICE_HEAD] &=
|
areq->regs.regs[IDE_REGISTER_DEVICE_HEAD] &=
|
||||||
~IDE_REGISTER_DEVICE_HEAD_L;
|
~IDE_REGISTER_DEVICE_HEAD_L;
|
||||||
}
|
}
|
||||||
@@ -312,7 +312,7 @@ ata_non_data_request(dev_t device, int cmd, void *argp)
|
|||||||
ATA_COMMAND_SET_MULTIPLE_MODE;
|
ATA_COMMAND_SET_MULTIPLE_MODE;
|
||||||
areq->regs.to_write |=
|
areq->regs.to_write |=
|
||||||
ATA_REGISTERS_VALUE(IDE_REGISTER_SECTOR_COUNT);
|
ATA_REGISTERS_VALUE(IDE_REGISTER_SECTOR_COUNT);
|
||||||
areq->regs.regs[IDE_REGISTER_SECTOR_COUNT] = *(uint8_t *)argp;
|
areq->regs.regs[IDE_REGISTER_SECTOR_COUNT] = *(uint8_t*)argp;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -356,7 +356,7 @@ ata_non_data_request(dev_t device, int cmd, void *argp)
|
|||||||
{
|
{
|
||||||
case ATAIO_SET_MULTIPLE_MODE:
|
case ATAIO_SET_MULTIPLE_MODE:
|
||||||
ATA_DEV_INFO(ctrl_minor, dev).current_multiple =
|
ATA_DEV_INFO(ctrl_minor, dev).current_multiple =
|
||||||
*(uint8_t *)argp;
|
*(uint8_t*)argp;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -962,7 +962,7 @@ ata_initialize(rtems_device_major_number major,
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer = (uint16_t *)malloc(ATA_SECTOR_SIZE);
|
buffer = (uint16_t*)malloc(ATA_SECTOR_SIZE);
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
{
|
{
|
||||||
rtems_task_delete(ata_task_id);
|
rtems_task_delete(ata_task_id);
|
||||||
@@ -1147,10 +1147,10 @@ ata_initialize(rtems_device_major_number major,
|
|||||||
ATA_DEV_INFO(ctrl_minor, dev).lba_avaible =
|
ATA_DEV_INFO(ctrl_minor, dev).lba_avaible =
|
||||||
(CF_LE_W(buffer[ATA_IDENT_WORD_CAPABILITIES]) >> 9) & 0x1;
|
(CF_LE_W(buffer[ATA_IDENT_WORD_CAPABILITIES]) >> 9) & 0x1;
|
||||||
ATA_DEV_INFO(ctrl_minor, dev).max_multiple =
|
ATA_DEV_INFO(ctrl_minor, dev).max_multiple =
|
||||||
(uint8_t ) (CF_LE_W(buffer[ATA_IDENT_WORD_RW_MULT]));
|
(uint8_t) (CF_LE_W(buffer[ATA_IDENT_WORD_RW_MULT]));
|
||||||
ATA_DEV_INFO(ctrl_minor, dev).current_multiple =
|
ATA_DEV_INFO(ctrl_minor, dev).current_multiple =
|
||||||
(CF_LE_W(buffer[ATA_IDENT_WORD_MULT_SECS]) & 0x100) ?
|
(CF_LE_W(buffer[ATA_IDENT_WORD_MULT_SECS]) & 0x100) ?
|
||||||
(uint8_t )(CF_LE_W(buffer[ATA_IDENT_WORD_MULT_SECS])) :
|
(uint8_t)(CF_LE_W(buffer[ATA_IDENT_WORD_MULT_SECS])) :
|
||||||
0;
|
0;
|
||||||
|
|
||||||
if ((CF_LE_W(buffer[ATA_IDENT_WORD_FIELD_VALIDITY]) &
|
if ((CF_LE_W(buffer[ATA_IDENT_WORD_FIELD_VALIDITY]) &
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ dec21140Enet_interrupt_handler ( struct dec21140_softc *sc )
|
|||||||
volatile uint32_t *tbase;
|
volatile uint32_t *tbase;
|
||||||
uint32_t status;
|
uint32_t status;
|
||||||
|
|
||||||
tbase = (uint32_t *)(sc->base);
|
tbase = (uint32_t*)(sc->base);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read status
|
* Read status
|
||||||
@@ -1190,7 +1190,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
|
|||||||
#if defined(__PPC__)
|
#if defined(__PPC__)
|
||||||
pci_write_config_word(pbus, pdev, pfun,
|
pci_write_config_word(pbus, pdev, pfun,
|
||||||
PCI_COMMAND,
|
PCI_COMMAND,
|
||||||
(uint16_t ) ( PCI_COMMAND_MEMORY |
|
(uint16_t) ( PCI_COMMAND_MEMORY |
|
||||||
PCI_COMMAND_MASTER |
|
PCI_COMMAND_MASTER |
|
||||||
PCI_COMMAND_INVALIDATE |
|
PCI_COMMAND_INVALIDATE |
|
||||||
PCI_COMMAND_WAIT |
|
PCI_COMMAND_WAIT |
|
||||||
|
|||||||
@@ -1380,7 +1380,7 @@ xl_read_eeprom(sc, dest, off, cnt, swap)
|
|||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
word = CSR_READ_2(sc, XL_W0_EE_DATA);
|
word = CSR_READ_2(sc, XL_W0_EE_DATA);
|
||||||
ptr = (u_int16_t *)(dest + (i * 2));
|
ptr = (u_int16_t*)(dest + (i * 2));
|
||||||
if (swap)
|
if (swap)
|
||||||
*ptr = ntohs(word);
|
*ptr = ntohs(word);
|
||||||
else
|
else
|
||||||
@@ -2132,7 +2132,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)
|
|||||||
*/
|
*/
|
||||||
for(i=0 ; i<sc->numRxbuffers; i++)
|
for(i=0 ; i<sc->numRxbuffers; i++)
|
||||||
{
|
{
|
||||||
if( ((uint32_t )&sc->rx_ring[i] & 0x7) )
|
if( ((uint32_t)&sc->rx_ring[i] & 0x7) )
|
||||||
{
|
{
|
||||||
rtems_panic ("etherlink : unit elnk%d rx ring entry %d not aligned to 8 bytes\n", sc->xl_unit, i );
|
rtems_panic ("etherlink : unit elnk%d rx ring entry %d not aligned to 8 bytes\n", sc->xl_unit, i );
|
||||||
}
|
}
|
||||||
@@ -2151,8 +2151,8 @@ elnk_initialize_hardware (struct elnk_softc *sc)
|
|||||||
sc->rx_ring[i].mbuf = m;
|
sc->rx_ring[i].mbuf = m;
|
||||||
|
|
||||||
st_le32( &sc->rx_ring[i].status, 0);
|
st_le32( &sc->rx_ring[i].status, 0);
|
||||||
st_le32( &sc->rx_ring[i].next, (uint32_t )phys_to_bus( nxtmd ));
|
st_le32( &sc->rx_ring[i].next, (uint32_t)phys_to_bus( nxtmd ));
|
||||||
st_le32( &sc->rx_ring[i].addr, (uint32_t )phys_to_bus( mtod(m, void *) ));
|
st_le32( &sc->rx_ring[i].addr, (uint32_t)phys_to_bus( mtod(m, void *) ));
|
||||||
st_le32( &sc->rx_ring[i].length, XL_LAST_FRAG | XL_PACKET_SIZE );
|
st_le32( &sc->rx_ring[i].length, XL_LAST_FRAG | XL_PACKET_SIZE );
|
||||||
}
|
}
|
||||||
sc->curr_rx_md = &sc->rx_ring[0];
|
sc->curr_rx_md = &sc->rx_ring[0];
|
||||||
@@ -2181,7 +2181,7 @@ elnk_initialize_hardware (struct elnk_softc *sc)
|
|||||||
|
|
||||||
for(i=0 ; i<sc->numTxbuffers; i++)
|
for(i=0 ; i<sc->numTxbuffers; i++)
|
||||||
{
|
{
|
||||||
if( ((uint32_t )&sc->tx_ring[i] & 0x7) )
|
if( ((uint32_t)&sc->tx_ring[i] & 0x7) )
|
||||||
{
|
{
|
||||||
rtems_panic ("etherlink : unit elnk%d tx ring entry %d not aligned to 8 bytes\n", sc->xl_unit, i );
|
rtems_panic ("etherlink : unit elnk%d tx ring entry %d not aligned to 8 bytes\n", sc->xl_unit, i );
|
||||||
}
|
}
|
||||||
@@ -2327,7 +2327,7 @@ elnk_rxDaemon (void *arg)
|
|||||||
m->m_pkthdr.rcvif = ifp;
|
m->m_pkthdr.rcvif = ifp;
|
||||||
rmd->mbuf = m;
|
rmd->mbuf = m;
|
||||||
st_le32( &rmd->status, 0 );
|
st_le32( &rmd->status, 0 );
|
||||||
st_le32( &rmd->addr, (uint32_t )phys_to_bus(mtod(m, void *)) );
|
st_le32( &rmd->addr, (uint32_t)phys_to_bus(mtod(m, void *)) );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2475,7 +2475,7 @@ elnk_txDaemon (void *arg)
|
|||||||
for(i=0; i< NUM_FRAGS; i++)
|
for(i=0; i< NUM_FRAGS; i++)
|
||||||
{
|
{
|
||||||
st_le32( &nextmd->txfrags[i].length, ((m->m_next)?0:XL_LAST_FRAG) | ( m->m_len & XL_TXSTAT_LENMASK) );
|
st_le32( &nextmd->txfrags[i].length, ((m->m_next)?0:XL_LAST_FRAG) | ( m->m_len & XL_TXSTAT_LENMASK) );
|
||||||
st_le32( &nextmd->txfrags[i].addr, (uint32_t )phys_to_bus( m->m_data ) );
|
st_le32( &nextmd->txfrags[i].addr, (uint32_t)phys_to_bus( m->m_data ) );
|
||||||
if ((m = m->m_next) == NULL)
|
if ((m = m->m_next) == NULL)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2491,7 +2491,7 @@ elnk_txDaemon (void *arg)
|
|||||||
{
|
{
|
||||||
char *pkt = bus_to_phys( ld_le32( &nextmd->txfrags[i].addr )), *delim;
|
char *pkt = bus_to_phys( ld_le32( &nextmd->txfrags[i].addr )), *delim;
|
||||||
int i;
|
int i;
|
||||||
printk("unit %d queued pkt (%08x) ", sc->xl_unit, (uint32_t )pkt );
|
printk("unit %d queued pkt (%08x) ", sc->xl_unit, (uint32_t)pkt );
|
||||||
for(delim="", i=0; i < sizeof(struct ether_header); i++, delim=":")
|
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");
|
printk("\n");
|
||||||
@@ -2522,7 +2522,7 @@ elnk_txDaemon (void *arg)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* hook this packet to the previous one */
|
/* hook this packet to the previous one */
|
||||||
st_le32( &lastmd->next, (uint32_t )phys_to_bus( nextmd ));
|
st_le32( &lastmd->next, (uint32_t)phys_to_bus( nextmd ));
|
||||||
}
|
}
|
||||||
|
|
||||||
++chainCount;
|
++chainCount;
|
||||||
@@ -2574,7 +2574,7 @@ elnk_txDaemon (void *arg)
|
|||||||
printk("unit %d queued %d pkts, lastpkt status %08X\n",
|
printk("unit %d queued %d pkts, lastpkt status %08X\n",
|
||||||
sc->xl_unit,
|
sc->xl_unit,
|
||||||
chainCount,
|
chainCount,
|
||||||
(uint32_t )ld_le32( &lastmd->status) );
|
(uint32_t)ld_le32( &lastmd->status) );
|
||||||
#endif
|
#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 )
|
||||||
@@ -3329,7 +3329,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
|
|||||||
*/
|
*/
|
||||||
pci_write_config_word(pbus, pdev, pfun,
|
pci_write_config_word(pbus, pdev, pfun,
|
||||||
PCI_COMMAND,
|
PCI_COMMAND,
|
||||||
(uint16_t )( PCI_COMMAND_IO |
|
(uint16_t)( PCI_COMMAND_IO |
|
||||||
PCI_COMMAND_MASTER |
|
PCI_COMMAND_MASTER |
|
||||||
PCI_COMMAND_INVALIDATE |
|
PCI_COMMAND_INVALIDATE |
|
||||||
PCI_COMMAND_WAIT ) );
|
PCI_COMMAND_WAIT ) );
|
||||||
@@ -3340,7 +3340,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
|
|||||||
PCI_BASE_ADDRESS_0,
|
PCI_BASE_ADDRESS_0,
|
||||||
&lvalue);
|
&lvalue);
|
||||||
|
|
||||||
sc->ioaddr = (uint32_t )lvalue & PCI_BASE_ADDRESS_IO_MASK;
|
sc->ioaddr = (uint32_t)lvalue & PCI_BASE_ADDRESS_IO_MASK;
|
||||||
/*
|
/*
|
||||||
** Store the interrupt name, we'll use it later when we initialize
|
** Store the interrupt name, we'll use it later when we initialize
|
||||||
** the board.
|
** the board.
|
||||||
|
|||||||
@@ -197,8 +197,8 @@ static void i82586_start_tx(struct ie_softc *sc);
|
|||||||
|
|
||||||
static int ie_readframe (struct ie_softc *, int);
|
static int ie_readframe (struct ie_softc *, int);
|
||||||
static struct mbuf *ieget (struct ie_softc *, int, int);
|
static struct mbuf *ieget (struct ie_softc *, int, int);
|
||||||
static int i82586_get_rbd_list (struct ie_softc *, u_int16_t *,
|
static int i82586_get_rbd_list (struct ie_softc *, u_int16_t*,
|
||||||
u_int16_t *, int *);
|
u_int16_t*, int *);
|
||||||
static void i82586_release_rbd_list (struct ie_softc *,
|
static void i82586_release_rbd_list (struct ie_softc *,
|
||||||
u_int16_t, u_int16_t);
|
u_int16_t, u_int16_t);
|
||||||
static int i82586_drop_frames (struct ie_softc *);
|
static int i82586_drop_frames (struct ie_softc *);
|
||||||
|
|||||||
@@ -273,8 +273,8 @@ fxp_lwcopy(volatile u_int32_t *src, volatile u_int32_t *dst)
|
|||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
*dst = *src;
|
*dst = *src;
|
||||||
#else
|
#else
|
||||||
volatile u_int16_t *a = (volatile u_int16_t *)src;
|
volatile u_int16_t *a = (volatile u_int16_t*)src;
|
||||||
volatile u_int16_t *b = (volatile u_int16_t *)dst;
|
volatile u_int16_t *b = (volatile u_int16_t*)dst;
|
||||||
|
|
||||||
b[0] = a[0];
|
b[0] = a[0];
|
||||||
b[1] = a[1];
|
b[1] = a[1];
|
||||||
@@ -290,7 +290,7 @@ static __inline u_int8_t fxp_csr_read_1(struct fxp_softc *sc,int reg) {
|
|||||||
inport_byte(sc->pci_regs_base + reg,val);
|
inport_byte(sc->pci_regs_base + reg,val);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val = *(u_int8_t *)(sc->pci_regs_base+reg);
|
val = *(u_int8_t*)(sc->pci_regs_base+reg);
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,7 @@ static __inline u_int32_t fxp_csr_read_2(struct fxp_softc *sc,int reg) {
|
|||||||
inport_word(sc->pci_regs_base + reg,val);
|
inport_word(sc->pci_regs_base + reg,val);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val = *(u_int16_t *)(sc->pci_regs_base+reg);
|
val = *(u_int16_t*)(sc->pci_regs_base+reg);
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@@ -310,7 +310,7 @@ static __inline u_int32_t fxp_csr_read_4(struct fxp_softc *sc,int reg) {
|
|||||||
inport_long(sc->pci_regs_base + reg,val);
|
inport_long(sc->pci_regs_base + reg,val);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val = *(u_int32_t *)(sc->pci_regs_base+reg);
|
val = *(u_int32_t*)(sc->pci_regs_base+reg);
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
@@ -753,15 +753,15 @@ rtems_fxp_attach(struct rtems_bsdnet_ifconfig *config, int attaching)
|
|||||||
/*
|
/*
|
||||||
* Read MAC address.
|
* Read MAC address.
|
||||||
*/
|
*/
|
||||||
fxp_read_eeprom(sc, (u_int16_t *)sc->arpcom.ac_enaddr, 0, 3);
|
fxp_read_eeprom(sc, (u_int16_t*)sc->arpcom.ac_enaddr, 0, 3);
|
||||||
if (fxp_is_verbose) {
|
if (fxp_is_verbose) {
|
||||||
device_printf(dev, "Ethernet address %x:%x:%x:%x:%x:%x %s \n",
|
device_printf(dev, "Ethernet address %x:%x:%x:%x:%x:%x %s \n",
|
||||||
((u_int8_t *)sc->arpcom.ac_enaddr)[0],
|
((u_int8_t*)sc->arpcom.ac_enaddr)[0],
|
||||||
((u_int8_t *)sc->arpcom.ac_enaddr)[1],
|
((u_int8_t*)sc->arpcom.ac_enaddr)[1],
|
||||||
((u_int8_t *)sc->arpcom.ac_enaddr)[2],
|
((u_int8_t*)sc->arpcom.ac_enaddr)[2],
|
||||||
((u_int8_t *)sc->arpcom.ac_enaddr)[3],
|
((u_int8_t*)sc->arpcom.ac_enaddr)[3],
|
||||||
((u_int8_t *)sc->arpcom.ac_enaddr)[4],
|
((u_int8_t*)sc->arpcom.ac_enaddr)[4],
|
||||||
((u_int8_t *)sc->arpcom.ac_enaddr)[5],
|
((u_int8_t*)sc->arpcom.ac_enaddr)[5],
|
||||||
sc->flags & FXP_FLAG_SERIAL_MEDIA ? ", 10Mbps" : "");
|
sc->flags & FXP_FLAG_SERIAL_MEDIA ? ", 10Mbps" : "");
|
||||||
device_printf(dev, "PCI IDs: 0x%x 0x%x 0x%x 0x%x 0x%x\n",
|
device_printf(dev, "PCI IDs: 0x%x 0x%x 0x%x 0x%x 0x%x\n",
|
||||||
pci_get_vendor(sc), pci_get_device(sc),
|
pci_get_vendor(sc), pci_get_device(sc),
|
||||||
@@ -1724,7 +1724,7 @@ rtems_task_wake_after(100);
|
|||||||
* zero and must be one bits in this structure and this is the easiest
|
* zero and must be one bits in this structure and this is the easiest
|
||||||
* way to initialize them all to proper values.
|
* way to initialize them all to proper values.
|
||||||
*/
|
*/
|
||||||
memcpy( (void *)(u_int32_t *)(volatile void *)&cbp->cb_status,
|
memcpy( (void *)(u_int32_t*)(volatile void *)&cbp->cb_status,
|
||||||
fxp_cb_config_template,
|
fxp_cb_config_template,
|
||||||
sizeof(fxp_cb_config_template));
|
sizeof(fxp_cb_config_template));
|
||||||
|
|
||||||
@@ -1830,7 +1830,7 @@ rtems_task_wake_after(100);
|
|||||||
cb_ias->cb_status = 0;
|
cb_ias->cb_status = 0;
|
||||||
cb_ias->cb_command = FXP_CB_COMMAND_IAS | FXP_CB_COMMAND_EL;
|
cb_ias->cb_command = FXP_CB_COMMAND_IAS | FXP_CB_COMMAND_EL;
|
||||||
cb_ias->link_addr = -1;
|
cb_ias->link_addr = -1;
|
||||||
memcpy((void *)(u_int32_t *)(volatile void *)cb_ias->macaddr,
|
memcpy((void *)(u_int32_t*)(volatile void *)cb_ias->macaddr,
|
||||||
sc->arpcom.ac_enaddr,
|
sc->arpcom.ac_enaddr,
|
||||||
sizeof(sc->arpcom.ac_enaddr));
|
sizeof(sc->arpcom.ac_enaddr));
|
||||||
|
|
||||||
@@ -2024,8 +2024,8 @@ fxp_add_rfabuf(struct fxp_softc *sc, struct mbuf *oldm)
|
|||||||
rfa->actual_size = 0;
|
rfa->actual_size = 0;
|
||||||
|
|
||||||
v = -1;
|
v = -1;
|
||||||
fxp_lwcopy(&v, (volatile u_int32_t *) rfa->link_addr);
|
fxp_lwcopy(&v, (volatile u_int32_t*) rfa->link_addr);
|
||||||
fxp_lwcopy(&v, (volatile u_int32_t *) rfa->rbd_addr);
|
fxp_lwcopy(&v, (volatile u_int32_t*) rfa->rbd_addr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there are other buffers already on the list, attach this
|
* If there are other buffers already on the list, attach this
|
||||||
@@ -2036,7 +2036,7 @@ fxp_add_rfabuf(struct fxp_softc *sc, struct mbuf *oldm)
|
|||||||
RFA_ALIGNMENT_FUDGE);
|
RFA_ALIGNMENT_FUDGE);
|
||||||
sc->rfa_tailm->m_next = m;
|
sc->rfa_tailm->m_next = m;
|
||||||
v = vtophys(rfa);
|
v = vtophys(rfa);
|
||||||
fxp_lwcopy(&v, (volatile u_int32_t *) p_rfa->link_addr);
|
fxp_lwcopy(&v, (volatile u_int32_t*) p_rfa->link_addr);
|
||||||
p_rfa->rfa_control = 0;
|
p_rfa->rfa_control = 0;
|
||||||
} else {
|
} else {
|
||||||
sc->rfa_headm = m;
|
sc->rfa_headm = m;
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ struct fxp_softc {
|
|||||||
if ((sc)->pci_regs_are_io) \
|
if ((sc)->pci_regs_are_io) \
|
||||||
outport_byte((sc)->pci_regs_base+(reg),val); \
|
outport_byte((sc)->pci_regs_base+(reg),val); \
|
||||||
else \
|
else \
|
||||||
*((u_int8_t *)((sc)->pci_regs_base)+(reg)) = val; \
|
*((u_int8_t*)((sc)->pci_regs_base)+(reg)) = val; \
|
||||||
}while (0)
|
}while (0)
|
||||||
|
|
||||||
#define CSR_WRITE_2(sc, reg, val) \
|
#define CSR_WRITE_2(sc, reg, val) \
|
||||||
@@ -183,7 +183,7 @@ struct fxp_softc {
|
|||||||
if ((sc)->pci_regs_are_io) \
|
if ((sc)->pci_regs_are_io) \
|
||||||
outport_word((sc)->pci_regs_base+(reg),val); \
|
outport_word((sc)->pci_regs_base+(reg),val); \
|
||||||
else \
|
else \
|
||||||
*((u_int16_t *)((u_int8_t *)((sc)->pci_regs_base)+(reg))) = val; \
|
*((u_int16_t*)((u_int8_t*)((sc)->pci_regs_base)+(reg))) = val; \
|
||||||
}while (0)
|
}while (0)
|
||||||
|
|
||||||
#define CSR_WRITE_4(sc, reg, val) \
|
#define CSR_WRITE_4(sc, reg, val) \
|
||||||
@@ -191,7 +191,7 @@ struct fxp_softc {
|
|||||||
if ((sc)->pci_regs_are_io) \
|
if ((sc)->pci_regs_are_io) \
|
||||||
outport_long((sc)->pci_regs_base+(reg),val); \
|
outport_long((sc)->pci_regs_base+(reg),val); \
|
||||||
else \
|
else \
|
||||||
*((u_int32_t *)((u_int8_t *)((sc)->pci_regs_base)+(reg))) = val; \
|
*((u_int32_t*)((u_int8_t*)((sc)->pci_regs_base)+(reg))) = val; \
|
||||||
}while (0)
|
}while (0)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ open_eth_initialize_hardware (struct open_eth_softc *sc)
|
|||||||
MCLGET (m, M_WAIT);
|
MCLGET (m, M_WAIT);
|
||||||
m->m_pkthdr.rcvif = &sc->arpcom.ac_if;
|
m->m_pkthdr.rcvif = &sc->arpcom.ac_if;
|
||||||
sc->rxdesc[i].m = m;
|
sc->rxdesc[i].m = m;
|
||||||
sc->regs->xd[i + sc->txbufs].addr = mtod (m, uint32_t *);
|
sc->regs->xd[i + sc->txbufs].addr = mtod (m, uint32_t*);
|
||||||
sc->regs->xd[i + sc->txbufs].len_status =
|
sc->regs->xd[i + sc->txbufs].len_status =
|
||||||
OETH_RX_BD_EMPTY | OETH_RX_BD_IRQ;
|
OETH_RX_BD_EMPTY | OETH_RX_BD_IRQ;
|
||||||
#ifdef OPEN_ETH_DEBUG
|
#ifdef OPEN_ETH_DEBUG
|
||||||
@@ -418,7 +418,7 @@ open_eth_rxDaemon (void *arg)
|
|||||||
m->m_pkthdr.rcvif = ifp;
|
m->m_pkthdr.rcvif = ifp;
|
||||||
dp->rxdesc[dp->rx_ptr].m = m;
|
dp->rxdesc[dp->rx_ptr].m = m;
|
||||||
dp->regs->xd[dp->rx_ptr + dp->txbufs].addr =
|
dp->regs->xd[dp->rx_ptr + dp->txbufs].addr =
|
||||||
(uint32_t *) mtod (m, void *);
|
(uint32_t*) mtod (m, void *);
|
||||||
dp->rxPackets++;
|
dp->rxPackets++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -458,7 +458,7 @@ sendpacket (struct ifnet *ifp, struct mbuf *m)
|
|||||||
|
|
||||||
len = 0;
|
len = 0;
|
||||||
temp = (unsigned char *) dp->txdesc[dp->tx_ptr].buf;
|
temp = (unsigned char *) dp->txdesc[dp->tx_ptr].buf;
|
||||||
dp->regs->xd[dp->tx_ptr].addr = (uint32_t *) temp;
|
dp->regs->xd[dp->tx_ptr].addr = (uint32_t*) temp;
|
||||||
|
|
||||||
#ifdef OPEN_ETH_DEBUG
|
#ifdef OPEN_ETH_DEBUG
|
||||||
printf("TXD: 0x%08x\n", (int) m->m_data);
|
printf("TXD: 0x%08x\n", (int) m->m_data);
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
* XXX fix this
|
* XXX fix this
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *set_vector(void *, uint32_t , uint32_t );
|
void *set_vector(void *, uint32_t, uint32_t);
|
||||||
|
|
||||||
#if (SONIC_DEBUG & SONIC_DEBUG_DUMP_MBUFS)
|
#if (SONIC_DEBUG & SONIC_DEBUG_DUMP_MBUFS)
|
||||||
#include <rtems/dumpbuf.h>
|
#include <rtems/dumpbuf.h>
|
||||||
@@ -116,9 +116,9 @@ void *set_vector(void *, uint32_t , uint32_t );
|
|||||||
/*
|
/*
|
||||||
* Macros for manipulating 32-bit pointers as 16-bit fragments
|
* Macros for manipulating 32-bit pointers as 16-bit fragments
|
||||||
*/
|
*/
|
||||||
#define LSW(p) ((uint16_t )((uint32_t )(p)))
|
#define LSW(p) ((uint16_t)((uint32_t)(p)))
|
||||||
#define MSW(p) ((uint16_t )((uint32_t )(p) >> 16))
|
#define MSW(p) ((uint16_t)((uint32_t)(p) >> 16))
|
||||||
#define PTR(m,l) ((void*)(((uint16_t )(m)<<16)|(uint16_t )(l)))
|
#define PTR(m,l) ((void*)(((uint16_t)(m)<<16)|(uint16_t)(l)))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hardware-specific storage
|
* Hardware-specific storage
|
||||||
@@ -985,7 +985,7 @@ SONIC_STATIC void sonic_rxDaemon (void *arg)
|
|||||||
rdp->byte_count &= 0x0ffff; /* ERC32 pollutes msb of byte_count */
|
rdp->byte_count &= 0x0ffff; /* ERC32 pollutes msb of byte_count */
|
||||||
m = rdp->mbufp;
|
m = rdp->mbufp;
|
||||||
m->m_len = m->m_pkthdr.len = rdp->byte_count -
|
m->m_len = m->m_pkthdr.len = rdp->byte_count -
|
||||||
sizeof(uint32_t ) -
|
sizeof(uint32_t) -
|
||||||
sizeof(struct ether_header);
|
sizeof(struct ether_header);
|
||||||
eh = mtod (m, struct ether_header *);
|
eh = mtod (m, struct ether_header *);
|
||||||
m->m_data += sizeof(struct ether_header);
|
m->m_data += sizeof(struct ether_header);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void icm7170_initialize(
|
|||||||
* Initialize the RTC with the proper clock frequency
|
* Initialize the RTC with the proper clock frequency
|
||||||
*/
|
*/
|
||||||
|
|
||||||
clock = (uint32_t ) RTC_Table[ minor ].pDeviceParams;
|
clock = (uint32_t) RTC_Table[ minor ].pDeviceParams;
|
||||||
(*setReg)( icm7170, ICM7170_CONTROL, 0x0c | clock );
|
(*setReg)( icm7170, ICM7170_CONTROL, 0x0c | clock );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +127,7 @@ int icm7170_set_time(
|
|||||||
icm7170 = RTC_Table[ minor ].ulCtrlPort1;
|
icm7170 = RTC_Table[ minor ].ulCtrlPort1;
|
||||||
getReg = RTC_Table[ minor ].getRegister;
|
getReg = RTC_Table[ minor ].getRegister;
|
||||||
setReg = RTC_Table[ minor ].setRegister;
|
setReg = RTC_Table[ minor ].setRegister;
|
||||||
clock = (uint32_t ) RTC_Table[ minor ].pDeviceParams;
|
clock = (uint32_t) RTC_Table[ minor ].pDeviceParams;
|
||||||
|
|
||||||
year = time->year;
|
year = time->year;
|
||||||
|
|
||||||
|
|||||||
@@ -103,8 +103,8 @@ NS16550_STATIC void ns16550_init(int minor)
|
|||||||
/* Set the divisor latch and set the baud rate. */
|
/* Set the divisor latch and set the baud rate. */
|
||||||
|
|
||||||
ulBaudDivisor = NS16550_Baud(
|
ulBaudDivisor = NS16550_Baud(
|
||||||
(uint32_t ) Console_Port_Tbl[minor].ulClock,
|
(uint32_t) Console_Port_Tbl[minor].ulClock,
|
||||||
(uint32_t ) Console_Port_Tbl[minor].pDeviceParams
|
(uint32_t) Console_Port_Tbl[minor].pDeviceParams
|
||||||
);
|
);
|
||||||
ucDataByte = SP_LINE_DLAB;
|
ucDataByte = SP_LINE_DLAB;
|
||||||
(*setReg)(pNS16550, NS16550_LINE_CONTROL, ucDataByte);
|
(*setReg)(pNS16550, NS16550_LINE_CONTROL, ucDataByte);
|
||||||
@@ -367,7 +367,7 @@ NS16550_STATIC int ns16550_set_attributes(
|
|||||||
baud_requested = B9600; /* default to 9600 baud */
|
baud_requested = B9600; /* default to 9600 baud */
|
||||||
|
|
||||||
ulBaudDivisor = NS16550_Baud(
|
ulBaudDivisor = NS16550_Baud(
|
||||||
(uint32_t ) Console_Port_Tbl[minor].ulClock,
|
(uint32_t) Console_Port_Tbl[minor].ulClock,
|
||||||
termios_baud_to_number(baud_requested)
|
termios_baud_to_number(baud_requested)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ Z85C30_STATIC void z85c30_initialize_port(
|
|||||||
);
|
);
|
||||||
|
|
||||||
ulBaudDivisor = Z85C30_Baud(
|
ulBaudDivisor = Z85C30_Baud(
|
||||||
(uint32_t ) Console_Port_Tbl[minor].ulClock,
|
(uint32_t) Console_Port_Tbl[minor].ulClock,
|
||||||
(uint32_t ) Console_Port_Tbl[minor].pDeviceParams
|
(uint32_t) Console_Port_Tbl[minor].pDeviceParams
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -451,8 +451,8 @@ Z85C30_STATIC int z85c30_set_attributes(
|
|||||||
baud_requested = B9600; /* default to 9600 baud */
|
baud_requested = B9600; /* default to 9600 baud */
|
||||||
|
|
||||||
ulBaudDivisor = Z85C30_Baud(
|
ulBaudDivisor = Z85C30_Baud(
|
||||||
(uint32_t ) Console_Port_Tbl[minor].ulClock,
|
(uint32_t) Console_Port_Tbl[minor].ulClock,
|
||||||
(uint32_t ) termios_baud_to_number( baud_requested )
|
(uint32_t) termios_baud_to_number( baud_requested )
|
||||||
);
|
);
|
||||||
|
|
||||||
wr3 = SCC_WR3_RX_EN;
|
wr3 = SCC_WR3_RX_EN;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ void Shm_Convert_packet(
|
|||||||
{
|
{
|
||||||
uint32_t *pkt, i;
|
uint32_t *pkt, i;
|
||||||
|
|
||||||
pkt = (uint32_t *) packet;
|
pkt = (uint32_t*) packet;
|
||||||
for ( i=RTEMS_MINIMUN_HETERO_CONVERSION ; i ; i--, pkt++ )
|
for ( i=RTEMS_MINIMUN_HETERO_CONVERSION ; i ; i--, pkt++ )
|
||||||
*pkt = CPU_swap_u32( *pkt );
|
*pkt = CPU_swap_u32( *pkt );
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ rtems_mpci_entry Shm_Initialization( void )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
interrupt_address =
|
interrupt_address =
|
||||||
(void *) Shm_Convert( (uint32_t )Shm_Configuration->Intr.address );
|
(void *) Shm_Convert( (uint32_t)Shm_Configuration->Intr.address );
|
||||||
interrupt_value = Shm_Convert( Shm_Configuration->Intr.value );
|
interrupt_value = Shm_Convert( Shm_Configuration->Intr.value );
|
||||||
interrupt_cause = Shm_Convert( Shm_Configuration->Intr.length );
|
interrupt_cause = Shm_Convert( Shm_Configuration->Intr.length );
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ rtems_mpci_entry Shm_Initialization( void )
|
|||||||
* shared area so other nodes can interrupt us.
|
* shared area so other nodes can interrupt us.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Shm_Local_node_status->int_address = (uint32_t ) interrupt_address;
|
Shm_Local_node_status->int_address = (uint32_t) interrupt_address;
|
||||||
Shm_Local_node_status->int_value = interrupt_value;
|
Shm_Local_node_status->int_value = interrupt_value;
|
||||||
Shm_Local_node_status->int_length = interrupt_cause;
|
Shm_Local_node_status->int_length = interrupt_cause;
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ rtems_mpci_entry Shm_Initialization( void )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Shm_Local_node_status->int_address =
|
Shm_Local_node_status->int_address =
|
||||||
(uint32_t ) interrupt_address;
|
(uint32_t) interrupt_address;
|
||||||
Shm_Local_node_status->int_value = interrupt_value;
|
Shm_Local_node_status->int_value = interrupt_value;
|
||||||
Shm_Local_node_status->int_length = interrupt_cause;
|
Shm_Local_node_status->int_length = interrupt_cause;
|
||||||
|
|
||||||
|
|||||||
@@ -42,16 +42,16 @@ void Shm_Cause_interrupt(
|
|||||||
case NO_INTERRUPT:
|
case NO_INTERRUPT:
|
||||||
break;
|
break;
|
||||||
case BYTE:
|
case BYTE:
|
||||||
u8 = (uint8_t *)intr->address;
|
u8 = (uint8_t*)intr->address;
|
||||||
*u8 = (uint8_t ) value;
|
*u8 = (uint8_t) value;
|
||||||
break;
|
break;
|
||||||
case WORD:
|
case WORD:
|
||||||
u16 = (uint16_t *)intr->address;
|
u16 = (uint16_t*)intr->address;
|
||||||
*u16 = (uint16_t ) value;
|
*u16 = (uint16_t) value;
|
||||||
break;
|
break;
|
||||||
case LONG:
|
case LONG:
|
||||||
u32 = (uint32_t *)intr->address;
|
u32 = (uint32_t*)intr->address;
|
||||||
*u32 = (uint32_t ) value;
|
*u32 = (uint32_t) value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -254,7 +254,7 @@ extern "C" {
|
|||||||
((void *)(ecb)->packet)
|
((void *)(ecb)->packet)
|
||||||
|
|
||||||
#define Shm_Packet_prefix_to_envelope_control_pointer( pkt ) \
|
#define Shm_Packet_prefix_to_envelope_control_pointer( pkt ) \
|
||||||
((Shm_Envelope_control *)((uint8_t *)(pkt) - \
|
((Shm_Envelope_control *)((uint8_t*)(pkt) - \
|
||||||
(sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD)))
|
(sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD)))
|
||||||
|
|
||||||
#define Shm_Build_preamble(ecb, node) \
|
#define Shm_Build_preamble(ecb, node) \
|
||||||
@@ -425,7 +425,7 @@ struct shm_config_info {
|
|||||||
vol_u32 format; /* SHM is big or little endian */
|
vol_u32 format; /* SHM is big or little endian */
|
||||||
vol_u32 (*convert)();/* neutral conversion routine */
|
vol_u32 (*convert)();/* neutral conversion routine */
|
||||||
vol_u32 poll_intr;/* POLLED or INTR driven mode */
|
vol_u32 poll_intr;/* POLLED or INTR driven mode */
|
||||||
void (*cause_intr)( uint32_t );
|
void (*cause_intr)( uint32_t);
|
||||||
Shm_Interrupt_information Intr; /* cause intr information */
|
Shm_Interrupt_information Intr; /* cause intr information */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -472,7 +472,7 @@ void Shm_Locked_queue_Add(
|
|||||||
Shm_Locked_queue_Control *, Shm_Envelope_control * );
|
Shm_Locked_queue_Control *, Shm_Envelope_control * );
|
||||||
Shm_Envelope_control *Shm_Locked_queue_Get( Shm_Locked_queue_Control * );
|
Shm_Envelope_control *Shm_Locked_queue_Get( Shm_Locked_queue_Control * );
|
||||||
void Shm_Locked_queue_Initialize(
|
void Shm_Locked_queue_Initialize(
|
||||||
Shm_Locked_queue_Control *, uint32_t );
|
Shm_Locked_queue_Control *, uint32_t);
|
||||||
/* Shm_Initialize_lock is CPU dependent */
|
/* Shm_Initialize_lock is CPU dependent */
|
||||||
/* Shm_Lock is CPU dependent */
|
/* Shm_Lock is CPU dependent */
|
||||||
/* Shm_Unlock is CPU dependent */
|
/* Shm_Unlock is CPU dependent */
|
||||||
@@ -480,8 +480,8 @@ void Shm_Locked_queue_Initialize(
|
|||||||
/* portable routines */
|
/* portable routines */
|
||||||
void Init_env_pool();
|
void Init_env_pool();
|
||||||
void Shm_Print_statistics( void );
|
void Shm_Print_statistics( void );
|
||||||
void MPCI_Fatal( Internal_errors_Source, boolean, uint32_t );
|
void MPCI_Fatal( Internal_errors_Source, boolean, uint32_t);
|
||||||
rtems_task Shm_Cause_interrupt( uint32_t );
|
rtems_task Shm_Cause_interrupt( uint32_t);
|
||||||
void Shm_Poll();
|
void Shm_Poll();
|
||||||
void Shm_setclockvec();
|
void Shm_setclockvec();
|
||||||
void Shm_Convert_packet( rtems_packet_prefix * );
|
void Shm_Convert_packet( rtems_packet_prefix * );
|
||||||
@@ -490,7 +490,7 @@ void Shm_Convert_packet( rtems_packet_prefix * );
|
|||||||
|
|
||||||
/* target specific routines */
|
/* target specific routines */
|
||||||
void *Shm_Convert_address( void * );
|
void *Shm_Convert_address( void * );
|
||||||
void Shm_Get_configuration( uint32_t , shm_config_table ** );
|
void Shm_Get_configuration( uint32_t, shm_config_table ** );
|
||||||
void Shm_isr();
|
void Shm_isr();
|
||||||
void Shm_setvec( void );
|
void Shm_setvec( void );
|
||||||
|
|
||||||
@@ -514,7 +514,7 @@ rtems_mpci_entry Shm_Return_packet(
|
|||||||
);
|
);
|
||||||
|
|
||||||
rtems_mpci_entry Shm_Send_packet(
|
rtems_mpci_entry Shm_Send_packet(
|
||||||
uint32_t ,
|
uint32_t,
|
||||||
rtems_packet_prefix *
|
rtems_packet_prefix *
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user