Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d1b76f6c
Commit
d1b76f6c
authored
Dec 28, 2002
by
Jeff Dike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted a bunch of inititializers in the drivers that I missed.
parent
e39f1f42
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
57 deletions
+58
-57
arch/um/drivers/null.c
arch/um/drivers/null.c
+10
-10
arch/um/drivers/pcap_kern.c
arch/um/drivers/pcap_kern.c
+21
-21
arch/um/drivers/pcap_user.c
arch/um/drivers/pcap_user.c
+10
-10
arch/um/drivers/port_kern.c
arch/um/drivers/port_kern.c
+17
-16
No files found.
arch/um/drivers/null.c
View file @
d1b76f6c
...
@@ -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
,
};
};
/*
/*
...
...
arch/um/drivers/pcap_kern.c
View file @
d1b76f6c
...
@@ -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
)
...
...
arch/um/drivers/pcap_user.c
View file @
d1b76f6c
...
@@ -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
};
};
/*
/*
...
...
arch/um/drivers/port_kern.c
View file @
d1b76f6c
...
@@ -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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment