Skip to content

Commit 1d9b041

Browse files
Russell Kingdavem330
authored andcommitted
net: marvell: mvpp2: use mvpp2_is_xlg() helper elsewhere
There are several places which make the decision whether to access the XLGMAC vs GMAC that only check for PHY_INTERFACE_MODE_10GKR and not its XAUI variant. Switch these to use the new helper so that we have consistency through the driver. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b7d286f commit 1d9b041

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ static void mvpp22_gop_unmask_irq(struct mvpp2_port *port)
11061106
if (port->gop_id == 0) {
11071107
/* Enable the XLG/GIG irqs for this port */
11081108
val = readl(port->base + MVPP22_XLG_EXT_INT_MASK);
1109-
if (port->phy_interface == PHY_INTERFACE_MODE_10GKR)
1109+
if (mvpp2_is_xlg(port->phy_interface))
11101110
val |= MVPP22_XLG_EXT_INT_MASK_XLG;
11111111
else
11121112
val |= MVPP22_XLG_EXT_INT_MASK_GIG;
@@ -2456,8 +2456,7 @@ static irqreturn_t mvpp2_link_status_isr(int irq, void *dev_id)
24562456

24572457
mvpp22_gop_mask_irq(port);
24582458

2459-
if (port->gop_id == 0 &&
2460-
port->phy_interface == PHY_INTERFACE_MODE_10GKR) {
2459+
if (port->gop_id == 0 && mvpp2_is_xlg(port->phy_interface)) {
24612460
val = readl(port->base + MVPP22_XLG_INT_STAT);
24622461
if (val & MVPP22_XLG_INT_STAT_LINK) {
24632462
event = true;
@@ -4665,7 +4664,7 @@ static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
46654664
bool change_interface = port->phy_interface != state->interface;
46664665

46674666
/* Check for invalid configuration */
4668-
if (state->interface == PHY_INTERFACE_MODE_10GKR && port->gop_id != 0) {
4667+
if (mvpp2_is_xlg(state->interface) && port->gop_id != 0) {
46694668
netdev_err(dev, "Invalid mode on %s\n", dev->name);
46704669
return;
46714670
}
@@ -4685,7 +4684,7 @@ static void mvpp2_mac_config(struct net_device *dev, unsigned int mode,
46854684
}
46864685

46874686
/* mac (re)configuration */
4688-
if (state->interface == PHY_INTERFACE_MODE_10GKR)
4687+
if (mvpp2_is_xlg(state->interface))
46894688
mvpp2_xlg_config(port, mode, state);
46904689
else if (phy_interface_mode_is_rgmii(state->interface) ||
46914690
phy_interface_mode_is_8023z(state->interface) ||
@@ -4707,8 +4706,7 @@ static void mvpp2_mac_link_up(struct net_device *dev, unsigned int mode,
47074706
struct mvpp2_port *port = netdev_priv(dev);
47084707
u32 val;
47094708

4710-
if (!phylink_autoneg_inband(mode) &&
4711-
interface != PHY_INTERFACE_MODE_10GKR) {
4709+
if (!phylink_autoneg_inband(mode) && !mvpp2_is_xlg(interface)) {
47124710
val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG);
47134711
val &= ~MVPP2_GMAC_FORCE_LINK_DOWN;
47144712
val |= MVPP2_GMAC_FORCE_LINK_PASS;
@@ -4728,8 +4726,7 @@ static void mvpp2_mac_link_down(struct net_device *dev, unsigned int mode,
47284726
struct mvpp2_port *port = netdev_priv(dev);
47294727
u32 val;
47304728

4731-
if (!phylink_autoneg_inband(mode) &&
4732-
interface != PHY_INTERFACE_MODE_10GKR) {
4729+
if (!phylink_autoneg_inband(mode) && !mvpp2_is_xlg(interface)) {
47334730
val = readl(port->base + MVPP2_GMAC_AUTONEG_CONFIG);
47344731
val &= ~MVPP2_GMAC_FORCE_LINK_PASS;
47354732
val |= MVPP2_GMAC_FORCE_LINK_DOWN;

0 commit comments

Comments
 (0)