Deleted Added
sdiff udiff text old ( 248763 ) new ( 248767 )
full compact
1/*-
2 * Copyright (C) 2012 Intel Corporation
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/dev/nvme/nvme_private.h 248763 2013-03-26 21:19:26Z jimharris $
27 */
28
29#ifndef __NVME_PRIVATE_H__
30#define __NVME_PRIVATE_H__
31
32#include <sys/param.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>

--- 45 unchanged lines hidden (view full) ---

80 * queues, while NVME_IO_TRACKERS defines the maximum number of I/O that we
81 * will allow outstanding on an I/O qpair at any time. The only advantage in
82 * having IO_ENTRIES > IO_TRACKERS is for debugging purposes - when dumping
83 * the contents of the submission and completion queues, it will show a longer
84 * history of data.
85 */
86#define NVME_IO_ENTRIES (256)
87#define NVME_IO_TRACKERS (128)
88#define NVME_MIN_IO_TRACKERS (16)
89#define NVME_MAX_IO_TRACKERS (1024)
90
91/*
92 * NVME_MAX_IO_ENTRIES is not defined, since it is specified in CC.MQES
93 * for each controller.
94 */
95
96#define NVME_INT_COAL_TIME (0) /* disabled */

--- 17 unchanged lines hidden (view full) ---

114#endif
115
116extern uma_zone_t nvme_request_zone;
117extern int32_t nvme_retry_count;
118
119struct nvme_request {
120
121 struct nvme_command cmd;
122 void *payload;
123 uint32_t payload_size;
124 boolean_t timeout;
125 struct uio *uio;
126 nvme_cb_fn_t cb_fn;
127 void *cb_arg;
128 int32_t retries;
129 STAILQ_ENTRY(nvme_request) stailq;

--- 115 unchanged lines hidden (view full) ---

245
246 uint32_t num_io_queues;
247 boolean_t per_cpu_io_queues;
248
249 /* Fields for tracking progress during controller initialization. */
250 struct intr_config_hook config_hook;
251 uint32_t ns_identified;
252 uint32_t queues_created;
253 struct task reset_task;
254 struct taskqueue *taskqueue;
255
256 /* For shared legacy interrupt. */
257 int rid;
258 struct resource *res;
259 void *tag;
260
261 bus_dma_tag_t hw_desc_tag;

--- 26 unchanged lines hidden (view full) ---

288
289 uint32_t num_aers;
290 struct nvme_async_event_request aer[NVME_MAX_ASYNC_EVENTS];
291
292 void *cons_cookie[NVME_MAX_CONSUMERS];
293
294 uint32_t is_resetting;
295
296#ifdef CHATHAM2
297 uint64_t chatham_size;
298 uint64_t chatham_lbas;
299#endif
300};
301
302#define nvme_mmio_offsetof(reg) \
303 offsetof(struct nvme_registers, reg)

--- 94 unchanged lines hidden (view full) ---

398int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr);
399void nvme_ctrlr_reset(struct nvme_controller *ctrlr);
400/* ctrlr defined as void * to allow use with config_intrhook. */
401void nvme_ctrlr_start_config_hook(void *ctrlr_arg);
402void nvme_ctrlr_submit_admin_request(struct nvme_controller *ctrlr,
403 struct nvme_request *req);
404void nvme_ctrlr_submit_io_request(struct nvme_controller *ctrlr,
405 struct nvme_request *req);
406
407void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id,
408 uint16_t vector, uint32_t num_entries,
409 uint32_t num_trackers, uint32_t max_xfer_size,
410 struct nvme_controller *ctrlr);
411void nvme_qpair_submit_tracker(struct nvme_qpair *qpair,
412 struct nvme_tracker *tr);
413void nvme_qpair_process_completions(struct nvme_qpair *qpair);
414void nvme_qpair_submit_request(struct nvme_qpair *qpair,
415 struct nvme_request *req);
416void nvme_qpair_reset(struct nvme_qpair *qpair);
417
418void nvme_admin_qpair_enable(struct nvme_qpair *qpair);
419void nvme_admin_qpair_disable(struct nvme_qpair *qpair);
420void nvme_admin_qpair_destroy(struct nvme_qpair *qpair);
421
422void nvme_io_qpair_enable(struct nvme_qpair *qpair);
423void nvme_io_qpair_disable(struct nvme_qpair *qpair);
424void nvme_io_qpair_destroy(struct nvme_qpair *qpair);

--- 54 unchanged lines hidden (view full) ---

479}
480
481#define nvme_free_request(req) uma_zfree(nvme_request_zone, req)
482
483void nvme_notify_async_consumers(struct nvme_controller *ctrlr,
484 const struct nvme_completion *async_cpl,
485 uint32_t log_page_id, void *log_page_buffer,
486 uint32_t log_page_size);
487
488#endif /* __NVME_PRIVATE_H__ */