2 #include <pci-bother.h>
6 unsigned short origstate;
9 static struct pci_bother bothers[MAX_BOTHERS];
10 static int nbothers = 0;
12 int pci_bother_add(pci_dev_t *dev)
14 if (nbothers == MAX_BOTHERS)
17 bothers[nbothers].bus = dev->bus;
18 bothers[nbothers].dev = dev->dev;
19 bothers[nbothers].fn = dev->fn;
21 bothers[nbothers].origstate = pci_read16(dev->bus, dev->dev, dev->fn, 0x04);
32 for (i = 0; i < nbothers; i++)
33 pci_write16(bothers[i].bus, bothers[i].dev, bothers[i].fn, 0x04, 0x0);
36 void pci_unbother_all()
40 for (i = 0; i < nbothers; i++)
41 pci_write16(bothers[i].bus, bothers[i].dev, bothers[i].fn, 0x04, bothers[i].origstate);