kernel: rtl8367b: use id as a bit offset for BYPASS_LINE_RATE

In RTL8367B (RTL8367RB/RTL8367R-VB), the driver in GPL tars of the
devices with this switch directly uses the ID of external interface
as a bit offset.

We should use the same way.

ref (RTL8367B):
  - ASUS RT-N56U
  - TP-Link Archer C2 v1

ref (RTL8367):
  - TP-Link TL-WR2543ND v1

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
master
INAGAKI Hiroshi 2020-03-30 15:19:50 +09:00 committed by Chuanhong Guo
parent e714cf4195
commit 817e132332
1 changed files with 2 additions and 4 deletions

View File

@ -813,8 +813,7 @@ static int rtl8367b_extif_set_mode(struct rtl8366_smi *smi, int id,
case RTL8367_EXTIF_MODE_TMII_MAC: case RTL8367_EXTIF_MODE_TMII_MAC:
case RTL8367_EXTIF_MODE_TMII_PHY: case RTL8367_EXTIF_MODE_TMII_PHY:
REG_RMW(smi, RTL8367B_BYPASS_LINE_RATE_REG, REG_RMW(smi, RTL8367B_BYPASS_LINE_RATE_REG, BIT(id), BIT(id));
BIT((id + 1) % 2), BIT((id + 1) % 2));
break; break;
case RTL8367_EXTIF_MODE_GMII: case RTL8367_EXTIF_MODE_GMII:
@ -827,8 +826,7 @@ static int rtl8367b_extif_set_mode(struct rtl8366_smi *smi, int id,
case RTL8367_EXTIF_MODE_MII_MAC: case RTL8367_EXTIF_MODE_MII_MAC:
case RTL8367_EXTIF_MODE_MII_PHY: case RTL8367_EXTIF_MODE_MII_PHY:
case RTL8367_EXTIF_MODE_DISABLED: case RTL8367_EXTIF_MODE_DISABLED:
REG_RMW(smi, RTL8367B_BYPASS_LINE_RATE_REG, REG_RMW(smi, RTL8367B_BYPASS_LINE_RATE_REG, BIT(id), 0);
BIT((id + 1) % 2), 0);
REG_RMW(smi, RTL8367B_EXT_RGMXF_REG(id), BIT(6), 0); REG_RMW(smi, RTL8367B_EXT_RGMXF_REG(id), BIT(6), 0);
break; break;