Lines Matching refs:path
183 static int tb_pci_init_path(struct tb_path *path) in tb_pci_init_path() argument
187 path->egress_fc_enable = TB_PATH_SOURCE | TB_PATH_INTERNAL; in tb_pci_init_path()
188 path->egress_shared_buffer = TB_PATH_NONE; in tb_pci_init_path()
189 path->ingress_fc_enable = TB_PATH_ALL; in tb_pci_init_path()
190 path->ingress_shared_buffer = TB_PATH_NONE; in tb_pci_init_path()
191 path->priority = 3; in tb_pci_init_path()
192 path->weight = 1; in tb_pci_init_path()
193 path->drop_packages = 0; in tb_pci_init_path()
195 tb_path_for_each_hop(path, hop) { in tb_pci_init_path()
218 struct tb_path *path; in tb_tunnel_discover_pci() local
235 path = tb_path_discover(down, TB_PCI_HOPID, NULL, -1, in tb_tunnel_discover_pci()
237 if (!path) { in tb_tunnel_discover_pci()
242 tunnel->paths[TB_PCI_PATH_UP] = path; in tb_tunnel_discover_pci()
246 path = tb_path_discover(tunnel->dst_port, -1, down, TB_PCI_HOPID, NULL, in tb_tunnel_discover_pci()
248 if (!path) in tb_tunnel_discover_pci()
250 tunnel->paths[TB_PCI_PATH_DOWN] = path; in tb_tunnel_discover_pci()
298 struct tb_path *path; in tb_tunnel_alloc_pci() local
308 path = tb_path_alloc(tb, down, TB_PCI_HOPID, up, TB_PCI_HOPID, 0, in tb_tunnel_alloc_pci()
310 if (!path) in tb_tunnel_alloc_pci()
312 tunnel->paths[TB_PCI_PATH_DOWN] = path; in tb_tunnel_alloc_pci()
313 if (tb_pci_init_path(path)) in tb_tunnel_alloc_pci()
316 path = tb_path_alloc(tb, up, TB_PCI_HOPID, down, TB_PCI_HOPID, 0, in tb_tunnel_alloc_pci()
318 if (!path) in tb_tunnel_alloc_pci()
320 tunnel->paths[TB_PCI_PATH_UP] = path; in tb_tunnel_alloc_pci()
321 if (tb_pci_init_path(path)) in tb_tunnel_alloc_pci()
694 static void tb_dp_init_aux_path(struct tb_path *path) in tb_dp_init_aux_path() argument
698 path->egress_fc_enable = TB_PATH_SOURCE | TB_PATH_INTERNAL; in tb_dp_init_aux_path()
699 path->egress_shared_buffer = TB_PATH_NONE; in tb_dp_init_aux_path()
700 path->ingress_fc_enable = TB_PATH_ALL; in tb_dp_init_aux_path()
701 path->ingress_shared_buffer = TB_PATH_NONE; in tb_dp_init_aux_path()
702 path->priority = 2; in tb_dp_init_aux_path()
703 path->weight = 1; in tb_dp_init_aux_path()
705 tb_path_for_each_hop(path, hop) in tb_dp_init_aux_path()
738 static int tb_dp_init_video_path(struct tb_path *path) in tb_dp_init_video_path() argument
742 path->egress_fc_enable = TB_PATH_NONE; in tb_dp_init_video_path()
743 path->egress_shared_buffer = TB_PATH_NONE; in tb_dp_init_video_path()
744 path->ingress_fc_enable = TB_PATH_NONE; in tb_dp_init_video_path()
745 path->ingress_shared_buffer = TB_PATH_NONE; in tb_dp_init_video_path()
746 path->priority = 1; in tb_dp_init_video_path()
747 path->weight = 1; in tb_dp_init_video_path()
749 tb_path_for_each_hop(path, hop) { in tb_dp_init_video_path()
775 struct tb_path *path; in tb_tunnel_discover_dp() local
789 path = tb_path_discover(in, TB_DP_VIDEO_HOPID, NULL, -1, in tb_tunnel_discover_dp()
791 if (!path) { in tb_tunnel_discover_dp()
796 tunnel->paths[TB_DP_VIDEO_PATH_OUT] = path; in tb_tunnel_discover_dp()
800 path = tb_path_discover(in, TB_DP_AUX_TX_HOPID, NULL, -1, NULL, "AUX TX"); in tb_tunnel_discover_dp()
801 if (!path) in tb_tunnel_discover_dp()
803 tunnel->paths[TB_DP_AUX_PATH_OUT] = path; in tb_tunnel_discover_dp()
806 path = tb_path_discover(tunnel->dst_port, -1, in, TB_DP_AUX_RX_HOPID, in tb_tunnel_discover_dp()
808 if (!path) in tb_tunnel_discover_dp()
810 tunnel->paths[TB_DP_AUX_PATH_IN] = path; in tb_tunnel_discover_dp()
862 struct tb_path *path; in tb_tunnel_alloc_dp() local
881 path = tb_path_alloc(tb, in, TB_DP_VIDEO_HOPID, out, TB_DP_VIDEO_HOPID, in tb_tunnel_alloc_dp()
883 if (!path) in tb_tunnel_alloc_dp()
885 tb_dp_init_video_path(path); in tb_tunnel_alloc_dp()
886 paths[TB_DP_VIDEO_PATH_OUT] = path; in tb_tunnel_alloc_dp()
888 path = tb_path_alloc(tb, in, TB_DP_AUX_TX_HOPID, out, in tb_tunnel_alloc_dp()
890 if (!path) in tb_tunnel_alloc_dp()
892 tb_dp_init_aux_path(path); in tb_tunnel_alloc_dp()
893 paths[TB_DP_AUX_PATH_OUT] = path; in tb_tunnel_alloc_dp()
895 path = tb_path_alloc(tb, out, TB_DP_AUX_RX_HOPID, in, in tb_tunnel_alloc_dp()
897 if (!path) in tb_tunnel_alloc_dp()
899 tb_dp_init_aux_path(path); in tb_tunnel_alloc_dp()
900 paths[TB_DP_AUX_PATH_IN] = path; in tb_tunnel_alloc_dp()
955 static int tb_dma_init_rx_path(struct tb_path *path, unsigned int credits) in tb_dma_init_rx_path() argument
960 path->egress_fc_enable = TB_PATH_SOURCE | TB_PATH_INTERNAL; in tb_dma_init_rx_path()
961 path->ingress_fc_enable = TB_PATH_ALL; in tb_dma_init_rx_path()
962 path->egress_shared_buffer = TB_PATH_NONE; in tb_dma_init_rx_path()
963 path->ingress_shared_buffer = TB_PATH_NONE; in tb_dma_init_rx_path()
964 path->priority = 5; in tb_dma_init_rx_path()
965 path->weight = 1; in tb_dma_init_rx_path()
966 path->clear_fc = true; in tb_dma_init_rx_path()
973 hop = &path->hops[0]; in tb_dma_init_rx_path()
978 for (i = 1; i < path->path_length; i++) { in tb_dma_init_rx_path()
981 ret = tb_dma_reserve_credits(&path->hops[i], credits); in tb_dma_init_rx_path()
990 static int tb_dma_init_tx_path(struct tb_path *path, unsigned int credits) in tb_dma_init_tx_path() argument
994 path->egress_fc_enable = TB_PATH_ALL; in tb_dma_init_tx_path()
995 path->ingress_fc_enable = TB_PATH_ALL; in tb_dma_init_tx_path()
996 path->egress_shared_buffer = TB_PATH_NONE; in tb_dma_init_tx_path()
997 path->ingress_shared_buffer = TB_PATH_NONE; in tb_dma_init_tx_path()
998 path->priority = 5; in tb_dma_init_tx_path()
999 path->weight = 1; in tb_dma_init_tx_path()
1000 path->clear_fc = true; in tb_dma_init_tx_path()
1002 tb_path_for_each_hop(path, hop) { in tb_dma_init_tx_path()
1025 static void tb_dma_deinit_path(struct tb_path *path) in tb_dma_deinit_path() argument
1029 tb_path_for_each_hop(path, hop) in tb_dma_deinit_path()
1065 struct tb_path *path; in tb_tunnel_alloc_dma() local
1087 path = tb_path_alloc(tb, dst, receive_path, nhi, receive_ring, 0, in tb_tunnel_alloc_dma()
1089 if (!path) in tb_tunnel_alloc_dma()
1091 tunnel->paths[i++] = path; in tb_tunnel_alloc_dma()
1092 if (tb_dma_init_rx_path(path, credits)) { in tb_tunnel_alloc_dma()
1099 path = tb_path_alloc(tb, nhi, transmit_ring, dst, transmit_path, 0, in tb_tunnel_alloc_dma()
1101 if (!path) in tb_tunnel_alloc_dma()
1103 tunnel->paths[i++] = path; in tb_tunnel_alloc_dma()
1104 if (tb_dma_init_tx_path(path, credits)) { in tb_tunnel_alloc_dma()
1141 const struct tb_path *path = tunnel->paths[i]; in tb_tunnel_match_dma() local
1143 if (!path) in tb_tunnel_match_dma()
1146 if (tb_port_is_nhi(path->hops[0].in_port)) in tb_tunnel_match_dma()
1147 tx_path = path; in tb_tunnel_match_dma()
1148 else if (tb_port_is_nhi(path->hops[path->path_length - 1].out_port)) in tb_tunnel_match_dma()
1149 rx_path = path; in tb_tunnel_match_dma()
1326 static void tb_usb3_init_path(struct tb_path *path) in tb_usb3_init_path() argument
1330 path->egress_fc_enable = TB_PATH_SOURCE | TB_PATH_INTERNAL; in tb_usb3_init_path()
1331 path->egress_shared_buffer = TB_PATH_NONE; in tb_usb3_init_path()
1332 path->ingress_fc_enable = TB_PATH_ALL; in tb_usb3_init_path()
1333 path->ingress_shared_buffer = TB_PATH_NONE; in tb_usb3_init_path()
1334 path->priority = 3; in tb_usb3_init_path()
1335 path->weight = 3; in tb_usb3_init_path()
1336 path->drop_packages = 0; in tb_usb3_init_path()
1338 tb_path_for_each_hop(path, hop) in tb_usb3_init_path()
1354 struct tb_path *path; in tb_tunnel_discover_usb3() local
1371 path = tb_path_discover(down, TB_USB3_HOPID, NULL, -1, in tb_tunnel_discover_usb3()
1373 if (!path) { in tb_tunnel_discover_usb3()
1378 tunnel->paths[TB_USB3_PATH_DOWN] = path; in tb_tunnel_discover_usb3()
1381 path = tb_path_discover(tunnel->dst_port, -1, down, TB_USB3_HOPID, NULL, in tb_tunnel_discover_usb3()
1383 if (!path) in tb_tunnel_discover_usb3()
1385 tunnel->paths[TB_USB3_PATH_UP] = path; in tb_tunnel_discover_usb3()
1460 struct tb_path *path; in tb_tunnel_alloc_usb3() local
1493 path = tb_path_alloc(tb, down, TB_USB3_HOPID, up, TB_USB3_HOPID, 0, in tb_tunnel_alloc_usb3()
1495 if (!path) { in tb_tunnel_alloc_usb3()
1499 tb_usb3_init_path(path); in tb_tunnel_alloc_usb3()
1500 tunnel->paths[TB_USB3_PATH_DOWN] = path; in tb_tunnel_alloc_usb3()
1502 path = tb_path_alloc(tb, up, TB_USB3_HOPID, down, TB_USB3_HOPID, 0, in tb_tunnel_alloc_usb3()
1504 if (!path) { in tb_tunnel_alloc_usb3()
1508 tb_usb3_init_path(path); in tb_tunnel_alloc_usb3()
1509 tunnel->paths[TB_USB3_PATH_UP] = path; in tb_tunnel_alloc_usb3()