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

!322 [sync] PR-321: net: hns3: fix the HCLGE_OPC_WOL_CFG opcode id for wol and...

!322 [sync] PR-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: @openeuler-sync-bot 
 

### 1. Origin pull request:
https://gitee.com/openeuler/kernel/pulls/321

### 2. Original pull request related issue(s):
https://gitee.com/openeuler/kernel/issues/I65FSF

### 3. Original pull request related commit(s):
| Sha | Datetime | Message |
|---|---|---|
|[987f422a](https://gitee.com/openeuler/kernel/commits/987f422a346e84c9d29a7a83d4a8448a02bad97c)|2022-12-09 11:01:58 +0800 CST|net: hns3: fix the HCLGE_OPC_WOL_CFG opcode id for wol<br><br>driver inclusion<br>category: bugfix<br>bugzilla: https://gitee.com/openeuler/kernel/issues/I65FSF<br>CVE: NA<br><br>----------------------------------------------------------------------<br><br>Fix the HCLGE_OPC_WOL_CFG opcode id for wol.<br><br>Fixes: c3c5f044 ("net: hns3: support wake on lan configuration and query")<br>Signed-off-by: Hao Lan <lanhao@huawei.com><br>Signed-off-by: Jiantao Xiao <xiaojiantao1@h-partners.com><br>|
|[c92b8f62](https://gitee.com/openeuler/kernel/commits/c92b8f62f9246d96e19300d5ad3804d2e6d578f7)|2022-12-09 10:54:46 +0800 CST|net: hns3: fix getting supported parameter from driver in hclge_set_wol<br><br>driver inclusion<br>category: bugfix<br>bugzilla: https://gitee.com/openeuler/kernel/issues/I65FSF<br>CVE: NA<br><br>----------------------------------------------------------------------<br><br>The driver should use the supported parameter got from firmware,<br>not from user,to validate the wol mode.<br><br>Fixes: c3c5f044 ("net: hns3: support wake on lan configuration and query")<br>Signed-off-by: Hao Lan <lanhao@huawei.com><br>Signed-off-by: Jiantao Xiao <xiaojiantao1@h-partners.com><br>|
 
 
Link:https://gitee.com/openeuler/kernel/pulls/322

 
Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 60cd8669 b1d672d3
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;