diff options
author | Jiri Pirko <jiri@nvidia.com> | 2022-04-25 06:44:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-25 12:42:28 +0300 |
commit | 28b2d1f1ac41dda0b239830765d85c7ae4434182 (patch) | |
tree | ad118d767f90b4f9539c87dd8e7c836a94bc5c9e /include | |
parent | 276910aecc6a4076f5fbfd8160ff70695d6c1eb5 (diff) | |
download | linux-28b2d1f1ac41dda0b239830765d85c7ae4434182.tar.xz |
devlink: introduce line card device info infrastructure
Extend the line card info message with information (e.g., FW version)
about devices found on the line card.
Example:
$ devlink lc info pci/0000:01:00.0 lc 8
pci/0000:01:00.0:
lc 8
versions:
fixed:
hw.revision 0
running:
ini.version 4
devices:
device 0
versions:
running:
fw 19.2010.1310
device 1
versions:
running:
fw 19.2010.1310
device 2
versions:
running:
fw 19.2010.1310
device 3
versions:
running:
fw 19.2010.1310
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/devlink.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/net/devlink.h b/include/net/devlink.h index f96dcb376630..062895973656 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -151,6 +151,7 @@ struct devlink_port_new_attrs { }; struct devlink_info_req; +struct devlink_linecard_device; /** * struct devlink_linecard_ops - Linecard operations @@ -171,6 +172,7 @@ struct devlink_info_req; * @types_count: callback to get number of supported types * @types_get: callback to get next type in list * @info_get: callback to get linecard info + * @device_info_get: callback to get linecard device info */ struct devlink_linecard_ops { int (*provision)(struct devlink_linecard *linecard, void *priv, @@ -188,6 +190,9 @@ struct devlink_linecard_ops { int (*info_get)(struct devlink_linecard *linecard, void *priv, struct devlink_info_req *req, struct netlink_ext_ack *extack); + int (*device_info_get)(struct devlink_linecard_device *device, + void *priv, struct devlink_info_req *req, + struct netlink_ext_ack *extack); }; struct devlink_sb_pool_info { @@ -1583,10 +1588,9 @@ struct devlink_linecard * devlink_linecard_create(struct devlink *devlink, unsigned int linecard_index, const struct devlink_linecard_ops *ops, void *priv); void devlink_linecard_destroy(struct devlink_linecard *linecard); -struct devlink_linecard_device; struct devlink_linecard_device * devlink_linecard_device_create(struct devlink_linecard *linecard, - unsigned int device_index); + unsigned int device_index, void *priv); void devlink_linecard_device_destroy(struct devlink_linecard *linecard, struct devlink_linecard_device *linecard_device); |