Skip to content

Commit fde25c2

Browse files
daniellertsPaolo Abeni
authored andcommitted
net: ethtool: Allow write mechanism of LPL and both LPL and EPL
CMIS 5.2 standard section 9.4.2 defines four types of firmware update supported mechanism: None, only LPL, only EPL, both LPL and EPL. Currently, only LPL (Local Payload) type of write firmware block is supported. However, if the module supports both LPL and EPL the flashing process wrongly fails for no supporting LPL. Fix that, by allowing the write mechanism to be LPL or both LPL and EPL. Fixes: c4f7813 ("ethtool: cmis_fw_update: add a layer for supporting firmware update using CDB") Reported-by: Vladyslav Mykhaliuk <[email protected]> Signed-off-by: Danielle Ratson <[email protected]> Reviewed-by: Petr Machata <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
1 parent 69139d2 commit fde25c2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

net/ethtool/cmis_fw_update.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ struct cmis_cdb_fw_mng_features_rpl {
3535
__be16 resv7;
3636
};
3737

38-
#define CMIS_CDB_FW_WRITE_MECHANISM_LPL 0x01
38+
enum cmis_cdb_fw_write_mechanism {
39+
CMIS_CDB_FW_WRITE_MECHANISM_LPL = 0x01,
40+
CMIS_CDB_FW_WRITE_MECHANISM_BOTH = 0x11,
41+
};
3942

4043
static int
4144
cmis_fw_update_fw_mng_features_get(struct ethtool_cmis_cdb *cdb,
@@ -64,7 +67,8 @@ cmis_fw_update_fw_mng_features_get(struct ethtool_cmis_cdb *cdb,
6467
}
6568

6669
rpl = (struct cmis_cdb_fw_mng_features_rpl *)args.req.payload;
67-
if (!(rpl->write_mechanism == CMIS_CDB_FW_WRITE_MECHANISM_LPL)) {
70+
if (!(rpl->write_mechanism == CMIS_CDB_FW_WRITE_MECHANISM_LPL ||
71+
rpl->write_mechanism == CMIS_CDB_FW_WRITE_MECHANISM_BOTH)) {
6872
ethnl_module_fw_flash_ntf_err(dev, ntf_params,
6973
"Write LPL is not supported",
7074
NULL);

0 commit comments

Comments
 (0)