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
110 vmci_transport_packet_init(struct vmci_transport_packet *pkt, in vmci_transport_packet_init() argument
123 pkt->dg.src = vmci_make_handle(VMADDR_CID_ANY, in vmci_transport_packet_init()
125 pkt->dg.dst = vmci_make_handle(dst->svm_cid, in vmci_transport_packet_init()
127 pkt->dg.payload_size = sizeof(*pkt) - sizeof(pkt->dg); in vmci_transport_packet_init()
128 pkt->version = VMCI_TRANSPORT_PACKET_VERSION; in vmci_transport_packet_init()
129 pkt->type = type; in vmci_transport_packet_init()
130 pkt->src_port = src->svm_port; in vmci_transport_packet_init()
131 pkt->dst_port = dst->svm_port; in vmci_transport_packet_init()
132 memset(&pkt->proto, 0, sizeof(pkt->proto)); in vmci_transport_packet_init()
133 memset(&pkt->_reserved2, 0, sizeof(pkt->_reserved2)); in vmci_transport_packet_init()
135 switch (pkt->type) { in vmci_transport_packet_init()
137 pkt->u.size = 0; in vmci_transport_packet_init()
142 pkt->u.size = size; in vmci_transport_packet_init()
147 pkt->u.handle = handle; in vmci_transport_packet_init()
153 pkt->u.size = 0; in vmci_transport_packet_init()
157 pkt->u.mode = mode; in vmci_transport_packet_init()
162 memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait)); in vmci_transport_packet_init()
167 pkt->u.size = size; in vmci_transport_packet_init()
168 pkt->proto = proto; in vmci_transport_packet_init()
174 vmci_transport_packet_get_addresses(struct vmci_transport_packet *pkt, in vmci_transport_packet_get_addresses() argument
178 vsock_addr_init(local, pkt->dg.dst.context, pkt->dst_port); in vmci_transport_packet_get_addresses()
179 vsock_addr_init(remote, pkt->dg.src.context, pkt->src_port); in vmci_transport_packet_get_addresses()
183 __vmci_transport_send_control_pkt(struct vmci_transport_packet *pkt, in __vmci_transport_send_control_pkt() argument
196 vmci_transport_packet_init(pkt, src, dst, type, size, mode, wait, in __vmci_transport_send_control_pkt()
198 err = vmci_datagram_send(&pkt->dg); in __vmci_transport_send_control_pkt()
206 vmci_transport_reply_control_pkt_fast(struct vmci_transport_packet *pkt, in vmci_transport_reply_control_pkt_fast() argument
216 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) { in vmci_transport_reply_control_pkt_fast()
219 vmci_transport_packet_get_addresses(pkt, &src, &dst); in vmci_transport_reply_control_pkt_fast()
242 static struct vmci_transport_packet pkt; in vmci_transport_send_control_pkt_bh() local
244 return __vmci_transport_send_control_pkt(&pkt, src, dst, type, in vmci_transport_send_control_pkt_bh()
260 struct vmci_transport_packet *pkt; in vmci_transport_alloc_send_control_pkt() local
263 pkt = kmalloc(sizeof(*pkt), GFP_KERNEL); in vmci_transport_alloc_send_control_pkt()
264 if (!pkt) in vmci_transport_alloc_send_control_pkt()
267 err = __vmci_transport_send_control_pkt(pkt, src, dst, type, size, in vmci_transport_alloc_send_control_pkt()
270 kfree(pkt); in vmci_transport_alloc_send_control_pkt()
302 struct vmci_transport_packet *pkt) in vmci_transport_send_reset_bh() argument
304 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) in vmci_transport_send_reset_bh()
313 struct vmci_transport_packet *pkt) in vmci_transport_send_reset() argument
319 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST) in vmci_transport_send_reset()
330 vsock_addr_init(&dst, pkt->dg.src.context, in vmci_transport_send_reset()
331 pkt->src_port); in vmci_transport_send_reset()
378 static int vmci_transport_reply_reset(struct vmci_transport_packet *pkt) in vmci_transport_reply_reset() argument
381 pkt, in vmci_transport_reply_reset()
478 struct vmci_transport_packet *pkt) in vmci_transport_get_pending() argument
485 vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port); in vmci_transport_get_pending()
492 pkt->dst_port == vpending->local_addr.svm_port) { in vmci_transport_get_pending()
674 struct vmci_transport_packet *pkt; in vmci_transport_recv_stream_cb() local
691 if (VMCI_DG_SIZE(dg) < sizeof(*pkt)) in vmci_transport_recv_stream_cb()
695 pkt = (struct vmci_transport_packet *)dg; in vmci_transport_recv_stream_cb()
701 vsock_addr_init(&src, pkt->dg.src.context, pkt->src_port); in vmci_transport_recv_stream_cb()
702 vsock_addr_init(&dst, pkt->dg.dst.context, pkt->dst_port); in vmci_transport_recv_stream_cb()
717 if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0) in vmci_transport_recv_stream_cb()
729 if (pkt->type >= VMCI_TRANSPORT_PACKET_TYPE_MAX) { in vmci_transport_recv_stream_cb()
745 if (!vmci_transport_allow_dgram(vsk, pkt->dg.src.context)) { in vmci_transport_recv_stream_cb()
763 sk, pkt, true, &dst, &src, in vmci_transport_recv_stream_cb()
774 if (vmci_transport_send_reset_bh(&dst, &src, pkt) < 0) in vmci_transport_recv_stream_cb()
782 memcpy(&recv_pkt_info->pkt, pkt, sizeof(recv_pkt_info->pkt)); in vmci_transport_recv_stream_cb()
891 struct vmci_transport_packet *pkt; in vmci_transport_recv_pkt_work() local
897 pkt = &recv_pkt_info->pkt; in vmci_transport_recv_pkt_work()
902 vsock_sk(sk)->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_pkt_work()
906 vmci_transport_recv_listen(sk, pkt); in vmci_transport_recv_pkt_work()
913 vmci_transport_recv_connecting_client(sk, pkt); in vmci_transport_recv_pkt_work()
916 vmci_transport_recv_connected(sk, pkt); in vmci_transport_recv_pkt_work()
925 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_pkt_work()
938 struct vmci_transport_packet *pkt) in vmci_transport_recv_listen() argument
954 pending = vmci_transport_get_pending(sk, pkt); in vmci_transport_recv_listen()
959 vsock_sk(pending)->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_listen()
965 pkt); in vmci_transport_recv_listen()
968 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_listen()
985 if (!(pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST || in vmci_transport_recv_listen()
986 pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2)) { in vmci_transport_recv_listen()
987 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
991 if (pkt->u.size == 0) { in vmci_transport_recv_listen()
992 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
1001 vmci_transport_reply_reset(pkt); in vmci_transport_recv_listen()
1007 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1013 vsock_addr_init(&vpending->local_addr, pkt->dg.dst.context, in vmci_transport_recv_listen()
1014 pkt->dst_port); in vmci_transport_recv_listen()
1015 vsock_addr_init(&vpending->remote_addr, pkt->dg.src.context, in vmci_transport_recv_listen()
1016 pkt->src_port); in vmci_transport_recv_listen()
1023 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1031 if (pkt->u.size >= vpending->buffer_min_size && in vmci_transport_recv_listen()
1032 pkt->u.size <= vpending->buffer_max_size) { in vmci_transport_recv_listen()
1033 qp_size = pkt->u.size; in vmci_transport_recv_listen()
1044 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST) in vmci_transport_recv_listen()
1046 else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_REQUEST2) in vmci_transport_recv_listen()
1062 int proto_int = pkt->proto; in vmci_transport_recv_listen()
1092 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_listen()
1129 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_server() argument
1143 switch (pkt->type) { in vmci_transport_recv_connecting_server()
1145 if (vmci_handle_is_invalid(pkt->u.handle)) { in vmci_transport_recv_connecting_server()
1146 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1154 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1156 err = pkt->type == VMCI_TRANSPORT_PACKET_TYPE_RST ? 0 : -EINVAL; in vmci_transport_recv_connecting_server()
1175 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1184 handle = pkt->u.handle; in vmci_transport_recv_connecting_server()
1199 pkt->dg.src.context, in vmci_transport_recv_connecting_server()
1205 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1238 vmci_transport_send_reset(pending, pkt); in vmci_transport_recv_connecting_server()
1275 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client() argument
1283 switch (pkt->type) { in vmci_transport_recv_connecting_client()
1285 if (vmci_handle_is_invalid(pkt->u.handle) || in vmci_transport_recv_connecting_client()
1286 !vmci_handle_is_equal(pkt->u.handle, in vmci_transport_recv_connecting_client()
1306 if (pkt->u.size == 0 in vmci_transport_recv_connecting_client()
1307 || pkt->dg.src.context != vsk->remote_addr.svm_cid in vmci_transport_recv_connecting_client()
1308 || pkt->src_port != vsk->remote_addr.svm_port in vmci_transport_recv_connecting_client()
1320 err = vmci_transport_recv_connecting_client_negotiate(sk, pkt); in vmci_transport_recv_connecting_client()
1328 err = vmci_transport_recv_connecting_client_invalid(sk, pkt); in vmci_transport_recv_connecting_client()
1364 vmci_transport_send_reset(sk, pkt); in vmci_transport_recv_connecting_client()
1374 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client_negotiate() argument
1398 if (pkt->u.size < vsk->buffer_min_size || in vmci_transport_recv_connecting_client_negotiate()
1399 pkt->u.size > vsk->buffer_max_size) { in vmci_transport_recv_connecting_client_negotiate()
1407 vsk->local_addr.svm_cid = pkt->dg.dst.context; in vmci_transport_recv_connecting_client_negotiate()
1416 if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE) in vmci_transport_recv_connecting_client_negotiate()
1418 else if (pkt->type == VMCI_TRANSPORT_PACKET_TYPE_NEGOTIATE2) in vmci_transport_recv_connecting_client_negotiate()
1426 version = pkt->proto; in vmci_transport_recv_connecting_client_negotiate()
1454 pkt->u.size, in vmci_transport_recv_connecting_client_negotiate()
1455 pkt->u.size, in vmci_transport_recv_connecting_client_negotiate()
1475 pkt->u.size; in vmci_transport_recv_connecting_client_negotiate()
1495 struct vmci_transport_packet *pkt) in vmci_transport_recv_connecting_client_invalid() argument
1516 struct vmci_transport_packet *pkt) in vmci_transport_recv_connected() argument
1529 switch (pkt->type) { in vmci_transport_recv_connected()
1531 if (pkt->u.mode) { in vmci_transport_recv_connected()
1534 vsk->peer_shutdown |= pkt->u.mode; in vmci_transport_recv_connected()
1561 sk, pkt, false, NULL, NULL, in vmci_transport_recv_connected()