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)
}
struct chan_ops null_ops = {
type: "null",
init: null_init,
open: null_open,
close: generic_close,
read: null_read,
write: generic_write,
console_write: generic_console_write,
window_size: generic_window_size,
free: null_free,
winch: 0,
.type = "null",
.init = null_init,
.open = null_open,
.close = generic_close,
.read = null_read,
.write = generic_write,
.console_write = generic_console_write,
.window_size = generic_window_size,
.free = null_free,
.winch = 0,
};
/*
......
......@@ -27,12 +27,12 @@ void pcap_init(struct net_device *dev, void *data)
pri = dev->priv;
ppri = (struct pcap_data *) pri->user;
*ppri = ((struct pcap_data)
{ host_if : init->host_if,
promisc : init->promisc,
optimize : init->optimize,
filter : init->filter,
compiled : NULL,
pcap : NULL });
{ .host_if = init->host_if,
.promisc = init->promisc,
.optimize = init->optimize,
.filter = init->filter,
.compiled = NULL,
.pcap = NULL });
}
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)
}
static struct net_kern_info pcap_kern_info = {
init: pcap_init,
protocol: eth_protocol,
read: pcap_read,
write: pcap_write,
.init = pcap_init,
.protocol = eth_protocol,
.read = pcap_read,
.write = pcap_write,
};
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;
*init = ((struct pcap_init)
{ host_if : "eth0",
promisc : 1,
optimize : 0,
filter : NULL });
{ .host_if = "eth0",
.promisc = 1,
.optimize = 0,
.filter = NULL });
remain = split_if_spec(str, &host_if, &init->filter,
&options[0], &options[1], NULL);
......@@ -98,13 +98,13 @@ int pcap_setup(char *str, char **mac_out, void *data)
}
static struct transport pcap_transport = {
list : LIST_HEAD_INIT(pcap_transport.list),
name : "pcap",
setup : pcap_setup,
user : &pcap_user_info,
kern : &pcap_kern_info,
private_size : sizeof(struct pcap_data),
setup_size : sizeof(struct pcap_init),
.list = LIST_HEAD_INIT(pcap_transport.list),
.name = "pcap",
.setup = pcap_setup,
.user = &pcap_user_info,
.kern = &pcap_kern_info,
.private_size = sizeof(struct pcap_data),
.setup_size = sizeof(struct pcap_init),
};
static int register_pcap(void)
......
......@@ -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)
{
struct pcap_handler_data hdata = ((struct pcap_handler_data)
{ buffer : buffer,
len : len });
{ .buffer = buffer,
.len = len });
int n;
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)
}
struct net_user_info pcap_user_info = {
init: pcap_user_init,
open: pcap_open,
close: NULL,
remove: pcap_remove,
set_mtu: NULL,
add_address: NULL,
delete_address: NULL,
max_packet: MAX_PACKET - ETH_HEADER_OTHER
.init = pcap_user_init,
.open = pcap_open,
.close = NULL,
.remove = pcap_remove,
.set_mtu = NULL,
.add_address = NULL,
.delete_address = NULL,
.max_packet = MAX_PACKET - ETH_HEADER_OTHER
};
/*
......
......@@ -85,11 +85,11 @@ static int port_accept(struct port_list *port)
goto out_close;
}
*conn = ((struct connection)
{ list : LIST_HEAD_INIT(conn->list),
fd : fd,
socket : { socket[0], socket[1] },
telnetd_pid : pid,
port : port });
{ .list = LIST_HEAD_INIT(conn->list),
.fd = fd,
.socket = { socket[0], socket[1] },
.telnetd_pid = pid,
.port = port });
if(um_request_irq(TELNETD_IRQ, socket[0], IRQ_READ, pipe_interrupt,
SA_INTERRUPT | SA_SHIRQ | SA_SAMPLE_RANDOM,
......@@ -174,14 +174,15 @@ void *port_data(int port_num)
}
*port = ((struct port_list)
{ list : LIST_HEAD_INIT(port->list),
has_connection : 0,
sem : __SEMAPHORE_INITIALIZER(port->sem, 0),
lock : SPIN_LOCK_UNLOCKED,
port : port_num,
fd : fd,
pending : LIST_HEAD_INIT(port->pending),
connections : LIST_HEAD_INIT(port->connections) });
{ .list = LIST_HEAD_INIT(port->list),
.has_connection = 0,
.sem = __SEMAPHORE_INITIALIZER(port->sem,
0),
.lock = SPIN_LOCK_UNLOCKED,
.port = port_num,
.fd = fd,
.pending = LIST_HEAD_INIT(port->pending),
.connections = LIST_HEAD_INIT(port->connections) });
list_add(&port->list, &ports);
found:
......@@ -191,9 +192,9 @@ void *port_data(int port_num)
goto out;
}
*dev = ((struct port_dev) { port : port,
fd : -1,
helper_pid : -1 });
*dev = ((struct port_dev) { .port = port,
.helper_pid = -1,
.telnetd_pid = -1 });
goto out;
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