forked from linux-nvme/nvme-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnvme-pci-ids.h
More file actions
41 lines (36 loc) · 1.2 KB
/
Copy pathnvme-pci-ids.h
File metadata and controls
41 lines (36 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Copyright (c) 2026 Micron Technology, Inc.
*
* Authors: Broc Going <bgoing@micron.com>
*/
#pragma once
#include <nvme/lib-types.h>
/**
* nvme_get_pci_ids() - Read PCI IDs for a controller
* @ctx: Global context
* @hdl: Transport handle
* @vid: Output vendor ID (may be NULL)
* @did: Output device ID (may be NULL)
* @subsys_vid: Output subsystem vendor ID (may be NULL)
* @subsys_did: Output subsystem device ID (may be NULL)
* @class_code: Output PCI class code (may be NULL)
*
* Gets the PCI IDs for the controller associated with @hdl.
* Any output pointer that is NULL is silently skipped.
* If any error occurs when reading an ID, the value of that ID
* is left unchanged.
*
* Return: 0 on success, negative errno on failure.
*/
int nvme_get_pci_ids(struct libnvme_global_ctx *ctx,
struct libnvme_transport_handle *hdl,
__u32 *vid, __u32 *did,
__u32 *subsys_vid, __u32 *subsys_did,
__u32 *class_code);
int __nvme_get_pci_ids(const char *sysfs_dir,
__u32 *vid, __u32 *did,
__u32 *subsys_vid, __u32 *subsys_did,
__u32 *class_code);
int __nvme_get_sysfs_dir(struct libnvme_global_ctx *ctx,
const char *ctrl_name, char **sysfs_dir);