I think the way NCUs are initialized and enabled should change a bit.  
The current implementation doesn't look at the activation-mode or 
priority at all.  We go on to initalize and enable all (wired) links. 

Like enms and locs, the _init_event() method should simply read in the 
ncu and store them in the in-memory representation for nwamd.  Some 
other "thing/event" determines which NCUs to enable. (I'm guessing 
enabling an ncu means getting the state machine for that ncu started and 
then plumbing and getting a static/dhcp IP, right?).  enms and locs have 
_check_conditions() which run periodically, but that's not necessary for 
ncus.  The state machine takes care of this.

I am guessing that the end of nwamd_init_ncus() after the dladm_walk() 
should do the checking of the activation-modes and priorities.  Because 
the walk enqueues INIT events, a different event to check activation 
should be enqueued following those, right?

When ready to be enabled, the _enable_event() will get the state machine 
for the given ncu started by first calling nwam_ncu_init()  and setting 
state (ncp.c: 296-335).

This approach will make manual activation of an ncu (via nwamadm) 
manageable.

Then, at _disable_event() (also called during graceful_shutdown()), the 
ncu will be unplumbed and dlpi link will be deleted and the state will 
be unset (to 0).

Anurag

Reply via email to