aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
diff options
context:
space:
mode:
authorShannon Nelson <snelson@pensando.io>2020-09-17 18:13:27 -0700
committerDavid S. Miller <davem@davemloft.net>2020-09-18 13:54:23 -0700
commit30b5191ad103b8ebfbbbeb3f45dc511c3156cfe6 (patch)
tree9ff96728f22991796bf9b6364479abb486b6aee3 /drivers/net/ethernet/pensando/ionic/ionic_devlink.c
parentionic: update the fw update api (diff)
downloadlinux-dev-30b5191ad103b8ebfbbbeb3f45dc511c3156cfe6.tar.xz
linux-dev-30b5191ad103b8ebfbbbeb3f45dc511c3156cfe6.zip
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>
Diffstat (limited to 'drivers/net/ethernet/pensando/ionic/ionic_devlink.c')
-rw-r--r--drivers/net/ethernet/pensando/ionic/ionic_devlink.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
index 8d9fb2e19cca..5348f05ebc32 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_devlink.c
@@ -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)