- for (i = 0; i < AR8216_NUM_PORTS; i++) {
- /* Enable port learning and tx */
- priv->write(priv, AR8216_REG_PORT_CTRL(i),
- AR8216_PORT_CTRL_LEARN |
- (4 << AR8216_PORT_CTRL_STATE_S));
-
- priv->write(priv, AR8216_REG_PORT_VLAN(i), 0);
-
- /* Configure all PHYs */
- if (i == AR8216_PORT_CPU) {
- priv->write(priv, AR8216_REG_PORT_STATUS(i),
- AR8216_PORT_STATUS_LINK_UP |
- ((priv->chip == AR8316) ?
- AR8216_PORT_SPEED_1000M : AR8216_PORT_SPEED_100M) |
- AR8216_PORT_STATUS_TXMAC |
- AR8216_PORT_STATUS_RXMAC |
- ((priv->chip == AR8316) ? AR8216_PORT_STATUS_RXFLOW : 0) |
- ((priv->chip == AR8316) ? AR8216_PORT_STATUS_TXFLOW : 0) |
- AR8216_PORT_STATUS_DUPLEX);
- } else {
- priv->write(priv, AR8216_REG_PORT_STATUS(i),
- AR8216_PORT_STATUS_LINK_AUTO);
- }
- }
+
+ /* Configure all ports */
+ for (i = 0; i < AR8216_NUM_PORTS; i++)
+ ar8216_init_port(priv, i);
+