summaryrefslogtreecommitdiffstats
path: root/c/src/libchip/network/dec21140.c
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2005-05-04 19:38:49 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2005-05-04 19:38:49 +0000
commita8e195984ff74cdaf06c650e1ada2c7e854cf65c (patch)
treeba1ad6eef220c96c1dfc84a1b3eab5fb8f22a4e7 /c/src/libchip/network/dec21140.c
parent2005-05-04 Jennifer Averett <jennifer.averett@oarcorp.com> (diff)
downloadrtems-a8e195984ff74cdaf06c650e1ada2c7e854cf65c.tar.bz2
2005-05-04 Jennifer Averett <jennifer.averett@oarcorp.com>
* libchip/network/dec21140.c, libchip/network/elnk.c: Consolidation of code as a result of the implementation of a common PCI interface.
Diffstat (limited to '')
-rw-r--r--c/src/libchip/network/dec21140.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/c/src/libchip/network/dec21140.c b/c/src/libchip/network/dec21140.c
index 53be9bfb60..4387ad38b6 100644
--- a/c/src/libchip/network/dec21140.c
+++ b/c/src/libchip/network/dec21140.c
@@ -48,7 +48,6 @@
#if defined(__i386__)
#define DEC21140_SUPPORTED
#endif
-
#if defined(__PPC__) && (defined(mpc604) || defined(mpc750) || defined(mpc603e))
#define DEC21140_SUPPORTED
#endif
@@ -56,9 +55,7 @@
#if defined(DEC21140_SUPPORTED)
#include <bsp.h>
#include <rtems/pci.h>
-#if defined(__i386__)
-#include <pcibios.h>
-#endif
+
#if defined(__PPC__)
#include <libcpu/byteorder.h>
#include <libcpu/io.h>
@@ -1011,7 +1008,6 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
int mtu;
unsigned char cvalue;
#if defined(__i386__)
- int signature;
unsigned int value;
unsigned char interrupt;
#endif
@@ -1049,8 +1045,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
/* the 21143 chip must be enabled before it can be accessed */
#if defined(__i386__)
- signature = PCIB_DEVSIG_MAKE( pbus, pdev, pfun );
- pcib_conf_write32( signature, 0x40, 0 );
+ pci_write_config_dword(pbus, pdev, pfun, 0x40, 0 );
#else
pci_write_config_dword(pbus, pdev, pfun, 0x40, PCI_DEVICE_ID_DEC_21143);
#endif
@@ -1068,12 +1063,6 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
}
#endif
-#if defined(__i386__)
- signature = PCIB_DEVSIG_MAKE( pbus, pdev, pfun );
-#endif
-
-
-
if ((unitNumber < 1) || (unitNumber > NDECDRIVER))
{
printk("dec2114x : unit %i is invalid, must be (1 <= n <= %d)\n", unitNumber);
@@ -1106,10 +1095,10 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
*/
#if defined(__i386__)
- pcib_conf_read32(signature, 16, &value);
+ pci_read_config_dword(pbus, pdev, pfun, 16, &value);
sc->port = value & ~IO_MASK;
- pcib_conf_read32(signature, 20, &value);
+ pci_read_config_dword(pbus, pdev, pfun, 20, &value);
if (_CPU_is_paging_enabled())
_CPU_map_phys_address((void **) &(sc->base),
(void *)(value & ~MEM_MASK),
@@ -1118,7 +1107,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
else
sc->base = (unsigned int *)(value & ~MEM_MASK);
- pcib_conf_read8(signature, 60, &interrupt);
+ pci_read_config_byte(pbus, pdev, pfun, 60, &interrupt);
cvalue = interrupt;
#endif
#if defined(__PPC__)
@@ -1153,12 +1142,7 @@ rtems_dec21140_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
** Prep the board
*/
-#if defined(__PPC__)
pci_write_config_word(pbus, pdev, pfun,
-#endif
-#if defined(__i386__)
- pcib_conf_write16(signature,
-#endif
PCI_COMMAND,
(uint16_t) ( PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER ) );