linux/net/8021q/vlan_dev.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* -*- linux-c -*-
 * INET		802.1Q VLAN
 *		Ethernet-type device handling.
 *
 * Authors:	Ben Greear <[email protected]>
 *              Please send support related email to: [email protected]
 *              VLAN Home Page: http://www.candelatech.com/~greear/vlan.html
 *
 * Fixes:       Mar 22 2001: Martin Bokaemper <[email protected]>
 *                - reset skb->pkt_type on incoming packets when MAC was changed
 *                - see that changed MAC is saddr for outgoing packets
 *              Oct 20, 2001:  Ard van Breeman:
 *                - Fix MC-list, finally.
 *                - Flush MC-list on VLAN destroy.
 */

#define pr_fmt(fmt)

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/net_tstamp.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <net/arp.h>
#include <net/macsec.h>

#include "vlan.h"
#include "vlanproc.h"
#include <linux/if_vlan.h>
#include <linux/netpoll.h>

/*
 *	Create the VLAN header for an arbitrary protocol layer
 *
 *	saddr=NULL	means use device source address
 *	daddr=NULL	means leave destination address (eg unresolved arp)
 *
 *  This is called when the SKB is moving down the stack towards the
 *  physical devices.
 */
static int vlan_dev_hard_header(struct sk_buff *skb, struct net_device *dev,
				unsigned short type,
				const void *daddr, const void *saddr,
				unsigned int len)
{}

static inline netdev_tx_t vlan_netpoll_send_skb(struct vlan_dev_priv *vlan, struct sk_buff *skb)
{}

static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
					    struct net_device *dev)
{}

static int vlan_dev_change_mtu(struct net_device *dev, int new_mtu)
{}

void vlan_dev_set_ingress_priority(const struct net_device *dev,
				   u32 skb_prio, u16 vlan_prio)
{}

int vlan_dev_set_egress_priority(const struct net_device *dev,
				 u32 skb_prio, u16 vlan_prio)
{}

/* Flags are defined in the vlan_flags enum in
 * include/uapi/linux/if_vlan.h file.
 */
int vlan_dev_change_flags(const struct net_device *dev, u32 flags, u32 mask)
{}

void vlan_dev_get_realdev_name(const struct net_device *dev, char *result, size_t size)
{}

bool vlan_dev_inherit_address(struct net_device *dev,
			      struct net_device *real_dev)
{}

static int vlan_dev_open(struct net_device *dev)
{}

static int vlan_dev_stop(struct net_device *dev)
{}

static int vlan_dev_set_mac_address(struct net_device *dev, void *p)
{}

static int vlan_hwtstamp_get(struct net_device *dev,
			     struct kernel_hwtstamp_config *cfg)
{}

static int vlan_hwtstamp_set(struct net_device *dev,
			     struct kernel_hwtstamp_config *cfg,
			     struct netlink_ext_ack *extack)
{}

static int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{}

static int vlan_dev_neigh_setup(struct net_device *dev, struct neigh_parms *pa)
{}

#if IS_ENABLED(CONFIG_FCOE)
static int vlan_dev_fcoe_ddp_setup(struct net_device *dev, u16 xid,
				   struct scatterlist *sgl, unsigned int sgc)
{}

static int vlan_dev_fcoe_ddp_done(struct net_device *dev, u16 xid)
{}

static int vlan_dev_fcoe_enable(struct net_device *dev)
{}

static int vlan_dev_fcoe_disable(struct net_device *dev)
{}

static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid,
				    struct scatterlist *sgl, unsigned int sgc)
{}
#endif

#ifdef NETDEV_FCOE_WWNN
static int vlan_dev_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
{}
#endif

static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
{}

static void vlan_dev_set_rx_mode(struct net_device *vlan_dev)
{}

static __be16 vlan_parse_protocol(const struct sk_buff *skb)
{}

static const struct header_ops vlan_header_ops =;

static int vlan_passthru_hard_header(struct sk_buff *skb, struct net_device *dev,
				     unsigned short type,
				     const void *daddr, const void *saddr,
				     unsigned int len)
{}

static const struct header_ops vlan_passthru_header_ops =;

static const struct device_type vlan_type =;

static const struct net_device_ops vlan_netdev_ops;

static int vlan_dev_init(struct net_device *dev)
{}

/* Note: this function might be called multiple times for the same device. */
void vlan_dev_free_egress_priority(const struct net_device *dev)
{}

static void vlan_dev_uninit(struct net_device *dev)
{}

static netdev_features_t vlan_dev_fix_features(struct net_device *dev,
	netdev_features_t features)
{}

static int vlan_ethtool_get_link_ksettings(struct net_device *dev,
					   struct ethtool_link_ksettings *cmd)
{}

static void vlan_ethtool_get_drvinfo(struct net_device *dev,
				     struct ethtool_drvinfo *info)
{}

static int vlan_ethtool_get_ts_info(struct net_device *dev,
				    struct kernel_ethtool_ts_info *info)
{}

static void vlan_dev_get_stats64(struct net_device *dev,
				 struct rtnl_link_stats64 *stats)
{}

#ifdef CONFIG_NET_POLL_CONTROLLER
static void vlan_dev_poll_controller(struct net_device *dev)
{}

static int vlan_dev_netpoll_setup(struct net_device *dev, struct netpoll_info *npinfo)
{}

static void vlan_dev_netpoll_cleanup(struct net_device *dev)
{}
#endif /* CONFIG_NET_POLL_CONTROLLER */

static int vlan_dev_get_iflink(const struct net_device *dev)
{}

static int vlan_dev_fill_forward_path(struct net_device_path_ctx *ctx,
				      struct net_device_path *path)
{}

#if IS_ENABLED(CONFIG_MACSEC)

static const struct macsec_ops *vlan_get_macsec_ops(const struct macsec_context *ctx)
{}

static int vlan_macsec_offload(int (* const func)(struct macsec_context *),
			       struct macsec_context *ctx)
{}

static int vlan_macsec_dev_open(struct macsec_context *ctx)
{}

static int vlan_macsec_dev_stop(struct macsec_context *ctx)
{}

static int vlan_macsec_add_secy(struct macsec_context *ctx)
{}

static int vlan_macsec_upd_secy(struct macsec_context *ctx)
{}

static int vlan_macsec_del_secy(struct macsec_context *ctx)
{}

static int vlan_macsec_add_rxsc(struct macsec_context *ctx)
{}

static int vlan_macsec_upd_rxsc(struct macsec_context *ctx)
{}

static int vlan_macsec_del_rxsc(struct macsec_context *ctx)
{}

static int vlan_macsec_add_rxsa(struct macsec_context *ctx)
{}

static int vlan_macsec_upd_rxsa(struct macsec_context *ctx)
{}

static int vlan_macsec_del_rxsa(struct macsec_context *ctx)
{}

static int vlan_macsec_add_txsa(struct macsec_context *ctx)
{}

static int vlan_macsec_upd_txsa(struct macsec_context *ctx)
{}

static int vlan_macsec_del_txsa(struct macsec_context *ctx)
{}

static int vlan_macsec_get_dev_stats(struct macsec_context *ctx)
{}

static int vlan_macsec_get_tx_sc_stats(struct macsec_context *ctx)
{}

static int vlan_macsec_get_tx_sa_stats(struct macsec_context *ctx)
{}

static int vlan_macsec_get_rx_sc_stats(struct macsec_context *ctx)
{}

static int vlan_macsec_get_rx_sa_stats(struct macsec_context *ctx)
{}

static const struct macsec_ops macsec_offload_ops =;

#endif

static const struct ethtool_ops vlan_ethtool_ops =;

static const struct net_device_ops vlan_netdev_ops =;

static void vlan_dev_free(struct net_device *dev)
{}

void vlan_setup(struct net_device *dev)
{}