Author: jimharris Date: Fri Apr 12 17:48:45 2013 New Revision: 249420 URL: http://svnweb.freebsd.org/changeset/base/249420
Log: Move the busdma mapping functions to nvme_qpair.c. This removes nvme_uio.c completely. Sponsored by: Intel Deleted: head/sys/dev/nvme/nvme_uio.c Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_private.h head/sys/dev/nvme/nvme_qpair.c head/sys/modules/nvme/Makefile Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Fri Apr 12 17:44:55 2013 (r249419) +++ head/sys/dev/nvme/nvme.c Fri Apr 12 17:48:45 2013 (r249420) @@ -229,43 +229,6 @@ nvme_dump_completion(struct nvme_complet cpl->status.m, cpl->status.dnr); } -void -nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) -{ - struct nvme_tracker *tr = arg; - uint32_t cur_nseg; - - /* - * If the mapping operation failed, return immediately. The caller - * is responsible for detecting the error status and failing the - * tracker manually. - */ - if (error != 0) - return; - - /* - * Note that we specified PAGE_SIZE for alignment and max - * segment size when creating the bus dma tags. So here - * we can safely just transfer each segment to its - * associated PRP entry. - */ - tr->req->cmd.prp1 = seg[0].ds_addr; - - if (nseg == 2) { - tr->req->cmd.prp2 = seg[1].ds_addr; - } else if (nseg > 2) { - cur_nseg = 1; - tr->req->cmd.prp2 = (uint64_t)tr->prp_bus_addr; - while (cur_nseg < nseg) { - tr->prp[cur_nseg-1] = - (uint64_t)seg[cur_nseg].ds_addr; - cur_nseg++; - } - } - - nvme_qpair_submit_tracker(tr->qpair, tr); -} - static int nvme_attach(device_t dev) { Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Fri Apr 12 17:44:55 2013 (r249419) +++ head/sys/dev/nvme/nvme_private.h Fri Apr 12 17:48:45 2013 (r249420) @@ -429,10 +429,6 @@ void nvme_ctrlr_cmd_set_async_event_conf void nvme_ctrlr_cmd_abort(struct nvme_controller *ctrlr, uint16_t cid, uint16_t sqid, nvme_cb_fn_t cb_fn, void *cb_arg); -void nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, - int error); -void nvme_payload_map_uio(void *arg, bus_dma_segment_t *seg, int nseg, - bus_size_t mapsize, int error); void nvme_completion_poll_cb(void *arg, const struct nvme_completion *cpl); int nvme_ctrlr_construct(struct nvme_controller *ctrlr, device_t dev); Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Fri Apr 12 17:44:55 2013 (r249419) +++ head/sys/dev/nvme/nvme_qpair.c Fri Apr 12 17:48:45 2013 (r249420) @@ -699,6 +699,51 @@ nvme_qpair_submit_tracker(struct nvme_qp } static void +nvme_payload_map(void *arg, bus_dma_segment_t *seg, int nseg, int error) +{ + struct nvme_tracker *tr = arg; + uint32_t cur_nseg; + + /* + * If the mapping operation failed, return immediately. The caller + * is responsible for detecting the error status and failing the + * tracker manually. + */ + if (error != 0) + return; + + /* + * Note that we specified PAGE_SIZE for alignment and max + * segment size when creating the bus dma tags. So here + * we can safely just transfer each segment to its + * associated PRP entry. + */ + tr->req->cmd.prp1 = seg[0].ds_addr; + + if (nseg == 2) { + tr->req->cmd.prp2 = seg[1].ds_addr; + } else if (nseg > 2) { + cur_nseg = 1; + tr->req->cmd.prp2 = (uint64_t)tr->prp_bus_addr; + while (cur_nseg < nseg) { + tr->prp[cur_nseg-1] = + (uint64_t)seg[cur_nseg].ds_addr; + cur_nseg++; + } + } + + nvme_qpair_submit_tracker(tr->qpair, tr); +} + +static void +nvme_payload_map_uio(void *arg, bus_dma_segment_t *seg, int nseg, + bus_size_t mapsize, int error) +{ + + nvme_payload_map(arg, seg, nseg, error); +} + +static void _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) { struct nvme_tracker *tr; Modified: head/sys/modules/nvme/Makefile ============================================================================== --- head/sys/modules/nvme/Makefile Fri Apr 12 17:44:55 2013 (r249419) +++ head/sys/modules/nvme/Makefile Fri Apr 12 17:48:45 2013 (r249420) @@ -12,7 +12,6 @@ SRCS = nvme.c \ nvme_qpair.c \ nvme_sysctl.c \ nvme_test.c \ - nvme_uio.c \ \ bus_if.h \ device_if.h \ _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"