[PATCH] eepro100 device name <-> pci bus/slot/func mapping

From: Anton Blanchard (anton@linuxcare.com)
Date: Wed May 31 2000 - 13:48:30 EST


Hi,

I am trying to link network device name with pci device bus/slot/func in
userspace using an eepro100. If we #define USE_IO it is easy:

# lspci -v
02:0b.0 Ethernet controller: Intel Corporation 82559 InBusiness 10/100 (rev 08)
        ...
        I/O ports at 7800 [size=64]

# ifconfig
eth0
        ...
        Interrupt:9 Base address:0x7800

We cannot do this if we arent using IO. With the attached patch we can
match them.

# lspci -v
02:0b.0 Ethernet controller: Intel Corporation 82559 InBusiness 10/100 (rev 08)
        ...
        Memory at e0800000 (32-bit, non-prefetchable) [size=4K]

# ifconfig
eth0
        ...
        Interrupt:9 Base address:0xc000 Memory:e0800000-e0801000

Cheers,
Anton

--- linux/drivers/net/eepro100.c Tue May 23 13:11:19 2000
+++ linux_work/drivers/net/eepro100.c Wed May 31 11:20:47 2000
@@ -838,6 +844,10 @@
 
         pdev->driver_data = dev;
 
+#ifndef USE_IO
+ dev->mem_start = pci_resource_start(pdev, 0);
+ dev->mem_end = dev->mem_start + pci_resource_len(pdev, 0);
+#endif
         dev->base_addr = ioaddr;
         dev->irq = irq;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:28 EST