Lines Matching refs:nc
97 struct nvmf_capsule *nc; in nvmf_allocate_command() local
101 nc = qp->nq_ops->allocate_capsule(qp, how); in nvmf_allocate_command()
102 if (nc == NULL) in nvmf_allocate_command()
105 nc->nc_qpair = qp; in nvmf_allocate_command()
106 nc->nc_qe_len = sizeof(struct nvme_command); in nvmf_allocate_command()
107 memcpy(&nc->nc_sqe, sqe, nc->nc_qe_len); in nvmf_allocate_command()
110 nc->nc_sqe.fuse &= ~NVMEM(NVME_CMD_PSDT); in nvmf_allocate_command()
111 nc->nc_sqe.fuse |= NVMEF(NVME_CMD_PSDT, NVME_PSDT_SGL); in nvmf_allocate_command()
112 return (nc); in nvmf_allocate_command()
118 struct nvmf_capsule *nc; in nvmf_allocate_response() local
122 nc = qp->nq_ops->allocate_capsule(qp, how); in nvmf_allocate_response()
123 if (nc == NULL) in nvmf_allocate_response()
126 nc->nc_qpair = qp; in nvmf_allocate_response()
127 nc->nc_qe_len = sizeof(struct nvme_completion); in nvmf_allocate_response()
128 memcpy(&nc->nc_cqe, cqe, nc->nc_qe_len); in nvmf_allocate_response()
129 return (nc); in nvmf_allocate_response()
133 nvmf_capsule_append_data(struct nvmf_capsule *nc, struct memdesc *mem, in nvmf_capsule_append_data() argument
137 if (nc->nc_data.io_len != 0) in nvmf_capsule_append_data()
140 nc->nc_send_data = send; in nvmf_capsule_append_data()
141 nc->nc_data.io_mem = *mem; in nvmf_capsule_append_data()
142 nc->nc_data.io_len = len; in nvmf_capsule_append_data()
143 nc->nc_data.io_complete = complete_cb; in nvmf_capsule_append_data()
144 nc->nc_data.io_complete_arg = cb_arg; in nvmf_capsule_append_data()
149 nvmf_free_capsule(struct nvmf_capsule *nc) in nvmf_free_capsule() argument
151 nc->nc_qpair->nq_ops->free_capsule(nc); in nvmf_free_capsule()
155 nvmf_transmit_capsule(struct nvmf_capsule *nc) in nvmf_transmit_capsule() argument
157 return (nc->nc_qpair->nq_ops->transmit_capsule(nc)); in nvmf_transmit_capsule()
161 nvmf_abort_capsule_data(struct nvmf_capsule *nc, int error) in nvmf_abort_capsule_data() argument
163 if (nc->nc_data.io_len != 0) in nvmf_abort_capsule_data()
164 nvmf_complete_io_request(&nc->nc_data, 0, error); in nvmf_abort_capsule_data()
168 nvmf_capsule_sqe(struct nvmf_capsule *nc) in nvmf_capsule_sqe() argument
170 KASSERT(nc->nc_qe_len == sizeof(struct nvme_command), in nvmf_capsule_sqe()
171 ("%s: capsule %p is not a command capsule", __func__, nc)); in nvmf_capsule_sqe()
172 return (&nc->nc_sqe); in nvmf_capsule_sqe()
176 nvmf_capsule_cqe(struct nvmf_capsule *nc) in nvmf_capsule_cqe() argument
178 KASSERT(nc->nc_qe_len == sizeof(struct nvme_completion), in nvmf_capsule_cqe()
179 ("%s: capsule %p is not a response capsule", __func__, nc)); in nvmf_capsule_cqe()
180 return (&nc->nc_cqe); in nvmf_capsule_cqe()
184 nvmf_sqhd_valid(struct nvmf_capsule *nc) in nvmf_sqhd_valid() argument
186 KASSERT(nc->nc_qe_len == sizeof(struct nvme_completion), in nvmf_sqhd_valid()
187 ("%s: capsule %p is not a response capsule", __func__, nc)); in nvmf_sqhd_valid()
188 return (nc->nc_sqhd_valid); in nvmf_sqhd_valid()
192 nvmf_validate_command_capsule(struct nvmf_capsule *nc) in nvmf_validate_command_capsule() argument
194 KASSERT(nc->nc_qe_len == sizeof(struct nvme_command), in nvmf_validate_command_capsule()
195 ("%s: capsule %p is not a command capsule", __func__, nc)); in nvmf_validate_command_capsule()
197 if (NVMEV(NVME_CMD_PSDT, nc->nc_sqe.fuse) != NVME_PSDT_SGL) in nvmf_validate_command_capsule()
200 return (nc->nc_qpair->nq_ops->validate_command_capsule(nc)); in nvmf_validate_command_capsule()
204 nvmf_capsule_data_len(const struct nvmf_capsule *nc) in nvmf_capsule_data_len() argument
206 return (nc->nc_qpair->nq_ops->capsule_data_len(nc)); in nvmf_capsule_data_len()
210 nvmf_receive_controller_data(struct nvmf_capsule *nc, uint32_t data_offset, in nvmf_receive_controller_data() argument
220 return (nc->nc_qpair->nq_ops->receive_controller_data(nc, data_offset, in nvmf_receive_controller_data()
225 nvmf_send_controller_data(struct nvmf_capsule *nc, uint32_t data_offset, in nvmf_send_controller_data() argument
229 return (nc->nc_qpair->nq_ops->send_controller_data(nc, data_offset, m, in nvmf_send_controller_data()