This is Unofficial EPICS BASE Doxygen Site
ne2kpci.c File Reference
#include <stdio.h>
#include <inttypes.h>
#include <bsp.h>
#include <rtems/pci.h>
#include <rtems/rtems_bsdnet.h>
+ Include dependency graph for ne2kpci.c:

Go to the source code of this file.

Functions

int rtems_ne_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
 
int rtems_ne2kpci_driver_attach (struct rtems_bsdnet_ifconfig *config, int attach)
 

Function Documentation

int rtems_ne2kpci_driver_attach ( struct rtems_bsdnet_ifconfig *  config,
int  attach 
)

Definition at line 28 of file ne2kpci.c.

29 {
30  uint8_t irq;
31  uint32_t bar0;
32  int B, D, F, ret;
33  printk("Probing for NE2000 on PCI (aka. Realtek 8029)\n");
34 
35  if(pci_find_device(PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8029, 0, &B, &D, &F))
36  {
37  printk("Not found\n");
38  return 0;
39  }
40 
41  printk("Found %d:%d.%d\n", B, D, F);
42 
43  ret = pci_read_config_dword(B, D, F, PCI_BASE_ADDRESS_0, &bar0);
44  ret|= pci_read_config_byte(B, D, F, PCI_INTERRUPT_LINE, &irq);
45 
46  if(ret || (bar0&PCI_BASE_ADDRESS_SPACE)!=PCI_BASE_ADDRESS_SPACE_IO)
47  {
48  printk("Failed reading card config\n");
49  return 0;
50  }
51 
52  config->irno = irq;
53  config->port = bar0&PCI_BASE_ADDRESS_IO_MASK;
54 
55  printk("Using port=0x%x irq=%u\n", (unsigned)config->port, config->irno);
56 
57  return rtems_ne_driver_attach(config, attach);
58 }
int rtems_ne_driver_attach(struct rtems_bsdnet_ifconfig *config, int attach)
int rtems_ne_driver_attach ( struct rtems_bsdnet_ifconfig *  config,
int  attach 
)