Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * This file is provided under a dual BSD/GPLv2 license.  When using or
0003  * redistributing this file, you may do so under either license.
0004  *
0005  * GPL LICENSE SUMMARY
0006  *
0007  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
0008  *
0009  * This program is free software; you can redistribute it and/or modify
0010  * it under the terms of version 2 of the GNU General Public License as
0011  * published by the Free Software Foundation.
0012  *
0013  * This program is distributed in the hope that it will be useful, but
0014  * WITHOUT ANY WARRANTY; without even the implied warranty of
0015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016  * General Public License for more details.
0017  *
0018  * You should have received a copy of the GNU General Public License
0019  * along with this program; if not, write to the Free Software
0020  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
0021  * The full GNU General Public License is included in this distribution
0022  * in the file called LICENSE.GPL.
0023  *
0024  * BSD LICENSE
0025  *
0026  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
0027  * All rights reserved.
0028  *
0029  * Redistribution and use in source and binary forms, with or without
0030  * modification, are permitted provided that the following conditions
0031  * are met:
0032  *
0033  *   * Redistributions of source code must retain the above copyright
0034  *     notice, this list of conditions and the following disclaimer.
0035  *   * Redistributions in binary form must reproduce the above copyright
0036  *     notice, this list of conditions and the following disclaimer in
0037  *     the documentation and/or other materials provided with the
0038  *     distribution.
0039  *   * Neither the name of Intel Corporation nor the names of its
0040  *     contributors may be used to endorse or promote products derived
0041  *     from this software without specific prior written permission.
0042  *
0043  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0044  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0045  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0046  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0047  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0048  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0049  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0050  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0051  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0052  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0053  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0054  */
0055 
0056 /*
0057  * This file contains the implementation of the SCIC_SDS_REMOTE_NODE_TABLE
0058  *    public, protected, and private methods.
0059  */
0060 #include "remote_node_table.h"
0061 #include "remote_node_context.h"
0062 
0063 /**
0064  * sci_remote_node_table_get_group_index()
0065  * @remote_node_table: This is the remote node index table from which the
0066  *    selection will be made.
0067  * @group_table_index: This is the index to the group table from which to
0068  *    search for an available selection.
0069  *
0070  * This routine will find the bit position in absolute bit terms of the next 32
0071  * + bit position.  If there are available bits in the first u32 then it is
0072  * just bit position. u32 This is the absolute bit position for an available
0073  * group.
0074  */
0075 static u32 sci_remote_node_table_get_group_index(
0076     struct sci_remote_node_table *remote_node_table,
0077     u32 group_table_index)
0078 {
0079     u32 dword_index;
0080     u32 *group_table;
0081     u32 bit_index;
0082 
0083     group_table = remote_node_table->remote_node_groups[group_table_index];
0084 
0085     for (dword_index = 0; dword_index < remote_node_table->group_array_size; dword_index++) {
0086         if (group_table[dword_index] != 0) {
0087             for (bit_index = 0; bit_index < 32; bit_index++) {
0088                 if ((group_table[dword_index] & (1 << bit_index)) != 0) {
0089                     return (dword_index * 32) + bit_index;
0090                 }
0091             }
0092         }
0093     }
0094 
0095     return SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX;
0096 }
0097 
0098 /**
0099  * sci_remote_node_table_clear_group_index()
0100  * @remote_node_table: This the remote node table in which to clear the
0101  *    selector.
0102  * @group_table_index: This is the remote node selector in which the change will be
0103  *    made.
0104  * @group_index: This is the bit index in the table to be modified.
0105  *
0106  * This method will clear the group index entry in the specified group index
0107  * table. none
0108  */
0109 static void sci_remote_node_table_clear_group_index(
0110     struct sci_remote_node_table *remote_node_table,
0111     u32 group_table_index,
0112     u32 group_index)
0113 {
0114     u32 dword_index;
0115     u32 bit_index;
0116     u32 *group_table;
0117 
0118     BUG_ON(group_table_index >= SCU_STP_REMOTE_NODE_COUNT);
0119     BUG_ON(group_index >= (u32)(remote_node_table->group_array_size * 32));
0120 
0121     dword_index = group_index / 32;
0122     bit_index   = group_index % 32;
0123     group_table = remote_node_table->remote_node_groups[group_table_index];
0124 
0125     group_table[dword_index] = group_table[dword_index] & ~(1 << bit_index);
0126 }
0127 
0128 /**
0129  * sci_remote_node_table_set_group_index()
0130  * @remote_node_table: This the remote node table in which to set the
0131  *    selector.
0132  * @group_table_index: This is the remote node selector in which the change
0133  *    will be made.
0134  * @group_index: This is the bit position in the table to be modified.
0135  *
0136  * This method will set the group index bit entry in the specified gropu index
0137  * table. none
0138  */
0139 static void sci_remote_node_table_set_group_index(
0140     struct sci_remote_node_table *remote_node_table,
0141     u32 group_table_index,
0142     u32 group_index)
0143 {
0144     u32 dword_index;
0145     u32 bit_index;
0146     u32 *group_table;
0147 
0148     BUG_ON(group_table_index >= SCU_STP_REMOTE_NODE_COUNT);
0149     BUG_ON(group_index >= (u32)(remote_node_table->group_array_size * 32));
0150 
0151     dword_index = group_index / 32;
0152     bit_index   = group_index % 32;
0153     group_table = remote_node_table->remote_node_groups[group_table_index];
0154 
0155     group_table[dword_index] = group_table[dword_index] | (1 << bit_index);
0156 }
0157 
0158 /**
0159  * sci_remote_node_table_set_node_index()
0160  * @remote_node_table: This is the remote node table in which to modify
0161  *    the remote node availability.
0162  * @remote_node_index: This is the remote node index that is being returned to
0163  *    the table.
0164  *
0165  * This method will set the remote to available in the remote node allocation
0166  * table. none
0167  */
0168 static void sci_remote_node_table_set_node_index(
0169     struct sci_remote_node_table *remote_node_table,
0170     u32 remote_node_index)
0171 {
0172     u32 dword_location;
0173     u32 dword_remainder;
0174     u32 slot_normalized;
0175     u32 slot_position;
0176 
0177     BUG_ON(
0178         (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
0179         <= (remote_node_index / SCU_STP_REMOTE_NODE_COUNT)
0180         );
0181 
0182     dword_location  = remote_node_index / SCIC_SDS_REMOTE_NODES_PER_DWORD;
0183     dword_remainder = remote_node_index % SCIC_SDS_REMOTE_NODES_PER_DWORD;
0184     slot_normalized = (dword_remainder / SCU_STP_REMOTE_NODE_COUNT) * sizeof(u32);
0185     slot_position   = remote_node_index % SCU_STP_REMOTE_NODE_COUNT;
0186 
0187     remote_node_table->available_remote_nodes[dword_location] |=
0188         1 << (slot_normalized + slot_position);
0189 }
0190 
0191 /**
0192  * sci_remote_node_table_clear_node_index()
0193  * @remote_node_table: This is the remote node table from which to clear
0194  *    the available remote node bit.
0195  * @remote_node_index: This is the remote node index which is to be cleared
0196  *    from the table.
0197  *
0198  * This method clears the remote node index from the table of available remote
0199  * nodes. none
0200  */
0201 static void sci_remote_node_table_clear_node_index(
0202     struct sci_remote_node_table *remote_node_table,
0203     u32 remote_node_index)
0204 {
0205     u32 dword_location;
0206     u32 dword_remainder;
0207     u32 slot_position;
0208     u32 slot_normalized;
0209 
0210     BUG_ON(
0211         (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
0212         <= (remote_node_index / SCU_STP_REMOTE_NODE_COUNT)
0213         );
0214 
0215     dword_location  = remote_node_index / SCIC_SDS_REMOTE_NODES_PER_DWORD;
0216     dword_remainder = remote_node_index % SCIC_SDS_REMOTE_NODES_PER_DWORD;
0217     slot_normalized = (dword_remainder / SCU_STP_REMOTE_NODE_COUNT) * sizeof(u32);
0218     slot_position   = remote_node_index % SCU_STP_REMOTE_NODE_COUNT;
0219 
0220     remote_node_table->available_remote_nodes[dword_location] &=
0221         ~(1 << (slot_normalized + slot_position));
0222 }
0223 
0224 /**
0225  * sci_remote_node_table_clear_group()
0226  * @remote_node_table: The remote node table from which the slot will be
0227  *    cleared.
0228  * @group_index: The index for the slot that is to be cleared.
0229  *
0230  * This method clears the entire table slot at the specified slot index. none
0231  */
0232 static void sci_remote_node_table_clear_group(
0233     struct sci_remote_node_table *remote_node_table,
0234     u32 group_index)
0235 {
0236     u32 dword_location;
0237     u32 dword_remainder;
0238     u32 dword_value;
0239 
0240     BUG_ON(
0241         (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
0242         <= (group_index / SCU_STP_REMOTE_NODE_COUNT)
0243         );
0244 
0245     dword_location  = group_index / SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
0246     dword_remainder = group_index % SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
0247 
0248     dword_value = remote_node_table->available_remote_nodes[dword_location];
0249     dword_value &= ~(SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE << (dword_remainder * 4));
0250     remote_node_table->available_remote_nodes[dword_location] = dword_value;
0251 }
0252 
0253 /*
0254  * sci_remote_node_table_set_group()
0255  *
0256  * THis method sets an entire remote node group in the remote node table.
0257  */
0258 static void sci_remote_node_table_set_group(
0259     struct sci_remote_node_table *remote_node_table,
0260     u32 group_index)
0261 {
0262     u32 dword_location;
0263     u32 dword_remainder;
0264     u32 dword_value;
0265 
0266     BUG_ON(
0267         (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
0268         <= (group_index / SCU_STP_REMOTE_NODE_COUNT)
0269         );
0270 
0271     dword_location  = group_index / SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
0272     dword_remainder = group_index % SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
0273 
0274     dword_value = remote_node_table->available_remote_nodes[dword_location];
0275     dword_value |= (SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE << (dword_remainder * 4));
0276     remote_node_table->available_remote_nodes[dword_location] = dword_value;
0277 }
0278 
0279 /**
0280  * sci_remote_node_table_get_group_value()
0281  * @remote_node_table: This is the remote node table that for which the group
0282  *    value is to be returned.
0283  * @group_index: This is the group index to use to find the group value.
0284  *
0285  * This method will return the group value for the specified group index. The
0286  * bit values at the specified remote node group index.
0287  */
0288 static u8 sci_remote_node_table_get_group_value(
0289     struct sci_remote_node_table *remote_node_table,
0290     u32 group_index)
0291 {
0292     u32 dword_location;
0293     u32 dword_remainder;
0294     u32 dword_value;
0295 
0296     dword_location  = group_index / SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
0297     dword_remainder = group_index % SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
0298 
0299     dword_value = remote_node_table->available_remote_nodes[dword_location];
0300     dword_value &= (SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE << (dword_remainder * 4));
0301     dword_value = dword_value >> (dword_remainder * 4);
0302 
0303     return (u8)dword_value;
0304 }
0305 
0306 /**
0307  * sci_remote_node_table_initialize()
0308  * @remote_node_table: The remote that which is to be initialized.
0309  * @remote_node_entries: The number of entries to put in the table.
0310  *
0311  * This method will initialize the remote node table for use. none
0312  */
0313 void sci_remote_node_table_initialize(
0314     struct sci_remote_node_table *remote_node_table,
0315     u32 remote_node_entries)
0316 {
0317     u32 index;
0318 
0319     /*
0320      * Initialize the raw data we could improve the speed by only initializing
0321      * those entries that we are actually going to be used */
0322     memset(
0323         remote_node_table->available_remote_nodes,
0324         0x00,
0325         sizeof(remote_node_table->available_remote_nodes)
0326         );
0327 
0328     memset(
0329         remote_node_table->remote_node_groups,
0330         0x00,
0331         sizeof(remote_node_table->remote_node_groups)
0332         );
0333 
0334     /* Initialize the available remote node sets */
0335     remote_node_table->available_nodes_array_size = (u16)
0336                             (remote_node_entries / SCIC_SDS_REMOTE_NODES_PER_DWORD)
0337                             + ((remote_node_entries % SCIC_SDS_REMOTE_NODES_PER_DWORD) != 0);
0338 
0339 
0340     /* Initialize each full DWORD to a FULL SET of remote nodes */
0341     for (index = 0; index < remote_node_entries; index++) {
0342         sci_remote_node_table_set_node_index(remote_node_table, index);
0343     }
0344 
0345     remote_node_table->group_array_size = (u16)
0346                           (remote_node_entries / (SCU_STP_REMOTE_NODE_COUNT * 32))
0347                           + ((remote_node_entries % (SCU_STP_REMOTE_NODE_COUNT * 32)) != 0);
0348 
0349     for (index = 0; index < (remote_node_entries / SCU_STP_REMOTE_NODE_COUNT); index++) {
0350         /*
0351          * These are all guaranteed to be full slot values so fill them in the
0352          * available sets of 3 remote nodes */
0353         sci_remote_node_table_set_group_index(remote_node_table, 2, index);
0354     }
0355 
0356     /* Now fill in any remainders that we may find */
0357     if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 2) {
0358         sci_remote_node_table_set_group_index(remote_node_table, 1, index);
0359     } else if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 1) {
0360         sci_remote_node_table_set_group_index(remote_node_table, 0, index);
0361     }
0362 }
0363 
0364 /**
0365  * sci_remote_node_table_allocate_single_remote_node()
0366  * @remote_node_table: The remote node table from which to allocate a
0367  *    remote node.
0368  * @group_table_index: The group index that is to be used for the search.
0369  *
0370  * This method will allocate a single RNi from the remote node table.  The
0371  * table index will determine from which remote node group table to search.
0372  * This search may fail and another group node table can be specified.  The
0373  * function is designed to allow a serach of the available single remote node
0374  * group up to the triple remote node group.  If an entry is found in the
0375  * specified table the remote node is removed and the remote node groups are
0376  * updated. The RNi value or an invalid remote node context if an RNi can not
0377  * be found.
0378  */
0379 static u16 sci_remote_node_table_allocate_single_remote_node(
0380     struct sci_remote_node_table *remote_node_table,
0381     u32 group_table_index)
0382 {
0383     u8 index;
0384     u8 group_value;
0385     u32 group_index;
0386     u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
0387 
0388     group_index = sci_remote_node_table_get_group_index(
0389         remote_node_table, group_table_index);
0390 
0391     /* We could not find an available slot in the table selector 0 */
0392     if (group_index != SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX) {
0393         group_value = sci_remote_node_table_get_group_value(
0394             remote_node_table, group_index);
0395 
0396         for (index = 0; index < SCU_STP_REMOTE_NODE_COUNT; index++) {
0397             if (((1 << index) & group_value) != 0) {
0398                 /* We have selected a bit now clear it */
0399                 remote_node_index = (u16)(group_index * SCU_STP_REMOTE_NODE_COUNT
0400                               + index);
0401 
0402                 sci_remote_node_table_clear_group_index(
0403                     remote_node_table, group_table_index, group_index
0404                     );
0405 
0406                 sci_remote_node_table_clear_node_index(
0407                     remote_node_table, remote_node_index
0408                     );
0409 
0410                 if (group_table_index > 0) {
0411                     sci_remote_node_table_set_group_index(
0412                         remote_node_table, group_table_index - 1, group_index
0413                         );
0414                 }
0415 
0416                 break;
0417             }
0418         }
0419     }
0420 
0421     return remote_node_index;
0422 }
0423 
0424 /**
0425  * sci_remote_node_table_allocate_triple_remote_node()
0426  * @remote_node_table: This is the remote node table from which to allocate the
0427  *    remote node entries.
0428  * @group_table_index: This is the group table index which must equal two (2)
0429  *    for this operation.
0430  *
0431  * This method will allocate three consecutive remote node context entries. If
0432  * there are no remaining triple entries the function will return a failure.
0433  * The remote node index that represents three consecutive remote node entries
0434  * or an invalid remote node context if none can be found.
0435  */
0436 static u16 sci_remote_node_table_allocate_triple_remote_node(
0437     struct sci_remote_node_table *remote_node_table,
0438     u32 group_table_index)
0439 {
0440     u32 group_index;
0441     u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
0442 
0443     group_index = sci_remote_node_table_get_group_index(
0444         remote_node_table, group_table_index);
0445 
0446     if (group_index != SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX) {
0447         remote_node_index = (u16)group_index * SCU_STP_REMOTE_NODE_COUNT;
0448 
0449         sci_remote_node_table_clear_group_index(
0450             remote_node_table, group_table_index, group_index
0451             );
0452 
0453         sci_remote_node_table_clear_group(
0454             remote_node_table, group_index
0455             );
0456     }
0457 
0458     return remote_node_index;
0459 }
0460 
0461 /**
0462  * sci_remote_node_table_allocate_remote_node()
0463  * @remote_node_table: This is the remote node table from which the remote node
0464  *    allocation is to take place.
0465  * @remote_node_count: This is ther remote node count which is one of
0466  *    SCU_SSP_REMOTE_NODE_COUNT(1) or SCU_STP_REMOTE_NODE_COUNT(3).
0467  *
0468  * This method will allocate a remote node that mataches the remote node count
0469  * specified by the caller.  Valid values for remote node count is
0470  * SCU_SSP_REMOTE_NODE_COUNT(1) or SCU_STP_REMOTE_NODE_COUNT(3). u16 This is
0471  * the remote node index that is returned or an invalid remote node context.
0472  */
0473 u16 sci_remote_node_table_allocate_remote_node(
0474     struct sci_remote_node_table *remote_node_table,
0475     u32 remote_node_count)
0476 {
0477     u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
0478 
0479     if (remote_node_count == SCU_SSP_REMOTE_NODE_COUNT) {
0480         remote_node_index =
0481             sci_remote_node_table_allocate_single_remote_node(
0482                 remote_node_table, 0);
0483 
0484         if (remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
0485             remote_node_index =
0486                 sci_remote_node_table_allocate_single_remote_node(
0487                     remote_node_table, 1);
0488         }
0489 
0490         if (remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
0491             remote_node_index =
0492                 sci_remote_node_table_allocate_single_remote_node(
0493                     remote_node_table, 2);
0494         }
0495     } else if (remote_node_count == SCU_STP_REMOTE_NODE_COUNT) {
0496         remote_node_index =
0497             sci_remote_node_table_allocate_triple_remote_node(
0498                 remote_node_table, 2);
0499     }
0500 
0501     return remote_node_index;
0502 }
0503 
0504 /**
0505  * sci_remote_node_table_release_single_remote_node()
0506  * @remote_node_table: This is the remote node table from which the remote node
0507  *    release is to take place.
0508  * @remote_node_index: This is the remote node index that is being released.
0509  * This method will free a single remote node index back to the remote node
0510  * table.  This routine will update the remote node groups
0511  */
0512 static void sci_remote_node_table_release_single_remote_node(
0513     struct sci_remote_node_table *remote_node_table,
0514     u16 remote_node_index)
0515 {
0516     u32 group_index;
0517     u8 group_value;
0518 
0519     group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT;
0520 
0521     group_value = sci_remote_node_table_get_group_value(remote_node_table, group_index);
0522 
0523     /*
0524      * Assert that we are not trying to add an entry to a slot that is already
0525      * full. */
0526     BUG_ON(group_value == SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE);
0527 
0528     if (group_value == 0x00) {
0529         /*
0530          * There are no entries in this slot so it must be added to the single
0531          * slot table. */
0532         sci_remote_node_table_set_group_index(remote_node_table, 0, group_index);
0533     } else if ((group_value & (group_value - 1)) == 0) {
0534         /*
0535          * There is only one entry in this slot so it must be moved from the
0536          * single slot table to the dual slot table */
0537         sci_remote_node_table_clear_group_index(remote_node_table, 0, group_index);
0538         sci_remote_node_table_set_group_index(remote_node_table, 1, group_index);
0539     } else {
0540         /*
0541          * There are two entries in the slot so it must be moved from the dual
0542          * slot table to the tripple slot table. */
0543         sci_remote_node_table_clear_group_index(remote_node_table, 1, group_index);
0544         sci_remote_node_table_set_group_index(remote_node_table, 2, group_index);
0545     }
0546 
0547     sci_remote_node_table_set_node_index(remote_node_table, remote_node_index);
0548 }
0549 
0550 /**
0551  * sci_remote_node_table_release_triple_remote_node()
0552  * @remote_node_table: This is the remote node table to which the remote node
0553  *    index is to be freed.
0554  * @remote_node_index: This is the remote node index that is being released.
0555  *
0556  * This method will release a group of three consecutive remote nodes back to
0557  * the free remote nodes.
0558  */
0559 static void sci_remote_node_table_release_triple_remote_node(
0560     struct sci_remote_node_table *remote_node_table,
0561     u16 remote_node_index)
0562 {
0563     u32 group_index;
0564 
0565     group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT;
0566 
0567     sci_remote_node_table_set_group_index(
0568         remote_node_table, 2, group_index
0569         );
0570 
0571     sci_remote_node_table_set_group(remote_node_table, group_index);
0572 }
0573 
0574 /**
0575  * sci_remote_node_table_release_remote_node_index()
0576  * @remote_node_table: The remote node table to which the remote node index is
0577  *    to be freed.
0578  * @remote_node_count: This is the count of consecutive remote nodes that are
0579  *    to be freed.
0580  * @remote_node_index: This is the remote node index that is being released.
0581  *
0582  * This method will release the remote node index back into the remote node
0583  * table free pool.
0584  */
0585 void sci_remote_node_table_release_remote_node_index(
0586     struct sci_remote_node_table *remote_node_table,
0587     u32 remote_node_count,
0588     u16 remote_node_index)
0589 {
0590     if (remote_node_count == SCU_SSP_REMOTE_NODE_COUNT) {
0591         sci_remote_node_table_release_single_remote_node(
0592             remote_node_table, remote_node_index);
0593     } else if (remote_node_count == SCU_STP_REMOTE_NODE_COUNT) {
0594         sci_remote_node_table_release_triple_remote_node(
0595             remote_node_table, remote_node_index);
0596     }
0597 }
0598