1 // SPDX-License-Identifier: GPL-2.0
3 * Thunderbolt driver - bus logic (NHI independent)
5 * Copyright (c) 2014 Andreas Noever <andreas.noever@gmail.com>
6 * Copyright (C) 2019, Intel Corporation
9 #include <linux/slab.h>
10 #include <linux/errno.h>
11 #include <linux/delay.h>
12 #include <linux/platform_data/x86/apple.h>
19 * struct tb_cm - Simple Thunderbolt connection manager
20 * @tunnel_list: List of active tunnels
21 * @dp_resources: List of available DP resources for DP tunneling
22 * @hotplug_active: tb_handle_hotplug will stop progressing plug
23 * events and exit if this is not set (it needs to
24 * acquire the lock one more time). Used to drain wq
25 * after cfg has been paused.
28 struct list_head tunnel_list;
29 struct list_head dp_resources;
33 struct tb_hotplug_event {
34 struct work_struct work;
41 static void tb_handle_hotplug(struct work_struct *work);
43 static void tb_queue_hotplug(struct tb *tb, u64 route, u8 port, bool unplug)
45 struct tb_hotplug_event *ev;
47 ev = kmalloc(sizeof(*ev), GFP_KERNEL);
55 INIT_WORK(&ev->work, tb_handle_hotplug);
56 queue_work(tb->wq, &ev->work);
59 /* enumeration & hot plug handling */
61 static void tb_add_dp_resources(struct tb_switch *sw)
63 struct tb_cm *tcm = tb_priv(sw->tb);
66 tb_switch_for_each_port(sw, port) {
67 if (!tb_port_is_dpin(port))
70 if (!tb_switch_query_dp_resource(sw, port))
73 list_add_tail(&port->list, &tcm->dp_resources);
74 tb_port_dbg(port, "DP IN resource available\n");
78 static void tb_remove_dp_resources(struct tb_switch *sw)
80 struct tb_cm *tcm = tb_priv(sw->tb);
81 struct tb_port *port, *tmp;
83 /* Clear children resources first */
84 tb_switch_for_each_port(sw, port) {
85 if (tb_port_has_remote(port))
86 tb_remove_dp_resources(port->remote->sw);
89 list_for_each_entry_safe(port, tmp, &tcm->dp_resources, list) {
91 tb_port_dbg(port, "DP OUT resource unavailable\n");
92 list_del_init(&port->list);
97 static void tb_discover_tunnels(struct tb_switch *sw)
99 struct tb *tb = sw->tb;
100 struct tb_cm *tcm = tb_priv(tb);
101 struct tb_port *port;
103 tb_switch_for_each_port(sw, port) {
104 struct tb_tunnel *tunnel = NULL;
106 switch (port->config.type) {
107 case TB_TYPE_DP_HDMI_IN:
108 tunnel = tb_tunnel_discover_dp(tb, port);
111 case TB_TYPE_PCIE_DOWN:
112 tunnel = tb_tunnel_discover_pci(tb, port);
122 if (tb_tunnel_is_pci(tunnel)) {
123 struct tb_switch *parent = tunnel->dst_port->sw;
125 while (parent != tunnel->src_port->sw) {
127 parent = tb_switch_parent(parent);
131 list_add_tail(&tunnel->list, &tcm->tunnel_list);
134 tb_switch_for_each_port(sw, port) {
135 if (tb_port_has_remote(port))
136 tb_discover_tunnels(port->remote->sw);
140 static void tb_scan_xdomain(struct tb_port *port)
142 struct tb_switch *sw = port->sw;
143 struct tb *tb = sw->tb;
144 struct tb_xdomain *xd;
147 route = tb_downstream_route(port);
148 xd = tb_xdomain_find_by_route(tb, route);
154 xd = tb_xdomain_alloc(tb, &sw->dev, route, tb->root_switch->uuid,
157 tb_port_at(route, sw)->xdomain = xd;
162 static void tb_scan_port(struct tb_port *port);
165 * tb_scan_switch() - scan for and initialize downstream switches
167 static void tb_scan_switch(struct tb_switch *sw)
169 struct tb_port *port;
171 tb_switch_for_each_port(sw, port)
176 * tb_scan_port() - check for and initialize switches below port
178 static void tb_scan_port(struct tb_port *port)
180 struct tb_cm *tcm = tb_priv(port->sw->tb);
181 struct tb_port *upstream_port;
182 struct tb_switch *sw;
184 if (tb_is_upstream_port(port))
187 if (tb_port_is_dpout(port) && tb_dp_port_hpd_is_active(port) == 1 &&
188 !tb_dp_port_is_enabled(port)) {
189 tb_port_dbg(port, "DP adapter HPD set, queuing hotplug\n");
190 tb_queue_hotplug(port->sw->tb, tb_route(port->sw), port->port,
195 if (port->config.type != TB_TYPE_PORT)
197 if (port->dual_link_port && port->link_nr)
199 * Downstream switch is reachable through two ports.
200 * Only scan on the primary port (link_nr == 0).
202 if (tb_wait_for_port(port, false) <= 0)
205 tb_port_dbg(port, "port already has a remote\n");
208 sw = tb_switch_alloc(port->sw->tb, &port->sw->dev,
209 tb_downstream_route(port));
212 * If there is an error accessing the connected switch
213 * it may be connected to another domain. Also we allow
214 * the other domain to be connected to a max depth switch.
216 if (PTR_ERR(sw) == -EIO || PTR_ERR(sw) == -EADDRNOTAVAIL)
217 tb_scan_xdomain(port);
221 if (tb_switch_configure(sw)) {
227 * If there was previously another domain connected remove it
231 tb_xdomain_remove(port->xdomain);
232 port->xdomain = NULL;
236 * Do not send uevents until we have discovered all existing
237 * tunnels and know which switches were authorized already by
240 if (!tcm->hotplug_active)
241 dev_set_uevent_suppress(&sw->dev, true);
243 if (tb_switch_add(sw)) {
248 /* Link the switches using both links if available */
249 upstream_port = tb_upstream_port(sw);
250 port->remote = upstream_port;
251 upstream_port->remote = port;
252 if (port->dual_link_port && upstream_port->dual_link_port) {
253 port->dual_link_port->remote = upstream_port->dual_link_port;
254 upstream_port->dual_link_port->remote = port->dual_link_port;
257 /* Enable lane bonding if supported */
258 if (tb_switch_lane_bonding_enable(sw))
259 tb_sw_warn(sw, "failed to enable lane bonding\n");
264 static struct tb_tunnel *tb_find_tunnel(struct tb *tb, enum tb_tunnel_type type,
265 struct tb_port *src_port,
266 struct tb_port *dst_port)
268 struct tb_cm *tcm = tb_priv(tb);
269 struct tb_tunnel *tunnel;
271 list_for_each_entry(tunnel, &tcm->tunnel_list, list) {
272 if (tunnel->type == type &&
273 ((src_port && src_port == tunnel->src_port) ||
274 (dst_port && dst_port == tunnel->dst_port))) {
282 static void tb_deactivate_and_free_tunnel(struct tb_tunnel *tunnel)
287 tb_tunnel_deactivate(tunnel);
288 list_del(&tunnel->list);
291 * In case of DP tunnel make sure the DP IN resource is deallocated
294 if (tb_tunnel_is_dp(tunnel)) {
295 struct tb_port *in = tunnel->src_port;
297 tb_switch_dealloc_dp_resource(in->sw, in);
300 tb_tunnel_free(tunnel);
304 * tb_free_invalid_tunnels() - destroy tunnels of devices that have gone away
306 static void tb_free_invalid_tunnels(struct tb *tb)
308 struct tb_cm *tcm = tb_priv(tb);
309 struct tb_tunnel *tunnel;
312 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) {
313 if (tb_tunnel_is_invalid(tunnel))
314 tb_deactivate_and_free_tunnel(tunnel);
319 * tb_free_unplugged_children() - traverse hierarchy and free unplugged switches
321 static void tb_free_unplugged_children(struct tb_switch *sw)
323 struct tb_port *port;
325 tb_switch_for_each_port(sw, port) {
326 if (!tb_port_has_remote(port))
329 if (port->remote->sw->is_unplugged) {
330 tb_remove_dp_resources(port->remote->sw);
331 tb_switch_lane_bonding_disable(port->remote->sw);
332 tb_switch_remove(port->remote->sw);
334 if (port->dual_link_port)
335 port->dual_link_port->remote = NULL;
337 tb_free_unplugged_children(port->remote->sw);
343 * tb_find_port() - return the first port of @type on @sw or NULL
344 * @sw: Switch to find the port from
345 * @type: Port type to look for
347 static struct tb_port *tb_find_port(struct tb_switch *sw,
348 enum tb_port_type type)
350 struct tb_port *port;
352 tb_switch_for_each_port(sw, port) {
353 if (port->config.type == type)
361 * tb_find_unused_port() - return the first inactive port on @sw
362 * @sw: Switch to find the port on
363 * @type: Port type to look for
365 static struct tb_port *tb_find_unused_port(struct tb_switch *sw,
366 enum tb_port_type type)
368 struct tb_port *port;
370 tb_switch_for_each_port(sw, port) {
371 if (tb_is_upstream_port(port))
373 if (port->config.type != type)
377 if (tb_port_is_enabled(port))
384 static struct tb_port *tb_find_pcie_down(struct tb_switch *sw,
385 const struct tb_port *port)
388 * To keep plugging devices consistently in the same PCIe
389 * hierarchy, do mapping here for root switch downstream PCIe
393 int phy_port = tb_phy_port_from_link(port->port);
397 * Hard-coded Thunderbolt port to PCIe down port mapping
400 if (tb_switch_is_cactus_ridge(sw) ||
401 tb_switch_is_alpine_ridge(sw))
402 index = !phy_port ? 6 : 7;
403 else if (tb_switch_is_falcon_ridge(sw))
404 index = !phy_port ? 6 : 8;
405 else if (tb_switch_is_titan_ridge(sw))
406 index = !phy_port ? 8 : 9;
410 /* Validate the hard-coding */
411 if (WARN_ON(index > sw->config.max_port_number))
413 if (WARN_ON(!tb_port_is_pcie_down(&sw->ports[index])))
415 if (WARN_ON(tb_pci_port_is_enabled(&sw->ports[index])))
418 return &sw->ports[index];
422 return tb_find_unused_port(sw, TB_TYPE_PCIE_DOWN);
425 static void tb_tunnel_dp(struct tb *tb)
427 struct tb_cm *tcm = tb_priv(tb);
428 struct tb_port *port, *in, *out;
429 struct tb_tunnel *tunnel;
432 * Find pair of inactive DP IN and DP OUT adapters and then
433 * establish a DP tunnel between them.
435 tb_dbg(tb, "looking for DP IN <-> DP OUT pairs:\n");
439 list_for_each_entry(port, &tcm->dp_resources, list) {
440 if (tb_port_is_enabled(port)) {
441 tb_port_dbg(port, "in use\n");
445 tb_port_dbg(port, "available\n");
447 if (!in && tb_port_is_dpin(port))
449 else if (!out && tb_port_is_dpout(port))
454 tb_dbg(tb, "no suitable DP IN adapter available, not tunneling\n");
458 tb_dbg(tb, "no suitable DP OUT adapter available, not tunneling\n");
462 if (tb_switch_alloc_dp_resource(in->sw, in)) {
463 tb_port_dbg(in, "no resource available for DP IN, not tunneling\n");
467 tunnel = tb_tunnel_alloc_dp(tb, in, out);
469 tb_port_dbg(out, "could not allocate DP tunnel\n");
473 if (tb_tunnel_activate(tunnel)) {
474 tb_port_info(out, "DP tunnel activation failed, aborting\n");
475 tb_tunnel_free(tunnel);
479 list_add_tail(&tunnel->list, &tcm->tunnel_list);
483 tb_switch_dealloc_dp_resource(in->sw, in);
486 static void tb_dp_resource_unavailable(struct tb *tb, struct tb_port *port)
488 struct tb_port *in, *out;
489 struct tb_tunnel *tunnel;
491 if (tb_port_is_dpin(port)) {
492 tb_port_dbg(port, "DP IN resource unavailable\n");
496 tb_port_dbg(port, "DP OUT resource unavailable\n");
501 tunnel = tb_find_tunnel(tb, TB_TUNNEL_DP, in, out);
502 tb_deactivate_and_free_tunnel(tunnel);
503 list_del_init(&port->list);
506 * See if there is another DP OUT port that can be used for
507 * to create another tunnel.
512 static void tb_dp_resource_available(struct tb *tb, struct tb_port *port)
514 struct tb_cm *tcm = tb_priv(tb);
517 if (tb_port_is_enabled(port))
520 list_for_each_entry(p, &tcm->dp_resources, list) {
525 tb_port_dbg(port, "DP %s resource available\n",
526 tb_port_is_dpin(port) ? "IN" : "OUT");
527 list_add_tail(&port->list, &tcm->dp_resources);
529 /* Look for suitable DP IN <-> DP OUT pairs now */
533 static int tb_tunnel_pci(struct tb *tb, struct tb_switch *sw)
535 struct tb_port *up, *down, *port;
536 struct tb_cm *tcm = tb_priv(tb);
537 struct tb_switch *parent_sw;
538 struct tb_tunnel *tunnel;
540 up = tb_find_port(sw, TB_TYPE_PCIE_UP);
545 * Look up available down port. Since we are chaining it should
546 * be found right above this switch.
548 parent_sw = tb_to_switch(sw->dev.parent);
549 port = tb_port_at(tb_route(sw), parent_sw);
550 down = tb_find_pcie_down(parent_sw, port);
554 tunnel = tb_tunnel_alloc_pci(tb, up, down);
558 if (tb_tunnel_activate(tunnel)) {
560 "PCIe tunnel activation failed, aborting\n");
561 tb_tunnel_free(tunnel);
565 list_add_tail(&tunnel->list, &tcm->tunnel_list);
569 static int tb_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd)
571 struct tb_cm *tcm = tb_priv(tb);
572 struct tb_port *nhi_port, *dst_port;
573 struct tb_tunnel *tunnel;
574 struct tb_switch *sw;
576 sw = tb_to_switch(xd->dev.parent);
577 dst_port = tb_port_at(xd->route, sw);
578 nhi_port = tb_find_port(tb->root_switch, TB_TYPE_NHI);
580 mutex_lock(&tb->lock);
581 tunnel = tb_tunnel_alloc_dma(tb, nhi_port, dst_port, xd->transmit_ring,
582 xd->transmit_path, xd->receive_ring,
585 mutex_unlock(&tb->lock);
589 if (tb_tunnel_activate(tunnel)) {
590 tb_port_info(nhi_port,
591 "DMA tunnel activation failed, aborting\n");
592 tb_tunnel_free(tunnel);
593 mutex_unlock(&tb->lock);
597 list_add_tail(&tunnel->list, &tcm->tunnel_list);
598 mutex_unlock(&tb->lock);
602 static void __tb_disconnect_xdomain_paths(struct tb *tb, struct tb_xdomain *xd)
604 struct tb_port *dst_port;
605 struct tb_tunnel *tunnel;
606 struct tb_switch *sw;
608 sw = tb_to_switch(xd->dev.parent);
609 dst_port = tb_port_at(xd->route, sw);
612 * It is possible that the tunnel was already teared down (in
613 * case of cable disconnect) so it is fine if we cannot find it
616 tunnel = tb_find_tunnel(tb, TB_TUNNEL_DMA, NULL, dst_port);
617 tb_deactivate_and_free_tunnel(tunnel);
620 static int tb_disconnect_xdomain_paths(struct tb *tb, struct tb_xdomain *xd)
622 if (!xd->is_unplugged) {
623 mutex_lock(&tb->lock);
624 __tb_disconnect_xdomain_paths(tb, xd);
625 mutex_unlock(&tb->lock);
630 /* hotplug handling */
633 * tb_handle_hotplug() - handle hotplug event
635 * Executes on tb->wq.
637 static void tb_handle_hotplug(struct work_struct *work)
639 struct tb_hotplug_event *ev = container_of(work, typeof(*ev), work);
640 struct tb *tb = ev->tb;
641 struct tb_cm *tcm = tb_priv(tb);
642 struct tb_switch *sw;
643 struct tb_port *port;
644 mutex_lock(&tb->lock);
645 if (!tcm->hotplug_active)
646 goto out; /* during init, suspend or shutdown */
648 sw = tb_switch_find_by_route(tb, ev->route);
651 "hotplug event from non existent switch %llx:%x (unplug: %d)\n",
652 ev->route, ev->port, ev->unplug);
655 if (ev->port > sw->config.max_port_number) {
657 "hotplug event from non existent port %llx:%x (unplug: %d)\n",
658 ev->route, ev->port, ev->unplug);
661 port = &sw->ports[ev->port];
662 if (tb_is_upstream_port(port)) {
663 tb_dbg(tb, "hotplug event for upstream port %llx:%x (unplug: %d)\n",
664 ev->route, ev->port, ev->unplug);
668 if (tb_port_has_remote(port)) {
669 tb_port_dbg(port, "switch unplugged\n");
670 tb_sw_set_unplugged(port->remote->sw);
671 tb_free_invalid_tunnels(tb);
672 tb_remove_dp_resources(port->remote->sw);
673 tb_switch_lane_bonding_disable(port->remote->sw);
674 tb_switch_remove(port->remote->sw);
676 if (port->dual_link_port)
677 port->dual_link_port->remote = NULL;
678 /* Maybe we can create another DP tunnel */
680 } else if (port->xdomain) {
681 struct tb_xdomain *xd = tb_xdomain_get(port->xdomain);
683 tb_port_dbg(port, "xdomain unplugged\n");
685 * Service drivers are unbound during
686 * tb_xdomain_remove() so setting XDomain as
687 * unplugged here prevents deadlock if they call
688 * tb_xdomain_disable_paths(). We will tear down
691 xd->is_unplugged = true;
692 tb_xdomain_remove(xd);
693 port->xdomain = NULL;
694 __tb_disconnect_xdomain_paths(tb, xd);
696 } else if (tb_port_is_dpout(port) || tb_port_is_dpin(port)) {
697 tb_dp_resource_unavailable(tb, port);
700 "got unplug event for disconnected port, ignoring\n");
702 } else if (port->remote) {
703 tb_port_dbg(port, "got plug event for connected port, ignoring\n");
705 if (tb_port_is_null(port)) {
706 tb_port_dbg(port, "hotplug: scanning\n");
709 tb_port_dbg(port, "hotplug: no switch found\n");
710 } else if (tb_port_is_dpout(port) || tb_port_is_dpin(port)) {
711 tb_dp_resource_available(tb, port);
718 mutex_unlock(&tb->lock);
723 * tb_schedule_hotplug_handler() - callback function for the control channel
725 * Delegates to tb_handle_hotplug.
727 static void tb_handle_event(struct tb *tb, enum tb_cfg_pkg_type type,
728 const void *buf, size_t size)
730 const struct cfg_event_pkg *pkg = buf;
733 if (type != TB_CFG_PKG_EVENT) {
734 tb_warn(tb, "unexpected event %#x, ignoring\n", type);
738 route = tb_cfg_get_route(&pkg->header);
740 if (tb_cfg_error(tb->ctl, route, pkg->port,
741 TB_CFG_ERROR_ACK_PLUG_EVENT)) {
742 tb_warn(tb, "could not ack plug event on %llx:%x\n", route,
746 tb_queue_hotplug(tb, route, pkg->port, pkg->unplug);
749 static void tb_stop(struct tb *tb)
751 struct tb_cm *tcm = tb_priv(tb);
752 struct tb_tunnel *tunnel;
755 /* tunnels are only present after everything has been initialized */
756 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list) {
758 * DMA tunnels require the driver to be functional so we
759 * tear them down. Other protocol tunnels can be left
762 if (tb_tunnel_is_dma(tunnel))
763 tb_tunnel_deactivate(tunnel);
764 tb_tunnel_free(tunnel);
766 tb_switch_remove(tb->root_switch);
767 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */
770 static int tb_scan_finalize_switch(struct device *dev, void *data)
772 if (tb_is_switch(dev)) {
773 struct tb_switch *sw = tb_to_switch(dev);
776 * If we found that the switch was already setup by the
777 * boot firmware, mark it as authorized now before we
778 * send uevent to userspace.
783 dev_set_uevent_suppress(dev, false);
784 kobject_uevent(&dev->kobj, KOBJ_ADD);
785 device_for_each_child(dev, NULL, tb_scan_finalize_switch);
791 static int tb_start(struct tb *tb)
793 struct tb_cm *tcm = tb_priv(tb);
796 tb->root_switch = tb_switch_alloc(tb, &tb->dev, 0);
797 if (IS_ERR(tb->root_switch))
798 return PTR_ERR(tb->root_switch);
801 * ICM firmware upgrade needs running firmware and in native
802 * mode that is not available so disable firmware upgrade of the
805 tb->root_switch->no_nvm_upgrade = true;
807 ret = tb_switch_configure(tb->root_switch);
809 tb_switch_put(tb->root_switch);
813 /* Announce the switch to the world */
814 ret = tb_switch_add(tb->root_switch);
816 tb_switch_put(tb->root_switch);
820 /* Full scan to discover devices added before the driver was loaded. */
821 tb_scan_switch(tb->root_switch);
822 /* Find out tunnels created by the boot firmware */
823 tb_discover_tunnels(tb->root_switch);
824 /* Add DP IN resources for the root switch */
825 tb_add_dp_resources(tb->root_switch);
826 /* Make the discovered switches available to the userspace */
827 device_for_each_child(&tb->root_switch->dev, NULL,
828 tb_scan_finalize_switch);
830 /* Allow tb_handle_hotplug to progress events */
831 tcm->hotplug_active = true;
835 static int tb_suspend_noirq(struct tb *tb)
837 struct tb_cm *tcm = tb_priv(tb);
839 tb_dbg(tb, "suspending...\n");
840 tb_switch_suspend(tb->root_switch);
841 tcm->hotplug_active = false; /* signal tb_handle_hotplug to quit */
842 tb_dbg(tb, "suspend finished\n");
847 static void tb_restore_children(struct tb_switch *sw)
849 struct tb_port *port;
851 tb_switch_for_each_port(sw, port) {
852 if (!tb_port_has_remote(port))
855 if (tb_switch_lane_bonding_enable(port->remote->sw))
856 dev_warn(&sw->dev, "failed to restore lane bonding\n");
858 tb_restore_children(port->remote->sw);
862 static int tb_resume_noirq(struct tb *tb)
864 struct tb_cm *tcm = tb_priv(tb);
865 struct tb_tunnel *tunnel, *n;
867 tb_dbg(tb, "resuming...\n");
869 /* remove any pci devices the firmware might have setup */
870 tb_switch_reset(tb, 0);
872 tb_switch_resume(tb->root_switch);
873 tb_free_invalid_tunnels(tb);
874 tb_free_unplugged_children(tb->root_switch);
875 tb_restore_children(tb->root_switch);
876 list_for_each_entry_safe(tunnel, n, &tcm->tunnel_list, list)
877 tb_tunnel_restart(tunnel);
878 if (!list_empty(&tcm->tunnel_list)) {
880 * the pcie links need some time to get going.
881 * 100ms works for me...
883 tb_dbg(tb, "tunnels restarted, sleeping for 100ms\n");
886 /* Allow tb_handle_hotplug to progress events */
887 tcm->hotplug_active = true;
888 tb_dbg(tb, "resume finished\n");
893 static int tb_free_unplugged_xdomains(struct tb_switch *sw)
895 struct tb_port *port;
898 tb_switch_for_each_port(sw, port) {
899 if (tb_is_upstream_port(port))
901 if (port->xdomain && port->xdomain->is_unplugged) {
902 tb_xdomain_remove(port->xdomain);
903 port->xdomain = NULL;
905 } else if (port->remote) {
906 ret += tb_free_unplugged_xdomains(port->remote->sw);
913 static void tb_complete(struct tb *tb)
916 * Release any unplugged XDomains and if there is a case where
917 * another domain is swapped in place of unplugged XDomain we
918 * need to run another rescan.
920 mutex_lock(&tb->lock);
921 if (tb_free_unplugged_xdomains(tb->root_switch))
922 tb_scan_switch(tb->root_switch);
923 mutex_unlock(&tb->lock);
926 static const struct tb_cm_ops tb_cm_ops = {
929 .suspend_noirq = tb_suspend_noirq,
930 .resume_noirq = tb_resume_noirq,
931 .complete = tb_complete,
932 .handle_event = tb_handle_event,
933 .approve_switch = tb_tunnel_pci,
934 .approve_xdomain_paths = tb_approve_xdomain_paths,
935 .disconnect_xdomain_paths = tb_disconnect_xdomain_paths,
938 struct tb *tb_probe(struct tb_nhi *nhi)
943 if (!x86_apple_machine)
946 tb = tb_domain_alloc(nhi, sizeof(*tcm));
950 tb->security_level = TB_SECURITY_USER;
951 tb->cm_ops = &tb_cm_ops;
954 INIT_LIST_HEAD(&tcm->tunnel_list);
955 INIT_LIST_HEAD(&tcm->dp_resources);