Skip to content

Commit 986368d

Browse files
inventory: initial API
add inventory message for EVE to upload to controller Signed-off-by: Christoph Ostarek <[email protected]>
1 parent 1b3accb commit 986368d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

proto/hardwareinventory/msg.proto

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Copyright(c) 2025 Zededa, Inc.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
syntax = "proto3";
5+
6+
package org.lfedge.eve.hardwareinventory;
7+
option go_package = "github.com/lf-edge/eve-api/go/hardwareinventory";
8+
option java_package = "org.lfedge.eve.hardwareinventory";
9+
10+
message USBBusDevnum {
11+
// https://elixir.bootlin.com/linux/v6.16.9/source/include/linux/usb.h#L451
12+
int64 bus = 1;
13+
// https://elixir.bootlin.com/linux/v6.16.9/source/include/linux/usb.h#L657
14+
int64 devnum = 2;
15+
}
16+
17+
message USBDevice {
18+
optional PCIAddress pci_parent = 1;
19+
optional USBBusDevnum usb_parent = 2;
20+
21+
// these are uint16, protobuf only supports from uint32
22+
// https://elixir.bootlin.com/linux/v6.16.9/source/include/linux/usb.h#L984
23+
uint32 vendor_id = 3;
24+
uint32 product_id = 4;
25+
26+
USBBusDevnum bus_devnum = 5;
27+
}
28+
29+
message PCIAddress {
30+
// https://github.com/lyonel/lshw/blob/master/src/core/pci.cc#L224
31+
uint32 bus = 1;
32+
uint32 device = 2;
33+
uint32 function = 3;
34+
}
35+
36+
message PCIDevice {
37+
optional string parent_pci_device_address = 1;
38+
string driver = 2;
39+
PCIAddress address = 3;
40+
// https://elixir.bootlin.com/linux/v6.16.9/source/include/linux/pci.h#L347
41+
uint32 vendor_id = 4;
42+
uint32 device_id = 5;
43+
string revision = 6;
44+
string subsystem_id = 7;
45+
string class_id = 8;
46+
string subclass_id = 9;
47+
// IOMMU group names apparently are strings: https://elixir.bootlin.com/linux/v6.16.9/source/drivers/iommu/iommu.c#L1101
48+
string iommu_group = 10;
49+
}
50+
51+
// this message is POSTed to /inventory/{serial}/{softserial}
52+
message InventoryMsg {
53+
string eve_version = 1;
54+
55+
repeated PCIDevice pci_devices = 2;
56+
repeated USBDevice usb_devices = 3;
57+
}

0 commit comments

Comments
 (0)