linux/net/bridge/br_if.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *	Userspace interface
 *	Linux ethernet bridge
 *
 *	Authors:
 *	Lennert Buytenhek		<[email protected]>
 */

#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/netpoll.h>
#include <linux/ethtool.h>
#include <linux/if_arp.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/rtnetlink.h>
#include <linux/if_ether.h>
#include <linux/slab.h>
#include <net/dsa.h>
#include <net/sock.h>
#include <linux/if_vlan.h>
#include <net/switchdev.h>
#include <net/net_namespace.h>

#include "br_private.h"

/*
 * Determine initial path cost based on speed.
 * using recommendations from 802.1d standard
 *
 * Since driver might sleep need to not be holding any locks.
 */
static int port_cost(struct net_device *dev)
{}


/* Check for port carrier transitions. */
void br_port_carrier_check(struct net_bridge_port *p, bool *notified)
{}

static void br_port_set_promisc(struct net_bridge_port *p)
{}

static void br_port_clear_promisc(struct net_bridge_port *p)
{}

/* When a port is added or removed or when certain port flags
 * change, this function is called to automatically manage
 * promiscuity setting of all the bridge ports.  We are always called
 * under RTNL so can skip using rcu primitives.
 */
void br_manage_promisc(struct net_bridge *br)
{}

int nbp_backup_change(struct net_bridge_port *p,
		      struct net_device *backup_dev)
{}

static void nbp_backup_clear(struct net_bridge_port *p)
{}

static void nbp_update_port_count(struct net_bridge *br)
{}

static void nbp_delete_promisc(struct net_bridge_port *p)
{}

static void release_nbp(struct kobject *kobj)
{}

static void brport_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t *gid)
{}

static const struct kobj_type brport_ktype =;

static void destroy_nbp(struct net_bridge_port *p)
{}

static void destroy_nbp_rcu(struct rcu_head *head)
{}

static unsigned get_max_headroom(struct net_bridge *br)
{}

static void update_headroom(struct net_bridge *br, int new_hr)
{}

/* Delete port(interface) from bridge is done in two steps.
 * via RCU. First step, marks device as down. That deletes
 * all the timers and stops new packets from flowing through.
 *
 * Final cleanup doesn't occur until after all CPU's finished
 * processing packets.
 *
 * Protected from multiple admin operations by RTNL mutex
 */
static void del_nbp(struct net_bridge_port *p)
{}

/* Delete bridge device */
void br_dev_delete(struct net_device *dev, struct list_head *head)
{}

/* find an available port number */
static int find_portno(struct net_bridge *br)
{}

/* called with RTNL but without bridge lock */
static struct net_bridge_port *new_nbp(struct net_bridge *br,
				       struct net_device *dev)
{}

int br_add_bridge(struct net *net, const char *name)
{}

int br_del_bridge(struct net *net, const char *name)
{}

/* MTU of the bridge pseudo-device: ETH_DATA_LEN or the minimum of the ports */
static int br_mtu_min(const struct net_bridge *br)
{}

void br_mtu_auto_adjust(struct net_bridge *br)
{}

static void br_set_gso_limits(struct net_bridge *br)
{}

/*
 * Recomputes features using slave's features
 */
netdev_features_t br_features_recompute(struct net_bridge *br,
	netdev_features_t features)
{}

/* called with RTNL */
int br_add_if(struct net_bridge *br, struct net_device *dev,
	      struct netlink_ext_ack *extack)
{}

/* called with RTNL */
int br_del_if(struct net_bridge *br, struct net_device *dev)
{}

void br_port_flags_change(struct net_bridge_port *p, unsigned long mask)
{}

bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag)
{}
EXPORT_SYMBOL_GPL();