]> Joshua Wise's Git repositories - netwatch.git/commitdiff
Bother the 3c905 every time we take an IRQ, which makes the bothering 'stick'.
authorJoshua Wise <joshua@rebirth.joshuawise.com>
Fri, 26 Sep 2008 04:32:14 +0000 (00:32 -0400)
committerJoshua Wise <joshua@rebirth.joshuawise.com>
Fri, 26 Sep 2008 04:32:14 +0000 (00:32 -0400)
aseg/counter.c
aseg/firstrun.c

index 6ef4cf91a19124649aadba12ec9db3ebc5127359..5c888505b73177cf5362800013b0af86c5f87bd1 100644 (file)
@@ -100,6 +100,9 @@ void smi_entry(void)
        sprintf(statstr, "15-412! %08x %08x", smi_status(), counter);
        strblit(statstr, 0, 0);
        
+       extern void do_bother();
+       do_bother();
+       
        if (inl(0x840) & 0x1000)
        {
                pci_dump();
index 2ca07e0dbaa43caddbdbccdb7224b80d51a29c35..75bcccc9f85e9966030b19857c558fd9f36c1253 100644 (file)
@@ -12,18 +12,32 @@ extern void timer_handler(smi_event_t ev);
 extern void kbc_handler(smi_event_t ev);
 extern void gbl_rls_handler(smi_event_t ev);
 
+static int found = 0, _bus, _dev, _fn;
+
+void do_bother()
+{
+       int bar;
+
+       if (!found)
+               return;
+               
+       pci_write16(_bus, _dev, _fn, 0x04, 0x00);
+       for (bar = 0; bar < 6; bar++)
+               pci_write32(_bus, _dev, _fn, 0x10 + bar*4, 0x1FFFFFFF);
+}
+
 int bother_3c905(pci_dev_t *dev)
 {
        if (dev->vid == 0x10B7 || dev->did == 0x9200)
        {
-               int bar;
-               
                outputf("Found a 3c905 to bother");
-               pci_write16(dev->bus, dev->dev, dev->fn, 0x04, 0x00);
                
-               for (bar = 0; bar < 6; bar++)
-                       if (dev->bars[bar].type != PCI_BAR_NONE)
-                               pci_write32(dev->bus, dev->dev, dev->fn, 0x10 + bar*4, 0);
+               _bus = dev->bus;
+               _dev = dev->dev;
+               _fn = dev->fn;
+               found = 1;
+               
+               do_bother();
                
                return 1;
        }
This page took 0.027551 seconds and 4 git commands to generate.