Lines Matching +full:phy +full:- +full:device

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause OR GPL-2.0
9 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
22 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
28 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
74 * @brief This routine constructs a smp phy object for an expander phy and insert
75 * to owning expander device's smp_phy_list.
76 * @param[in] this_smp_phy The memory space to store a phy
77 * @param[in] owning_device The smp remote device that owns this smp phy.
78 * @param[in] expander_phy_id The expander phy id for this_smp_phy.
89 this_smp_phy->phy_identifier = expander_phy_id; in scif_sas_smp_phy_construct()
90 this_smp_phy->owning_device = owning_device; in scif_sas_smp_phy_construct()
92 sci_fast_list_element_init((this_smp_phy), (&this_smp_phy->list_element)); in scif_sas_smp_phy_construct()
94 //insert to owning device's smp phy list. in scif_sas_smp_phy_construct()
96 (&owning_device->protocol_device.smp_device.smp_phy_list), in scif_sas_smp_phy_construct()
97 (&this_smp_phy->list_element) in scif_sas_smp_phy_construct()
102 * @brief This routine destructs a smp phy object for an expander phy and free the smp
103 * phy to controller's smp phy memory.
104 * @param[in] this_smp_phy The smp phy to be destructed.
112 SCIF_SAS_REMOTE_DEVICE_T * owning_device = this_smp_phy->owning_device; in scif_sas_smp_phy_destruct()
113 SCIF_SAS_CONTROLLER_T * fw_controller = owning_device->domain->controller; in scif_sas_smp_phy_destruct()
115 if ( ( this_smp_phy->attached_device_type == SMP_EDGE_EXPANDER_DEVICE in scif_sas_smp_phy_destruct()
116 || this_smp_phy->attached_device_type == SMP_FANOUT_EXPANDER_DEVICE) in scif_sas_smp_phy_destruct()
117 && this_smp_phy->u.attached_phy != NULL ) in scif_sas_smp_phy_destruct()
119 //update the counterpart phy from the other smp phy list. in scif_sas_smp_phy_destruct()
120 this_smp_phy->u.attached_phy->attached_device_type = SMP_NO_DEVICE_ATTACHED; in scif_sas_smp_phy_destruct()
121 this_smp_phy->u.attached_phy->u.attached_phy = NULL; in scif_sas_smp_phy_destruct()
125 sci_fast_list_remove_element(&this_smp_phy->list_element); in scif_sas_smp_phy_destruct()
131 * @brief This routine save a smp phy information based on discover response.
133 * @param[in] this_smp_phy The memory space to store a phy
134 * @param[in] attached_device A possible direct attached device to this phy.
145 ASSERT (this_smp_phy->owning_device != NULL); in scif_sas_smp_phy_save_information()
146 ASSERT (this_smp_phy->phy_identifier == discover_response->phy_identifier); in scif_sas_smp_phy_save_information()
148 this_smp_phy->attached_device_type = (U8)discover_response->u2.sas1_1.attached_device_type; in scif_sas_smp_phy_save_information()
149 this_smp_phy->routing_attribute = (U8)discover_response->routing_attribute; in scif_sas_smp_phy_save_information()
150 this_smp_phy->attached_sas_address = discover_response->attached_sas_address; in scif_sas_smp_phy_save_information()
151 this_smp_phy->config_route_table_index_anchor = 0; in scif_sas_smp_phy_save_information()
153 if (this_smp_phy->attached_device_type != SMP_EDGE_EXPANDER_DEVICE in scif_sas_smp_phy_save_information()
154 && this_smp_phy->attached_device_type != SMP_FANOUT_EXPANDER_DEVICE) in scif_sas_smp_phy_save_information()
156 … //note, end_device field could be an end device, or a NULL value, but can't be expander device. in scif_sas_smp_phy_save_information()
157 this_smp_phy->u.end_device = attached_device; in scif_sas_smp_phy_save_information()
161 //if attached device type is expander, we will set u.attached_phy later when the in scif_sas_smp_phy_save_information()
168 * @brief This routine constructs a smp phy object for an expander phy.
169 * @param[in] this_smp_phy The memory space to store a phy
170 * @param[in] owning_device The smp remote device that owns this smp phy.
173 * @return Whether a smp phy has an attached phy and the pair of phy are set
174 * set to each other as attached phy successfully.
182 //find the attached phy from its owning device by attached_phy_id. in scif_sas_smp_phy_set_attached_phy()
186 &attached_remote_device->protocol_device.smp_device); in scif_sas_smp_phy_set_attached_phy()
190 this_smp_phy->u.attached_phy = attached_smp_phy; in scif_sas_smp_phy_set_attached_phy()
191 attached_smp_phy->u.attached_phy = this_smp_phy; in scif_sas_smp_phy_set_attached_phy()
201 * @brief This method verify the routing attributes of a phy connection per
204 * @param[in] this_smp_phy One smp phy belongs to a smp phy connection.
205 * @param[in] attached_smp_phy One smp phy belongs to a smp phy connection.
207 * @return Whether routing attributes of a phy connection is legal.
208 * @retval SCI_SUCCESS indicates a good phy connection.
209 * SCI_FAILURE indicates a illegal phy connection.
218 //expander phy with direct routing attribute can only connect to in scif_sas_smp_phy_verify_routing_attribute()
219 //phy with direct routing attribute. in scif_sas_smp_phy_verify_routing_attribute()
220 if ( this_smp_phy->routing_attribute == DIRECT_ROUTING_ATTRIBUTE in scif_sas_smp_phy_verify_routing_attribute()
221 || attached_smp_phy->routing_attribute == DIRECT_ROUTING_ATTRIBUTE ) in scif_sas_smp_phy_verify_routing_attribute()
223 if ( (this_smp_phy->routing_attribute | attached_smp_phy->routing_attribute) in scif_sas_smp_phy_verify_routing_attribute()
228 if (this_smp_phy->routing_attribute == TABLE_ROUTING_ATTRIBUTE in scif_sas_smp_phy_verify_routing_attribute()
229 && attached_smp_phy->routing_attribute == TABLE_ROUTING_ATTRIBUTE) in scif_sas_smp_phy_verify_routing_attribute()
231 if ( ! this_smp_phy->owning_device->protocol_device.smp_device.is_table_to_table_supported in scif_sas_smp_phy_verify_routing_attribute()
232 … || !attached_smp_phy->owning_device->protocol_device.smp_device.is_table_to_table_supported ) in scif_sas_smp_phy_verify_routing_attribute()
241 * @brief This method find The next smp phy that is in the smp phy list and
244 * @param[in] this_smp_phy The smp phy whose neighbor phy that is in the same
247 * @return The next smp phy that is in the smp phy list and resides in the same
255 &(this_smp_phy->list_element) ); in scif_sas_smp_phy_find_next_phy_in_wide_port()
263 next_phy_element = sci_fast_list_get_next( &(next_phy->list_element)); in scif_sas_smp_phy_find_next_phy_in_wide_port()
265 if (next_phy->attached_sas_address.high == this_smp_phy->attached_sas_address.high in scif_sas_smp_phy_find_next_phy_in_wide_port()
266 &&next_phy->attached_sas_address.low == this_smp_phy->attached_sas_address.low) in scif_sas_smp_phy_find_next_phy_in_wide_port()
275 * @brief This method find the smp phy that resides in the middle of the same
278 * @param[in] this_smp_phy The smp phy who is the lowest order phy in a wide
281 * @return The next smp phy that is in the smp phy list and resides in the same
293 //second phy is always the correct answer for x2, x3 or x4 wide port. in scif_sas_smp_phy_find_middle_phy_in_wide_port()
294 //For a narrow port, phy0 is the middle phy. in scif_sas_smp_phy_find_middle_phy_in_wide_port()
310 * @brief This method find the smp phy that is the hishest order phy
313 * @param[in] this_smp_phy The smp phy who is the lowest order phy in a wide
316 * @return The next smp phy that is in the smp phy list and resides in the same