summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--c/src/ChangeLog5
-rw-r--r--c/src/libchip/network/dec21140.c26
-rw-r--r--c/src/libchip/network/elnk.c18
3 files changed, 16 insertions, 33 deletions
diff --git a/c/src/ChangeLog b/c/src/ChangeLog
index 358a20dd5f..f7fa5bab41 100644
--- a/c/src/ChangeLog
+++ b/c/src/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2005-05-04 Joel Sherrill <joel@OARcorp.com>
* libchip/network/open_eth.c: Remove prototype of set_vector.
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 ) );
diff --git a/c/src/libchip/network/elnk.c b/c/src/libchip/network/elnk.c
index 1b7e3f807f..54ac089f76 100644
--- a/c/src/libchip/network/elnk.c
+++ b/c/src/libchip/network/elnk.c
@@ -83,11 +83,9 @@
#if defined(ELNK_SUPPORTED)
#include <bsp.h>
-#if defined(__i386__)
-#include <pcibios.h>
-#endif
+#include <rtems/pci.h>
+
#if defined(__PPC__)
-#include <bsp/pci.h>
#include <libcpu/byteorder.h>
#include <libcpu/io.h>
#endif
@@ -3138,7 +3136,6 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
int numFound = 0;
int pbus, pdev, pfun;
#if defined(__i386__)
- int signature;
unsigned int value;
unsigned char interrupt;
#endif
@@ -3248,9 +3245,6 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
pbus = sysboards[unitNumber-1].pbus;
pdev = sysboards[unitNumber-1].pdev;
pfun = sysboards[unitNumber-1].pfun;
-#if defined(__i386__)
- signature = PCIB_DEVSIG_MAKE(pbus,pdev,pfun);
-#endif
}
sc = &elnk_softc[unitNumber - 1];
@@ -3318,10 +3312,10 @@ rtems_elnk_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->ioaddr = value & ~IO_MASK;
- pcib_conf_read8(signature, 60, &interrupt);
+ pci_read_config_byte(pbus, pdev, pfun, 60, &interrupt);
cvalue = interrupt;
#endif
#if defined(__PPC__)
@@ -3369,7 +3363,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
when the timer expires during a transfer. This bug exists the Vortex
chip only. */
#if defined(__i386__)
- pcib_conf_read8(signature, 0x0d, &pci_latency);
+ pci_read_config_byte(pbus, pdev, pfun, 0x0d, &pci_latency);
#endif
#if defined(__PPC__)
pci_read_config_byte(pbus,pdev,pfun, PCI_LATENCY_TIMER, &pci_latency);
@@ -3378,7 +3372,7 @@ rtems_elnk_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
{
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__)
- pcib_conf_write8(signature, 0x0d, new_latency);
+ pci_write_config_byte(pbus, pdev, pfun, 0x0d, new_latency);
#endif
#if defined(__PPC__)
pci_write_config_byte(pbus,pdev,pfun, PCI_LATENCY_TIMER, new_latency);