Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ifwatchd: (4 Items)
   
ifwatchd  
What part of code in qnx_native io-pkt drivers relates to following problem:

state of interface and link changes but `ifwatchd` responds like

bash-2.05a# SOCK=/dts ifwatchd  -i -vvv pan0
. . . .
interface "pan0" has index 2
unknown link status ignored
unknown message ignored
unknown link status ignored
unknown message ignored

If mii.c in driver sources is mandatory  for proper `ifwatchd` work
but there is no appropriate HW mdi interface
(though sw method for link status monitoring is available) - 
could some emulation be done for `ifwatchd` interface monitoring?


Regards,
Sergey
 
RE: ifwatchd  
I *think* you are referring to 

case MDI_LINK_UP:
  if_link_state_change(ifp, LINK_STATE_UP);

case MDI_LINK_DOWN:
  if_link_state_change(ifp, LINK_STATE_DOWN);

which is in some (but not all!) io-pkt native
driver mii.c source, for link up and link down
events.

These link change events are actually done via
software - generally, the driver sets up a 
"housekeeping" timer which fires every 2 or 3
seconds, which then calls into the MDI_ code
in the libdrvr which is statically linked into
each driver.

Very few nics (drivers) have a reliable hardware
event mechanism for link state change (the i82544
is an exception), so the vast majority use the 
software polling mechanism above.

Which nic/driver are you testing with?

--
aboyd

Re: RE: ifwatchd  
>Which nic/driver are you testing with?

I had started with sample driver, then developed it in a
way like speedo (or mpc85xx) driver.
There is no real hardware, I'm plaing with driver in two
stacks framework with drivers communicating via
some library at bottom layer with lib interface primitives
like read/write packets and get_connection_state etc.
This is helpfull in investigating io-pkt and drivers architecture.

Driver pass the traffic quite stable (flud ping),
and `ifconfig` controls/show  interface up/down/destroy
appropriatly, but 

when I take interface under `ifwatch` - it doesn't recognised the state changes.

> if_link_state_change(ifp, LINK_STATE_UP);

Yes, there is   
callout_msec(&pan->mii_callout, 1000, pan_monitor_ln, pan);

with if_link_state_change() calls in pan_monitor_ln().

Is this enough for `ifwatchd`?

What about  of
ifmedia_ioctl(ifp, ifr, &pan->bsd_mii.mii_media, cmd);
in <drvr>_ioctl() in devctl.c  and its relation to mii.c
(especialy in context of no hardware)?

Is it mandatory or another workarounds possible for `ifwatchd` work?

Regards,
Sergey
RE: RE: ifwatchd  
I _think_ you're going to need to copy and
paste a version of bsd_media.c from a native
io-pkt driver to yours.

This is easy to do - just change the name of
the driver device structure in bsd_media.c
and add the call to ifmedia_ioctl() in 
devctl.c and bsd_mii_initmedia() in init.c 
like the other drivers.

--
aboyd