Commit 44bbcf5c authored by Vivien Didelot's avatar Vivien Didelot Committed by David S. Miller

net: switchdev: extract struct switchdev_obj_*

Now that switchdev and its drivers directly use specific switchdev_obj_*
structures, move them out of the switchdev_obj union and get rif of this
outer structure.
Signed-off-by: default avatarVivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ab069002
...@@ -64,30 +64,29 @@ enum switchdev_obj_id { ...@@ -64,30 +64,29 @@ enum switchdev_obj_id {
SWITCHDEV_OBJ_PORT_FDB, SWITCHDEV_OBJ_PORT_FDB,
}; };
struct switchdev_obj { /* SWITCHDEV_OBJ_PORT_VLAN */
enum switchdev_obj_id id; struct switchdev_obj_vlan {
int (*cb)(struct switchdev_obj *obj); u16 flags;
union { u16 vid_begin;
struct switchdev_obj_vlan { /* PORT_VLAN */ u16 vid_end;
u16 flags; };
u16 vid_begin;
u16 vid_end; /* SWITCHDEV_OBJ_IPV4_FIB */
} vlan; struct switchdev_obj_ipv4_fib {
struct switchdev_obj_ipv4_fib { /* IPV4_FIB */ u32 dst;
u32 dst; int dst_len;
int dst_len; struct fib_info *fi;
struct fib_info *fi; u8 tos;
u8 tos; u8 type;
u8 type; u32 nlflags;
u32 nlflags; u32 tb_id;
u32 tb_id; };
} ipv4_fib;
struct switchdev_obj_fdb { /* PORT_FDB */ /* SWITCHDEV_OBJ_PORT_FDB */
const unsigned char *addr; struct switchdev_obj_fdb {
u16 vid; const unsigned char *addr;
u16 ndm_state; u16 vid;
} fdb; u16 ndm_state;
} u;
}; };
void switchdev_trans_item_enqueue(struct switchdev_trans *trans, void switchdev_trans_item_enqueue(struct switchdev_trans *trans,
...@@ -102,11 +101,11 @@ void *switchdev_trans_item_dequeue(struct switchdev_trans *trans); ...@@ -102,11 +101,11 @@ void *switchdev_trans_item_dequeue(struct switchdev_trans *trans);
* *
* @switchdev_port_attr_set: Set a port attribute (see switchdev_attr). * @switchdev_port_attr_set: Set a port attribute (see switchdev_attr).
* *
* @switchdev_port_obj_add: Add an object to port (see switchdev_obj). * @switchdev_port_obj_add: Add an object to port (see switchdev_obj_*).
* *
* @switchdev_port_obj_del: Delete an object from port (see switchdev_obj). * @switchdev_port_obj_del: Delete an object from port (see switchdev_obj_*).
* *
* @switchdev_port_obj_dump: Dump port objects (see switchdev_obj). * @switchdev_port_obj_dump: Dump port objects (see switchdev_obj_*).
*/ */
struct switchdev_ops { struct switchdev_ops {
int (*switchdev_port_attr_get)(struct net_device *dev, int (*switchdev_port_attr_get)(struct net_device *dev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment