From: Chiqijun chiqijun@huawei.com
driver inclusion category: bugfix bugzilla: 4472
-----------------------------------------------------------------------
When the driver incorporates new features, but the firmware is an old version, some commands are not supported by the firmware. After the driver sends the command, printing the error level log will mislead the user to think that there is an abnormality, so modify the print and log level.
Signed-off-by: Chiqijun chiqijun@huawei.com Reviewed-by: Wangxiaoyun cloud.wangxiaoyun@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/huawei/hinic/hinic_hwdev.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c b/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c index 1178e53be9c6..036ab76d714b 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_hwdev.c @@ -655,7 +655,8 @@ static void __print_status_info(struct hinic_hwdev *dev, } }
-static bool hinic_status_need_special_handle(enum hinic_mod_type mod, +static bool hinic_status_need_special_handle(struct hinic_hwdev *dev, + enum hinic_mod_type mod, u8 cmd, u8 status) { if (mod == HINIC_MOD_L2NIC) { @@ -671,6 +672,17 @@ static bool hinic_status_need_special_handle(enum hinic_mod_type mod, return true; }
+ if (status == HINIC_MGMT_STATUS_ERR_UNSUPPORT) { + if (mod == HINIC_MOD_L2NIC) + sdk_warn(dev->dev_hdl, "Mgmt command: mod(0x%x) cmd(0x%x) not supported\n", + mod, cmd); + else + sdk_warn(dev->dev_hdl, "Mgmt command: mod(0x%x) cmd(0x%x) not supported\n", + mod, cmd); + + return true; + } + return false; }
@@ -693,7 +705,7 @@ static void hinic_print_status_info(void *hwdev, enum hinic_mod_type mod, if (!status) return;
- if (hinic_status_need_special_handle(mod, cmd, status)) + if (hinic_status_need_special_handle(dev, mod, cmd, status)) return;
size = ARRAY_SIZE(mgmt_status_log);