nvmf_controller.c (e0649a35a670c4b625d1de289b3886d9b3c9654f) | nvmf_controller.c (365b89e8ea4af34a05f68aa28e77573e89fa00b2) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2024 Chelsio Communications, Inc. 5 * Written by: John Baldwin <jhb@FreeBSD.org> 6 */ 7 8#include <sys/utsname.h> --- 443 unchanged lines hidden (view full) --- 452nvmf_get_log_page_offset(const struct nvme_command *cmd) 453{ 454 assert(cmd->opc == NVME_OPC_GET_LOG_PAGE); 455 return (le32toh(cmd->cdw12) | (uint64_t)le32toh(cmd->cdw13) << 32); 456} 457 458int 459nvmf_handoff_controller_qpair(struct nvmf_qpair *qp, | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause 3 * 4 * Copyright (c) 2024 Chelsio Communications, Inc. 5 * Written by: John Baldwin <jhb@FreeBSD.org> 6 */ 7 8#include <sys/utsname.h> --- 443 unchanged lines hidden (view full) --- 452nvmf_get_log_page_offset(const struct nvme_command *cmd) 453{ 454 assert(cmd->opc == NVME_OPC_GET_LOG_PAGE); 455 return (le32toh(cmd->cdw12) | (uint64_t)le32toh(cmd->cdw13) << 32); 456} 457 458int 459nvmf_handoff_controller_qpair(struct nvmf_qpair *qp, |
460 struct nvmf_handoff_controller_qpair *h) | 460 const struct nvmf_fabric_connect_cmd *cmd, 461 const struct nvmf_fabric_connect_data *data, struct nvmf_ioc_nv *nv) |
461{ | 462{ |
462 h->trtype = qp->nq_association->na_trtype; 463 return (nvmf_kernel_handoff_params(qp, &h->params)); | 463 nvlist_t *nvl, *nvl_qp; 464 int error; 465 466 error = nvmf_kernel_handoff_params(qp, &nvl_qp); 467 if (error) 468 return (error); 469 470 nvl = nvlist_create(0); 471 nvlist_add_number(nvl, "trtype", qp->nq_association->na_trtype); 472 nvlist_move_nvlist(nvl, "params", nvl_qp); 473 nvlist_add_binary(nvl, "cmd", cmd, sizeof(*cmd)); 474 nvlist_add_binary(nvl, "data", data, sizeof(*data)); 475 476 error = nvmf_pack_ioc_nvlist(nv, nvl); 477 nvlist_destroy(nvl); 478 return (error); |
464} | 479} |