diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-01-05 13:03:07 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-01-05 13:03:07 +0000 |
commit | 1cbf0fbcb42843eeda5e03fe34f9cf7c1db99f49 (patch) | |
tree | 3453ca0a098d90e16923e97d0eeca0446d6fb4d8 /target/linux/generic/files/drivers/net/phy/ar8216.h | |
parent | cc02d4c72dbe7b4ef143e390776792260503bd53 (diff) | |
download | mtk-20170518-1cbf0fbcb42843eeda5e03fe34f9cf7c1db99f49.zip mtk-20170518-1cbf0fbcb42843eeda5e03fe34f9cf7c1db99f49.tar.gz mtk-20170518-1cbf0fbcb42843eeda5e03fe34f9cf7c1db99f49.tar.bz2 |
ar8216: factor out AR8327/AR8337-specific driver code into ar8327.c
Move all AR8327/AR8337-specific driver code into a separate source file
ar8327.c and adjust patches so that ar8327.c is compiled if
CONFIG_AR8216_PHY is set.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
SVN-Revision: 43845
Diffstat (limited to 'target/linux/generic/files/drivers/net/phy/ar8216.h')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8216.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h b/target/linux/generic/files/drivers/net/phy/ar8216.h index 3d2e6e4..50f2252 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.h +++ b/target/linux/generic/files/drivers/net/phy/ar8216.h @@ -419,6 +419,76 @@ struct ar8xxx_priv { int monitor_port; }; +u32 +ar8xxx_read(struct ar8xxx_priv *priv, int reg); +void +ar8xxx_write(struct ar8xxx_priv *priv, int reg, u32 val); +u32 +ar8xxx_rmw(struct ar8xxx_priv *priv, int reg, u32 mask, u32 val); + +void +ar8xxx_phy_dbg_write(struct ar8xxx_priv *priv, int phy_addr, + u16 dbg_addr, u16 dbg_data); +void +ar8xxx_phy_mmd_write(struct ar8xxx_priv *priv, int phy_addr, u16 addr, u16 data); +void +ar8xxx_phy_init(struct ar8xxx_priv *priv); +int +ar8xxx_sw_set_vlan(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_get_vlan(struct switch_dev *dev, const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_set_reset_mibs(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_set_mirror_rx_enable(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_get_mirror_rx_enable(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_set_mirror_tx_enable(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_get_mirror_tx_enable(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_set_mirror_monitor_port(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_get_mirror_monitor_port(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_set_mirror_source_port(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_get_mirror_source_port(struct switch_dev *dev, + const struct switch_attr *attr, + struct switch_val *val); +int +ar8xxx_sw_set_pvid(struct switch_dev *dev, int port, int vlan); +int +ar8xxx_sw_get_pvid(struct switch_dev *dev, int port, int *vlan); +int +ar8xxx_sw_hw_apply(struct switch_dev *dev); +int +ar8xxx_sw_reset_switch(struct switch_dev *dev); +int +ar8xxx_sw_get_port_link(struct switch_dev *dev, int port, + struct switch_port_link *link); +int +ar8216_wait_bit(struct ar8xxx_priv *priv, int reg, u32 mask, u32 val); + static inline struct ar8xxx_priv * swdev_to_ar8xxx(struct switch_dev *swdev) { @@ -460,4 +530,10 @@ static inline bool chip_is_ar8337(struct ar8xxx_priv *priv) return priv->chip_ver == AR8XXX_VER_AR8337; } +static inline void +ar8xxx_reg_set(struct ar8xxx_priv *priv, int reg, u32 val) +{ + ar8xxx_rmw(priv, reg, 0, val); +} + #endif |