Lines Matching +full:t +full:- +full:head

1 // SPDX-License-Identifier: GPL-2.0-or-later
28 * functions aren't performance sensitive, so this conversion isn't an
37 return -EINVAL; in hvcs_convert()
39 return -EIO; in hvcs_convert()
47 return -EBUSY; in hvcs_convert()
50 return -EPERM; in hvcs_convert()
55 * hvcs_free_partner_info - free pi allocated by hvcs_get_partner_info
56 * @head: list_head pointer for an allocated list of partner info structs to
62 int hvcs_free_partner_info(struct list_head *head) in hvcs_free_partner_info() argument
67 if (!head) in hvcs_free_partner_info()
68 return -EINVAL; in hvcs_free_partner_info()
70 while (!list_empty(head)) { in hvcs_free_partner_info()
71 element = head->next; in hvcs_free_partner_info()
95 * hvcs_get_partner_info - Get all of the partner info for a vty-server adapter
96 * @unit_address: The unit_address of the vty-server adapter for which this
98 * @head: An initialized list_head pointer to an empty list to use to return the
100 * @pi_buff: A page sized buffer pre-allocated prior to calling this function
104 * This function returns non-zero on success, or if there is no partner info.
106 * The pi_buff is pre-allocated prior to calling this function because this
116 * hvcs_free_partner_info() using a pointer to the SAME list head instance
119 int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head, in hvcs_get_partner_info() argument
133 if (!head || !pi_buff) in hvcs_get_partner_info()
134 return -EINVAL; in hvcs_get_partner_info()
138 INIT_LIST_HEAD(head); in hvcs_get_partner_info()
145 * Don't indicate that we've failed if we have in hvcs_get_partner_info()
148 if (!list_empty(head)) in hvcs_get_partner_info()
169 hvcs_free_partner_info(head); in hvcs_get_partner_info()
170 return -ENOMEM; in hvcs_get_partner_info()
173 next_partner_info->unit_address in hvcs_get_partner_info()
175 next_partner_info->partition_ID in hvcs_get_partner_info()
178 /* copy the Null-term char too */ in hvcs_get_partner_info()
179 strscpy(&next_partner_info->location_code[0], in hvcs_get_partner_info()
181 sizeof(next_partner_info->location_code)); in hvcs_get_partner_info()
183 list_add_tail(&(next_partner_info->node), head); in hvcs_get_partner_info()
193 * hvcs_register_connection - establish a connection between this vty-server and
195 * @unit_address: The unit address of the vty-server adapter that is to be
198 * @p_unit_address: The unit address of the vty adapter to which the vty-server
201 * If this function is called once and -EINVAL is returned it may
205 * for a second time, -EINVAL is returned then it indicates that
207 * different vty-server adapter. It is also possible that a second
208 * -EINVAL may indicate that one of the parms is not valid, for
209 * instance if the link was removed between the vty-server adapter
210 * and the vty adapter that you are trying to open. Don't shoot the
224 * hvcs_free_connection - free the connection between a vty-server and vty
225 * @unit_address: The unit address of the vty-server that is to have its
228 * This function is used to free the partner connection between a vty-server
231 * If -EBUSY is returned continue to call this function until 0 is returned.