Lines Matching refs:pkt
40 struct vmci_transport_packet *pkt);
44 struct vmci_transport_packet *pkt);
47 struct vmci_transport_packet *pkt);
50 struct vmci_transport_packet *pkt);
53 struct vmci_transport_packet *pkt);
55 struct vmci_transport_packet *pkt);
65 struct vmci_transport_packet pkt; member
112 vmci_transport_packet_init(struct vmci_transport_packet *pkt, in vmci_transport_packet_init() argument
125 pkt->dg.src = vmci_make_handle(VMADDR_CID_ANY, in vmci_transport_packet_init()
127 pkt->dg.dst = vmci_make_handle(dst->svm_cid, in vmci_transport_packet_init()
129 pkt->dg.payload_size = sizeof(*pkt) - sizeof(pkt->dg); in vmci_transport_packet_init()
130 pkt->version = VMCI_TRANSPORT_PACKET_VERSION; in vmci_transport_packet_init()
131 pkt->type = type; in vmci_transport_packet_init()
132 pkt->src_port = src->svm_port; in vmci_transport_packet_init()
133 pkt->dst_port = dst->svm_port; in vmci_transport_packet_init()
134 memset(&pkt->proto, 0, sizeof(pkt->proto)); in vmci_transport_packet_init()
135 memset(&pkt->_reserved2, 0, sizeof(pkt->_reserved2)); in vmci_transport_packet_init()
137 switch (pkt->type) { in vmci_transport_packet_init()
139 pkt->u.size = 0; in vmci_transport_packet_init()
144 pkt->u.size = size; in vmci_transport_packet_init()
149 pkt->u.handle = handle; in vmci_transport_packet_init()
155 pkt->u.size = 0; in vmci_transport_packet_init()
159 pkt->u.mode = mode; in vmci_transport_packet_init()
164 memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait)); in vmci_transport_packet_init()
169 pkt->u.size = size; in vmci_transport_packet_init()
170 pkt->proto = proto; in vmci_transport_packet_init()
176 vmci_transport_packet_get_addresses(struct vmci_transport_packet *pkt, in vmci_transport_packet_get_addresses() argument
180 vsock_addr_init(local, pkt->dg.dst.context, pkt->dst_port); in vmci_transport_packet_get_addresses()
181 vsock_addr_init(remote, pkt->dg.src.context, pkt->src_port); in vmci_transport_packet_get_addresses()
185 __vmci_transport_send_control_pkt(struct vmci_transport_packet *pkt, in __vmci_transport_send_control_pkt() argument
198 vmci_transport_packet_init(pkt, src, dst, type, size, mode, wait, in __vmci_transport_send_control_pkt()
200 err = vmci_datagram_send(&pkt->dg); in __vmci_transport_send_control_pkt()
208 vmci_transport_reply_control_pkt_fast(struct vmci_transport_packet *pkt, in vmci_transport_reply_control_pkt_fast() argument
218 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) { in vmci_transport_reply_control_pkt_fast()
221 vmci_transport_packet_get_addresses(pkt, &src, &dst); in vmci_transport_reply_control_pkt_fast()
244 static struct vmci_transport_packet pkt; in vmci_transport_send_control_pkt_bh() local
246 return __vmci_transport_send_control_pkt(&pkt, src, dst, type, in vmci_transport_send_control_pkt_bh()
262 struct vmci_transport_packet *pkt; in vmci_transport_alloc_send_control_pkt() local
265 pkt = kmalloc(sizeof(*pkt), GFP_KERNEL); in vmci_transport_alloc_send_control_pkt()
266 if (!pkt) in vmci_transport_alloc_send_control_pkt()
269 err = __vmci_transport_send_control_pkt(pkt, src, dst, type, size, in vmci_transport_alloc_send_control_pkt()
272 kfree(pkt); in vmci_transport_alloc_send_control_pkt()
304 struct vmci_transport_packet *pkt) in vmci_transport_send_reset_bh() argument
306 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) in vmci_transport_send_reset_bh()
315 struct vmci_transport_packet *pkt) in vmci_transport_send_reset() argument
321 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) in vmci_transport_send_reset()
332 vsock_addr_init(&dst, pkt->dg.src.context, in vmci_transport_send_reset()
333 pkt->src_port); in vmci_transport_send_reset()
380 static int vmci_transport_reply_reset(struct vmci_transport_packet *pkt) in vmci_transport_reply_reset() argument
383 pkt, in vmci_transport_reply_reset()
480 struct vmci_transport_packet *pkt) in vmci_transport_get_pending() argument
487 vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port); in vmci_transport_get_pending()
494 pkt->dst_port == vpending->local_addr.svm_port) { in vmci_transport_get_pending()
676 struct vmci_transport_packet *pkt; in vmci_transport_recv_stream_cb() local
693 if (VMCI_DG_SIZE(dg) < sizeof(*pkt)) in vmci_transport_recv_stream_cb()
697 pkt = (struct vmci_transport_packet *)dg; in vmci_transport_recv_stream_cb()
703 vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port); in vmci_transport_recv_stream_cb()
704 vsock_addr_init(&dst, pkt->dg.dst.context, pkt->dst_port); in vmci_transport_recv_stream_cb()
719 if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0) in vmci_transport_recv_stream_cb()
731 if (pkt->type >= VMCI_TRANSPORT_PACKET_TYPE_MAX) { in vmci_transport_recv_stream_cb()
747 if (!vmci_transport_allow_dgram(vsk, pkt->dg.src.context)) { in vmci_transport_recv_stream_cb()
765 sk, pkt, true, &dst, &src, in vmci_transport_recv_stream_cb()
776 if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0) in vmci_transport_recv_stream_cb()
784 memcpy(&recv_pkt_info->pkt, pkt, sizeof(recv_pkt_info->pkt)); in vmci_transport_recv_stream_cb()
894 struct vmci_transport_packet *pkt; in vmci_transport_recv_pkt_work() local
900 pkt = &recv_pkt_info->pkt; in vmci_transport_recv_pkt_work()
905 vsock_sk(sk)->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_pkt_work()
909 vmci_transport_recv_listen(sk, pkt); in vmci_transport_recv_pkt_work()
916 vmci_transport_recv_connecting_client(sk, pkt); in vmci_transport_recv_pkt_work()
919 vmci_transport_recv_connected(sk, pkt); in vmci_transport_recv_pkt_work()
928 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_pkt_work()
941 struct vmci_transport_packet *pkt) in vmci_transport_recv_listen() argument
957 pending = vmci_transport_get_pending(sk, pkt); in vmci_transport_recv_listen()
962 vsock_sk(pending)->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_listen()
968 pkt); in vmci_transport_recv_listen()
971 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_listen()
988 if (!(pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST || in vmci_transport_recv_listen()
989 pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2)) { in vmci_transport_recv_listen()
990 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
994 if (pkt->u.size == 0) { in vmci_transport_recv_listen()
995 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
1004 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
1010 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1016 vsock_addr_init(&vpending->local_addr, pkt->dg.dst.context, in vmci_transport_recv_listen()
1017 pkt->dst_port); in vmci_transport_recv_listen()
1018 vsock_addr_init(&vpending->remote_addr, pkt->dg.src.context, in vmci_transport_recv_listen()
1019 pkt->src_port); in vmci_transport_recv_listen()
1026 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1034 if (pkt->u.size >= vpending->buffer_min_size && in vmci_transport_recv_listen()
1035 pkt->u.size <= vpending->buffer_max_size) { in vmci_transport_recv_listen()
1036 qp_size = pkt->u.size; in vmci_transport_recv_listen()
1047 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST) in vmci_transport_recv_listen()
1049 else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2) in vmci_transport_recv_listen()
1065 int proto_int = pkt->proto; in vmci_transport_recv_listen()
1095 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1132 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_server() argument
1146 switch (pkt->type) { in vmci_transport_recv_connecting_server()
1148 if (vmci_handle_is_invalid(pkt->u.handle)) { in vmci_transport_recv_connecting_server()
1149 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1157 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1159 err = pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST ? 0 : -EINVAL; in vmci_transport_recv_connecting_server()
1178 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1187 handle = pkt->u.handle; in vmci_transport_recv_connecting_server()
1202 pkt->dg.src.context, in vmci_transport_recv_connecting_server()
1208 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1241 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1278 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client() argument
1286 switch (pkt->type) { in vmci_transport_recv_connecting_client()
1288 if (vmci_handle_is_invalid(pkt->u.handle) || in vmci_transport_recv_connecting_client()
1289 !vmci_handle_is_equal(pkt->u.handle, in vmci_transport_recv_connecting_client()
1309 if (pkt->u.size == 0 in vmci_transport_recv_connecting_client()
1310 || pkt->dg.src.context != vsk->remote_addr.svm_cid in vmci_transport_recv_connecting_client()
1311 || pkt->src_port != vsk->remote_addr.svm_port in vmci_transport_recv_connecting_client()
1323 err = vmci_transport_recv_connecting_client_negotiate(sk, pkt); in vmci_transport_recv_connecting_client()
1331 err = vmci_transport_recv_connecting_client_invalid(sk, pkt); in vmci_transport_recv_connecting_client()
1367 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_connecting_client()
1377 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client_negotiate() argument
1401 if (pkt->u.size < vsk->buffer_min_size || in vmci_transport_recv_connecting_client_negotiate()
1402 pkt->u.size > vsk->buffer_max_size) { in vmci_transport_recv_connecting_client_negotiate()
1410 vsk->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_connecting_client_negotiate()
1419 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE) in vmci_transport_recv_connecting_client_negotiate()
1421 else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2) in vmci_transport_recv_connecting_client_negotiate()
1429 version = pkt->proto; in vmci_transport_recv_connecting_client_negotiate()
1457 pkt->u.size, in vmci_transport_recv_connecting_client_negotiate()
1458 pkt->u.size, in vmci_transport_recv_connecting_client_negotiate()
1478 pkt->u.size; in vmci_transport_recv_connecting_client_negotiate()
1498 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client_invalid() argument
1519 struct vmci_transport_packet *pkt) in vmci_transport_recv_connected() argument
1532 switch (pkt->type) { in vmci_transport_recv_connected()
1534 if (pkt->u.mode) { in vmci_transport_recv_connected()
1537 vsk->peer_shutdown |= pkt->u.mode; in vmci_transport_recv_connected()
1564 sk, pkt, false, NULL, NULL, in vmci_transport_recv_connected()