summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-05-26 02:03:44 -0400
committerIan Moffett <ian@osmora.org>2025-05-26 02:03:44 -0400
commit5fb5b80ca4aed97ef01858bfc19a9e752dd25e83 (patch)
tree9cdde33f17d594814192b992091f494738e3ebdc /sys/dev/ic
parent4861ca5f7db6ae19e59537edfa3574e64a7db1e7 (diff)
kernel: ahci: Add ahci_dev_bsize()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/ahci.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c
index c7ef2cc..d07acd7 100644
--- a/sys/dev/ic/ahci.c
+++ b/sys/dev/ic/ahci.c
@@ -712,6 +712,21 @@ ahci_dev_write(dev_t dev, struct sio_txn *sio, int flags)
}
/*
+ * Device interface number of blocks
+ */
+static int
+ahci_dev_bsize(dev_t dev)
+{
+ struct hba_device *dp;
+
+ if ((dp = ahci_get_dev(dev)) == NULL) {
+ return -ENODEV;
+ }
+
+ return dp->nlba;
+}
+
+/*
* Initialize a drive on an HBA port
*
* @hba: HBA descriptor
@@ -1000,6 +1015,7 @@ ahci_init(void)
static struct bdevsw ahci_bdevsw = {
.read = ahci_dev_read,
.write = ahci_dev_write,
+ .bsize = ahci_dev_bsize
};
DRIVER_EXPORT(ahci_init);