On Wed, 16 Sep 2020 20:02:01 -0700 Shannon Nelson wrote: > The dev flash status notify function parameter lists are getting > rather long, so add a struct to be filled and passed rather than > continuously changing the function signatures. > > Signed-off-by: Shannon Nelson <snel...@pensando.io> > --- > include/net/devlink.h | 21 ++++++++++++ > net/core/devlink.c | 80 +++++++++++++++++++++++-------------------- > 2 files changed, 63 insertions(+), 38 deletions(-) > > diff --git a/include/net/devlink.h b/include/net/devlink.h > index f206accf80ad..9ab2014885cb 100644 > --- a/include/net/devlink.h > +++ b/include/net/devlink.h > @@ -391,6 +391,27 @@ struct devlink_param_gset_ctx { > enum devlink_param_cmode cmode; > }; > > +/** > + * struct devlink_flash_notify - devlink dev flash notify data > + * @cmd: devlink notify command code > + * @status_msg: current status string > + * @component: firmware component being updated > + * @done: amount of work completed of total amount > + * @total: amount of work expected to be done > + * @timeout: expected max timeout in seconds > + * > + * These are values to be given to userland to be displayed in order > + * to show current activity in a firmware update process. > + */ > +struct devlink_flash_notify { > + enum devlink_command cmd;
I'd leave out cmd out of the params structure, otherwise I'll be slightly awkward for drivers to fill in given the current helpers are per cmd. > + const char *status_msg; > + const char *component; > + unsigned long done; > + unsigned long total; > + unsigned long timeout; > +};