网络——在QNX下怎样取得MAC地址?

在QNX下怎样取得MAC地址?

nicinfo

这个命令,我在QNX6.2.1和QNX6.3.2试了,都不能得到网卡的MAC地址!它输出的内容如下:

3COM (90xB) 10BASE-T/100BASE-TX Ethernet Controller
Physical Node ID … 000102 BE3A28
Current Physical Node ID … 000102 BE3A28
Media Rate … 100.00 Mb/s full-duplex UTP
MTU … 1514
Lan … 0
I/O Port Range … 0x9000 → 0x907F
Hardware Interrupt … 0xC
Promiscuous … Disabled
Multicast … Enabled

Total Packets Txd OK … 335
Total Packets Txd Bad … 0
Total Packets Rxd OK … 719
Total Rx Errors … 0

Total Bytes Txd … 25664
Total Bytes Rxd … 57482

Tx Collision Errors … 0
Tx Collisions Errors (aborted) … 0
Carrier Sense Lost on Tx … 0
FIFO Underruns During Tx … 0
Tx deferred … 0
Out of Window Collisions … 0
FIFO Overruns During Rx … 0
Alignment errors … 0
CRC errors … 0[/list]

你的MAC地址不是显示在那么?
000102 BE3A28

喔!
但是我的在另一台机子上,却显示如下信息:

INTEL 82557 Ethernet Controller
Physical Node ID…FFFFFF FFFFFF
Current Physical Node ID…FFFFFF FFFFFF
Current Operation Rate…Unknow
Active Interface Type…UTP
Maximum Transmittable data Unit…1514
Maximum Receivable data Unit…1514
Hardware Interrupt…0xa
I/O Aperture…0xe1000000-0xe10000ff
Memory Aperture…0xa000-0xa0ff
Promisuous Mode…Off
Multicast Support…Enabled
get states: Input/Output error

这是为什么?

那说明你的网卡驱动用错了:

http://www.openqnx.com/chinese/viewtopic.php?t=1655

我的网卡是集成的RTL8169,是945主板上的。我也试过用rtl驱动,命令如下:
“io-net -d rtl vid=0x10ec,did=0x8167 verbose -ptcpip”
但是,提示说没有devn-rtl驱动,将rtl换成speedo,也就是:
“io-net -d speedo vid=0x10ec,did=0x8167 verbose -ptcpip”
这样就没有问题了,在Photon中打开network的配置窗口也可以看到有了device,命令行输入ifconfig也可以看到有了en0这个设备。但是奇怪的很,用nicinfo这个命令时,显示说这块网卡是Intel的,而用pci命令时却说是RealTek的。而且在使用nicinfo时,显示不出网卡的MAC地址。可能还是驱动有问题,但是到底应该怎么写这个装入驱动的命令,我倒迷糊了!

另外,还有就是命令写成这个样子:
“io-net -d rtl verbose -ptcpip”
就不会报错,但是Photon中的network配置不会出现device,ifconfig也不会出现en0这个设备。

devn-xxxxx.so 是网卡驱动。不同的网卡要用不同的驱动。你的是RTL的网卡,但你去用devn-speedo.so,那是不会成功的。

“io-net -d rtl vid=0x10ec,did=0x8167 verbose -ptcpip” – 你能肯定这个命令的提示是“没有devn-rtl驱动”吗?因为你的机器上肯定是有rtl驱动的,你的另一个帖子说“io-net -d rtl -p tcpip” 没有出错,说明你至少是有rtl驱动的。(通常这个文件在/lib/dll/devn-rtl.so)

另外,你同时提到了6.21和6.3.2,到底你是用的哪一个版本?6.2.1是非常旧的版本,而6.3.2只能在安装6.3.0以后才能升级到的。

是这个样子的,我这里有四台机子装了QNX,有两台由于配置了独立网卡,可以正常使用,一台是QNX6.3.2,另一台QNX6.2.1。有问题的是另外两台集成网卡的机子,也是一个是6.3.2,一个是6.2.1,都是945的主板,集成RTL8169网卡。这两台出现问题的现象是完全一样的,没有任何差别。

我也知道devn-speedo是Intel的驱动,realtek的网卡应用devn-rtl,但是我用了两次都出现问题:
第一次“io-net -d rtl vid=0x10ec,did=0x8167 verbose -ptcpip”,报错说没有devn-rtl驱动。
第二次“io-net -d rtl verbose -ptcpip”不报错,但是PHOTON下的network配置中没有device,用ifconfig也没有en0这个设备。

但是,我给它装devn-speedo,它就假假地能出来,但是却用不了。是不是这个驱动具有虚拟网卡的功能啊? :smiley:

我这里的QNX6.3.2不是从6.3.0升级过来的,我这个版本来自我们的供应商,可能他们已经做过处理了吧!

难道集成网卡RTL8169不能用吗?

我觉得你可能把 vid, did 搞错了。
运行 pci -v
看看 Vendor ID, Device ID

没有,你看我的"pci -v":

PCI version = 3.00

Class = Bridge (Host/PCI)
Vendor ID = 8086h, Intel Corporation
Device ID = 2770h, 945G/GZ/P/PL Express Memory Controller Hub
PCI index = 0h
Class Codes = 060000h
Revision ID = 2h
Bus number = 0
Device number = 0
Function num = 0
Status Reg = 2090h
Command Reg = 6h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
Subsystem Vendor ID = 1458h
Subsystem ID = 5000h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = NC
Interrupt line = 0
CPU Interrupt = 0h
Capabilities Pointer = e0h
Capability ID = 9h - Vendor Specific
Capabilities = 7109h - 989be12bh

Class = Display (VGA)
Vendor ID = 8086h, Intel Corporation
Device ID = 2772h, 945G/GZ Express Integrated Graphics Controller
PCI index = 0h
Class Codes = 030000h
Revision ID = 2h
Bus number = 0
Device number = 2
Function num = 0
Status Reg = 90h
Command Reg = 7h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI Mem Address = e2000000h 32bit length 524288 enabled
PCI IO Address = c000h length 8 enabled
PCI Mem Address = d0000000h prefetchable 32bit length 268435456 enabled
PCI Mem Address = e2080000h 32bit length 262144 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = d000h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 5
CPU Interrupt = 5h
Capabilities Pointer = 90h
Capability ID = 5h - Message Signaled Interrupts
Capabilities = 0h - 0h
Capability ID = 1h - Power Management
Capabilities = 22h - 0h

Class = Multimedia (RAM)
Vendor ID = 8086h, Intel Corporation
Device ID = 27d8h, 82801G (ICH7 Family) High Definition Audio Controller
PCI index = 0h
Class Codes = 040300h
Revision ID = 1h
Bus number = 0
Device number = 27
Function num = 0
Status Reg = 10h
Command Reg = 6h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 8h un-cacheable
PCI Mem Address = e20c0000h 64bit length 16384 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = a002h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 5
CPU Interrupt = 5h
Capabilities Pointer = 50h
Capability ID = 1h - Power Management
Capabilities = c842h - 0h
Capability ID = 5h - Message Signaled Interrupts
Capabilities = 80h - 0h
Capability ID = 10h - PCI Express
Capabilities = 91h - 0h

Class = Serial Bus (Universal Serial Bus)
Vendor ID = 8086h, Intel Corporation
Device ID = 27c8h, 82801G (ICH7 Family) USB UHCI #1
PCI index = 0h
Class Codes = 0c0300h
Revision ID = 1h
Bus number = 0
Device number = 29
Function num = 0
Status Reg = 280h
Command Reg = 5h
Header type = 0h Multi-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI IO Address = b000h length 32 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = 5004h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 9
CPU Interrupt = 9h

Class = Serial Bus (Universal Serial Bus)
Vendor ID = 8086h, Intel Corporation
Device ID = 27c9h, 82801G (ICH7 Family) USB UHCI #2
PCI index = 0h
Class Codes = 0c0300h
Revision ID = 1h
Bus number = 0
Device number = 29
Function num = 1
Status Reg = 280h
Command Reg = 5h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI IO Address = b400h length 32 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = 5004h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT B
Interrupt line = 11
CPU Interrupt = bh

Class = Serial Bus (Universal Serial Bus)
Vendor ID = 8086h, Intel Corporation
Device ID = 27cah, 82801G (ICH7 Family) USB UHCI #3
PCI index = 0h
Class Codes = 0c0300h
Revision ID = 1h
Bus number = 0
Device number = 29
Function num = 2
Status Reg = 280h
Command Reg = 5h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI IO Address = b800h length 32 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = 5004h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT C
Interrupt line = 6
CPU Interrupt = 6h

Class = Serial Bus (Universal Serial Bus)
Vendor ID = 8086h, Intel Corporation
Device ID = 27cbh, 82801G (ICH7 Family) USB UHCI #4
PCI index = 0h
Class Codes = 0c0300h
Revision ID = 1h
Bus number = 0
Device number = 29
Function num = 3
Status Reg = 280h
Command Reg = 5h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI IO Address = bc00h length 32 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = 5004h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT D
Interrupt line = 5
CPU Interrupt = 5h

Class = Serial Bus (Universal Serial Bus)
Vendor ID = 8086h, Intel Corporation
Device ID = 27cch, 82801G (ICH7 Family) USB2 EHCI Controller
PCI index = 0h
Class Codes = 0c0320h
Revision ID = 1h
Bus number = 0
Device number = 29
Function num = 7
Status Reg = 290h
Command Reg = 6h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI Mem Address = e20c4000h 32bit length 1024 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = 5006h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT A
Interrupt line = 9
CPU Interrupt = 9h
Capabilities Pointer = 50h
Capability ID = 1h - Power Management
Capabilities = 2h - 0h

Class = Bridge (PCI/PCI)
Vendor ID = 8086h, Intel Corporation
Device ID = 244eh, 82801 PCI Bridge
PCI index = 0h
Class Codes = 060401h
Revision ID = e1h
Bus number = 0
Device number = 30
Function num = 0
Status Reg = 10h
Command Reg = 7h
Header type = 1h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
Primary Bus Number = 0h
Secondary Bus Number = 1h
Subordinate Bus Number = 1h
Secondary Latency Timer = 20h
I/O Base = a0h
I/O Limit = a0h
Secondary Status = 2280h
Memory Base = e000h
Memory Limit = e1f0h
Prefetchable Memory Base = fff1h
Prefetchable Memory Limit= 1h
Prefetchable Base Upper 32 Bits = 0h
Prefetchable Limit Upper 32 Bits = 0h
I/O Base Upper 16 Bits = 0h
I/O Limit Upper 16 Bits = 0h
Bridge Control = 4h
PCI Int Pin = NC
Interrupt line = no connection
Capabilities Pointer = 50h
Capability ID = dh - PCI Bridge Subsystem Vendor ID
Capabilities = 0h - 50001458h

Class = Bridge (PCI/ISA)
Vendor ID = 8086h, Intel Corporation
Device ID = 27b8h, 82801GB/GR (ICH7 Family) LPC Interface Bridge
PCI index = 0h
Class Codes = 060100h
Revision ID = 1h
Bus number = 0
Device number = 31
Function num = 0
Status Reg = 210h
Command Reg = 107h
Header type = 0h Multi-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
Subsystem Vendor ID = 1458h
Subsystem ID = 5001h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = NC
Interrupt line = 0
CPU Interrupt = 0h
Capabilities Pointer = e0h
Capability ID = 9h - Vendor Specific
Capabilities = 100ch - 2400a8h

Class = Mass Storage (IDE)
Vendor ID = 8086h, Intel Corporation
Device ID = 27c0h, 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller IDE
PCI index = 0h
Class Codes = 010180h
Revision ID = 1h
Bus number = 0
Device number = 31
Function num = 2
Status Reg = 2b8h
Command Reg = 5h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI IO Address = 0h length 8 enabled
PCI IO Address = 0h length 4 enabled
PCI IO Address = 0h length 8 enabled
PCI IO Address = 0h length 4 enabled
PCI IO Address = f000h length 16 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = b002h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT B
Interrupt line = 0
CPU Interrupt = 0h
Capabilities Pointer = 70h
Capability ID = 1h - Power Management
Capabilities = 4002h - 0h

Class = Serial Bus (SMBus)
Vendor ID = 8086h, Intel Corporation
Device ID = 27dah, 82801G (ICH7 Family) SMBus Controller
PCI index = 0h
Class Codes = 0c0500h
Revision ID = 1h
Bus number = 0
Device number = 31
Function num = 3
Status Reg = 280h
Command Reg = 1h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 0h
Cache Line Size= 0h
PCI IO Address = 500h length 32 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = 5001h
Max Lat = 0ns
Min Gnt = 0ns
PCI Int Pin = INT B
Interrupt line = 11
CPU Interrupt = bh

Class = Network (Ethernet)
Vendor ID = 10ech, Realtek Semiconductor Co., Ltd.
Device ID = 8167h, Unknown Unknown
PCI index = 0h
Class Codes = 020000h
Revision ID = 10h
Bus number = 1
Device number = 5
Function num = 0
Status Reg = 2b0h
Command Reg = 7h
Header type = 0h Single-function
BIST = 0h Build-in-self-test not supported
Latency Timer = 20h
Cache Line Size= 8h un-cacheable
PCI IO Address = a000h length 256 enabled
PCI Mem Address = e1000000h 32bit length 256 enabled
Subsystem Vendor ID = 1458h
Subsystem ID = e000h
PCI Expansion ROM = 0h length 131072 disabled
Max Lat = 64ns
Min Gnt = 32ns
PCI Int Pin = INT A
Interrupt line = 10
CPU Interrupt = ah
Capabilities Pointer = dch
Capability ID = 1h - Power Management
Capabilities = f7c2h - 0h

verbose 和 前面的7之间应该有逗号,不能有空格。

io-net -d rtl vid=0x10ec,did=0x8167,verbose -p tcpip

:slight_smile: 不是。它能“找到设备”,是因为你强行指定了设备号的关系。

我试了一下,加逗号和不加逗号没有什么区别,都说没有devn-rtl驱动

我看了一下devn-rtl.so的驱动说明,其中它的Description写道:
“The devn-rtl.so driver controls Realtek 8139 PCI cards.”

是不是这个驱动它还只能支持RTL8139,还不能支持RTL8169啊?

看看去RealTek的网站看了一下,他们支持RTL8139的驱动是03年开发的,http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=2&PNid=6&PFid=6&Level=5&Conn=4&DownTypeID=3&GetDown=false#RTL8100B(L)/RTL8100C(L)/RTL8101L/RTL8139C(L)
RTL8139C(L)+/RTL8139D(L)/RTL8100(L)
RTL8130/RTL8139B(L)
而关于RTL8169他们网站上压根就没有
http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=2&PNid=4&PFid=4&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true#RTL8110S-32/RTL8110SB(L)/RTL8169SB(L)/RTL8169SC(L)
RTL8169

今天去QNX的网站看了一下,他们的硬件支持列表中也只有RTL8139和8029,没有对RTL的支持。上次那位搞定这块卡的仁兄,是不是没有做完?

唉,这个故事告诉我们:不要盲目相信任何成功案例!

同时对QNX,我在这里要表示最最强烈的不满:为什么应用如此普及的集成网卡就不支持一下?!