- add kernel epoch, adapterized
[packages/xorg-driver-video-nvidia.git] / NVIDIA_kernel-1.0-6629-1171869.diff
1 diff -ru usr/src/nv/nv-linux.h usr/src/nv.1171869/nv-linux.h
2 --- usr/src/nv/nv-linux.h       2004-11-03 22:53:00.000000000 +0100
3 +++ usr/src/nv.1171869/nv-linux.h       2004-12-03 11:34:45.000000000 +0100
4 @@ -480,12 +480,22 @@
5  #define NV_PCI_RESOURCE_SIZE(dev, bar)  ((dev)->resource[(bar) - 1].end - (dev)->resource[(bar) - 1].start + 1)
6  
7  #define NV_PCI_BUS_NUMBER(dev)        (dev)->bus->number
8 -#define NV_PCI_SLOT_NUMBER(dev)       PCI_SLOT((dev)->devfn)
9 +#define NV_PCI_DEVFN(dev)             (dev)->devfn
10 +#define NV_PCI_SLOT_NUMBER(dev)       PCI_SLOT(NV_PCI_DEVFN(dev))
11  
12  #ifdef NV_PCI_GET_CLASS_PRESENT
13  #define NV_PCI_DEV_PUT(dev)                    pci_dev_put(dev)
14  #define NV_PCI_GET_DEVICE(vendor,device,from)  pci_get_device(vendor,device,from)
15 -#define NV_PCI_GET_SLOT(bus,devfn)             pci_get_slot(pci_find_bus(0,bus),devfn)
16 +#define NV_PCI_GET_SLOT(bus,devfn)                                       \
17 +   ({                                                                    \
18 +        struct pci_dev *__dev = NULL;                                    \
19 +        while ((__dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, __dev)))  \
20 +        {                                                                \
21 +            if (NV_PCI_BUS_NUMBER(__dev) == bus                          \
22 +                    && NV_PCI_DEVFN(__dev) == devfn) break;              \
23 +        }                                                                \
24 +        __dev;                                                           \
25 +    })
26  #define NV_PCI_GET_CLASS(class,from)           pci_get_class(class,from)
27  #else
28  #define NV_PCI_DEV_PUT(dev)
29 diff -ru usr/src/nv/os-interface.c usr/src/nv.1171869/os-interface.c
30 --- usr/src/nv/os-interface.c   2004-11-03 22:53:00.000000000 +0100
31 +++ usr/src/nv.1171869/os-interface.c   2004-12-03 11:34:51.000000000 +0100
32 @@ -866,7 +866,8 @@
33  )
34  {
35      struct pci_dev *dev;
36 -    dev = NV_PCI_GET_SLOT(bus, PCI_DEVFN(slot, function));
37 +    unsigned int devfn = PCI_DEVFN(slot, function);
38 +    dev = NV_PCI_GET_SLOT(bus, devfn);
39      if (dev) {
40          if (vendor) *vendor = dev->vendor;
41          if (device) *device = dev->device;
This page took 0.033062 seconds and 3 git commands to generate.