Commit bc73241e authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: rename CPCMD_QUIRK_MASK and apply it on all chip versions

CPCMD_QUIRK_MASK isn't specific to certain chip versions. The vendor
driver applies this mask to all 8168 versions. Therefore remove QUIRK
from the mask name and apply it on all chip versions.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ec9a4088
...@@ -490,6 +490,7 @@ enum rtl_register_content { ...@@ -490,6 +490,7 @@ enum rtl_register_content {
PCIDAC = (1 << 4), PCIDAC = (1 << 4),
PCIMulRW = (1 << 3), PCIMulRW = (1 << 3),
#define INTT_MASK GENMASK(1, 0) #define INTT_MASK GENMASK(1, 0)
#define CPCMD_MASK (Normal_mode | RxVlan | RxChkSum | INTT_MASK)
/* rtl8169_PHYstatus */ /* rtl8169_PHYstatus */
TBI_Enable = 0x80, TBI_Enable = 0x80,
...@@ -573,7 +574,6 @@ enum rtl_rx_desc_bit { ...@@ -573,7 +574,6 @@ enum rtl_rx_desc_bit {
}; };
#define RsvdMask 0x3fffc000 #define RsvdMask 0x3fffc000
#define CPCMD_QUIRK_MASK (Normal_mode | RxVlan | RxChkSum | INTT_MASK)
struct TxDesc { struct TxDesc {
__le32 opts1; __le32 opts1;
...@@ -4210,6 +4210,9 @@ static void rtl_hw_start(struct rtl8169_private *tp) ...@@ -4210,6 +4210,9 @@ static void rtl_hw_start(struct rtl8169_private *tp)
{ {
rtl_unlock_config_regs(tp); rtl_unlock_config_regs(tp);
tp->cp_cmd &= CPCMD_MASK;
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
tp->hw_start(tp); tp->hw_start(tp);
rtl_set_rx_max_size(tp); rtl_set_rx_max_size(tp);
...@@ -4377,9 +4380,6 @@ static void rtl_hw_start_8168bb(struct rtl8169_private *tp) ...@@ -4377,9 +4380,6 @@ static void rtl_hw_start_8168bb(struct rtl8169_private *tp)
{ {
RTL_W8(tp, Config3, RTL_R8(tp, Config3) & ~Beacon_en); RTL_W8(tp, Config3, RTL_R8(tp, Config3) & ~Beacon_en);
tp->cp_cmd &= CPCMD_QUIRK_MASK;
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
if (tp->dev->mtu <= ETH_DATA_LEN) { if (tp->dev->mtu <= ETH_DATA_LEN) {
rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B | rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B |
PCI_EXP_DEVCTL_NOSNOOP_EN); PCI_EXP_DEVCTL_NOSNOOP_EN);
...@@ -4405,9 +4405,6 @@ static void __rtl_hw_start_8168cp(struct rtl8169_private *tp) ...@@ -4405,9 +4405,6 @@ static void __rtl_hw_start_8168cp(struct rtl8169_private *tp)
rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B);
rtl_disable_clock_request(tp); rtl_disable_clock_request(tp);
tp->cp_cmd &= CPCMD_QUIRK_MASK;
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
} }
static void rtl_hw_start_8168cp_1(struct rtl8169_private *tp) static void rtl_hw_start_8168cp_1(struct rtl8169_private *tp)
...@@ -4435,9 +4432,6 @@ static void rtl_hw_start_8168cp_2(struct rtl8169_private *tp) ...@@ -4435,9 +4432,6 @@ static void rtl_hw_start_8168cp_2(struct rtl8169_private *tp)
if (tp->dev->mtu <= ETH_DATA_LEN) if (tp->dev->mtu <= ETH_DATA_LEN)
rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B);
tp->cp_cmd &= CPCMD_QUIRK_MASK;
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
} }
static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp) static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp)
...@@ -4453,9 +4447,6 @@ static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp) ...@@ -4453,9 +4447,6 @@ static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp)
if (tp->dev->mtu <= ETH_DATA_LEN) if (tp->dev->mtu <= ETH_DATA_LEN)
rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B);
tp->cp_cmd &= CPCMD_QUIRK_MASK;
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
} }
static void rtl_hw_start_8168c_1(struct rtl8169_private *tp) static void rtl_hw_start_8168c_1(struct rtl8169_private *tp)
...@@ -4511,9 +4502,6 @@ static void rtl_hw_start_8168d(struct rtl8169_private *tp) ...@@ -4511,9 +4502,6 @@ static void rtl_hw_start_8168d(struct rtl8169_private *tp)
if (tp->dev->mtu <= ETH_DATA_LEN) if (tp->dev->mtu <= ETH_DATA_LEN)
rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B);
tp->cp_cmd &= CPCMD_QUIRK_MASK;
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
} }
static void rtl_hw_start_8168dp(struct rtl8169_private *tp) static void rtl_hw_start_8168dp(struct rtl8169_private *tp)
...@@ -5148,9 +5136,6 @@ static void rtl_hw_start_8101(struct rtl8169_private *tp) ...@@ -5148,9 +5136,6 @@ static void rtl_hw_start_8101(struct rtl8169_private *tp)
RTL_W8(tp, MaxTxPacketSize, TxPacketMax); RTL_W8(tp, MaxTxPacketSize, TxPacketMax);
tp->cp_cmd &= CPCMD_QUIRK_MASK;
RTL_W16(tp, CPlusCmd, tp->cp_cmd);
rtl_hw_config(tp); rtl_hw_config(tp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment