mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
generic: fix compilation warning for ar8xxx swconfig for kernel 5.4/5.10
This commit is contained in:
parent
f3887ab8b7
commit
ca094bc318
@ -891,7 +891,11 @@ ar8216_phy_write(struct ar8xxx_priv *priv, int addr, int regnum, u16 val)
|
||||
static int
|
||||
ar8229_hw_init(struct ar8xxx_priv *priv)
|
||||
{
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
|
||||
phy_interface_t phy_if_mode;
|
||||
#else
|
||||
int phy_if_mode;
|
||||
#endif
|
||||
|
||||
if (priv->initialized)
|
||||
return 0;
|
||||
@ -899,7 +903,11 @@ ar8229_hw_init(struct ar8xxx_priv *priv)
|
||||
ar8xxx_write(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET);
|
||||
ar8xxx_reg_wait(priv, AR8216_REG_CTRL, AR8216_CTRL_RESET, 0, 1000);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
|
||||
of_get_phy_mode(priv->pdev->of_node, &phy_if_mode);
|
||||
#else
|
||||
phy_if_mode = of_get_phy_mode(priv->pdev->of_node);
|
||||
#endif
|
||||
|
||||
if (phy_if_mode == PHY_INTERFACE_MODE_GMII) {
|
||||
ar8xxx_write(priv, AR8229_REG_OPER_MODE0,
|
||||
@ -1419,7 +1427,8 @@ ar8xxx_sw_reset_switch(struct switch_dev *dev)
|
||||
int i;
|
||||
|
||||
mutex_lock(&priv->reg_mutex);
|
||||
memset(&priv->ar8xxx_priv_volatile, 0, sizeof(priv->ar8xxx_priv_volatile));
|
||||
memset(&priv->vlan, 0, sizeof(struct ar8xxx_priv) -
|
||||
offsetof(struct ar8xxx_priv, vlan));
|
||||
|
||||
for (i = 0; i < dev->vlans; i++)
|
||||
priv->vlan_id[i] = i;
|
||||
@ -2424,9 +2433,7 @@ static int
|
||||
ar8xxx_phy_config_init(struct phy_device *phydev)
|
||||
{
|
||||
struct ar8xxx_priv *priv = phydev->priv;
|
||||
#ifdef CONFIG_ETHERNET_PACKET_MANGLE
|
||||
struct net_device *dev = phydev->attached_dev;
|
||||
#endif
|
||||
int ret;
|
||||
|
||||
if (WARN_ON(!priv))
|
||||
@ -2458,11 +2465,7 @@ ar8xxx_phy_config_init(struct phy_device *phydev)
|
||||
/* VID fixup only needed on ar8216 */
|
||||
if (chip_is_ar8216(priv)) {
|
||||
dev->phy_ptr = priv;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
|
||||
dev->priv_flags |= IFF_NO_IP_ALIGN;
|
||||
#else
|
||||
dev->extra_priv_flags |= IFF_NO_IP_ALIGN;
|
||||
#endif
|
||||
dev->eth_mangle_rx = ar8216_mangle_rx;
|
||||
dev->eth_mangle_tx = ar8216_mangle_tx;
|
||||
}
|
||||
@ -2697,11 +2700,7 @@ ar8xxx_phy_detach(struct phy_device *phydev)
|
||||
|
||||
#ifdef CONFIG_ETHERNET_PACKET_MANGLE
|
||||
dev->phy_ptr = NULL;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
|
||||
dev->priv_flags &= ~IFF_NO_IP_ALIGN;
|
||||
#else
|
||||
dev->extra_priv_flags &= ~IFF_NO_IP_ALIGN;
|
||||
#endif
|
||||
dev->eth_mangle_rx = NULL;
|
||||
dev->eth_mangle_tx = NULL;
|
||||
#endif
|
||||
|
@ -506,7 +506,6 @@ struct ar8xxx_priv {
|
||||
unsigned int use_count;
|
||||
|
||||
/* all fields below are cleared on reset */
|
||||
struct_group(ar8xxx_priv_volatile,
|
||||
bool vlan;
|
||||
|
||||
u16 vlan_id[AR8XXX_MAX_VLANS];
|
||||
@ -521,7 +520,6 @@ struct ar8xxx_priv {
|
||||
int source_port;
|
||||
int monitor_port;
|
||||
u8 port_vlan_prio[AR8X16_MAX_PORTS];
|
||||
);
|
||||
};
|
||||
|
||||
u32
|
||||
|
@ -183,7 +183,7 @@ ar8327_phy_fixup(struct ar8xxx_priv *priv, int phy)
|
||||
|
||||
case 2:
|
||||
ar8xxx_phy_mmd_write(priv, phy, 0x7, 0x3c, 0x0);
|
||||
fallthrough;
|
||||
/* fallthrough */
|
||||
case 4:
|
||||
ar8xxx_phy_mmd_write(priv, phy, 0x3, 0x800d, 0x803f);
|
||||
ar8xxx_phy_dbg_write(priv, phy, 0x3d, 0x6860);
|
||||
|
Loading…
Reference in New Issue
Block a user