net/mlxfw: Improve FSM err message reporting and return codes
authorSaeed Mahameed <saeedm@mellanox.com>
Fri, 21 Feb 2020 21:45:59 +0000 (21:45 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Feb 2020 23:41:10 +0000 (15:41 -0800)
commit86a1270fd79f99e7aa85c2c81cd59d0eab92112f
treea0c33cf11b80134ee6b6a85c5d9cf23ab2076e8f
parent4ae575661f98915410a90e11a27b7496e50df8cf
net/mlxfw: Improve FSM err message reporting and return codes

Report unique and standard error codes corresponding to the specific
FW flash error. In addition, add a more detailed error messages to
netlink.

Before:
$ devlink dev flash pci/0000:05:00.0 file ...
Error: mlxfw: Firmware flash failed.
devlink answers: Invalid argument

After:
$ devlink dev flash pci/0000:05:00.0 file ...
Error: mlxfw: Firmware flash failed: pending reset.
devlink answers: Device busy

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxfw/mlxfw_fsm.c