Lines Matching refs:pkt

50 	struct vio_ver_info pkt;  in send_version()  local
54 memset(&pkt, 0, sizeof(pkt)); in send_version()
55 init_tag(&pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_VER_INFO); in send_version()
56 pkt.major = major; in send_version()
57 pkt.minor = minor; in send_version()
58 pkt.dev_class = vio->dev_class; in send_version()
63 return send_ctrl(vio, &pkt.tag, sizeof(pkt)); in send_version()
163 struct vio_msg_tag *pkt = arg; in process_unknown() local
166 pkt->type, pkt->stype, pkt->stype_env, pkt->sid); in process_unknown()
180 struct vio_dring_register pkt; in send_dreg() member
194 init_tag(&u.pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_DRING_REG); in send_dreg()
195 u.pkt.dring_ident = 0; in send_dreg()
196 u.pkt.num_descr = dr->num_entries; in send_dreg()
197 u.pkt.descr_size = dr->entry_size; in send_dreg()
198 u.pkt.options = VIO_TX_DRING; in send_dreg()
199 u.pkt.num_cookies = dr->ncookies; in send_dreg()
203 u.pkt.num_descr, u.pkt.descr_size, u.pkt.options, in send_dreg()
204 u.pkt.num_cookies); in send_dreg()
207 u.pkt.cookies[i] = dr->cookies[i]; in send_dreg()
211 (unsigned long long) u.pkt.cookies[i].cookie_addr, in send_dreg()
212 (unsigned long long) u.pkt.cookies[i].cookie_size); in send_dreg()
215 return send_ctrl(vio, &u.pkt.tag, bytes); in send_dreg()
220 struct vio_rdx pkt; in send_rdx() local
222 memset(&pkt, 0, sizeof(pkt)); in send_rdx()
224 init_tag(&pkt.tag, VIO_TYPE_CTRL, VIO_SUBTYPE_INFO, VIO_RDX); in send_rdx()
228 return send_ctrl(vio, &pkt.tag, sizeof(pkt)); in send_rdx()
256 struct vio_ver_info *pkt) in process_ver_info() argument
262 pkt->major, pkt->minor, pkt->dev_class); in process_ver_info()
270 vap = find_by_major(vio, pkt->major); in process_ver_info()
272 vio->_peer_sid = pkt->tag.sid; in process_ver_info()
275 pkt->tag.stype = VIO_SUBTYPE_NACK; in process_ver_info()
276 pkt->major = 0; in process_ver_info()
277 pkt->minor = 0; in process_ver_info()
279 err = send_ctrl(vio, &pkt->tag, sizeof(*pkt)); in process_ver_info()
280 } else if (vap->major != pkt->major) { in process_ver_info()
281 pkt->tag.stype = VIO_SUBTYPE_NACK; in process_ver_info()
282 pkt->major = vap->major; in process_ver_info()
283 pkt->minor = vap->minor; in process_ver_info()
285 pkt->major, pkt->minor); in process_ver_info()
286 err = send_ctrl(vio, &pkt->tag, sizeof(*pkt)); in process_ver_info()
289 .major = pkt->major, in process_ver_info()
290 .minor = pkt->minor, in process_ver_info()
294 pkt->minor = ver.minor; in process_ver_info()
295 pkt->tag.stype = VIO_SUBTYPE_ACK; in process_ver_info()
296 pkt->dev_class = vio->dev_class; in process_ver_info()
298 pkt->major, pkt->minor); in process_ver_info()
299 err = send_ctrl(vio, &pkt->tag, sizeof(*pkt)); in process_ver_info()
312 struct vio_ver_info *pkt) in process_ver_ack() argument
315 pkt->major, pkt->minor, pkt->dev_class); in process_ver_ack()
318 if (vio->ver.major != pkt->major || in process_ver_ack()
319 vio->ver.minor != pkt->minor) { in process_ver_ack()
320 pkt->tag.stype = VIO_SUBTYPE_NACK; in process_ver_ack()
321 (void) send_ctrl(vio, &pkt->tag, sizeof(*pkt)); in process_ver_ack()
325 vio->ver.major = pkt->major; in process_ver_ack()
326 vio->ver.minor = pkt->minor; in process_ver_ack()
345 struct vio_ver_info *pkt) in process_ver_nack() argument
350 pkt->major, pkt->minor, pkt->dev_class); in process_ver_nack()
352 if (pkt->major == 0 && pkt->minor == 0) in process_ver_nack()
354 nver = find_by_major(vio, pkt->major); in process_ver_nack()
364 static int process_ver(struct vio_driver_state *vio, struct vio_ver_info *pkt) in process_ver() argument
366 switch (pkt->tag.stype) { in process_ver()
368 return process_ver_info(vio, pkt); in process_ver()
371 return process_ver_ack(vio, pkt); in process_ver()
374 return process_ver_nack(vio, pkt); in process_ver()
381 static int process_attr(struct vio_driver_state *vio, void *pkt) in process_attr() argument
391 err = vio->ops->handle_attr(vio, pkt); in process_attr()
428 struct vio_dring_register *pkt) in process_dreg_info() argument
435 (unsigned long long) pkt->dring_ident, in process_dreg_info()
436 pkt->num_descr, pkt->descr_size, pkt->options, in process_dreg_info()
437 pkt->num_cookies); in process_dreg_info()
447 if (!(pkt->options & VIO_TX_DRING)) in process_dreg_info()
449 pkt->options = VIO_TX_DRING; in process_dreg_info()
454 vio->desc_buf = kzalloc(pkt->descr_size, GFP_ATOMIC); in process_dreg_info()
458 vio->desc_buf_len = pkt->descr_size; in process_dreg_info()
462 dr->num_entries = pkt->num_descr; in process_dreg_info()
463 dr->entry_size = pkt->descr_size; in process_dreg_info()
464 dr->ncookies = pkt->num_cookies; in process_dreg_info()
466 dr->cookies[i] = pkt->cookies[i]; in process_dreg_info()
471 pkt->cookies[i].cookie_addr, in process_dreg_info()
473 pkt->cookies[i].cookie_size); in process_dreg_info()
476 pkt->tag.stype = VIO_SUBTYPE_ACK; in process_dreg_info()
477 pkt->dring_ident = ++dr->ident; in process_dreg_info()
481 (unsigned long long) pkt->dring_ident, in process_dreg_info()
482 pkt->num_descr, pkt->descr_size, pkt->options, in process_dreg_info()
483 pkt->num_cookies); in process_dreg_info()
485 if (send_ctrl(vio, &pkt->tag, struct_size(pkt, cookies, dr->ncookies)) < 0) in process_dreg_info()
493 pkt->tag.stype = VIO_SUBTYPE_NACK; in process_dreg_info()
495 (void) send_ctrl(vio, &pkt->tag, sizeof(*pkt)); in process_dreg_info()
501 struct vio_dring_register *pkt) in process_dreg_ack() argument
507 (unsigned long long) pkt->dring_ident, in process_dreg_ack()
508 pkt->num_descr, pkt->descr_size, pkt->options, in process_dreg_ack()
509 pkt->num_cookies); in process_dreg_ack()
516 dr->ident = pkt->dring_ident; in process_dreg_ack()
528 struct vio_dring_register *pkt) in process_dreg_nack() argument
532 (unsigned long long) pkt->dring_ident, in process_dreg_nack()
533 pkt->num_descr, pkt->descr_size, pkt->options, in process_dreg_nack()
534 pkt->num_cookies); in process_dreg_nack()
540 struct vio_dring_register *pkt) in process_dreg() argument
545 switch (pkt->tag.stype) { in process_dreg()
547 return process_dreg_info(vio, pkt); in process_dreg()
550 return process_dreg_ack(vio, pkt); in process_dreg()
553 return process_dreg_nack(vio, pkt); in process_dreg()
561 struct vio_dring_unregister *pkt) in process_dunreg() argument
567 if (pkt->dring_ident != dr->ident) in process_dunreg()
581 static int process_rdx_info(struct vio_driver_state *vio, struct vio_rdx *pkt) in process_rdx_info() argument
585 pkt->tag.stype = VIO_SUBTYPE_ACK; in process_rdx_info()
587 if (send_ctrl(vio, &pkt->tag, sizeof(*pkt)) < 0) in process_rdx_info()
594 static int process_rdx_ack(struct vio_driver_state *vio, struct vio_rdx *pkt) in process_rdx_ack() argument
605 static int process_rdx_nack(struct vio_driver_state *vio, struct vio_rdx *pkt) in process_rdx_nack() argument
612 static int process_rdx(struct vio_driver_state *vio, struct vio_rdx *pkt) in process_rdx() argument
617 switch (pkt->tag.stype) { in process_rdx()
619 return process_rdx_info(vio, pkt); in process_rdx()
622 return process_rdx_ack(vio, pkt); in process_rdx()
625 return process_rdx_nack(vio, pkt); in process_rdx()
632 int vio_control_pkt_engine(struct vio_driver_state *vio, void *pkt) in vio_control_pkt_engine() argument
634 struct vio_msg_tag *tag = pkt; in vio_control_pkt_engine()
640 err = process_ver(vio, pkt); in vio_control_pkt_engine()
644 err = process_attr(vio, pkt); in vio_control_pkt_engine()
648 err = process_dreg(vio, pkt); in vio_control_pkt_engine()
652 err = process_dunreg(vio, pkt); in vio_control_pkt_engine()
656 err = process_rdx(vio, pkt); in vio_control_pkt_engine()
660 err = process_unknown(vio, pkt); in vio_control_pkt_engine()