cregit-Linux how code gets into the kernel

Release 4.14 arch/um/drivers/daemon_kern.c

Directory: arch/um/drivers
/*
 * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) and
 * James Leu (jleu@mindspring.net).
 * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
 * Copyright (C) 2001 by various other people who didn't put their name here.
 * Licensed under the GPL.
 */

#include <linux/init.h>
#include <linux/netdevice.h>
#include <net_kern.h>
#include "daemon.h"


struct daemon_init {
	
char *sock_type;
	
char *ctl_sock;
};


static void daemon_init(struct net_device *dev, void *data) { struct uml_net_private *pri; struct daemon_data *dpri; struct daemon_init *init = data; pri = netdev_priv(dev); dpri = (struct daemon_data *) pri->user; dpri->sock_type = init->sock_type; dpri->ctl_sock = init->ctl_sock; dpri->fd = -1; dpri->control = -1; dpri->dev = dev; /* We will free this pointer. If it contains crap we're burned. */ dpri->ctl_addr = NULL; dpri->data_addr = NULL; dpri->local_addr = NULL; printk("daemon backend (uml_switch version %d) - %s:%s", SWITCH_VERSION, dpri->sock_type, dpri->ctl_sock); printk("\n"); }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike8971.20%342.86%
Paolo 'Blaisorblade' Giarrusso2016.00%228.57%
David S. Miller1310.40%114.29%
Wang Chen32.40%114.29%
Total125100.00%7100.00%


static int daemon_read(int fd, struct sk_buff *skb, struct uml_net_private *lp) { return net_recvfrom(fd, skb_mac_header(skb), skb->dev->mtu + ETH_HEADER_OTHER); }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike3592.11%150.00%
Arnaldo Carvalho de Melo37.89%150.00%
Total38100.00%2100.00%


static int daemon_write(int fd, struct sk_buff *skb, struct uml_net_private *lp) { return daemon_user_write(fd, skb->data, skb->len, (struct daemon_data *) &lp->user); }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike43100.00%1100.00%
Total43100.00%1100.00%

static const struct net_kern_info daemon_kern_info = { .init = daemon_init, .protocol = eth_protocol, .read = daemon_read, .write = daemon_write, };
static int daemon_setup(char *str, char **mac_out, void *data) { struct daemon_init *init = data; char *remain; *init = ((struct daemon_init) { .sock_type = "unix", .ctl_sock = "/tmp/uml.ctl" }); remain = split_if_spec(str, mac_out, &init->sock_type, &init->ctl_sock, NULL); if (remain != NULL) printk(KERN_WARNING "daemon_setup : Ignoring data socket " "specification\n"); return 1; }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike8798.86%375.00%
Paolo 'Blaisorblade' Giarrusso11.14%125.00%
Total88100.00%4100.00%

static struct transport daemon_transport = { .list = LIST_HEAD_INIT(daemon_transport.list), .name = "daemon", .setup = daemon_setup, .user = &daemon_user_info, .kern = &daemon_kern_info, .private_size = sizeof(struct daemon_data), .setup_size = sizeof(struct daemon_init), };
static int register_daemon(void) { register_transport(&daemon_transport); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike17100.00%2100.00%
Total17100.00%2100.00%

late_initcall(register_daemon);

Overall Contributors

PersonTokensPropCommitsCommitProp
Jeff Dike38590.16%753.85%
Paolo 'Blaisorblade' Giarrusso214.92%215.38%
David S. Miller133.04%17.69%
Wang Chen30.70%17.69%
Arnaldo Carvalho de Melo30.70%17.69%
Al Viro20.47%17.69%
Total427100.00%13100.00%
Directory: arch/um/drivers
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.