]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/dsa/tag_8021q.c
Merge tag 'leds-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux...
[linux.git] / net / dsa / tag_8021q.c
index 9e5a883a9f0c39e17fa9e0e18cf2a0c4506d04f6..2fb6c26294b50ea4890225608e94c9ced0ecec3d 100644 (file)
  *     Must be transmitted as zero and ignored on receive.
  *
  * SWITCH_ID - VID[8:6]:
- *     Index of switch within DSA tree. Must be between 0 and
- *     DSA_MAX_SWITCHES - 1.
+ *     Index of switch within DSA tree. Must be between 0 and 7.
  *
  * RSV - VID[5:4]:
  *     To be used for further expansion of PORT or for other purposes.
  *     Must be transmitted as zero and ignored on receive.
  *
  * PORT - VID[3:0]:
- *     Index of switch port. Must be between 0 and DSA_MAX_PORTS - 1.
+ *     Index of switch port. Must be between 0 and 15.
  */
 
 #define DSA_8021Q_DIR_SHIFT            10
@@ -103,7 +102,7 @@ static int dsa_8021q_restore_pvid(struct dsa_switch *ds, int port)
        if (!dsa_is_user_port(ds, port))
                return 0;
 
-       slave = ds->ports[port].slave;
+       slave = dsa_to_port(ds, port)->slave;
 
        err = br_vlan_get_pvid(slave, &pvid);
        if (!pvid || err < 0)
@@ -118,7 +117,7 @@ static int dsa_8021q_restore_pvid(struct dsa_switch *ds, int port)
                return err;
        }
 
-       return dsa_port_vid_add(&ds->ports[port], pvid, vinfo.flags);
+       return dsa_port_vid_add(dsa_to_port(ds, port), pvid, vinfo.flags);
 }
 
 /* If @enabled is true, installs @vid with @flags into the switch port's HW
@@ -130,7 +129,7 @@ static int dsa_8021q_restore_pvid(struct dsa_switch *ds, int port)
 static int dsa_8021q_vid_apply(struct dsa_switch *ds, int port, u16 vid,
                               u16 flags, bool enabled)
 {
-       struct dsa_port *dp = &ds->ports[port];
+       struct dsa_port *dp = dsa_to_port(ds, port);
        struct bridge_vlan_info vinfo;
        int err;
 
@@ -342,13 +341,4 @@ struct sk_buff *dsa_8021q_remove_header(struct sk_buff *skb)
 }
 EXPORT_SYMBOL_GPL(dsa_8021q_remove_header);
 
-static const struct dsa_device_ops dsa_8021q_netdev_ops = {
-       .name           = "8021q",
-       .proto          = DSA_TAG_PROTO_8021Q,
-       .overhead       = VLAN_HLEN,
-};
-
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_8021Q);
-
-module_dsa_tag_driver(dsa_8021q_netdev_ops);