xref: /freebsd/sys/dev/nvme/nvme_if.m (revision aed44717a1606e4c5c79f7c8831de49cba64d7e6)
1# Copyright (c) 2025 Netlix, Inc
2#
3# SPDX-License-Identifier: BSD-2-Clause
4#
5
6# Interface from the NVME controller to its children to notify it of certain
7# interesting events.
8
9INTERFACE nvme;
10
11HEADER {
12	#include "dev/nvme/nvme_private.h"
13};
14
15#
16# A new namespace is now available
17#
18METHOD int ns_added {
19	device_t	dev;		/* nvme device */
20	struct nvme_namespace *ns;	/* information about the namespace */
21};
22
23#
24# A namespace has been removed
25#
26METHOD int ns_removed {
27	device_t	dev;		/* nvme device */
28	struct nvme_namespace *ns;	/* information about the namespace */
29};
30
31#
32# A namespace has been changed somehow
33#
34METHOD int ns_changed {
35	device_t	dev;		/* nvme device */
36	uint32_t	nsid;		/* nsid that just changed */
37};
38
39#
40# The controller has failed
41#
42METHOD int controller_failed {
43	device_t	dev;		/* nvme device */
44};
45
46#
47# Async completion
48#
49METHOD int handle_aen {
50	device_t	dev;		/* nvme device */
51	const struct nvme_completion *cpl; /* Completion for this async event */
52	uint32_t	pg_nr;		/* Page number reported by async event */
53	void		*page;		/* Contents of the page */
54	uint32_t	page_len;	/* Length of the page */
55};
56