FreeBSD/sys/dev/isci/scil/scic_sds_phy.c
/**
 * Debug code to record the state transitions in the phy
 *
 * @param our_observer
 * @param the_state_machine
 */
Debug code to record the state transitions in the phy
@param our_observer
@param the_state_machine
Debug code to record the state transitions in the phy @param our_observer @param the_state_machine
void scic_sds_phy_observe_state_change(
   SCI_BASE_OBSERVER_T * our_observer,
   SCI_BASE_SUBJECT_T  * the_subject
)
{
   SCIC_SDS_PHY_T           *this_phy;
   SCI_BASE_STATE_MACHINE_T *the_state_machine;
   U8  transition_requestor;
   U32 base_state_id;
   U32 starting_substate_id;
   the_state_machine = (SCI_BASE_STATE_MACHINE_T *)the_subject;
   this_phy = (SCIC_SDS_PHY_T *)the_state_machine->state_machine_owner;
   if (the_state_machine == &this_phy->parent.state_machine)
   {
      transition_requestor = 0x01;
   }
   else if (the_state_machine == &this_phy->starting_substate_machine)
   {
      transition_requestor = 0x02;
   }
   else
   {
      transition_requestor = 0xFF;
   }
   base_state_id =
      sci_base_state_machine_get_state(&this_phy->parent.state_machine);
   starting_substate_id =
      sci_base_state_machine_get_state(&this_phy->starting_substate_machine);
   this_phy->state_record.state_transition_table[
      this_phy->state_record.index++] = ( (transition_requestor << 24)
                                        | ((U8)base_state_id << 8)
                                        | ((U8)starting_substate_id));
   this_phy->state_record.index =
      this_phy->state_record.index & (MAX_STATE_TRANSITION_RECORD - 1);
}
void scic_sds_phy_observe_state_change ( SCI_BASE_OBSERVER_T * our_observer , SCI_BASE_SUBJECT_T * the_subject ) { SCIC_SDS_PHY_T * this_phy ; SCI_BASE_STATE_MACHINE_T * the_state_machine ; U8 transition_requestor ; U32 base_state_id ; U32 starting_substate_id ; the_state_machine = ( SCI_BASE_STATE_MACHINE_T * ) the_subject ; this_phy = ( SCIC_SDS_PHY_T * ) the_state_machine -> state_machine_owner ; if ( the_state_machine == & this_phy -> parent . state_machine ) { transition_requestor = 0x01 ; } else if ( the_state_machine == & this_phy -> starting_substate_machine ) { transition_requestor = 0x02 ; } else { transition_requestor = 0xFF ; } base_state_id = sci_base_state_machine_get_state ( & this_phy -> parent . state_machine ) ; starting_substate_id = sci_base_state_machine_get_state ( & this_phy -> starting_substate_machine ) ; this_phy -> state_record . state_transition_table [ this_phy -> state_record . index ++ ] = ( ( transition_requestor << 24 ) | ( ( U8 ) base_state_id << 8 ) | ( ( U8 ) starting_substate_id ) ) ; this_phy -> state_record . index = this_phy -> state_record . index & ( MAX_STATE_TRANSITION_RECORD - 1 ) ; }
Debug code to record the state transitions in the phy
 @param our_observer
 @param the_state_machine
Debug code to record the state transitions in the phy @param our_observer @param the_state_machine