+}
+
+static void handle_vlan_port_write_new(switch_driver *d, switch_vlan_config *c, int nr)
+{
+ __u8 vtbl_entry, vtbl_index, vtbl_access;
+ __u32 untag = ((c->untag & ~(1 << d->cpuport)) << d->ports);
+
+ /* write config now */
+ if ((robo.devid == ROBO_DEVICE_ID_5395) ||
+ (robo.devid == ROBO_DEVICE_ID_53115)) {
+ vtbl_access = ROBO_VTBL_ACCESS_5395;
+ vtbl_index = ROBO_VTBL_INDX_5395;
+ vtbl_entry = ROBO_VTBL_ENTRY_5395;
+ } else {
+ vtbl_access = ROBO_VTBL_ACCESS;
+ vtbl_index = ROBO_VTBL_INDX;
+ vtbl_entry = ROBO_VTBL_ENTRY;
+ }
+
+ robo_write32(ROBO_ARLIO_PAGE, vtbl_entry, untag | c->port);
+ robo_write16(ROBO_ARLIO_PAGE, vtbl_index, nr);
+ robo_write16(ROBO_ARLIO_PAGE, vtbl_access, 1 << 7);
+}
+
+static int handle_vlan_port_write(void *driver, char *buf, int nr)
+{
+ switch_driver *d = (switch_driver *)driver;
+ switch_vlan_config *c = switch_parse_vlan(d, buf);
+ int j;
+
+ if (c == NULL)
+ return -EINVAL;
+
+ for (j = 0; j < d->ports; j++) {
+ if ((c->untag | c->pvid) & (1 << j)) {
+ /* change default vlan tag */
+ robo_write16(ROBO_VLAN_PAGE, ROBO_VLAN_PORT0_DEF_TAG + (j << 1), nr);
+ }
+ }
+
+ if (robo.devid != ROBO_DEVICE_ID_5325)
+ handle_vlan_port_write_new(d, c, nr);
+ else
+ handle_vlan_port_write_old(d, c, nr);