Lines Matching +full:0 +full:xd

45 #define TBNET_L0_PORT_NUM(route) ((route) & GENMASK(5, 0))
56 * supported then @frame_id is filled, otherwise it stays %0.
88 #define TBIP_HDR_LENGTH_MASK GENMASK(5, 0)
147 * @xd: XDomain the service blongs to
178 struct tb_xdomain *xd; member
202 UUID_INIT(0xc66189ca, 0x1cce, 0x4195,
203 0xbd, 0xb8, 0x49, 0x59, 0x2e, 0x5f, 0x5a, 0x4f);
207 UUID_INIT(0x798f589e, 0x3616, 0x8a47,
208 0x97, 0xc6, 0x56, 0x64, 0xa9, 0x20, 0xc8, 0xdd);
236 struct tb_xdomain *xd = net->xd; in tbnet_login_response() local
238 memset(&reply, 0, sizeof(reply)); in tbnet_login_response()
239 tbnet_fill_header(&reply.hdr, route, sequence, xd->local_uuid, in tbnet_login_response()
240 xd->remote_uuid, TBIP_LOGIN_RESPONSE, sizeof(reply), in tbnet_login_response()
245 return tb_xdomain_response(xd, &reply, sizeof(reply), in tbnet_login_response()
253 struct tb_xdomain *xd = net->xd; in tbnet_login_request() local
255 memset(&request, 0, sizeof(request)); in tbnet_login_request()
256 tbnet_fill_header(&request.hdr, xd->route, sequence, xd->local_uuid, in tbnet_login_request()
257 xd->remote_uuid, TBIP_LOGIN, sizeof(request), in tbnet_login_request()
263 return tb_xdomain_request(xd, &request, sizeof(request), in tbnet_login_request()
273 struct tb_xdomain *xd = net->xd; in tbnet_logout_response() local
275 memset(&reply, 0, sizeof(reply)); in tbnet_logout_response()
276 tbnet_fill_header(&reply.hdr, route, sequence, xd->local_uuid, in tbnet_logout_response()
277 xd->remote_uuid, TBIP_STATUS, sizeof(reply), in tbnet_logout_response()
279 return tb_xdomain_response(xd, &reply, sizeof(reply), in tbnet_logout_response()
287 struct tb_xdomain *xd = net->xd; in tbnet_logout_request() local
289 memset(&request, 0, sizeof(request)); in tbnet_logout_request()
290 tbnet_fill_header(&request.hdr, xd->route, 0, xd->local_uuid, in tbnet_logout_request()
291 xd->remote_uuid, TBIP_LOGOUT, sizeof(request), in tbnet_logout_request()
294 return tb_xdomain_request(xd, &request, sizeof(request), in tbnet_logout_request()
326 for (i = 0; i < TBNET_RING_SIZE; i++) { in tbnet_free_buffers()
338 order = 0; in tbnet_free_buffers()
354 ring->cons = 0; in tbnet_free_buffers()
355 ring->prod = 0; in tbnet_free_buffers()
370 while (send_logout && retries-- > 0) { in tbnet_tear_down()
381 ret = tb_xdomain_disable_paths(net->xd, in tbnet_tear_down()
389 tb_xdomain_release_in_hopid(net->xd, net->remote_transmit_path); in tbnet_tear_down()
390 net->remote_transmit_path = 0; in tbnet_tear_down()
393 net->login_retries = 0; in tbnet_tear_down()
405 int ret = 0; in tbnet_handle_packet()
411 return 0; in tbnet_handle_packet()
412 if (!uuid_equal(&pkg->hdr.initiator_uuid, net->xd->remote_uuid)) in tbnet_handle_packet()
413 return 0; in tbnet_handle_packet()
414 if (!uuid_equal(&pkg->hdr.target_uuid, net->xd->local_uuid)) in tbnet_handle_packet()
415 return 0; in tbnet_handle_packet()
419 if (route != net->xd->route) in tbnet_handle_packet()
420 return 0; in tbnet_handle_packet()
444 net->login_retries = 0; in tbnet_handle_packet()
446 &net->login_work, 0); in tbnet_handle_packet()
461 return 0; in tbnet_handle_packet()
489 /* Allocate page (order > 0) so that it can hold maximum in tbnet_alloc_rx_buffers()
499 dma_addr = dma_map_page(dma_dev, tf->page, 0, in tbnet_alloc_rx_buffers()
514 return 0; in tbnet_alloc_rx_buffers()
534 tf->frame.size = 0; in tbnet_get_tx_buffer()
561 for (i = 0; i < TBNET_RING_SIZE; i++) { in tbnet_alloc_tx_buffers()
571 dma_addr = dma_map_page(dma_dev, tf->page, 0, TBNET_FRAME_SIZE, in tbnet_alloc_tx_buffers()
587 ring->cons = 0; in tbnet_alloc_tx_buffers()
590 return 0; in tbnet_alloc_tx_buffers()
609 ret = tb_xdomain_alloc_in_hopid(net->xd, net->remote_transmit_path); in tbnet_connected_work()
618 ret = tb_xdomain_enable_paths(net->xd, net->local_transmit_path, in tbnet_connected_work()
647 tb_xdomain_release_in_hopid(net->xd, net->remote_transmit_path); in tbnet_connected_work()
668 net->login_retries = 0; in tbnet_login_work()
744 if (frame_count == 0 || frame_count > TBNET_RING_SIZE / 4) { in tbnet_check_frame()
748 if (frame_index != 0) { in tbnet_check_frame()
761 unsigned int rx_packets = 0; in tbnet_poll()
779 cleaned_count = 0; in tbnet_poll()
867 struct tb_xdomain *xd = net->xd; in tbnet_open() local
874 ring = tb_ring_alloc_tx(xd->tb->nhi, -1, TBNET_RING_SIZE, in tbnet_open()
882 hopid = tb_xdomain_alloc_out_hopid(xd, -1); in tbnet_open()
883 if (hopid < 0) { in tbnet_open()
894 ring = tb_ring_alloc_rx(xd->tb->nhi, -1, TBNET_RING_SIZE, in tbnet_open()
895 RING_FLAG_FRAME, 0, sof_mask, eof_mask, in tbnet_open()
908 return 0; in tbnet_open()
923 tb_xdomain_release_out_hopid(net->xd, net->local_transmit_path); in tbnet_stop()
927 return 0; in tbnet_stop()
933 struct thunderbolt_ip_frame_header *hdr = page_address(frames[0]->page); in tbnet_xmit_csum_and_map()
946 for (i = 0; i < frame_count; i++) { in tbnet_xmit_csum_and_map()
975 *ipcso = 0; in tbnet_xmit_csum_and_map()
987 ip_hdr(skb)->daddr, 0, in tbnet_xmit_csum_and_map()
988 ip_hdr(skb)->protocol, 0); in tbnet_xmit_csum_and_map()
992 &ipv6_hdr(skb)->daddr, 0, in tbnet_xmit_csum_and_map()
993 IPPROTO_TCP, 0); in tbnet_xmit_csum_and_map()
998 &ipv6_hdr(skb)->daddr, 0, in tbnet_xmit_csum_and_map()
999 ipv6_hdr(skb)->nexthdr, 0); in tbnet_xmit_csum_and_map()
1007 for (i = 0; i < frame_count; i++) { in tbnet_xmit_csum_and_map()
1014 offset = 0; in tbnet_xmit_csum_and_map()
1022 for (i = 0; i < frame_count; i++) { in tbnet_xmit_csum_and_map()
1049 unsigned int frag = 0; in tbnet_start_xmit()
1051 u32 frame_index = 0; in tbnet_start_xmit()
1103 } else if (unlikely(size_left > 0)) { in tbnet_start_xmit()
1106 } while (size_left > 0); in tbnet_start_xmit()
1139 } else if (unlikely(data_len > 0)) { in tbnet_start_xmit()
1152 for (i = 0; i < frame_index + 1; i++) in tbnet_start_xmit()
1204 const struct tb_xdomain *xd = net->xd; in tbnet_generate_mac() local
1208 phy_port = tb_phy_port_from_link(TBNET_L0_PORT_NUM(xd->route)); in tbnet_generate_mac()
1211 dev->dev_addr[0] = phy_port << 4 | 0x02; in tbnet_generate_mac()
1212 hash = jhash2((u32 *)xd->local_uuid, 4, 0); in tbnet_generate_mac()
1214 hash = jhash2((u32 *)xd->local_uuid, 4, hash); in tbnet_generate_mac()
1215 dev->dev_addr[5] = hash & 0xff; in tbnet_generate_mac()
1220 struct tb_xdomain *xd = tb_service_parent(svc); in tbnet_probe() local
1236 atomic_set(&net->command_id, 0); in tbnet_probe()
1237 atomic_set(&net->frame_id, 0); in tbnet_probe()
1240 net->xd = xd; in tbnet_probe()
1285 return 0; in tbnet_probe()
1314 return 0; in tbnet_suspend()
1330 return 0; in tbnet_resume()
1366 /* Currently only announce support for match frags ID (bit 1). Bit 0 in tbnet_init()