@@ -78,6 +78,9 @@ versions is generally discouraged - here, and via any other Linux API.
``stored`` versions when new software is flashed, it must not report
them.
+ * - ``capabilities``
+ - Group for device capabilities.
+
Each version can be reported at most once in each version group. Firmware
components stored on the flash should feature in both the ``running`` and
``stored`` sections, if device is capable of reporting ``stored`` versions
@@ -1687,6 +1687,8 @@ int devlink_info_version_stored_put(struct devlink_info_req *req,
int devlink_info_version_running_put(struct devlink_info_req *req,
const char *version_name,
const char *version_value);
+int devlink_info_device_capability_put(struct devlink_info_req *req,
+ const char *capability_name);
int devlink_fmsg_obj_nest_start(struct devlink_fmsg *fmsg);
int devlink_fmsg_obj_nest_end(struct devlink_fmsg *fmsg);
@@ -551,6 +551,9 @@ enum devlink_attr {
DEVLINK_ATTR_RATE_NODE_NAME, /* string */
DEVLINK_ATTR_RATE_PARENT_NODE_NAME, /* string */
+ DEVLINK_ATTR_INFO_DEVICE_CAPABILITY_LIST, /* nested */
+ DEVLINK_ATTR_INFO_DEVICE_CAPABILITY_NAME, /* string */
+
/* add new attributes above here, update the policy in devlink.c */
__DEVLINK_ATTR_MAX,
@@ -5850,6 +5850,31 @@ int devlink_info_version_running_put(struct devlink_info_req *req,
}
EXPORT_SYMBOL_GPL(devlink_info_version_running_put);
+int devlink_info_device_capability_put(struct devlink_info_req *req,
+ const char *capability_name)
+{
+ struct nlattr *nest;
+ int err;
+
+ nest = nla_nest_start(req->msg, DEVLINK_ATTR_INFO_DEVICE_CAPABILITY_LIST);
+ if (!nest)
+ return -EMSGSIZE;
+
+ err = nla_put_string(req->msg, DEVLINK_ATTR_INFO_DEVICE_CAPABILITY_NAME,
+ capability_name);
+ if (err)
+ goto nla_put_failure;
+
+ nla_nest_end(req->msg, nest);
+
+ return 0;
+
+nla_put_failure:
+ nla_nest_cancel(req->msg, nest);
+ return err;
+}
+EXPORT_SYMBOL_GPL(devlink_info_device_capability_put);
+
static int
devlink_nl_info_fill(struct sk_buff *msg, struct devlink *devlink,
enum devlink_command cmd, u32 portid,