allow bigger packets in the marvell switch (does not fix the mtu problems yet)
[openwrt-10.03/.git] / target / linux / generic-2.6 / files / drivers / net / phy / mvswitch.c
index 3e644c223274ac1dd971325b477b16e463e9838f..cb0d377d2712db44e48644b8efbfbd2b47ebff75 100644 (file)
@@ -235,7 +235,6 @@ mvswitch_config_init(struct phy_device *pdev)
        /* initialize the cpu port */
        w16(pdev, MV_PORTREG(CONTROL, MV_CPUPORT),
                MV_PORTCTRL_ENABLED |
-               MV_PORTCTRL_VLANTUN |
                MV_PORTCTRL_RXTR |
                MV_PORTCTRL_TXTR
        );
@@ -275,8 +274,8 @@ mvswitch_config_init(struct phy_device *pdev)
        }
 
        /* build the target list for the cpu port */
-       for (i = 0, vlmap = 0; i < ARRAY_SIZE(priv->vlans); i++)
-               vlmap |= priv->vlans[i];
+       for (i = 0; i < MV_PORTS; i++)
+               vlmap |= (1 << i);
 
        w16(pdev, MV_PORTREG(VLANMAP, MV_CPUPORT),
                MV_PORTVLAN_PORTS(vlmap)
@@ -289,6 +288,12 @@ mvswitch_config_init(struct phy_device *pdev)
                );
        }
 
+       /* init switch control */
+       w16(pdev, MV_SWITCHREG(CTRL),
+               MV_SWITCHCTL_MSIZE |
+               MV_SWITCHCTL_DROP
+       );
+
        /* hook into the tx function */
        priv->hardstart = dev->hard_start_xmit;
        pdev->netif_receive_skb = mvswitch_netif_receive_skb;