Группа :: Система/Ядро и оборудование
Пакет: kernel-modules-nvidia-std-up
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: NVIDIA_kernel-1.0-6629-1171869.diff
diff -ru usr/src/nv/nv-linux.h usr/src/nv.1171869/nv-linux.h
--- usr/src/nv/nv-linux.h 2004-11-03 22:53:00.000000000 +0100
+++ usr/src/nv.1171869/nv-linux.h 2004-12-03 11:34:45.000000000 +0100
@@ -480,12 +480,22 @@
#define NV_PCI_RESOURCE_SIZE(dev, bar) ((dev)->resource[(bar) - 1].end - (dev)->resource[(bar) - 1].start + 1)
#define NV_PCI_BUS_NUMBER(dev) (dev)->bus->number
-#define NV_PCI_SLOT_NUMBER(dev) PCI_SLOT((dev)->devfn)
+#define NV_PCI_DEVFN(dev) (dev)->devfn
+#define NV_PCI_SLOT_NUMBER(dev) PCI_SLOT(NV_PCI_DEVFN(dev))
#ifdef NV_PCI_GET_CLASS_PRESENT
#define NV_PCI_DEV_PUT(dev) pci_dev_put(dev)
#define NV_PCI_GET_DEVICE(vendor,device,from) pci_get_device(vendor,device,from)
-#define NV_PCI_GET_SLOT(bus,devfn) pci_get_slot(pci_find_bus(0,bus),devfn)
+#define NV_PCI_GET_SLOT(bus,devfn) \
+ ({ \
+ struct pci_dev *__dev = NULL; \
+ while ((__dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, __dev))) \
+ { \
+ if (NV_PCI_BUS_NUMBER(__dev) == bus \
+ && NV_PCI_DEVFN(__dev) == devfn) break; \
+ } \
+ __dev; \
+ })
#define NV_PCI_GET_CLASS(class,from) pci_get_class(class,from)
#else
#define NV_PCI_DEV_PUT(dev)
diff -ru usr/src/nv/os-interface.c usr/src/nv.1171869/os-interface.c
--- usr/src/nv/os-interface.c 2004-11-03 22:53:00.000000000 +0100
+++ usr/src/nv.1171869/os-interface.c 2004-12-03 11:34:51.000000000 +0100
@@ -866,7 +866,8 @@
)
{
struct pci_dev *dev;
- dev = NV_PCI_GET_SLOT(bus, PCI_DEVFN(slot, function));
+ unsigned int devfn = PCI_DEVFN(slot, function);
+ dev = NV_PCI_GET_SLOT(bus, devfn);
if (dev) {
if (vendor) *vendor = dev->vendor;
if (device) *device = dev->device;