summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-04-08 23:21:03 -0400
committerIan Moffett <ian@osmora.org>2024-04-08 23:21:03 -0400
commit3c8dd7d392dc50ca9d356beefba7820a14d7fd74 (patch)
tree1c84da02fb1f243e262eb13c2ca58a71758ceb20 /sys/dev/ic
parent803b03e1bfe87dc28c387a22b4559423945f2bdd (diff)
kernel: nvme: Add more comments
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/nvme.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c
index 7b79da9..dcdb5a8 100644
--- a/sys/dev/ic/nvme.c
+++ b/sys/dev/ic/nvme.c
@@ -288,6 +288,11 @@ nvme_rw(struct nvme_ns *ns, char *buf, off_t slba, size_t count, bool write)
return nvme_poll_submit_cmd(&ns->ioq, cmd);
}
+/*
+ * Fetch a namespace from its ID
+ *
+ * @nsid: Namespace ID of namespace to fetch
+ */
static struct nvme_ns *
nvme_get_ns(size_t nsid)
{
@@ -302,6 +307,9 @@ nvme_get_ns(size_t nsid)
return NULL;
}
+/*
+ * Device interface read/write helper
+ */
static int
nvme_dev_rw(struct device *dev, struct sio_txn *sio, bool write)
{
@@ -319,12 +327,18 @@ nvme_dev_rw(struct device *dev, struct sio_txn *sio, bool write)
return nvme_rw(ns, sio->buf, sio->offset, sio->len, write);
}
+/*
+ * Device interface read
+ */
static int
nvme_dev_read(struct device *dev, struct sio_txn *sio)
{
return nvme_dev_rw(dev, sio, false);
}
+/*
+ * Device interface write
+ */
static int
nvme_dev_write(struct device *dev, struct sio_txn *sio)
{