From 9e0b00881e50623b1d1ef7e801e09edec37ab83a Mon Sep 17 00:00:00 2001 From: Hao Lan Date: Fri, 9 Dec 2022 10:54:46 +0800 Subject: [PATCH 1/2] net: hns3: fix getting supported parameter from driver in hclge_set_wol driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65FSF CVE: NA ---------------------------------------------------------------------- The driver should use the supported parameter got from firmware, not from user,to validate the wol mode. Fixes: c3c5f044b7dc ("net: hns3: support wake on lan configuration and query") Signed-off-by: Hao Lan Signed-off-by: Jiantao Xiao (cherry picked from commit c92b8f62f9246d96e19300d5ad3804d2e6d578f7) --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 0eb66ddf4c4b..febd505b30ad 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -12199,12 +12199,10 @@ static int hclge_set_wol(struct hnae3_handle *handle, struct hclge_vport *vport = hclge_get_vport(handle); struct hclge_dev *hdev = vport->back; struct hclge_wol_info *wol_info = &hdev->hw.mac.wol; - u32 wol_supported; u32 wol_mode; - wol_supported = hclge_wol_mode_from_ethtool(wol->supported); wol_mode = hclge_wol_mode_from_ethtool(wol->wolopts); - if (wol_mode & ~wol_supported) + if (wol_mode & ~wol_info->wol_support_mode) return -EINVAL; wol_info->wol_current_mode = wol_mode; -- Gitee From b1d672d3b14be78e38218f3b8ccdc6494b41a346 Mon Sep 17 00:00:00 2001 From: Hao Lan Date: Fri, 9 Dec 2022 11:01:58 +0800 Subject: [PATCH 2/2] net: hns3: fix the HCLGE_OPC_WOL_CFG opcode id for wol driver inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I65FSF CVE: NA ---------------------------------------------------------------------- Fix the HCLGE_OPC_WOL_CFG opcode id for wol. Fixes: c3c5f044b7dc ("net: hns3: support wake on lan configuration and query") Signed-off-by: Hao Lan Signed-off-by: Jiantao Xiao (cherry picked from commit 987f422a346e84c9d29a7a83d4a8448a02bad97c) --- .../net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h index 2fde935dcbbd..c7146256f721 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_common/hclge_comm_cmd.h @@ -294,8 +294,8 @@ enum hclge_opcode_type { HCLGE_PPP_CMD0_INT_CMD = 0x2100, HCLGE_PPP_CMD1_INT_CMD = 0x2101, HCLGE_MAC_ETHERTYPE_IDX_RD = 0x2105, - HCLGE_OPC_WOL_CFG = 0x2200, HCLGE_OPC_WOL_GET_SUPPORTED_MODE = 0x2201, + HCLGE_OPC_WOL_CFG = 0x2202, HCLGE_NCSI_INT_EN = 0x2401, /* ROH MAC commands */ -- Gitee