FreeBSD/sys/dev/isci/scil/scic_sds_remote_node_table.c
/**
 * This method will initialize the remote node table for use.
 *
 * @param[in out] remote_node_table The remote that which is to be
 *       initialized.
 * @param[in] remote_node_entries The number of entries to put in the table.
 *
 * @return none
 */
This method will initialize the remote node table for use.
@param[in out] remote_node_table The remote that which is to be
initialized.
@param[in] remote_node_entries The number of entries to put in the table.

@return none
This method will initialize the remote node table for use . @param [ in out ] remote_node_table The remote that which is to be initialized . @param [ in ] remote_node_entries The number of entries to put in the table . @return none
void scic_sds_remote_node_table_initialize(
   SCIC_REMOTE_NODE_TABLE_T * remote_node_table,
   U32                        remote_node_entries
)
{
   U32 index;
   memset(
      remote_node_table->available_remote_nodes,
      0x00,
      sizeof(remote_node_table->available_remote_nodes)
   );
   memset(
      remote_node_table->remote_node_groups,
      0x00,
      sizeof(remote_node_table->remote_node_groups)
   );
   remote_node_table->available_nodes_array_size = (U16)
        (remote_node_entries / SCIC_SDS_REMOTE_NODES_PER_DWORD)
      + ((remote_node_entries % SCIC_SDS_REMOTE_NODES_PER_DWORD) != 0);
   for (index = 0; index < remote_node_entries; index++)
   {
      scic_sds_remote_node_table_set_node_index(remote_node_table, index);
   }
   remote_node_table->group_array_size = (U16)
        (remote_node_entries / (SCU_STP_REMOTE_NODE_COUNT * 32))
      + ((remote_node_entries % (SCU_STP_REMOTE_NODE_COUNT * 32)) != 0);
   for (index = 0; index < (remote_node_entries / SCU_STP_REMOTE_NODE_COUNT); index++)
   {
      scic_sds_remote_node_table_set_group_index(remote_node_table, 2, index);
   }
   if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 2)
   {
      scic_sds_remote_node_table_set_group_index(remote_node_table, 1, index);
   }
   else if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 1)
   {
      scic_sds_remote_node_table_set_group_index(remote_node_table, 0, index);
   }
}
void scic_sds_remote_node_table_initialize ( SCIC_REMOTE_NODE_TABLE_T * remote_node_table , U32 remote_node_entries ) { U32 index ; memset ( remote_node_table -> available_remote_nodes , 0x00 , sizeof ( remote_node_table -> available_remote_nodes ) ) ; memset ( remote_node_table -> remote_node_groups , 0x00 , sizeof ( remote_node_table -> remote_node_groups ) ) ; remote_node_table -> available_nodes_array_size = ( U16 ) ( remote_node_entries / SCIC_SDS_REMOTE_NODES_PER_DWORD ) + ( ( remote_node_entries % SCIC_SDS_REMOTE_NODES_PER_DWORD ) != 0 ) ; for ( index = 0 ; index < remote_node_entries ; index ++ ) { scic_sds_remote_node_table_set_node_index ( remote_node_table , index ) ; } remote_node_table -> group_array_size = ( U16 ) ( remote_node_entries / ( SCU_STP_REMOTE_NODE_COUNT * 32 ) ) + ( ( remote_node_entries % ( SCU_STP_REMOTE_NODE_COUNT * 32 ) ) != 0 ) ; for ( index = 0 ; index < ( remote_node_entries / SCU_STP_REMOTE_NODE_COUNT ) ; index ++ ) { scic_sds_remote_node_table_set_group_index ( remote_node_table , 2 , index ) ; } if ( ( remote_node_entries % SCU_STP_REMOTE_NODE_COUNT ) == 2 ) { scic_sds_remote_node_table_set_group_index ( remote_node_table , 1 , index ) ; } else if ( ( remote_node_entries % SCU_STP_REMOTE_NODE_COUNT ) == 1 ) { scic_sds_remote_node_table_set_group_index ( remote_node_table , 0 , index ) ; } }
This method will initialize the remote node table for use.
This method will initialize the remote node table for use .
// Initialize the raw data we could improve the speed by only initializing // those entries that we are actually going to be used // Initialize the available remote node sets // Initialize each full DWORD to a FULL SET of remote nodes // These are all guaranteed to be full slot values so fill them in the // available sets of 3 remote nodes // Now fill in any remainders that we may find