ionic: add devlink firmware update

Add support for firmware update through the devlink interface.
This update copies the firmware object into the device, asks
the current firmware to install it, then asks the firmware to
select the new firmware for the next boot-up.

The install and select steps are launched as asynchronous
requests, which are then followed up with status request
commands.  These status request commands will be answered with
an EAGAIN return value and will try again until the request
has completed or reached the timeout specified.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Shannon Nelson
2020-09-17 18:13:27 -07:00
committed by David S. Miller
parent 87c905d84f
commit 30b5191ad1
5 changed files with 239 additions and 9 deletions

View File

@@ -9,6 +9,19 @@
#include "ionic_lif.h"
#include "ionic_devlink.h"
static int ionic_dl_flash_update(struct devlink *dl,
const char *fwname,
const char *component,
struct netlink_ext_ack *extack)
{
struct ionic *ionic = devlink_priv(dl);
if (component)
return -EOPNOTSUPP;
return ionic_firmware_update(ionic->lif, fwname, extack);
}
static int ionic_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
struct netlink_ext_ack *extack)
{
@@ -48,6 +61,7 @@ static int ionic_dl_info_get(struct devlink *dl, struct devlink_info_req *req,
static const struct devlink_ops ionic_dl_ops = {
.info_get = ionic_dl_info_get,
.flash_update = ionic_dl_flash_update,
};
struct ionic *ionic_devlink_alloc(struct device *dev)