Commit 9d21c0d8 authored by hayeswang's avatar hayeswang Committed by David S. Miller

r8152: move the setting for the default speed

Move calling set_speed() from open() to rtl_hw_phy_work_func_t().
Then, we would set the default speed only for first initialization
or after resuming.

Besides, the set_speed() could handle the flag of PHY_RESET which
would be set in rtl_ops.hw_phy_cfg().
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a028a9e0
...@@ -3051,6 +3051,10 @@ static void rtl_hw_phy_work_func_t(struct work_struct *work) ...@@ -3051,6 +3051,10 @@ static void rtl_hw_phy_work_func_t(struct work_struct *work)
tp->rtl_ops.hw_phy_cfg(tp); tp->rtl_ops.hw_phy_cfg(tp);
rtl8152_set_speed(tp, AUTONEG_ENABLE,
tp->mii.supports_gmii ? SPEED_1000 : SPEED_100,
DUPLEX_FULL);
mutex_unlock(&tp->control); mutex_unlock(&tp->control);
usb_autopm_put_interface(tp->intf); usb_autopm_put_interface(tp->intf);
...@@ -3104,9 +3108,6 @@ static int rtl8152_open(struct net_device *netdev) ...@@ -3104,9 +3108,6 @@ static int rtl8152_open(struct net_device *netdev)
tp->rtl_ops.up(tp); tp->rtl_ops.up(tp);
rtl8152_set_speed(tp, AUTONEG_ENABLE,
tp->mii.supports_gmii ? SPEED_1000 : SPEED_100,
DUPLEX_FULL);
netif_carrier_off(netdev); netif_carrier_off(netdev);
netif_start_queue(netdev); netif_start_queue(netdev);
set_bit(WORK_ENABLE, &tp->flags); set_bit(WORK_ENABLE, &tp->flags);
...@@ -3549,10 +3550,6 @@ static int rtl8152_resume(struct usb_interface *intf) ...@@ -3549,10 +3550,6 @@ static int rtl8152_resume(struct usb_interface *intf)
napi_enable(&tp->napi); napi_enable(&tp->napi);
} else { } else {
tp->rtl_ops.up(tp); tp->rtl_ops.up(tp);
rtl8152_set_speed(tp, AUTONEG_ENABLE,
tp->mii.supports_gmii ?
SPEED_1000 : SPEED_100,
DUPLEX_FULL);
netif_carrier_off(tp->netdev); netif_carrier_off(tp->netdev);
set_bit(WORK_ENABLE, &tp->flags); set_bit(WORK_ENABLE, &tp->flags);
} }
......
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