Lines Matching refs:port
19 static void tb_scan_port(struct tb_port *port);
34 static void tb_scan_port(struct tb_port *port) in tb_scan_port() argument
37 if (tb_is_upstream_port(port)) in tb_scan_port()
39 if (port->config.type != TB_TYPE_PORT) in tb_scan_port()
41 if (port->dual_link_port && port->link_nr) in tb_scan_port()
46 if (tb_wait_for_port(port, false) <= 0) in tb_scan_port()
48 if (port->remote) { in tb_scan_port()
49 tb_port_WARN(port, "port already has a remote!\n"); in tb_scan_port()
52 sw = tb_switch_alloc(port->sw->tb, tb_downstream_route(port)); in tb_scan_port()
55 port->remote = tb_upstream_port(sw); in tb_scan_port()
56 tb_upstream_port(sw)->remote = port; in tb_scan_port()
83 struct tb_port *port = &sw->ports[i]; in tb_free_unplugged_children() local
84 if (tb_is_upstream_port(port)) in tb_free_unplugged_children()
86 if (!port->remote) in tb_free_unplugged_children()
88 if (port->remote->sw->is_unplugged) { in tb_free_unplugged_children()
89 tb_switch_free(port->remote->sw); in tb_free_unplugged_children()
90 port->remote = NULL; in tb_free_unplugged_children()
92 tb_free_unplugged_children(port->remote->sw); in tb_free_unplugged_children()
207 u8 port; member
221 struct tb_port *port; in tb_handle_hotplug() local
230 ev->route, ev->port, ev->unplug); in tb_handle_hotplug()
233 if (ev->port > sw->config.max_port_number) { in tb_handle_hotplug()
236 ev->route, ev->port, ev->unplug); in tb_handle_hotplug()
239 port = &sw->ports[ev->port]; in tb_handle_hotplug()
240 if (tb_is_upstream_port(port)) { in tb_handle_hotplug()
243 ev->route, ev->port, ev->unplug); in tb_handle_hotplug()
247 if (port->remote) { in tb_handle_hotplug()
248 tb_port_info(port, "unplugged\n"); in tb_handle_hotplug()
249 tb_sw_set_unpplugged(port->remote->sw); in tb_handle_hotplug()
251 tb_switch_free(port->remote->sw); in tb_handle_hotplug()
252 port->remote = NULL; in tb_handle_hotplug()
254 tb_port_info(port, in tb_handle_hotplug()
257 } else if (port->remote) { in tb_handle_hotplug()
258 tb_port_info(port, in tb_handle_hotplug()
261 tb_port_info(port, "hotplug: scanning\n"); in tb_handle_hotplug()
262 tb_scan_port(port); in tb_handle_hotplug()
263 if (!port->remote) { in tb_handle_hotplug()
264 tb_port_info(port, "hotplug: no switch found\n"); in tb_handle_hotplug()
265 } else if (port->remote->sw->config.depth > 1) { in tb_handle_hotplug()
266 tb_sw_warn(port->remote->sw, in tb_handle_hotplug()
269 tb_sw_info(port->remote->sw, in tb_handle_hotplug()
284 static void tb_schedule_hotplug_handler(void *data, u64 route, u8 port, in tb_schedule_hotplug_handler() argument
294 ev->port = port; in tb_schedule_hotplug_handler()