Files
kernel_common_drivers/include/linux/amlogic/aml_phy_debug.h
T
Huqiang Qin b765919d43 eth: Make the old WOL sysfs able to control the functions of the new WOL [1/1]
PD#SWPL-234877

Problem:
The user layer requires a compatible WOL interface.

Solution:
Make the old WOL sysfs able to control the functions of the new WOL.

Verify:
S6/BL201

Change-Id: Ie5ef660ec2929904277a06343445916c3ef481a7
Signed-off-by: Huqiang Qin <huqiang.qin@amlogic.com>
(cherry picked from commit 69a1930ae8a073befee2d45d7cccbf9eea6636da)
2025-10-12 23:21:17 -07:00

104 lines
2.7 KiB
C

/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
/*
* Copyright (c) 2019 Amlogic, Inc. All rights reserved.
*/
#ifndef _STMMAC_MESON_PHY_DEBUG_H
#define _STMMAC_MESON_PHY_DEBUG_H
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/if_ether.h>
#include <linux/crc32.h>
#include <linux/mii.h>
#include <linux/if.h>
#include <linux/if_vlan.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/prefetch.h>
#include <linux/pinctrl/consumer.h>
#include <linux/net_tstamp.h>
#include <linux/phylink.h>
//#include "eth_reg.h"
/*add this to stop checking wol,which will reset phy*/
//extern unsigned int enable_wol_check;
//extern unsigned int tx_amp_bl2;
//extern unsigned int enet_type;
//extern void __iomem *ioaddr_dbg;
//#ifdef CONFIG_AMLOGIC_ETH_PRIVE
/**
* struct phylink - internal data type for phylink
*/
struct phylink {
/* private: */
struct net_device *netdev;
const struct phylink_mac_ops *mac_ops;
struct phylink_config *config;
struct phylink_pcs *pcs;
struct device *dev;
unsigned int old_link_state:1;
unsigned long phylink_disable_state; /* bitmask of disables */
struct phy_device *phydev;
phy_interface_t link_interface; /* PHY_INTERFACE_xxx */
u8 cfg_link_an_mode; /* MLO_AN_xxx */
u8 cur_link_an_mode;
u8 link_port; /* The current non-phy ethtool port */
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
/* The link configuration settings */
struct phylink_link_state link_config;
/* The current settings */
phy_interface_t cur_interface;
struct gpio_desc *link_gpio;
unsigned int link_irq;
struct timer_list link_poll;
void (*get_fixed_state)(struct net_device *dev,
struct phylink_link_state *s);
struct mutex state_mutex;
struct phylink_link_state phy_state;
struct work_struct resolve;
unsigned int pcs_neg_mode;
unsigned int pcs_state;
bool mac_link_dropped;
bool using_mac_select_pcs;
struct sfp_bus *sfp_bus;
bool sfp_may_have_phy;
DECLARE_PHY_INTERFACE_MASK(sfp_interfaces);
__ETHTOOL_DECLARE_LINK_MODE_MASK(sfp_support);
u8 sfp_port;
};
struct wol_sysfs_hook {
bool (*not_empty)(void);
void (*clr_all)(void);
void (*set_all)(void);
};
#ifdef CONFIG_PM_SLEEP
extern unsigned int wol_switch_from_user;
extern unsigned int mdns_switch_from_user;
extern unsigned int support_gpio_wol;
extern unsigned int exphy_mdns_wkup;
extern struct wol_sysfs_hook wol_sysfs_hook;
#endif
extern unsigned int internal_phy;
extern unsigned int tx_amp_bl2;
extern unsigned int voltage_phy;
//#endif
int gmac_create_sysfs(struct phy_device *phydev, void __iomem *ioaddr);
int gmac_remove_sysfs(struct phy_device *phydev);
#endif