aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/skge.c35
1 files changed, 2 insertions, 33 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 53d2059a6604..186eb8ebfda6 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -2896,11 +2896,7 @@ static void skge_tx_timeout(struct net_device *dev)
2896 2896
2897static int skge_change_mtu(struct net_device *dev, int new_mtu) 2897static int skge_change_mtu(struct net_device *dev, int new_mtu)
2898{ 2898{
2899 struct skge_port *skge = netdev_priv(dev);
2900 struct skge_hw *hw = skge->hw;
2901 int port = skge->port;
2902 int err; 2899 int err;
2903 u16 ctl, reg;
2904 2900
2905 if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU) 2901 if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
2906 return -EINVAL; 2902 return -EINVAL;
@@ -2910,40 +2906,13 @@ static int skge_change_mtu(struct net_device *dev, int new_mtu)
2910 return 0; 2906 return 0;
2911 } 2907 }
2912 2908
2913 skge_write32(hw, B0_IMSK, 0); 2909 skge_down(dev);
2914 dev->trans_start = jiffies; /* prevent tx timeout */
2915 netif_stop_queue(dev);
2916 napi_disable(&skge->napi);
2917
2918 ctl = gma_read16(hw, port, GM_GP_CTRL);
2919 gma_write16(hw, port, GM_GP_CTRL, ctl & ~GM_GPCR_RX_ENA);
2920
2921 skge_rx_clean(skge);
2922 skge_rx_stop(hw, port);
2923 2910
2924 dev->mtu = new_mtu; 2911 dev->mtu = new_mtu;
2925 2912
2926 reg = GM_SMOD_VLAN_ENA | IPG_DATA_VAL(IPG_DATA_DEF); 2913 err = skge_up(dev);
2927 if (new_mtu > 1500)
2928 reg |= GM_SMOD_JUMBO_ENA;
2929 gma_write16(hw, port, GM_SERIAL_MODE, reg);
2930
2931 skge_write8(hw, RB_ADDR(rxqaddr[port], RB_CTRL), RB_ENA_OP_MD);
2932
2933 err = skge_rx_fill(dev);
2934 wmb();
2935 if (!err)
2936 skge_write8(hw, Q_ADDR(rxqaddr[port], Q_CSR), CSR_START | CSR_IRQ_CL_F);
2937 skge_write32(hw, B0_IMSK, hw->intr_mask);
2938
2939 if (err) 2914 if (err)
2940 dev_close(dev); 2915 dev_close(dev);
2941 else {
2942 gma_write16(hw, port, GM_GP_CTRL, ctl);
2943
2944 napi_enable(&skge->napi);
2945 netif_wake_queue(dev);
2946 }
2947 2916
2948 return err; 2917 return err;
2949} 2918}