Unverified Commit 4741bc65 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!321 net: hns3: fix the HCLGE_OPC_WOL_CFG opcode id for wol and fix the...

!321 net: hns3: fix the HCLGE_OPC_WOL_CFG opcode id for wol and fix the incorrect way to obtain parameters.

Merge Pull Request from: @svishen 
 
(1)The driver should use the supported parameter got from firmware, not from user, to validate the wol mode.
(2)fix the HCLGE_OPC_WOL_CFG opcode id for wol.

issue:
https://gitee.com/openeuler/kernel/issues/I65FSF 
 
Link:https://gitee.com/openeuler/kernel/pulls/321

 
Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 20ca80a7 987f422a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */
+1 −3
Original line number Diff line number Diff line
@@ -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;