From 76cb841cb886eef6b3bee341a2266c76578724ad Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 03:02:30 +0200 Subject: Adding upstream version 4.19.249. Signed-off-by: Daniel Baumann --- arch/um/include/shared/net_kern.h | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 arch/um/include/shared/net_kern.h (limited to 'arch/um/include/shared/net_kern.h') diff --git a/arch/um/include/shared/net_kern.h b/arch/um/include/shared/net_kern.h new file mode 100644 index 000000000..40442b98b --- /dev/null +++ b/arch/um/include/shared/net_kern.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2002 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) + * Licensed under the GPL + */ + +#ifndef __UM_NET_KERN_H +#define __UM_NET_KERN_H + +#include +#include +#include +#include +#include +#include + +struct uml_net { + struct list_head list; + struct net_device *dev; + struct platform_device pdev; + int index; +}; + +struct uml_net_private { + struct list_head list; + spinlock_t lock; + struct net_device *dev; + struct timer_list tl; + + struct work_struct work; + int fd; + unsigned char mac[ETH_ALEN]; + int max_packet; + unsigned short (*protocol)(struct sk_buff *); + int (*open)(void *); + void (*close)(int, void *); + void (*remove)(void *); + int (*read)(int, struct sk_buff *skb, struct uml_net_private *); + int (*write)(int, struct sk_buff *skb, struct uml_net_private *); + + void (*add_address)(unsigned char *, unsigned char *, void *); + void (*delete_address)(unsigned char *, unsigned char *, void *); + char user[0]; +}; + +struct net_kern_info { + void (*init)(struct net_device *, void *); + unsigned short (*protocol)(struct sk_buff *); + int (*read)(int, struct sk_buff *skb, struct uml_net_private *); + int (*write)(int, struct sk_buff *skb, struct uml_net_private *); +}; + +struct transport { + struct list_head list; + const char *name; + int (* const setup)(char *, char **, void *); + const struct net_user_info *user; + const struct net_kern_info *kern; + const int private_size; + const int setup_size; +}; + +extern struct net_device *ether_init(int); +extern unsigned short ether_protocol(struct sk_buff *); +extern int tap_setup_common(char *str, char *type, char **dev_name, + char **mac_out, char **gate_addr); +extern void register_transport(struct transport *new); +extern unsigned short eth_protocol(struct sk_buff *skb); +extern void uml_net_setup_etheraddr(struct net_device *dev, char *str); + + +#endif -- cgit v1.2.3