CFLAGS=-I../include -I../include/raw -nostdlib -nostdinc -fno-builtin -D__RAW__ -Wall -Werror -pedantic -ansi -std=gnu99
OBJS=counter.o firstrun.o ../pci/pci-raw.o ../lib/minilib.o ../lib/console.o \
- ../ich2/smram-ich2.o ../ich2/smi.o vga-overlay.o packet.o ../lib/sprintf.o \
- ../lib/doprnt.o ../pci/pci.o 3c905.o ../ich2/ich2-timer.o
+ ../ich2/smram-ich2.o ../ich2/smi.o vga-overlay.o packet.o \
+ ../lib/sprintf.o ../lib/doprnt.o ../pci/pci.o ../net/net.o \
+ ../ich2/ich2-timer.o ../pci/pci-bother.o
all: aseg.elf
#include <video_defines.h>
#include <minilib.h>
#include <smi.h>
+#include <pci-bother.h>
#include "3c905.h"
#include "vga-overlay.h"
#include "packet.h"
pcisave = inl(0xCF8);
vgasave = inb(0x3D4);
+ pci_unbother_all();
counter++;
sprintf(statstr, "15-412! %08x %08x", smi_status(), counter);
smi_poll();
+ pci_bother_all();
outl(0xCF8, pcisave);
outb(0x3D4, vgasave);
}
#include <pci.h>
+#include <pci-bother.h>
#include <output.h>
-#include "3c905.h"
-
-static int found = 0, _bus, _dev, _fn;
+#include "net.h"
static int bother_3c905(pci_dev_t *dev, void *nutrinus)
{
{
outputf("Found a 3c905 to bother");
- _bus = dev->bus;
- _dev = dev->dev;
- _fn = dev->fn;
- found = 1;
-
+ pci_bother_add(dev);
return 1;
}
return 0;
void eth_poll()
{
- if (!found)
- return;
-
- pci_write16(_bus, _dev, _fn, 0x04, 0xFF);
-
- pci_write16(_bus, _dev, _fn, 0x04, 0x00);
+ /* ... */
}
void eth_init()