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
nexedi
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
Show 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 @@
...
@@ -36,22 +36,22 @@
#include <asm/uaccess.h>
#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
)
int
register_pppox_proto
(
int
proto_num
,
struct
pppox_proto
*
pp
)
{
{
if
(
proto_num
<
0
||
proto_num
>
PX_MAX_PROTO
)
if
(
proto_num
<
0
||
proto_num
>
PX_MAX_PROTO
)
return
-
EINVAL
;
return
-
EINVAL
;
if
(
p
roto
[
proto_num
])
if
(
p
ppox_protos
[
proto_num
])
return
-
EALREADY
;
return
-
EALREADY
;
p
roto
[
proto_num
]
=
pp
;
p
ppox_protos
[
proto_num
]
=
pp
;
return
0
;
return
0
;
}
}
void
unregister_pppox_proto
(
int
proto_num
)
void
unregister_pppox_proto
(
int
proto_num
)
{
{
if
(
proto_num
>=
0
&&
proto_num
<=
PX_MAX_PROTO
)
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
)
void
pppox_unbind_sock
(
struct
sock
*
sk
)
...
@@ -73,57 +73,56 @@ static int pppox_ioctl(struct socket* sock, unsigned int cmd,
...
@@ -73,57 +73,56 @@ static int pppox_ioctl(struct socket* sock, unsigned int cmd,
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
pppox_opt
*
po
=
pppox_sk
(
sk
);
struct
pppox_opt
*
po
=
pppox_sk
(
sk
);
int
err
=
0
;
int
rc
=
0
;
lock_sock
(
sk
);
lock_sock
(
sk
);
switch
(
cmd
)
{
switch
(
cmd
)
{
case
PPPIOCGCHAN
:{
case
PPPIOCGCHAN
:
{
int
index
;
int
index
;
err
=
-
ENOTCONN
;
rc
=
-
ENOTCONN
;
if
(
!
(
sk
->
state
&
PPPOX_CONNECTED
))
if
(
!
(
sk
->
state
&
PPPOX_CONNECTED
))
break
;
break
;
err
=
-
EINVAL
;
rc
=
-
EINVAL
;
index
=
ppp_channel_index
(
&
po
->
chan
);
index
=
ppp_channel_index
(
&
po
->
chan
);
if
(
put_user
(
index
,
(
int
*
)
arg
))
if
(
put_user
(
index
,
(
int
*
)
arg
))
break
;
break
;
err
=
0
;
rc
=
0
;
sk
->
state
|=
PPPOX_BOUND
;
sk
->
state
|=
PPPOX_BOUND
;
break
;
break
;
}
}
default:
default:
if
(
p
roto
[
sk
->
protocol
]
->
ioctl
)
if
(
p
ppox_protos
[
sk
->
protocol
]
->
ioctl
)
err
=
(
*
proto
[
sk
->
protocol
]
->
ioctl
)
(
sock
,
cmd
,
arg
);
rc
=
pppox_protos
[
sk
->
protocol
]
->
ioctl
(
sock
,
cmd
,
arg
);
break
;
break
;
};
};
release_sock
(
sk
);
release_sock
(
sk
);
return
err
;
return
rc
;
}
}
static
int
pppox_create
(
struct
socket
*
sock
,
int
protocol
)
static
int
pppox_create
(
struct
socket
*
sock
,
int
protocol
)
{
{
int
err
=
0
;
int
rc
=
-
EPROTOTYPE
;
if
(
protocol
<
0
||
protocol
>
PX_MAX_PROTO
)
if
(
protocol
<
0
||
protocol
>
PX_MAX_PROTO
)
return
-
EPROTOTYPE
;
goto
out
;
if
(
proto
[
protocol
]
==
NULL
)
rc
=
-
EPROTONOSUPPORT
;
return
-
EPROTONOSUPPORT
;
if
(
!
pppox_protos
[
protocol
])
goto
out
;
err
=
(
*
proto
[
protocol
]
->
create
)(
sock
);
rc
=
pppox_protos
[
protocol
]
->
create
(
sock
);
if
(
!
rc
)
if
(
err
==
0
)
{
/* We get to set the ioctl handler. */
/* We get to set the ioctl handler. */
/* For everything else, pppox is just a shell. */
/* For everything else, pppox is just a shell. */
sock
->
ops
->
ioctl
=
pppox_ioctl
;
sock
->
ops
->
ioctl
=
pppox_ioctl
;
}
out:
return
rc
;
return
err
;
}
}
static
struct
net_proto_family
pppox_proto_family
=
{
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