remote_node_table.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  1. /*
  2. * This file is provided under a dual BSD/GPLv2 license. When using or
  3. * redistributing this file, you may do so under either license.
  4. *
  5. * GPL LICENSE SUMMARY
  6. *
  7. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of version 2 of the GNU General Public License as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called LICENSE.GPL.
  23. *
  24. * BSD LICENSE
  25. *
  26. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  27. * All rights reserved.
  28. *
  29. * Redistribution and use in source and binary forms, with or without
  30. * modification, are permitted provided that the following conditions
  31. * are met:
  32. *
  33. * * Redistributions of source code must retain the above copyright
  34. * notice, this list of conditions and the following disclaimer.
  35. * * Redistributions in binary form must reproduce the above copyright
  36. * notice, this list of conditions and the following disclaimer in
  37. * the documentation and/or other materials provided with the
  38. * distribution.
  39. * * Neither the name of Intel Corporation nor the names of its
  40. * contributors may be used to endorse or promote products derived
  41. * from this software without specific prior written permission.
  42. *
  43. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  44. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  45. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  46. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  47. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  48. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  49. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  50. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  51. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  52. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  53. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  54. */
  55. /**
  56. * This file contains the implementation of the SCIC_SDS_REMOTE_NODE_TABLE
  57. * public, protected, and private methods.
  58. *
  59. *
  60. */
  61. #include "remote_node_table.h"
  62. #include "remote_node_context.h"
  63. /**
  64. *
  65. * @remote_node_table: This is the remote node index table from which the
  66. * selection will be made.
  67. * @group_table_index: This is the index to the group table from which to
  68. * search for an available selection.
  69. *
  70. * This routine will find the bit position in absolute bit terms of the next 32
  71. * + bit position. If there are available bits in the first u32 then it is
  72. * just bit position. u32 This is the absolute bit position for an available
  73. * group.
  74. */
  75. static u32 sci_remote_node_table_get_group_index(
  76. struct sci_remote_node_table *remote_node_table,
  77. u32 group_table_index)
  78. {
  79. u32 dword_index;
  80. u32 *group_table;
  81. u32 bit_index;
  82. group_table = remote_node_table->remote_node_groups[group_table_index];
  83. for (dword_index = 0; dword_index < remote_node_table->group_array_size; dword_index++) {
  84. if (group_table[dword_index] != 0) {
  85. for (bit_index = 0; bit_index < 32; bit_index++) {
  86. if ((group_table[dword_index] & (1 << bit_index)) != 0) {
  87. return (dword_index * 32) + bit_index;
  88. }
  89. }
  90. }
  91. }
  92. return SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX;
  93. }
  94. /**
  95. *
  96. * @out]: remote_node_table This the remote node table in which to clear the
  97. * selector.
  98. * @set_index: This is the remote node selector in which the change will be
  99. * made.
  100. * @group_index: This is the bit index in the table to be modified.
  101. *
  102. * This method will clear the group index entry in the specified group index
  103. * table. none
  104. */
  105. static void sci_remote_node_table_clear_group_index(
  106. struct sci_remote_node_table *remote_node_table,
  107. u32 group_table_index,
  108. u32 group_index)
  109. {
  110. u32 dword_index;
  111. u32 bit_index;
  112. u32 *group_table;
  113. BUG_ON(group_table_index >= SCU_STP_REMOTE_NODE_COUNT);
  114. BUG_ON(group_index >= (u32)(remote_node_table->group_array_size * 32));
  115. dword_index = group_index / 32;
  116. bit_index = group_index % 32;
  117. group_table = remote_node_table->remote_node_groups[group_table_index];
  118. group_table[dword_index] = group_table[dword_index] & ~(1 << bit_index);
  119. }
  120. /**
  121. *
  122. * @out]: remote_node_table This the remote node table in which to set the
  123. * selector.
  124. * @group_table_index: This is the remote node selector in which the change
  125. * will be made.
  126. * @group_index: This is the bit position in the table to be modified.
  127. *
  128. * This method will set the group index bit entry in the specified gropu index
  129. * table. none
  130. */
  131. static void sci_remote_node_table_set_group_index(
  132. struct sci_remote_node_table *remote_node_table,
  133. u32 group_table_index,
  134. u32 group_index)
  135. {
  136. u32 dword_index;
  137. u32 bit_index;
  138. u32 *group_table;
  139. BUG_ON(group_table_index >= SCU_STP_REMOTE_NODE_COUNT);
  140. BUG_ON(group_index >= (u32)(remote_node_table->group_array_size * 32));
  141. dword_index = group_index / 32;
  142. bit_index = group_index % 32;
  143. group_table = remote_node_table->remote_node_groups[group_table_index];
  144. group_table[dword_index] = group_table[dword_index] | (1 << bit_index);
  145. }
  146. /**
  147. *
  148. * @out]: remote_node_table This is the remote node table in which to modify
  149. * the remote node availability.
  150. * @remote_node_index: This is the remote node index that is being returned to
  151. * the table.
  152. *
  153. * This method will set the remote to available in the remote node allocation
  154. * table. none
  155. */
  156. static void sci_remote_node_table_set_node_index(
  157. struct sci_remote_node_table *remote_node_table,
  158. u32 remote_node_index)
  159. {
  160. u32 dword_location;
  161. u32 dword_remainder;
  162. u32 slot_normalized;
  163. u32 slot_position;
  164. BUG_ON(
  165. (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
  166. <= (remote_node_index / SCU_STP_REMOTE_NODE_COUNT)
  167. );
  168. dword_location = remote_node_index / SCIC_SDS_REMOTE_NODES_PER_DWORD;
  169. dword_remainder = remote_node_index % SCIC_SDS_REMOTE_NODES_PER_DWORD;
  170. slot_normalized = (dword_remainder / SCU_STP_REMOTE_NODE_COUNT) * sizeof(u32);
  171. slot_position = remote_node_index % SCU_STP_REMOTE_NODE_COUNT;
  172. remote_node_table->available_remote_nodes[dword_location] |=
  173. 1 << (slot_normalized + slot_position);
  174. }
  175. /**
  176. *
  177. * @out]: remote_node_table This is the remote node table from which to clear
  178. * the available remote node bit.
  179. * @remote_node_index: This is the remote node index which is to be cleared
  180. * from the table.
  181. *
  182. * This method clears the remote node index from the table of available remote
  183. * nodes. none
  184. */
  185. static void sci_remote_node_table_clear_node_index(
  186. struct sci_remote_node_table *remote_node_table,
  187. u32 remote_node_index)
  188. {
  189. u32 dword_location;
  190. u32 dword_remainder;
  191. u32 slot_position;
  192. u32 slot_normalized;
  193. BUG_ON(
  194. (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
  195. <= (remote_node_index / SCU_STP_REMOTE_NODE_COUNT)
  196. );
  197. dword_location = remote_node_index / SCIC_SDS_REMOTE_NODES_PER_DWORD;
  198. dword_remainder = remote_node_index % SCIC_SDS_REMOTE_NODES_PER_DWORD;
  199. slot_normalized = (dword_remainder / SCU_STP_REMOTE_NODE_COUNT) * sizeof(u32);
  200. slot_position = remote_node_index % SCU_STP_REMOTE_NODE_COUNT;
  201. remote_node_table->available_remote_nodes[dword_location] &=
  202. ~(1 << (slot_normalized + slot_position));
  203. }
  204. /**
  205. *
  206. * @out]: remote_node_table The remote node table from which the slot will be
  207. * cleared.
  208. * @group_index: The index for the slot that is to be cleared.
  209. *
  210. * This method clears the entire table slot at the specified slot index. none
  211. */
  212. static void sci_remote_node_table_clear_group(
  213. struct sci_remote_node_table *remote_node_table,
  214. u32 group_index)
  215. {
  216. u32 dword_location;
  217. u32 dword_remainder;
  218. u32 dword_value;
  219. BUG_ON(
  220. (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
  221. <= (group_index / SCU_STP_REMOTE_NODE_COUNT)
  222. );
  223. dword_location = group_index / SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
  224. dword_remainder = group_index % SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
  225. dword_value = remote_node_table->available_remote_nodes[dword_location];
  226. dword_value &= ~(SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE << (dword_remainder * 4));
  227. remote_node_table->available_remote_nodes[dword_location] = dword_value;
  228. }
  229. /**
  230. *
  231. * @remote_node_table:
  232. *
  233. * THis method sets an entire remote node group in the remote node table.
  234. */
  235. static void sci_remote_node_table_set_group(
  236. struct sci_remote_node_table *remote_node_table,
  237. u32 group_index)
  238. {
  239. u32 dword_location;
  240. u32 dword_remainder;
  241. u32 dword_value;
  242. BUG_ON(
  243. (remote_node_table->available_nodes_array_size * SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD)
  244. <= (group_index / SCU_STP_REMOTE_NODE_COUNT)
  245. );
  246. dword_location = group_index / SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
  247. dword_remainder = group_index % SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
  248. dword_value = remote_node_table->available_remote_nodes[dword_location];
  249. dword_value |= (SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE << (dword_remainder * 4));
  250. remote_node_table->available_remote_nodes[dword_location] = dword_value;
  251. }
  252. /**
  253. *
  254. * @remote_node_table: This is the remote node table that for which the group
  255. * value is to be returned.
  256. * @group_index: This is the group index to use to find the group value.
  257. *
  258. * This method will return the group value for the specified group index. The
  259. * bit values at the specified remote node group index.
  260. */
  261. static u8 sci_remote_node_table_get_group_value(
  262. struct sci_remote_node_table *remote_node_table,
  263. u32 group_index)
  264. {
  265. u32 dword_location;
  266. u32 dword_remainder;
  267. u32 dword_value;
  268. dword_location = group_index / SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
  269. dword_remainder = group_index % SCIC_SDS_REMOTE_NODE_SETS_PER_DWORD;
  270. dword_value = remote_node_table->available_remote_nodes[dword_location];
  271. dword_value &= (SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE << (dword_remainder * 4));
  272. dword_value = dword_value >> (dword_remainder * 4);
  273. return (u8)dword_value;
  274. }
  275. /**
  276. *
  277. * @out]: remote_node_table The remote that which is to be initialized.
  278. * @remote_node_entries: The number of entries to put in the table.
  279. *
  280. * This method will initialize the remote node table for use. none
  281. */
  282. void sci_remote_node_table_initialize(
  283. struct sci_remote_node_table *remote_node_table,
  284. u32 remote_node_entries)
  285. {
  286. u32 index;
  287. /*
  288. * Initialize the raw data we could improve the speed by only initializing
  289. * those entries that we are actually going to be used */
  290. memset(
  291. remote_node_table->available_remote_nodes,
  292. 0x00,
  293. sizeof(remote_node_table->available_remote_nodes)
  294. );
  295. memset(
  296. remote_node_table->remote_node_groups,
  297. 0x00,
  298. sizeof(remote_node_table->remote_node_groups)
  299. );
  300. /* Initialize the available remote node sets */
  301. remote_node_table->available_nodes_array_size = (u16)
  302. (remote_node_entries / SCIC_SDS_REMOTE_NODES_PER_DWORD)
  303. + ((remote_node_entries % SCIC_SDS_REMOTE_NODES_PER_DWORD) != 0);
  304. /* Initialize each full DWORD to a FULL SET of remote nodes */
  305. for (index = 0; index < remote_node_entries; index++) {
  306. sci_remote_node_table_set_node_index(remote_node_table, index);
  307. }
  308. remote_node_table->group_array_size = (u16)
  309. (remote_node_entries / (SCU_STP_REMOTE_NODE_COUNT * 32))
  310. + ((remote_node_entries % (SCU_STP_REMOTE_NODE_COUNT * 32)) != 0);
  311. for (index = 0; index < (remote_node_entries / SCU_STP_REMOTE_NODE_COUNT); index++) {
  312. /*
  313. * These are all guaranteed to be full slot values so fill them in the
  314. * available sets of 3 remote nodes */
  315. sci_remote_node_table_set_group_index(remote_node_table, 2, index);
  316. }
  317. /* Now fill in any remainders that we may find */
  318. if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 2) {
  319. sci_remote_node_table_set_group_index(remote_node_table, 1, index);
  320. } else if ((remote_node_entries % SCU_STP_REMOTE_NODE_COUNT) == 1) {
  321. sci_remote_node_table_set_group_index(remote_node_table, 0, index);
  322. }
  323. }
  324. /**
  325. *
  326. * @out]: remote_node_table The remote node table from which to allocate a
  327. * remote node.
  328. * @table_index: The group index that is to be used for the search.
  329. *
  330. * This method will allocate a single RNi from the remote node table. The
  331. * table index will determine from which remote node group table to search.
  332. * This search may fail and another group node table can be specified. The
  333. * function is designed to allow a serach of the available single remote node
  334. * group up to the triple remote node group. If an entry is found in the
  335. * specified table the remote node is removed and the remote node groups are
  336. * updated. The RNi value or an invalid remote node context if an RNi can not
  337. * be found.
  338. */
  339. static u16 sci_remote_node_table_allocate_single_remote_node(
  340. struct sci_remote_node_table *remote_node_table,
  341. u32 group_table_index)
  342. {
  343. u8 index;
  344. u8 group_value;
  345. u32 group_index;
  346. u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
  347. group_index = sci_remote_node_table_get_group_index(
  348. remote_node_table, group_table_index);
  349. /* We could not find an available slot in the table selector 0 */
  350. if (group_index != SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX) {
  351. group_value = sci_remote_node_table_get_group_value(
  352. remote_node_table, group_index);
  353. for (index = 0; index < SCU_STP_REMOTE_NODE_COUNT; index++) {
  354. if (((1 << index) & group_value) != 0) {
  355. /* We have selected a bit now clear it */
  356. remote_node_index = (u16)(group_index * SCU_STP_REMOTE_NODE_COUNT
  357. + index);
  358. sci_remote_node_table_clear_group_index(
  359. remote_node_table, group_table_index, group_index
  360. );
  361. sci_remote_node_table_clear_node_index(
  362. remote_node_table, remote_node_index
  363. );
  364. if (group_table_index > 0) {
  365. sci_remote_node_table_set_group_index(
  366. remote_node_table, group_table_index - 1, group_index
  367. );
  368. }
  369. break;
  370. }
  371. }
  372. }
  373. return remote_node_index;
  374. }
  375. /**
  376. *
  377. * @remote_node_table: This is the remote node table from which to allocate the
  378. * remote node entries.
  379. * @group_table_index: THis is the group table index which must equal two (2)
  380. * for this operation.
  381. *
  382. * This method will allocate three consecutive remote node context entries. If
  383. * there are no remaining triple entries the function will return a failure.
  384. * The remote node index that represents three consecutive remote node entries
  385. * or an invalid remote node context if none can be found.
  386. */
  387. static u16 sci_remote_node_table_allocate_triple_remote_node(
  388. struct sci_remote_node_table *remote_node_table,
  389. u32 group_table_index)
  390. {
  391. u32 group_index;
  392. u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
  393. group_index = sci_remote_node_table_get_group_index(
  394. remote_node_table, group_table_index);
  395. if (group_index != SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX) {
  396. remote_node_index = (u16)group_index * SCU_STP_REMOTE_NODE_COUNT;
  397. sci_remote_node_table_clear_group_index(
  398. remote_node_table, group_table_index, group_index
  399. );
  400. sci_remote_node_table_clear_group(
  401. remote_node_table, group_index
  402. );
  403. }
  404. return remote_node_index;
  405. }
  406. /**
  407. *
  408. * @remote_node_table: This is the remote node table from which the remote node
  409. * allocation is to take place.
  410. * @remote_node_count: This is ther remote node count which is one of
  411. * SCU_SSP_REMOTE_NODE_COUNT(1) or SCU_STP_REMOTE_NODE_COUNT(3).
  412. *
  413. * This method will allocate a remote node that mataches the remote node count
  414. * specified by the caller. Valid values for remote node count is
  415. * SCU_SSP_REMOTE_NODE_COUNT(1) or SCU_STP_REMOTE_NODE_COUNT(3). u16 This is
  416. * the remote node index that is returned or an invalid remote node context.
  417. */
  418. u16 sci_remote_node_table_allocate_remote_node(
  419. struct sci_remote_node_table *remote_node_table,
  420. u32 remote_node_count)
  421. {
  422. u16 remote_node_index = SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX;
  423. if (remote_node_count == SCU_SSP_REMOTE_NODE_COUNT) {
  424. remote_node_index =
  425. sci_remote_node_table_allocate_single_remote_node(
  426. remote_node_table, 0);
  427. if (remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
  428. remote_node_index =
  429. sci_remote_node_table_allocate_single_remote_node(
  430. remote_node_table, 1);
  431. }
  432. if (remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) {
  433. remote_node_index =
  434. sci_remote_node_table_allocate_single_remote_node(
  435. remote_node_table, 2);
  436. }
  437. } else if (remote_node_count == SCU_STP_REMOTE_NODE_COUNT) {
  438. remote_node_index =
  439. sci_remote_node_table_allocate_triple_remote_node(
  440. remote_node_table, 2);
  441. }
  442. return remote_node_index;
  443. }
  444. /**
  445. *
  446. * @remote_node_table:
  447. *
  448. * This method will free a single remote node index back to the remote node
  449. * table. This routine will update the remote node groups
  450. */
  451. static void sci_remote_node_table_release_single_remote_node(
  452. struct sci_remote_node_table *remote_node_table,
  453. u16 remote_node_index)
  454. {
  455. u32 group_index;
  456. u8 group_value;
  457. group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT;
  458. group_value = sci_remote_node_table_get_group_value(remote_node_table, group_index);
  459. /*
  460. * Assert that we are not trying to add an entry to a slot that is already
  461. * full. */
  462. BUG_ON(group_value == SCIC_SDS_REMOTE_NODE_TABLE_FULL_SLOT_VALUE);
  463. if (group_value == 0x00) {
  464. /*
  465. * There are no entries in this slot so it must be added to the single
  466. * slot table. */
  467. sci_remote_node_table_set_group_index(remote_node_table, 0, group_index);
  468. } else if ((group_value & (group_value - 1)) == 0) {
  469. /*
  470. * There is only one entry in this slot so it must be moved from the
  471. * single slot table to the dual slot table */
  472. sci_remote_node_table_clear_group_index(remote_node_table, 0, group_index);
  473. sci_remote_node_table_set_group_index(remote_node_table, 1, group_index);
  474. } else {
  475. /*
  476. * There are two entries in the slot so it must be moved from the dual
  477. * slot table to the tripple slot table. */
  478. sci_remote_node_table_clear_group_index(remote_node_table, 1, group_index);
  479. sci_remote_node_table_set_group_index(remote_node_table, 2, group_index);
  480. }
  481. sci_remote_node_table_set_node_index(remote_node_table, remote_node_index);
  482. }
  483. /**
  484. *
  485. * @remote_node_table: This is the remote node table to which the remote node
  486. * index is to be freed.
  487. *
  488. * This method will release a group of three consecutive remote nodes back to
  489. * the free remote nodes.
  490. */
  491. static void sci_remote_node_table_release_triple_remote_node(
  492. struct sci_remote_node_table *remote_node_table,
  493. u16 remote_node_index)
  494. {
  495. u32 group_index;
  496. group_index = remote_node_index / SCU_STP_REMOTE_NODE_COUNT;
  497. sci_remote_node_table_set_group_index(
  498. remote_node_table, 2, group_index
  499. );
  500. sci_remote_node_table_set_group(remote_node_table, group_index);
  501. }
  502. /**
  503. *
  504. * @remote_node_table: The remote node table to which the remote node index is
  505. * to be freed.
  506. * @remote_node_count: This is the count of consecutive remote nodes that are
  507. * to be freed.
  508. *
  509. * This method will release the remote node index back into the remote node
  510. * table free pool.
  511. */
  512. void sci_remote_node_table_release_remote_node_index(
  513. struct sci_remote_node_table *remote_node_table,
  514. u32 remote_node_count,
  515. u16 remote_node_index)
  516. {
  517. if (remote_node_count == SCU_SSP_REMOTE_NODE_COUNT) {
  518. sci_remote_node_table_release_single_remote_node(
  519. remote_node_table, remote_node_index);
  520. } else if (remote_node_count == SCU_STP_REMOTE_NODE_COUNT) {
  521. sci_remote_node_table_release_triple_remote_node(
  522. remote_node_table, remote_node_index);
  523. }
  524. }