]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Add the mechanism by which we bother PCI, generically.
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 2 Oct 2008 23:20:28 +0000 (19:20 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Thu, 2 Oct 2008 23:20:28 +0000 (19:20 -0400)
aseg/Makefile
aseg/counter.c
net/net.c

index 3015bd7a4a48d951ec6e50a11af0f21d5827855e..40726061e4911d7ee6bc9d5ec17e4931db885e94 100644 (file)
@@ -2,8 +2,9 @@ CC=gcc
 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 \
 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
 
 
 all: aseg.elf
 
index eaeec525e7ab11b006ba18c826d0726279791f8c..bf60ffda0d1e568964b65d58d12d17c9bf921b8f 100644 (file)
@@ -3,6 +3,7 @@
 #include <video_defines.h>
 #include <minilib.h>
 #include <smi.h>
 #include <video_defines.h>
 #include <minilib.h>
 #include <smi.h>
+#include <pci-bother.h>
 #include "3c905.h"
 #include "vga-overlay.h"
 #include "packet.h"
 #include "3c905.h"
 #include "vga-overlay.h"
 #include "packet.h"
@@ -96,6 +97,7 @@ void smi_entry(void)
        
        pcisave = inl(0xCF8);
        vgasave = inb(0x3D4);
        
        pcisave = inl(0xCF8);
        vgasave = inb(0x3D4);
+       pci_unbother_all();
        
        counter++;
        sprintf(statstr, "15-412! %08x %08x", smi_status(), counter);
        
        counter++;
        sprintf(statstr, "15-412! %08x %08x", smi_status(), counter);
@@ -112,6 +114,7 @@ void smi_entry(void)
 
        smi_poll();
        
 
        smi_poll();
        
+       pci_bother_all();
        outl(0xCF8, pcisave);
        outb(0x3D4, vgasave);
 }
        outl(0xCF8, pcisave);
        outb(0x3D4, vgasave);
 }
index b89abe2d2b0f56206aa4446121de9099a28d8a0c..488f52b1f1be5c072559a69376d5c1348c94cee7 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1,8 +1,7 @@
 #include <pci.h>
 #include <pci.h>
+#include <pci-bother.h>
 #include <output.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)
 {
 
 static int bother_3c905(pci_dev_t *dev, void *nutrinus)
 {
@@ -10,11 +9,7 @@ static int bother_3c905(pci_dev_t *dev, void *nutrinus)
        {
                outputf("Found a 3c905 to bother");
                
        {
                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;
                return 1;
        }
        return 0;
@@ -22,12 +17,7 @@ static int bother_3c905(pci_dev_t *dev, void *nutrinus)
 
 void eth_poll()
 {
 
 void eth_poll()
 {
-       if (!found)
-               return;
-               
-       pci_write16(_bus, _dev, _fn, 0x04, 0xFF);
-       
-       pci_write16(_bus, _dev, _fn, 0x04, 0x00);
+       /* ... */
 }
 
 void eth_init()
 }
 
 void eth_init()
This page took 0.033504 seconds and 4 git commands to generate.