FreeBSD/sys/dev/isci/scil/scic_sds_remote_node_table.c
/**
 * This method will free a single remote node index back to the remote node
 * table.  This routine will update the remote node groups
 *
 * @param[in] remote_node_table
 * @param[in] remote_node_index
 */
This method will free a single remote node index back to the remote node
table.  This routine will update the remote node groups


This method will free a single remote node index back to the remote node table . This routine will update the remote node groups
static
void scic_sds_remote_node_table_release_single_remote_node(
   SCIC_REMOTE_NODE_TABLE_T * remote_node_table,
   U16                        remote_node_index
)
{
   U32 group_index;
   U8  group_value;
   group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT;
   group_value = scic_sds_remote_node_table_get_group_value(remote_node_table, group_index);
   ASSERT(group_value != SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE);
   if (group_value == 0x00)
   {
      scic_sds_remote_node_table_set_group_index(remote_node_table, 0, group_index);
   }
   else if ((group_value & (group_value -1)) == 0)
   {
      scic_sds_remote_node_table_clear_group_index(remote_node_table, 0, group_index);
      scic_sds_remote_node_table_set_group_index(remote_node_table, 1, group_index);
   }
   else
   {
      scic_sds_remote_node_table_clear_group_index(remote_node_table, 1, group_index);
      scic_sds_remote_node_table_set_group_index(remote_node_table, 2, group_index);
   }
   scic_sds_remote_node_table_set_node_index(remote_node_table, remote_node_index);
}
static void scic_sds_remote_node_table_release_single_remote_node ( SCIC_REMOTE_NODE_TABLE_T * remote_node_table , U16 remote_node_index ) { U32 group_index ; U8 group_value ; group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT ; group_value = scic_sds_remote_node_table_get_group_value ( remote_node_table , group_index ) ; ASSERT ( group_value != SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE ) ; if ( group_value == 0x00 ) { scic_sds_remote_node_table_set_group_index ( remote_node_table , 0 , group_index ) ; } else if ( ( group_value & ( group_value - 1 ) ) == 0 ) { scic_sds_remote_node_table_clear_group_index ( remote_node_table , 0 , group_index ) ; scic_sds_remote_node_table_set_group_index ( remote_node_table , 1 , group_index ) ; } else { scic_sds_remote_node_table_clear_group_index ( remote_node_table , 1 , group_index ) ; scic_sds_remote_node_table_set_group_index ( remote_node_table , 2 , group_index ) ; } scic_sds_remote_node_table_set_node_index ( remote_node_table , remote_node_index ) ; }
This method will free a single remote node index back to the remote node
 table.
This method will free a single remote node index back to the remote node table .
// Assert that we are not trying to add an entry to a slot that is already // full. // There are no entries in this slot so it must be added to the single // slot table. // There is only one entry in this slot so it must be moved from the // single slot table to the dual slot table // There are two entries in the slot so it must be moved from the dual // slot table to the tripple slot table.