Skip to content

Commit 6e10001

Browse files
committed
Merge branch 'r8152-fixes'
Hayes Wang says: ==================== r8152: fix flow control settings These patches fix the settings of RX FIFO about flow control. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 3c53cd6 + b75d612 commit 6e10001

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

drivers/net/usb/r8152.c

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,6 +5906,11 @@ static void r8153_enter_oob(struct r8152 *tp)
59065906
ocp_data &= ~NOW_IS_OOB;
59075907
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
59085908

5909+
/* RX FIFO settings for OOB */
5910+
ocp_write_dword(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL0, RXFIFO_THR1_OOB);
5911+
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL1, RXFIFO_THR2_OOB);
5912+
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RXFIFO_CTRL2, RXFIFO_THR3_OOB);
5913+
59095914
rtl_disable(tp);
59105915
rtl_reset_bmu(tp);
59115916

@@ -6431,21 +6436,8 @@ static void r8156_fc_parameter(struct r8152 *tp)
64316436
u32 pause_on = tp->fc_pause_on ? tp->fc_pause_on : fc_pause_on_auto(tp);
64326437
u32 pause_off = tp->fc_pause_off ? tp->fc_pause_off : fc_pause_off_auto(tp);
64336438

6434-
switch (tp->version) {
6435-
case RTL_VER_10:
6436-
case RTL_VER_11:
6437-
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_FULL, pause_on / 8);
6438-
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_EMPTY, pause_off / 8);
6439-
break;
6440-
case RTL_VER_12:
6441-
case RTL_VER_13:
6442-
case RTL_VER_15:
6443-
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_FULL, pause_on / 16);
6444-
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_EMPTY, pause_off / 16);
6445-
break;
6446-
default:
6447-
break;
6448-
}
6439+
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_FULL, pause_on / 16);
6440+
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_EMPTY, pause_off / 16);
64496441
}
64506442

64516443
static void rtl8156_change_mtu(struct r8152 *tp)
@@ -6557,6 +6549,11 @@ static void rtl8156_down(struct r8152 *tp)
65576549
ocp_data &= ~NOW_IS_OOB;
65586550
ocp_write_byte(tp, MCU_TYPE_PLA, PLA_OOB_CTRL, ocp_data);
65596551

6552+
/* RX FIFO settings for OOB */
6553+
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RXFIFO_FULL, 64 / 16);
6554+
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_FULL, 1024 / 16);
6555+
ocp_write_word(tp, MCU_TYPE_PLA, PLA_RX_FIFO_EMPTY, 4096 / 16);
6556+
65606557
rtl_disable(tp);
65616558
rtl_reset_bmu(tp);
65626559

0 commit comments

Comments
 (0)