Commit be1c1521 authored by Jiantao Xiao's avatar Jiantao Xiao
Browse files

Revert "net: hns3: support wake on lan configuration and query"

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7ON9Y


CVE: NA

----------------------------------------------------------------------

This reverts commit c3c5f044.

Signed-off-by: default avatarJiantao Xiao <xiaojiantao1@h-partners.com>
parent aeb528f9
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -101,7 +101,6 @@ enum HNAE3_DEV_CAP_BITS {
	HNAE3_DEV_SUPPORT_MC_MAC_MNG_B,
	HNAE3_DEV_SUPPORT_CQ_B,
	HNAE3_DEV_SUPPORT_LANE_NUM_B,
	HNAE3_DEV_SUPPORT_WOL_B,
	HNAE3_DEV_SUPPORT_VF_FAULT_B,
	HNAE3_DEV_SUPPORT_NOTIFY_PKT_B,
};
@@ -169,9 +168,6 @@ enum HNAE3_DEV_CAP_BITS {
#define hnae3_ae_dev_lane_num_supported(ae_dev) \
	test_bit(HNAE3_DEV_SUPPORT_LANE_NUM_B, (ae_dev)->caps)

#define hnae3_ae_dev_wol_supported(ae_dev) \
	test_bit(HNAE3_DEV_SUPPORT_WOL_B, (ae_dev)->caps)

#define hnae3_ae_dev_vf_fault_supported(ae_dev) \
	test_bit(HNAE3_DEV_SUPPORT_VF_FAULT_B, (ae_dev)->caps)

@@ -582,10 +578,6 @@ struct hnae3_ae_dev {
 *   Get phc info
 * clean_vf_config
 *   Clean residual vf info after disable sriov
 * get_wol
 *   Get wake on lan info
 * set_wol
 *   Config wake on lan
 */
struct hnae3_ae_ops {
	int (*init_ae_dev)(struct hnae3_ae_dev *ae_dev);
@@ -783,10 +775,6 @@ struct hnae3_ae_ops {
	void (*clean_vf_config)(struct hnae3_ae_dev *ae_dev, int num_vfs);
	int (*get_dscp_prio)(struct hnae3_handle *handle, u8 dscp,
			     u8 *tc_map_mode, u8 *priority);
	void (*get_wol)(struct hnae3_handle *handle,
			struct ethtool_wolinfo *wol);
	int (*set_wol)(struct hnae3_handle *handle,
		       struct ethtool_wolinfo *wol);
	int (*priv_ops)(struct hnae3_handle *handle, int opcode,
			void *data, size_t length);
};
+0 −1
Original line number Diff line number Diff line
@@ -154,7 +154,6 @@ static const struct hclge_comm_caps_bit_map hclge_pf_cmd_caps[] = {
	{HCLGE_COMM_CAP_GRO_B, HNAE3_DEV_SUPPORT_GRO_B},
	{HCLGE_COMM_CAP_FD_B, HNAE3_DEV_SUPPORT_FD_B},
	{HCLGE_COMM_CAP_LANE_NUM_B, HNAE3_DEV_SUPPORT_LANE_NUM_B},
	{HCLGE_COMM_CAP_WOL_B, HNAE3_DEV_SUPPORT_WOL_B},
	{HCLGE_COMM_CAP_VF_FAULT_B, HNAE3_DEV_SUPPORT_VF_FAULT_B},
	{HCLGE_COMM_CAP_NOTIFY_PKT_B, HNAE3_DEV_SUPPORT_NOTIFY_PKT_B},
};
+0 −3
Original line number Diff line number Diff line
@@ -295,8 +295,6 @@ 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_NCSI_INT_EN		= 0x2401,

	/* ROH MAC commands */
@@ -348,7 +346,6 @@ enum HCLGE_COMM_CAP_BITS {
	HCLGE_COMM_CAP_FD_B = 21,
	HCLGE_COMM_CAP_VF_FAULT_B = 26,
	HCLGE_COMM_CAP_LANE_NUM_B = 27,
	HCLGE_COMM_CAP_WOL_B = 28,
	HCLGE_COMM_CAP_NOTIFY_PKT_B = 29,
};

+0 −27
Original line number Diff line number Diff line
@@ -2042,31 +2042,6 @@ static int hns3_get_link_ext_state(struct net_device *netdev,
	return -ENODATA;
}

static void hns3_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;

	if (!hnae3_ae_dev_wol_supported(ae_dev) || !ops->get_wol)
		return;

	ops->get_wol(handle, wol);
}

static int hns3_set_wol(struct net_device *netdev,
			struct ethtool_wolinfo *wol)
{
	struct hnae3_handle *handle = hns3_get_handle(netdev);
	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;

	if (!hnae3_ae_dev_wol_supported(ae_dev) || !ops->set_wol)
		return -EOPNOTSUPP;

	return ops->set_wol(handle, wol);
}

static const struct ethtool_ops hns3vf_ethtool_ops = {
	.supported_coalesce_params = HNS3_ETHTOOL_COALESCE,
	.supported_ring_params = HNS3_ETHTOOL_RING,
@@ -2141,8 +2116,6 @@ static const struct ethtool_ops hns3_ethtool_ops = {
	.set_tunable = hns3_set_tunable,
	.reset = hns3_set_reset,
	.get_link_ext_state = hns3_get_link_ext_state,
	.get_wol = hns3_get_wol,
	.set_wol = hns3_set_wol,
};

void hns3_ethtool_set_ops(struct net_device *netdev)
+0 −24
Original line number Diff line number Diff line
@@ -898,30 +898,6 @@ struct hclge_phy_reg_cmd {
	u8 rsv2[12];
};

enum HCLGE_WOL_MODE {
	HCLGE_WOL_PHY           = BIT(0),
	HCLGE_WOL_UNICAST       = BIT(1),
	HCLGE_WOL_MULTICAST     = BIT(2),
	HCLGE_WOL_BROADCAST     = BIT(3),
	HCLGE_WOL_ARP           = BIT(4),
	HCLGE_WOL_MAGIC         = BIT(5),
	HCLGE_WOL_MAGICSECURED  = BIT(6),
	HCLGE_WOL_FILTER        = BIT(7),
	HCLGE_WOL_DISABLE       = 0,
};

struct hclge_wol_cfg_cmd {
	__le32 wake_on_lan_mode;
	u8 sopass[SOPASS_MAX];
	u8 sopass_size;
	u8 rsv[13];
};

struct hclge_query_wol_supported_cmd {
	__le32 supported_wake_mode;
	u8 rsv[20];
};

struct hclge_hw;
int hclge_cmd_send(struct hclge_hw *hw, struct hclge_desc *desc, int num);
enum hclge_comm_cmd_status hclge_cmd_mdio_write(struct hclge_hw *hw,
Loading