--- zzzz-none-000/linux-5.15.111/net/openvswitch/vport.h 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/net/openvswitch/vport.h 2024-02-07 10:23:30.000000000 +0000 @@ -3,6 +3,16 @@ * Copyright (c) 2007-2012 Nicira, Inc. */ +/* + * Includes Inango Systems Ltd’s changes/modifications dated: 2021. + * Changed/modified portions - Copyright (c) 2021 , Inango Systems Ltd. + */ + +/* + Includes MaxLinear's changes dated: 2021, 2022, 2023. + Changed portions - Copyright 2021-2023 MaxLinear, Inc. +*/ + #ifndef VPORT_H #define VPORT_H 1 @@ -59,23 +69,47 @@ * struct vport - one port within a datapath * @dev: Pointer to net_device. * @dp: Datapath to which this port belongs. +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + * @kobj: Represents /sys/class/net//brport. + * @ifobj: Use for bridges. Represents /sys/class/net//brif. + * @type: serves for storing information about vport type. OVS_VPORT_TYPE_INTERNAL and so on. + * @linkname: Link name. +#endif * @upcall_portids: RCU protected 'struct vport_portids'. * @port_no: Index into @dp's @ports array. +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + * @flags: Operational flags. +#endif * @hash_node: Element in @dev_table hash table in vport.c. * @dp_hash_node: Element in @datapath->ports hash table in datapath.c. * @ops: Class structure. +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + * @brcompat_data: Pointer to private brcomat data. +#endif * @detach_list: list used for detaching vport in net-exit call. * @rcu: RCU callback head for deferred destruction. */ struct vport { struct net_device *dev; struct datapath *dp; +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + struct kobject kobj; + struct kobject *ifobj; + int type; + char linkname[IFNAMSIZ]; +#endif struct vport_portids __rcu *upcall_portids; u16 port_no; +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + u32 flags; +#endif struct hlist_node hash_node; struct hlist_node dp_hash_node; const struct vport_ops *ops; +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + void *brcompat_data; +#endif struct list_head detach_list; struct rcu_head rcu; @@ -87,6 +121,9 @@ * @name: New vport's name. * @type: New vport's type. * @options: %OVS_VPORT_ATTR_OPTIONS attribute from Netlink message, %NULL if +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + * @bridge_name: Name of the bridge. +#endif * none was supplied. * @dp: New vport's datapath. * @port_no: New vport's port number. @@ -95,6 +132,9 @@ const char *name; enum ovs_vport_type type; struct nlattr *options; +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + const char *bridge_name; +#endif /* For ovs_vport_alloc(). */ struct datapath *dp; @@ -115,6 +155,20 @@ * @get_options: Appends vport-specific attributes for the configuration of an * existing vport to a &struct sk_buff. May be %NULL for a vport that does not * have any configuration. +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + * @set_addr: Set the device's MAC address. May be null if not supported. + * @get_name: Get the device's name. + * @get_addr: Get the device's MAC address. + * @get_config: Get the device's configuration. + * @get_kobj: Get the kobj associated with the device (may return null). + * @get_dev_flags: Get the device's flags. + * @is_running: Checks whether the device is running. + * @get_operstate: Get the device's operating state. + * @get_ifindex: Get the device's interface index. + * @get_mtu: Get the device's MTU. May be %NULL if the device does not have an + * MTU (as e.g. some tunnels do not). Must be implemented if @get_ifindex is + * implemented. +#endif * @send: Send a packet on the device. * zero for dropped packets or negative for error. */ @@ -128,6 +182,23 @@ int (*set_options)(struct vport *, struct nlattr *); int (*get_options)(const struct vport *, struct sk_buff *); +#ifdef CONFIG_OPENVSWITCH_BRCOMPAT + int (*set_addr)(struct vport *, const unsigned char *); + + const char *(*get_name)(const struct vport *); + const unsigned char *(*get_addr)(const struct vport *); + void (*get_config)(const struct vport *, void *); + struct kobject *(*get_kobj)(const struct vport *); + + unsigned (*get_dev_flags)(const struct vport *); + int (*is_running)(const struct vport *); + unsigned char (*get_operstate)(const struct vport *); + + int (*get_ifindex)(const struct vport *); + + int (*get_mtu)(const struct vport *); +#endif + netdev_tx_t (*send) (struct sk_buff *skb); struct module *owner; struct list_head list;