switch: improve robo_switch_enable()
authorHauke Mehrtens <hauke@hauke-m.de>
Wed, 13 Feb 2013 16:04:18 +0000 (16:04 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Wed, 13 Feb 2013 16:04:18 +0000 (16:04 +0000)
This is based on a patch by jcharest and the Broadcom SDK.

SVN-Revision: 35583

package/switch/src/switch-robo.c

index 0e39c8fe56afee52018c33318db4b3a51b1f8578..41f0c1826dbd6b01bc481b77b51c063880788f0a 100644 (file)
@@ -237,10 +237,14 @@ static int robo_switch_enable(void)
                        return -EBUSY;
                }
 
+               /* No spanning tree for unmanaged mode */
                last_port = (robo.devid == ROBO_DEVICE_ID_5398) ?
-                               ROBO_PORT6_CTRL : ROBO_PORT3_CTRL;
-               for (i = ROBO_PORT0_CTRL; i < last_port + 1; i++)
+                               ROBO_PORT7_CTRL : ROBO_PORT4_CTRL;
+               for (i = ROBO_PORT0_CTRL; i <= last_port; i++)
                        robo_write16(ROBO_CTRL_PAGE, i, 0);
+
+               /* No spanning tree on IMP port too */
+               robo_write16(ROBO_CTRL_PAGE, ROBO_IM_PORT_CTRL, 0);
        }
 
 #ifdef CONFIG_BCM47XX