On Mon, Aug 1, 2011 at 3:04 PM, Grant <emailgr...@gmail.com> wrote:
>>>  My laptop's
>>> r8169 eth0 appears under ifconfig even when there's no ethernet cable
>>> attached.  That's the expected behavior isn't it?
>>
>> Sure; ifconfig will even tell you if the link is up or down. Just
>> because the link is down doesn't mean the interface isn't there. :)
>
> I see eth0 under ifconfig on my laptop but not on my desktop.
> Strangely, on my desktop eth0 does appear under iwconfig (no wireless
> extensions).  dmesg pertaining to eth0 and r8169 looks normal.  lspci
> -v says:
>
> Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI
> Express Gigabit Ethernet controller
> ...
> Kernel driver in use: r8169
>
> But no eth0 under ifconfig.

Time to go for a walk in /sys, to find out more information.

Check out /sys/bus/pci/devices

Now, with lspci, a NIC will look something like this:
01:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL-8139/8139C/8139C+ (rev 10)

If I look under /sys/bus/pci/devices, I'll see a corresponding
directory (compare the first column from the lspci output):
0000:01:08.0

If I run 'ls' in that directory, I see:

-rw-r--r-- 1 root root 4096 2011-08-01 15:19 broken_parity_status
lrwxrwxrwx 1 root root    0 2011-08-01 15:19 bus -> ../../../../bus/pci
-r--r--r-- 1 root root 4096 2011-08-01 15:11 class
-rw-r--r-- 1 root root  256 2011-08-01 15:11 config
-r--r--r-- 1 root root 4096 2011-08-01 15:11 device
lrwxrwxrwx 1 root root    0 2011-08-01 15:11 driver ->
../../../../bus/pci/drivers/8139too
-rw------- 1 root root 4096 2011-08-01 15:19 enable
-r--r--r-- 1 root root 4096 2011-08-01 15:11 irq
-r--r--r-- 1 root root 4096 2011-08-01 15:19 local_cpus
-r--r--r-- 1 root root 4096 2011-08-01 15:19 modalias
-rw-r--r-- 1 root root 4096 2011-08-01 15:19 msi_bus
lrwxrwxrwx 1 root root    0 2011-08-01 15:19 net:eth2 ->
../../../../class/net/eth2
drwxr-xr-x 2 root root    0 2011-05-12 10:47 power
-r--r--r-- 1 root root 4096 2011-08-01 15:11 resource
-rw------- 1 root root  256 2011-08-01 15:19 resource0
-rw------- 1 root root  256 2011-08-01 15:19 resource1
lrwxrwxrwx 1 root root    0 2011-08-01 15:19 subsystem -> ../../../../bus/pci
-r--r--r-- 1 root root 4096 2011-08-01 15:19 subsystem_device
-r--r--r-- 1 root root 4096 2011-08-01 15:19 subsystem_vendor
-rw-r--r-- 1 root root 4096 2011-08-01 15:19 uevent
-r--r--r-- 1 root root 4096 2011-08-01 15:11 vendor


So, you an see a file named 'net:eth2', so I expect it would show up
as eth2, absent any udev renaming or aliasing rules.

-- 
:wq

Reply via email to