Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - io-pkt driver and no /dev/io-pkt device and no _init ever called: (6 Items)
   
io-pkt driver and no /dev/io-pkt device and no _init ever called  
I have created a custom io-pkt network driver based mostly on the sample provided.  Currently testing on QNX 6.4.1 x86, 
but same behavior happens on 6.5.

I am seeing something strange where my driver seems to start fine and shows up under ifconfig, but it does not get 
listed in the /dev or /dev/io-pkt directory.  Likely related to this issue, the _init call never gets called.  Other 
calls like _start, _ioctl, _attach etc all seem fine.

Here is the mount verbose output:

mount -vvv -Tio-pkt -obaud=1000,port=0,board_index=0,verbose devnp-canpro_g.so
Parsed: mount from [devnp-canpro_g.so] mount on [NULL] type [io-pkt]
exec: mount_io-pkt -o baud=1000 -o port=0 -o board_index=0 -o verbose -o implied -o nostat devnp-canpro_g.so /
Using internal mount (mount_io-pkt not found)
Type    [io-pkt] Flags 0x80080000
Device  [devnp-canpro_g.so] Directory [/]
Options [baud=1000,port=0,board_index=0,verbose]

Also the sloginfo output

Jul 30 00:02:04    5    10     0 devnp-canpro: canpro_detach
Jul 30 00:02:04    5    10     0 devnp-canpro: canpro_stop
Jul 30 00:02:04    5    10     0 devnp-canpro:  in8: 0x40100000 = 0x21
Jul 30 00:02:04    5    10     0 devnp-canpro:  in8: 0x40100000 = 0x21
Jul 30 00:02:04    5    10     0 devnp-canpro: out8: 0x40100002 = 0x3c
Jul 30 00:02:04    5    10     0 devnp-canpro: out8: 0x4010000d = 0x60
Jul 30 00:02:04    5    10     0 devnp-canpro: out8: 0x4010000e = 0x00
Jul 30 00:02:04    5    10     0 devnp-canpro: out8: 0x4010000f = 0x00
Jul 30 00:02:04    5    10     0 devnp-canpro: out8: 0x40100001 = 0x0c
Jul 30 00:02:04    5    10     0 devnp-canpro: Controller reset
Jul 30 00:02:04    5    10     0 devnp-canpro:  in8: 0x40100000 = 0x21
Jul 30 00:02:04    5    10     0 devnp-canpro: canpro_ioctl (2156947762)
Jul 30 00:02:37    5    10     0 devnp-canpro: canpro_detect
Jul 30 00:02:37    1    10     0 devnp-canpro: SubSystemVendorID=0x12c4 SubSystemID=0x0900
Jul 30 00:02:37    1    10     0 devnp-canpro: canpro_detect: mem=0x40102000
Jul 30 00:02:37    5    10     0 devnp-canpro: canpro_attach
Jul 30 00:02:37    5    10     0 devnp-canpro:  in8: 0x40102000 = 0x21

I have definately set the ifp->if_init parameter during _attach.

I have reviewed the dev_attach parameters and they seem ok but I am betting there is something wrong there.

Any suggestions would be greatly appreciated.

Allan
Re: io-pkt driver and no /dev/io-pkt device and no _init ever called  
As far as I know native io-pkt drivers don't get listed in /dev/ or in 
/dev/io-pkt only older io-net drivers get listed in /dev/io-net.

To force a call to your init call, try changing the mtu of your device 
or setting an address:

ifconfig yourdev0 mtu 1300
Re: io-pkt driver and no /dev/io-pkt device and no _init ever called  
Oh wow, thanks for the info.

Read or write to the interface will cause an _init as well right?

Allan
Re: io-pkt driver and no /dev/io-pkt device and no _init ever called  
Hmmm changing the mtu is only causing an ioctl call

Allan

Time             Sev Major Minor Args
Jul 30 13:14:13    5    10     0 devnp-canpro: canpro_ioctl (2156947839)
Re: io-pkt driver and no /dev/io-pkt device and no _init ever called  
Ok figured out the init call.

The ifconfig only causes an init when an IP is also assigned to the interface before hand.

Thanks for the tips.

Allan
Re: io-pkt driver and no /dev/io-pkt device and no _init ever called  
Yea sorry I should have clarified that - you need to set an address to 
kick start the init for your device. Until that point it won't get 
called. After that point it can get called multiple times for example 
when you change mtu - so in general if you are writing to the interface.