aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/usb/r8152.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 8a7c876e4ebd..bc5d5691c99c 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1447,13 +1447,11 @@ static inline u8 rtl8152_get_speed(struct r8152 *tp)
1447 return ocp_read_byte(tp, MCU_TYPE_PLA, PLA_PHYSTATUS); 1447 return ocp_read_byte(tp, MCU_TYPE_PLA, PLA_PHYSTATUS);
1448} 1448}
1449 1449
1450static int rtl8152_enable(struct r8152 *tp) 1450static void rtl_set_eee_plus(struct r8152 *tp)
1451{ 1451{
1452 u32 ocp_data; 1452 u32 ocp_data;
1453 int i, ret;
1454 u8 speed; 1453 u8 speed;
1455 1454
1456 set_tx_qlen(tp);
1457 speed = rtl8152_get_speed(tp); 1455 speed = rtl8152_get_speed(tp);
1458 if (speed & _10bps) { 1456 if (speed & _10bps) {
1459 ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR); 1457 ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR);
@@ -1464,6 +1462,12 @@ static int rtl8152_enable(struct r8152 *tp)
1464 ocp_data &= ~EEEP_CR_EEEP_TX; 1462 ocp_data &= ~EEEP_CR_EEEP_TX;
1465 ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR, ocp_data); 1463 ocp_write_word(tp, MCU_TYPE_PLA, PLA_EEEP_CR, ocp_data);
1466 } 1464 }
1465}
1466
1467static int rtl_enable(struct r8152 *tp)
1468{
1469 u32 ocp_data;
1470 int i, ret;
1467 1471
1468 r8152b_reset_packet_filter(tp); 1472 r8152b_reset_packet_filter(tp);
1469 1473
@@ -1485,6 +1489,14 @@ static int rtl8152_enable(struct r8152 *tp)
1485 return ret; 1489 return ret;
1486} 1490}
1487 1491
1492static int rtl8152_enable(struct r8152 *tp)
1493{
1494 set_tx_qlen(tp);
1495 rtl_set_eee_plus(tp);
1496
1497 return rtl_enable(tp);
1498}
1499
1488static void rtl8152_disable(struct r8152 *tp) 1500static void rtl8152_disable(struct r8152 *tp)
1489{ 1501{
1490 struct net_device_stats *stats = rtl8152_get_stats(tp->netdev); 1502 struct net_device_stats *stats = rtl8152_get_stats(tp->netdev);