Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Problem with the only documentation around: (5 Items)
   
Problem with the only documentation around  
From the document:

Remember , the ifp->if_init function can and will be called
over and over again by the stack.  This is very different
from an io-net driver, who's initialization executes only
once.

For example, if someone does this:

    ifconfig sam0 mtu 8100

The ifp->if_init function in the driver will be called again
by the stack.   So, it is up to the driver to initialize the
harware as specified.

My question, is this still true.
I have an otherwise working driver.   I've implemented the IOCTL to update the mtu.
I have a printf that shows when if_init() is called.
It displays on startup.

I run "ifconfig xxx mtu 8100" and I see the ioctl call run successfully, but no if_init.
I then run "ifconfig xxx nnn.nnn.nnn.nnn" and again, nothing?

Has the behavior changed?

Thanks,
Re: Problem with the only documentation around  
No, the behaviour hasn¹t changed. Your init routine should be called every
time you run an ifconfig or dhcp.client.




On 2014/1/12, 10:20 PM, "Mitchell Schoenbrun" <community-noreply@qnx.com>
wrote:

>From the document:
>
>Remember , the ifp->if_init function can and will be called
>over and over again by the stack.  This is very different
>from an io-net driver, who's initialization executes only
>once.
>
>For example, if someone does this:
>
>    ifconfig sam0 mtu 8100
>
>The ifp->if_init function in the driver will be called again
>by the stack.   So, it is up to the driver to initialize the
>harware as specified.
>
>My question, is this still true.
>I have an otherwise working driver.   I've implemented the IOCTL to
>update the mtu.
>I have a printf that shows when if_init() is called.
>It displays on startup.
>
>I run "ifconfig xxx mtu 8100" and I see the ioctl call run successfully,
>but no if_init.
>I then run "ifconfig xxx nnn.nnn.nnn.nnn" and again, nothing?
>
>Has the behavior changed?
>
>Thanks,
>
>
>
>_______________________________________________
>
>Networking Drivers
>http://community.qnx.com/sf/go/post107889
>To cancel your subscription to this discussion, please e-mail
>drivers-networking-unsubscribe@community.qnx.com

Re: Problem with the only documentation around  
On Sun, Jan 12, 2014 at 10:20:57PM -0500, Mitchell Schoenbrun wrote:
> From the document:
> 
> Remember , the ifp->if_init function can and will be called
> over and over again by the stack.  This is very different
> from an io-net driver, who's initialization executes only
> once.
> 
> For example, if someone does this:
> 
>     ifconfig sam0 mtu 8100
> 
> The ifp->if_init function in the driver will be called again
> by the stack.   So, it is up to the driver to initialize the
> harware as specified.
> 
> My question, is this still true.
> I have an otherwise working driver.   I've implemented the IOCTL to update the mtu.
> I have a printf that shows when if_init() is called.
> It displays on startup.
> 
> I run "ifconfig xxx mtu 8100" and I see the ioctl call run successfully, but no if_init.
> I then run "ifconfig xxx nnn.nnn.nnn.nnn" and again, nothing?
> 
> Has the behavior changed?
> 

No.  If you 'ifconfig foo0 down up' it will be called.
Re: Problem with the only documentation around  
I'm going to double check my work, but as of yesterday, it was not doing this.
In particular, the driver is running under VM ESXi and the driver is for a virtual device called VMXNET3.
I'll get back to you on this.
Re: Problem with the only documentation around  
Here is what I see:

# mount .....
ENTRY
ATTACH
INIT
#ifconfig vmx0 192.168.1.50
IOCTL
IOCTL
i# ifconfig vmx0 down
IOCTL
# ifconfig vmx0 up
IOCTL
INIT
# ifconfig vmx0 mtu 8100
IOCTL


So I'm seeing INIT called when I first do the mount, when I do an UP, but not when I do a DOWN, an MTU or set the IP 
address.

I'm will to send you the code that shows this, but you would need an ESXi system setup with the VMXNET3 device to test 
it.