Lines Matching refs:port

79 /* bits 0..7 = port 0, bits 8..15 = port 1 */
81 /* bits 0..7 = port 2, bits 8..15 = port 3 */
83 /* bits 0..7 = port 4, bits 8..15 = port 5 */
100 /* bits 0..7 = port 0, bits 8..15 = port 1 */
102 /* bits 0..7 = port 2, bits 8..15 = port 3 */
104 /* bits 0..7 = port 4, bits 8..15 = port 5 */
109 /* CPU port control reg */
220 #define RTL8366RB_PORT_1 BIT(0) /* In userspace port 0 */
221 #define RTL8366RB_PORT_2 BIT(1) /* In userspace port 1 */
222 #define RTL8366RB_PORT_3 BIT(2) /* In userspace port 2 */
223 #define RTL8366RB_PORT_4 BIT(3) /* In userspace port 3 */
224 #define RTL8366RB_PORT_5 BIT(4) /* In userspace port 4 */
226 #define RTL8366RB_PORT_CPU BIT(5) /* CPU port */
316 * @max_mtu: per-port max MTU setting
359 int port,
368 RTL8366RB_MIB_COUNTER_PORT_OFFSET * (port) +
858 /* Enable CPU port with custom DSA tag 8899.
869 /* Make sure we default-enable the fixed CPU port */
896 /* Port 4 setup: this enables Port 4, usually the WAN port,
898 * the port is initialized to. There is no explanation of the
899 * IO modes in the Realtek source code, if your WAN port is
909 /* Discard VLAN tagged packets if the port is not a member of
931 * Each port has 4 LEDs, we configure all ports to the same
979 int port,
987 rtl8366rb_mac_link_up(struct dsa_switch *ds, int port, unsigned int mode,
994 if (port != smi->cpu_port)
997 dev_dbg(smi->dev, "MAC link up on CPU port (%d)\n", port);
999 /* Force the fixed CPU port into 1Gbit mode, no autonegotiation */
1001 BIT(port), BIT(port));
1003 dev_err(smi->dev, "failed to force 1Gbit on CPU port\n");
1011 dev_err(smi->dev, "failed to set PAACR on CPU port\n");
1015 /* Enable the CPU port */
1016 ret = regmap_update_bits(smi->map, RTL8366RB_PECR, BIT(port),
1019 dev_err(smi->dev, "failed to enable the CPU port\n");
1025 rtl8366rb_mac_link_down(struct dsa_switch *ds, int port, unsigned int mode,
1031 if (port != smi->cpu_port)
1034 dev_dbg(smi->dev, "MAC link down on CPU port (%d)\n", port);
1036 /* Disable the CPU port */
1037 ret = regmap_update_bits(smi->map, RTL8366RB_PECR, BIT(port),
1038 BIT(port));
1040 dev_err(smi->dev, "failed to disable the CPU port\n");
1046 int port, bool enable)
1054 switch (port) {
1084 dev_err(smi->dev, "no LED for port %d\n", port);
1088 dev_err(smi->dev, "error updating LED on port %d\n", port);
1092 rtl8366rb_port_enable(struct dsa_switch *ds, int port,
1098 dev_dbg(smi->dev, "enable port %d\n", port);
1099 ret = regmap_update_bits(smi->map, RTL8366RB_PECR, BIT(port),
1104 rb8366rb_set_port_led(smi, port, true);
1109 rtl8366rb_port_disable(struct dsa_switch *ds, int port)
1114 dev_dbg(smi->dev, "disable port %d\n", port);
1115 ret = regmap_update_bits(smi->map, RTL8366RB_PECR, BIT(port),
1116 BIT(port));
1120 rb8366rb_set_port_led(smi, port, false);
1123 static int rtl8366rb_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
1131 /* Cache the per-port MTU setting */
1133 rb->max_mtu[port] = new_mtu;
1136 * common denominator: the biggest set for any one port will
1165 static int rtl8366rb_max_mtu(struct dsa_switch *ds, int port)
1313 static int rtl8366rb_get_mc_index(struct realtek_smi *smi, int port, int *val)
1318 if (port >= smi->num_ports)
1321 ret = regmap_read(smi->map, RTL8366RB_PORT_VLAN_CTRL_REG(port),
1326 *val = (data >> RTL8366RB_PORT_VLAN_CTRL_SHIFT(port)) &
1332 static int rtl8366rb_set_mc_index(struct realtek_smi *smi, int port, int index)
1334 if (port >= smi->num_ports || index >= RTL8366RB_NUM_VLANS)
1337 return regmap_update_bits(smi->map, RTL8366RB_PORT_VLAN_CTRL_REG(port),
1339 RTL8366RB_PORT_VLAN_CTRL_SHIFT(port),
1341 RTL8366RB_PORT_VLAN_CTRL_SHIFT(port));