1 #include "linux/config.h"
2 #include "linux/kernel.h"
3 #include "linux/stddef.h"
4 #include "linux/init.h"
5 #include "linux/netdevice.h"
6 #include "linux/if_arp.h"
16 void slip_init(struct net_device
*dev
, void *data
)
18 struct uml_net_private
*private;
19 struct slip_data
*spri
;
20 struct slip_init
*init
= data
;
23 spri
= (struct slip_data
*) private->user
;
24 *spri
= ((struct slip_data
)
27 .gate_addr
= init
->gate_addr
,
29 .slip
= SLIP_PROTO_INIT
,
33 dev
->header_cache_update
= NULL
;
34 dev
->hard_header_cache
= NULL
;
35 dev
->hard_header
= NULL
;
36 dev
->hard_header_len
= 0;
38 dev
->type
= ARPHRD_SLIP
;
39 dev
->tx_queue_len
= 256;
40 dev
->flags
= IFF_NOARP
;
41 printk("SLIP backend - SLIP IP = %s\n", spri
->gate_addr
);
44 static unsigned short slip_protocol(struct sk_buff
*skbuff
)
46 return(htons(ETH_P_IP
));
49 static int slip_read(int fd
, struct sk_buff
**skb
,
50 struct uml_net_private
*lp
)
52 return(slip_user_read(fd
, (*skb
)->mac
.raw
, (*skb
)->dev
->mtu
,
53 (struct slip_data
*) &lp
->user
));
56 static int slip_write(int fd
, struct sk_buff
**skb
,
57 struct uml_net_private
*lp
)
59 return(slip_user_write(fd
, (*skb
)->data
, (*skb
)->len
,
60 (struct slip_data
*) &lp
->user
));
63 struct net_kern_info slip_kern_info
= {
65 .protocol
= slip_protocol
,
70 static int slip_setup(char *str
, char **mac_out
, void *data
)
72 struct slip_init
*init
= data
;
74 *init
= ((struct slip_init
)
75 { .gate_addr
= NULL
});
78 init
->gate_addr
= str
;
82 static struct transport slip_transport
= {
83 .list
= LIST_HEAD_INIT(slip_transport
.list
),
86 .user
= &slip_user_info
,
87 .kern
= &slip_kern_info
,
88 .private_size
= sizeof(struct slip_data
),
89 .setup_size
= sizeof(struct slip_init
),
92 static int register_slip(void)
94 register_transport(&slip_transport
);
98 __initcall(register_slip
);
101 * Overrides for Emacs so that we follow Linus's tabbing style.
102 * Emacs will notice this stuff at the end of the file and automatically
103 * adjust the settings for this buffer only. This must remain at the end
105 * ---------------------------------------------------------------------------
107 * c-file-style: "linux"