Commit d1b76f6c authored by Jeff Dike's avatar Jeff Dike

Converted a bunch of inititializers in the drivers that I missed.

parent e39f1f42
...@@ -32,16 +32,16 @@ void null_free(void *data) ...@@ -32,16 +32,16 @@ void null_free(void *data)
} }
struct chan_ops null_ops = { struct chan_ops null_ops = {
type: "null", .type = "null",
init: null_init, .init = null_init,
open: null_open, .open = null_open,
close: generic_close, .close = generic_close,
read: null_read, .read = null_read,
write: generic_write, .write = generic_write,
console_write: generic_console_write, .console_write = generic_console_write,
window_size: generic_window_size, .window_size = generic_window_size,
free: null_free, .free = null_free,
winch: 0, .winch = 0,
}; };
/* /*
......
...@@ -27,12 +27,12 @@ void pcap_init(struct net_device *dev, void *data) ...@@ -27,12 +27,12 @@ void pcap_init(struct net_device *dev, void *data)
pri = dev->priv; pri = dev->priv;
ppri = (struct pcap_data *) pri->user; ppri = (struct pcap_data *) pri->user;
*ppri = ((struct pcap_data) *ppri = ((struct pcap_data)
{ host_if : init->host_if, { .host_if = init->host_if,
promisc : init->promisc, .promisc = init->promisc,
optimize : init->optimize, .optimize = init->optimize,
filter : init->filter, .filter = init->filter,
compiled : NULL, .compiled = NULL,
pcap : NULL }); .pcap = NULL });
} }
static int pcap_read(int fd, struct sk_buff **skb, static int pcap_read(int fd, struct sk_buff **skb,
...@@ -51,10 +51,10 @@ static int pcap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp) ...@@ -51,10 +51,10 @@ static int pcap_write(int fd, struct sk_buff **skb, struct uml_net_private *lp)
} }
static struct net_kern_info pcap_kern_info = { static struct net_kern_info pcap_kern_info = {
init: pcap_init, .init = pcap_init,
protocol: eth_protocol, .protocol = eth_protocol,
read: pcap_read, .read = pcap_read,
write: pcap_write, .write = pcap_write,
}; };
int pcap_setup(char *str, char **mac_out, void *data) int pcap_setup(char *str, char **mac_out, void *data)
...@@ -64,10 +64,10 @@ int pcap_setup(char *str, char **mac_out, void *data) ...@@ -64,10 +64,10 @@ int pcap_setup(char *str, char **mac_out, void *data)
int i; int i;
*init = ((struct pcap_init) *init = ((struct pcap_init)
{ host_if : "eth0", { .host_if = "eth0",
promisc : 1, .promisc = 1,
optimize : 0, .optimize = 0,
filter : NULL }); .filter = NULL });
remain = split_if_spec(str, &host_if, &init->filter, remain = split_if_spec(str, &host_if, &init->filter,
&options[0], &options[1], NULL); &options[0], &options[1], NULL);
...@@ -98,13 +98,13 @@ int pcap_setup(char *str, char **mac_out, void *data) ...@@ -98,13 +98,13 @@ int pcap_setup(char *str, char **mac_out, void *data)
} }
static struct transport pcap_transport = { static struct transport pcap_transport = {
list : LIST_HEAD_INIT(pcap_transport.list), .list = LIST_HEAD_INIT(pcap_transport.list),
name : "pcap", .name = "pcap",
setup : pcap_setup, .setup = pcap_setup,
user : &pcap_user_info, .user = &pcap_user_info,
kern : &pcap_kern_info, .kern = &pcap_kern_info,
private_size : sizeof(struct pcap_data), .private_size = sizeof(struct pcap_data),
setup_size : sizeof(struct pcap_init), .setup_size = sizeof(struct pcap_init),
}; };
static int register_pcap(void) static int register_pcap(void)
......
...@@ -106,8 +106,8 @@ static void handler(u_char *data, const struct pcap_pkthdr *header, ...@@ -106,8 +106,8 @@ static void handler(u_char *data, const struct pcap_pkthdr *header,
int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri) int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri)
{ {
struct pcap_handler_data hdata = ((struct pcap_handler_data) struct pcap_handler_data hdata = ((struct pcap_handler_data)
{ buffer : buffer, { .buffer = buffer,
len : len }); .len = len });
int n; int n;
n = pcap_dispatch(pri->pcap, 1, handler, (u_char *) &hdata); n = pcap_dispatch(pri->pcap, 1, handler, (u_char *) &hdata);
...@@ -121,14 +121,14 @@ int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri) ...@@ -121,14 +121,14 @@ int pcap_user_read(int fd, void *buffer, int len, struct pcap_data *pri)
} }
struct net_user_info pcap_user_info = { struct net_user_info pcap_user_info = {
init: pcap_user_init, .init = pcap_user_init,
open: pcap_open, .open = pcap_open,
close: NULL, .close = NULL,
remove: pcap_remove, .remove = pcap_remove,
set_mtu: NULL, .set_mtu = NULL,
add_address: NULL, .add_address = NULL,
delete_address: NULL, .delete_address = NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER .max_packet = MAX_PACKET - ETH_HEADER_OTHER
}; };
/* /*
......
...@@ -85,11 +85,11 @@ static int port_accept(struct port_list *port) ...@@ -85,11 +85,11 @@ static int port_accept(struct port_list *port)
goto out_close; goto out_close;
} }
*conn = ((struct connection) *conn = ((struct connection)
{ list : LIST_HEAD_INIT(conn->list), { .list = LIST_HEAD_INIT(conn->list),
fd : fd, .fd = fd,
socket : { socket[0], socket[1] }, .socket = { socket[0], socket[1] },
telnetd_pid : pid, .telnetd_pid = pid,
port : port }); .port = port });
if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt, if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM, SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
...@@ -174,14 +174,15 @@ void *port_data(int port_num) ...@@ -174,14 +174,15 @@ void *port_data(int port_num)
} }
*port = ((struct port_list) *port = ((struct port_list)
{ list : LIST_HEAD_INIT(port->list), { .list = LIST_HEAD_INIT(port->list),
has_connection : 0, .has_connection = 0,
sem : __SEMAPHORE_INITIALIZER(port->sem, 0), .sem = __SEMAPHORE_INITIALIZER(port->sem,
lock : SPIN_LOCK_UNLOCKED, 0),
port : port_num, .lock = SPIN_LOCK_UNLOCKED,
fd : fd, .port = port_num,
pending : LIST_HEAD_INIT(port->pending), .fd = fd,
connections : LIST_HEAD_INIT(port->connections) }); .pending = LIST_HEAD_INIT(port->pending),
.connections = LIST_HEAD_INIT(port->connections) });
list_add(&port->list, &ports); list_add(&port->list, &ports);
found: found:
...@@ -191,9 +192,9 @@ void *port_data(int port_num) ...@@ -191,9 +192,9 @@ void *port_data(int port_num)
goto out; goto out;
} }
*dev = ((struct port_dev) { port : port, *dev = ((struct port_dev) { .port = port,
fd : -1, .helper_pid = -1,
helper_pid : -1 }); .telnetd_pid = -1 });
goto out; goto out;
out_free: out_free:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment