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
f31ab861
Commit
f31ab861
authored
Apr 28, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/acme/net-2.5
into nuts.ninka.net:/home/davem/src/BK/net-2.5
parents
f445a573
427375ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
drivers/net/pppox.c
drivers/net/pppox.c
+21
-22
No files found.
drivers/net/pppox.c
View file @
f31ab861
...
...
@@ -36,22 +36,22 @@
#include <asm/uaccess.h>
static
struct
pppox_proto
*
p
roto
[
PX_MAX_PROTO
+
1
];
static
struct
pppox_proto
*
p
ppox_protos
[
PX_MAX_PROTO
+
1
];
int
register_pppox_proto
(
int
proto_num
,
struct
pppox_proto
*
pp
)
{
if
(
proto_num
<
0
||
proto_num
>
PX_MAX_PROTO
)
return
-
EINVAL
;
if
(
p
roto
[
proto_num
])
if
(
p
ppox_protos
[
proto_num
])
return
-
EALREADY
;
p
roto
[
proto_num
]
=
pp
;
p
ppox_protos
[
proto_num
]
=
pp
;
return
0
;
}
void
unregister_pppox_proto
(
int
proto_num
)
{
if
(
proto_num
>=
0
&&
proto_num
<=
PX_MAX_PROTO
)
p
roto
[
proto_num
]
=
NULL
;
p
ppox_protos
[
proto_num
]
=
NULL
;
}
void
pppox_unbind_sock
(
struct
sock
*
sk
)
...
...
@@ -73,57 +73,56 @@ static int pppox_ioctl(struct socket* sock, unsigned int cmd,
{
struct
sock
*
sk
=
sock
->
sk
;
struct
pppox_opt
*
po
=
pppox_sk
(
sk
);
int
err
=
0
;
int
rc
=
0
;
lock_sock
(
sk
);
switch
(
cmd
)
{
case
PPPIOCGCHAN
:{
case
PPPIOCGCHAN
:
{
int
index
;
err
=
-
ENOTCONN
;
rc
=
-
ENOTCONN
;
if
(
!
(
sk
->
state
&
PPPOX_CONNECTED
))
break
;
err
=
-
EINVAL
;
rc
=
-
EINVAL
;
index
=
ppp_channel_index
(
&
po
->
chan
);
if
(
put_user
(
index
,
(
int
*
)
arg
))
break
;
err
=
0
;
rc
=
0
;
sk
->
state
|=
PPPOX_BOUND
;
break
;
}
default:
if
(
p
roto
[
sk
->
protocol
]
->
ioctl
)
err
=
(
*
proto
[
sk
->
protocol
]
->
ioctl
)
(
sock
,
cmd
,
arg
);
if
(
p
ppox_protos
[
sk
->
protocol
]
->
ioctl
)
rc
=
pppox_protos
[
sk
->
protocol
]
->
ioctl
(
sock
,
cmd
,
arg
);
break
;
};
release_sock
(
sk
);
return
err
;
return
rc
;
}
static
int
pppox_create
(
struct
socket
*
sock
,
int
protocol
)
{
int
err
=
0
;
int
rc
=
-
EPROTOTYPE
;
if
(
protocol
<
0
||
protocol
>
PX_MAX_PROTO
)
return
-
EPROTOTYPE
;
goto
out
;
if
(
proto
[
protocol
]
==
NULL
)
return
-
EPROTONOSUPPORT
;
rc
=
-
EPROTONOSUPPORT
;
if
(
!
pppox_protos
[
protocol
])
goto
out
;
err
=
(
*
proto
[
protocol
]
->
create
)(
sock
);
if
(
err
==
0
)
{
rc
=
pppox_protos
[
protocol
]
->
create
(
sock
);
if
(
!
rc
)
/* We get to set the ioctl handler. */
/* For everything else, pppox is just a shell. */
sock
->
ops
->
ioctl
=
pppox_ioctl
;
}
return
err
;
out:
return
rc
;
}
static
struct
net_proto_family
pppox_proto_family
=
{
...
...
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