Hi,
I’m using QNX 6.5 SP1 on a board with two ethernet controllers, which are supported by the e1000 driver. Only one (wm0) is auto detected and working fine.
If I want to use both controllers I have to stop io-pkt-v4-hc and to restart it as follows:
slay io-pkt-v4-hc
wait 2
io-pkt-v4-hc -de1000 verbose=1,pci=0x0,vid=0x8086,did=0x10d3 -ptcpip
io-pkt-v4-hc -de1000 verbose=1,pci=0x0,vid=0x8086,did=0x1502 -ptcpip prefix=/dev/socket2
wait 2
ifconfig en0 172.16.205.31 netmask 255.255.0.0
SOCK=/dev/socket2 ifconfig en0 172.16.205.36 netmask 255.255.0.0
pidin -p io-pkt-v4-hc
pid tid name prio STATE Blocked
1871895 1 sbin/io-pkt-v4-hc 21r SIGWAITINFO
1871895 2 sbin/io-pkt-v4-hc 10r RECEIVE 1
1871895 3 sbin/io-pkt-v4-hc 21r RECEIVE 25
1871895 4 sbin/io-pkt-v4-hc 21r RECEIVE 28
1876007 1 sbin/io-pkt-v4-hc 21r SIGWAITINFO
1876007 2 sbin/io-pkt-v4-hc 21r RECEIVE 1
1876007 3 sbin/io-pkt-v4-hc 21r RECEIVE 24
1876007 4 sbin/io-pkt-v4-hc 21r RECEIVE 27
ls -l /dev/sock*
/dev/socket:
total 0
srw-rw-rw- 1 root root 0 Oct 30 13:58 1
srw-rw-rw- 1 root root 0 Oct 30 13:58 17
srw-rw-rw- 1 root root 0 Oct 30 13:58 2
nrw-rw-rw- 1 root root 0 Oct 30 13:58 autoconnect
nrw-rw-rw- 1 root root 0 Oct 30 13:58 config
nrw-rw-rw- 1 root root 0 Oct 30 13:58 netmanager
-rw-r–r-- 1 root root 0 Oct 30 13:42 pppmgr
/dev/socket2:
total 0
dr-xr-xr-x 2 root root 0 Oct 30 13:58 dev
ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
inet 127.0.0.1 netmask 0xff000000
wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=1f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM>
enabled=0
address: 00:19:99:c1:5d:1b
media: Ethernet autoselect (100baseTX full-duplex,flowcontrol,rxpause,tx
pause)
status: active
inet 172.16.205.31 netmask 0xffff0000 broadcast 172.16.255.255
SOCK=/dev/socket2 ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33192
inet 127.0.0.1 netmask 0xff000000
wm0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
capabilities=1f<IP4CSUM,TCP4CSUM,UDP4CSUM,TCP6CSUM,UDP6CSUM>
enabled=0
address: 00:19:99:c6:60:e2
media: Ethernet autoselect (100baseTX full-duplex,flowcontrol,rxpause,tx
pause)
status: active
inet 172.16.205.36 netmask 0xffff0000 broadcast 172.16.255.255
ping -c 3 172.16.205.6
PING 172.16.205.6 (172.16.205.6): 56 data bytes
64 bytes from 172.16.205.6: icmp_seq=0 ttl=255 time=0 ms
64 bytes from 172.16.205.6: icmp_seq=1 ttl=255 time=0 ms
64 bytes from 172.16.205.6: icmp_seq=2 ttl=255 time=0 ms
----172.16.205.6 PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms variance = 0 ms^2
SOCK=/dev/socket2 ping -c 3 172.16.205.6
PING 172.16.205.6 (172.16.205.6): 56 data bytes
64 bytes from 172.16.205.6: icmp_seq=0 ttl=255 time=0 ms
64 bytes from 172.16.205.6: icmp_seq=1 ttl=255 time=0 ms
64 bytes from 172.16.205.6: icmp_seq=2 ttl=255 time=0 ms
----172.16.205.6 PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0/0/0 ms variance = 0 ms^2
So everything seems to be fine, but it is not.
As you see in the attached jpg the system only knows wm0, but not wm1, which I would expect.
Therefor I can’t use the second ethernet port via my own program, because I have to use “wm1”
to address the second port, otherwise (and without “setsockopt()”) I would get the first port:
int iSocketHandle;
struct ifreq ifr;
iSocketHandle = socket(AF_INET, SOCK_DGRAM, 0);
memset(&ifr, 0 , sizeof(ifr));
snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "wm1");
if(setsockopt(iSocketHandle, SOL_SOCKET, SO_BINDTODEVICE, (void*)&ifr, sizeof(ifr)) < 0)
printf("setsockopt(SO_BINDTODEVICE): %s\n", strerror(errno));
Even if I combine
io-pkt-v4-hc -de1000 verbose=1,pci=0x0,vid=0x8086,did=0x10d3 -ptcpip
io-pkt-v4-hc -de1000 verbose=1,pci=0x0,vid=0x8086,did=0x1502 -ptcpip prefix=/dev/socket2
to
io-pkt-v4-hc -de1000 verbose=1,pci=0x0,vid=0x8086,did=0x10d3 -ptcpip -de1000 \ verbose=1,pci=0x0,vid=0x8086,did=0x1502 -ptcpip prefix=/dev/socket2
or to
io-pkt-v4-hc -i1 -de1000 verbose=1,pci=0x0,vid=0x8086,did=0x10d3 -ptcpip -i2 -de1000 \ verbose=1,pci=0x0,vid=0x8086,did=0x1502 -ptcpip prefix=/dev/socket2
I always get only /dev/socket2 and no errors in sloginfo:
sloginfo
Time Sev Major Minor Args
Oct 30 14:14:20 5 10 0 devnp-e1000: i82544_stop() called, disable = 1
Oct 30 14:14:34 5 10 0 devnp-e1000: i82544_stop() called, disable = 1
Oct 30 14:16:15 5 14 0 tcpip starting
Oct 30 14:16:15 3 14 0 Using pseudo random generator. See “random” op
tion
Oct 30 14:16:15 5 14 0 initializing IPsec… done
Oct 30 14:16:15 5 14 0 IPsec: Initialized Security Association Process
ing.
Oct 30 14:16:15 5 10 0 Link down
Oct 30 14:16:15 5 14 0 INTEL PRO/1000 Gigabit (Copper)
Oct 30 14:16:15 5 14 0 Vendor … 0x8086
Oct 30 14:16:15 5 14 0 Device … 0x1502
Oct 30 14:16:15 5 14 0 Revision … 0x0
Oct 30 14:16:15 5 14 0 Memory base … 0xfe600000
Oct 30 14:16:15 5 14 0 Interrupt … 0xa
Oct 30 14:16:15 5 14 0 MAC address … 001999 c660e2
Oct 30 14:16:28 5 14 0 tcpip starting
Oct 30 14:16:28 3 14 0 Using pseudo random generator. See “random” op
tion
Oct 30 14:16:28 5 14 0 initializing IPsec… done
Oct 30 14:16:28 5 14 0 IPsec: Initialized Security Association Process
ing.
Oct 30 14:16:29 5 10 0 Link down
Oct 30 14:16:29 5 14 0 INTEL PRO/1000 Gigabit (Copper)
Oct 30 14:16:29 5 14 0 Vendor … 0x8086
Oct 30 14:16:29 5 14 0 Device … 0x10d3
Oct 30 14:16:29 5 14 0 Revision … 0x0
Oct 30 14:16:29 5 14 0 Memory base … 0xfe500000
Oct 30 14:16:29 5 14 0 Interrupt … 0xa
Oct 30 14:16:29 5 14 0 MAC address … 001999 c15d1b
I believe some time ago I had two interfaces to be seen in the network configurator, but I can’t remember when and for what reason the second one disappeared.
How do I get the second interface correctly back in the system?
Kind regards
Martin