Lines Matching +full:0 +full:xd

34 #define TBNET_E2E		BIT(0)
47 #define TBNET_L0_PORT_NUM(route) ((route) & GENMASK(5, 0))
58 * supported then @frame_id is filled, otherwise it stays %0.
90 #define TBIP_HDR_LENGTH_MASK GENMASK(5, 0)
149 * @xd: XDomain the service blongs to
180 struct tb_xdomain *xd; member
204 UUID_INIT(0xc66189ca, 0x1cce, 0x4195,
205 0xbd, 0xb8, 0x49, 0x59, 0x2e, 0x5f, 0x5a, 0x4f);
209 UUID_INIT(0x798f589e, 0x3616, 0x8a47,
210 0x97, 0xc6, 0x56, 0x64, 0xa9, 0x20, 0xc8, 0xdd);
242 struct tb_xdomain *xd = net->xd; in tbnet_login_response() local
244 memset(&reply, 0, sizeof(reply)); in tbnet_login_response()
245 tbnet_fill_header(&reply.hdr, route, sequence, xd->local_uuid, in tbnet_login_response()
246 xd->remote_uuid, TBIP_LOGIN_RESPONSE, sizeof(reply), in tbnet_login_response()
251 return tb_xdomain_response(xd, &reply, sizeof(reply), in tbnet_login_response()
259 struct tb_xdomain *xd = net->xd; in tbnet_login_request() local
261 memset(&request, 0, sizeof(request)); in tbnet_login_request()
262 tbnet_fill_header(&request.hdr, xd->route, sequence, xd->local_uuid, in tbnet_login_request()
263 xd->remote_uuid, TBIP_LOGIN, sizeof(request), in tbnet_login_request()
269 return tb_xdomain_request(xd, &request, sizeof(request), in tbnet_login_request()
279 struct tb_xdomain *xd = net->xd; in tbnet_logout_response() local
281 memset(&reply, 0, sizeof(reply)); in tbnet_logout_response()
282 tbnet_fill_header(&reply.hdr, route, sequence, xd->local_uuid, in tbnet_logout_response()
283 xd->remote_uuid, TBIP_STATUS, sizeof(reply), in tbnet_logout_response()
285 return tb_xdomain_response(xd, &reply, sizeof(reply), in tbnet_logout_response()
293 struct tb_xdomain *xd = net->xd; in tbnet_logout_request() local
295 memset(&request, 0, sizeof(request)); in tbnet_logout_request()
296 tbnet_fill_header(&request.hdr, xd->route, 0, xd->local_uuid, in tbnet_logout_request()
297 xd->remote_uuid, TBIP_LOGOUT, sizeof(request), in tbnet_logout_request()
300 return tb_xdomain_request(xd, &request, sizeof(request), in tbnet_logout_request()
332 for (i = 0; i < TBNET_RING_SIZE; i++) { in tbnet_free_buffers()
344 order = 0; in tbnet_free_buffers()
360 ring->cons = 0; in tbnet_free_buffers()
361 ring->prod = 0; in tbnet_free_buffers()
376 while (send_logout && retries-- > 0) { in tbnet_tear_down()
387 ret = tb_xdomain_disable_paths(net->xd, in tbnet_tear_down()
395 tb_xdomain_release_in_hopid(net->xd, net->remote_transmit_path); in tbnet_tear_down()
396 net->remote_transmit_path = 0; in tbnet_tear_down()
399 net->login_retries = 0; in tbnet_tear_down()
411 int ret = 0; in tbnet_handle_packet()
417 return 0; in tbnet_handle_packet()
418 if (!uuid_equal(&pkg->hdr.initiator_uuid, net->xd->remote_uuid)) in tbnet_handle_packet()
419 return 0; in tbnet_handle_packet()
420 if (!uuid_equal(&pkg->hdr.target_uuid, net->xd->local_uuid)) in tbnet_handle_packet()
421 return 0; in tbnet_handle_packet()
425 if (route != net->xd->route) in tbnet_handle_packet()
426 return 0; in tbnet_handle_packet()
450 net->login_retries = 0; in tbnet_handle_packet()
452 &net->login_work, 0); in tbnet_handle_packet()
467 return 0; in tbnet_handle_packet()
495 /* Allocate page (order > 0) so that it can hold maximum in tbnet_alloc_rx_buffers()
505 dma_addr = dma_map_page(dma_dev, tf->page, 0, in tbnet_alloc_rx_buffers()
520 return 0; in tbnet_alloc_rx_buffers()
540 tf->frame.size = 0; in tbnet_get_tx_buffer()
567 for (i = 0; i < TBNET_RING_SIZE; i++) { in tbnet_alloc_tx_buffers()
577 dma_addr = dma_map_page(dma_dev, tf->page, 0, TBNET_FRAME_SIZE, in tbnet_alloc_tx_buffers()
593 ring->cons = 0; in tbnet_alloc_tx_buffers()
596 return 0; in tbnet_alloc_tx_buffers()
615 ret = tb_xdomain_alloc_in_hopid(net->xd, net->remote_transmit_path); in tbnet_connected_work()
639 ret = tb_xdomain_enable_paths(net->xd, net->local_transmit_path, in tbnet_connected_work()
659 tb_xdomain_release_in_hopid(net->xd, net->remote_transmit_path); in tbnet_connected_work()
680 net->login_retries = 0; in tbnet_login_work()
756 if (frame_count == 0 || frame_count > TBNET_RING_SIZE / 4) { in tbnet_check_frame()
760 if (frame_index != 0) { in tbnet_check_frame()
773 unsigned int rx_packets = 0; in tbnet_poll()
791 cleaned_count = 0; in tbnet_poll()
879 struct tb_xdomain *xd = net->xd; in tbnet_open() local
887 ring = tb_ring_alloc_tx(xd->tb->nhi, -1, TBNET_RING_SIZE, in tbnet_open()
895 hopid = tb_xdomain_alloc_out_hopid(xd, -1); in tbnet_open()
896 if (hopid < 0) { in tbnet_open()
912 ring = tb_ring_alloc_rx(xd->tb->nhi, -1, TBNET_RING_SIZE, flags, in tbnet_open()
917 tb_xdomain_release_out_hopid(xd, hopid); in tbnet_open()
927 return 0; in tbnet_open()
942 tb_xdomain_release_out_hopid(net->xd, net->local_transmit_path); in tbnet_stop()
946 return 0; in tbnet_stop()
952 struct thunderbolt_ip_frame_header *hdr = page_address(frames[0]->page); in tbnet_xmit_csum_and_map()
965 for (i = 0; i < frame_count; i++) { in tbnet_xmit_csum_and_map()
994 *ipcso = 0; in tbnet_xmit_csum_and_map()
1006 ip_hdr(skb)->daddr, 0, in tbnet_xmit_csum_and_map()
1007 ip_hdr(skb)->protocol, 0); in tbnet_xmit_csum_and_map()
1011 &ipv6_hdr(skb)->daddr, 0, in tbnet_xmit_csum_and_map()
1012 IPPROTO_TCP, 0); in tbnet_xmit_csum_and_map()
1017 &ipv6_hdr(skb)->daddr, 0, in tbnet_xmit_csum_and_map()
1018 ipv6_hdr(skb)->nexthdr, 0); in tbnet_xmit_csum_and_map()
1026 for (i = 0; i < frame_count; i++) { in tbnet_xmit_csum_and_map()
1033 offset = 0; in tbnet_xmit_csum_and_map()
1041 for (i = 0; i < frame_count; i++) { in tbnet_xmit_csum_and_map()
1068 unsigned int frag = 0; in tbnet_start_xmit()
1070 u32 frame_index = 0; in tbnet_start_xmit()
1122 } else if (unlikely(size_left > 0)) { in tbnet_start_xmit()
1125 } while (size_left > 0); in tbnet_start_xmit()
1158 } else if (unlikely(data_len > 0)) { in tbnet_start_xmit()
1171 for (i = 0; i < frame_index + 1; i++) in tbnet_start_xmit()
1223 const struct tb_xdomain *xd = net->xd; in tbnet_generate_mac() local
1228 phy_port = tb_phy_port_from_link(TBNET_L0_PORT_NUM(xd->route)); in tbnet_generate_mac()
1231 addr[0] = phy_port << 4 | 0x02; in tbnet_generate_mac()
1232 hash = jhash2((u32 *)xd->local_uuid, 4, 0); in tbnet_generate_mac()
1234 hash = jhash2((u32 *)xd->local_uuid, 4, hash); in tbnet_generate_mac()
1235 addr[5] = hash & 0xff; in tbnet_generate_mac()
1241 struct tb_xdomain *xd = tb_service_parent(svc); in tbnet_probe() local
1257 atomic_set(&net->command_id, 0); in tbnet_probe()
1258 atomic_set(&net->frame_id, 0); in tbnet_probe()
1261 net->xd = xd; in tbnet_probe()
1306 return 0; in tbnet_probe()
1335 return 0; in tbnet_suspend()
1351 return 0; in tbnet_resume()
1402 return 0; in tbnet_init()