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
a45e8399
Commit
a45e8399
authored
Sep 25, 2003
by
Chas Williams
Committed by
David S. Miller
Sep 25, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ATM]: [ioctl][8/8] Use new code for atmtcp (from levon@movementarian.org)
parent
ee45a5d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
69 deletions
+38
-69
drivers/atm/atmtcp.c
drivers/atm/atmtcp.c
+38
-18
net/atm/ioctl.c
net/atm/ioctl.c
+0
-51
No files found.
drivers/atm/atmtcp.c
View file @
a45e8399
...
@@ -431,32 +431,52 @@ int atmtcp_remove_persistent(int itf)
...
@@ -431,32 +431,52 @@ int atmtcp_remove_persistent(int itf)
return
0
;
return
0
;
}
}
static
int
atmtcp_ioctl
(
struct
socket
*
sock
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
int
err
=
0
;
struct
atm_vcc
*
vcc
=
ATM_SD
(
sock
);
if
(
cmd
!=
SIOCSIFATMTCP
&&
cmd
!=
ATMTCP_CREATE
&&
cmd
!=
ATMTCP_REMOVE
)
return
-
ENOIOCTLCMD
;
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
switch
(
cmd
)
{
case
SIOCSIFATMTCP
:
err
=
atmtcp_attach
(
vcc
,
(
int
)
arg
);
if
(
err
>=
0
)
{
sock
->
state
=
SS_CONNECTED
;
__module_get
(
THIS_MODULE
);
}
break
;
case
ATMTCP_CREATE
:
err
=
atmtcp_create_persistent
((
int
)
arg
);
break
;
case
ATMTCP_REMOVE
:
err
=
atmtcp_remove_persistent
((
int
)
arg
);
break
;
}
return
err
;
}
#ifdef MODULE
static
struct
atm_ioctl
atmtcp_ioctl_ops
=
{
.
owner
=
THIS_MODULE
,
.
ioctl
=
atmtcp_ioctl
,
};
int
init_module
(
void
)
static
__init
int
atmtcp_init
(
void
)
{
{
atm_tcp_ops
.
attach
=
atmtcp_attach
;
register_atm_ioctl
(
&
atmtcp_ioctl_ops
);
atm_tcp_ops
.
create_persistent
=
atmtcp_create_persistent
;
atm_tcp_ops
.
remove_persistent
=
atmtcp_remove_persistent
;
return
0
;
return
0
;
}
}
void
cleanup_module
(
void
)
static
void
__exit
atmtcp_exit
(
void
)
{
{
atm_tcp_ops
.
attach
=
NULL
;
deregister_atm_ioctl
(
&
atmtcp_ioctl_ops
);
atm_tcp_ops
.
create_persistent
=
NULL
;
atm_tcp_ops
.
remove_persistent
=
NULL
;
}
}
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
#else
module_init
(
atmtcp_init
);
module_exit
(
atmtcp_exit
);
struct
atm_tcp_ops
atm_tcp_ops
=
{
atmtcp_attach
,
/* attach */
atmtcp_create_persistent
,
/* create_persistent */
atmtcp_remove_persistent
/* remove_persistent */
};
#endif
net/atm/ioctl.c
View file @
a45e8399
...
@@ -53,14 +53,6 @@ EXPORT_SYMBOL(atm_lane_ops_set);
...
@@ -53,14 +53,6 @@ EXPORT_SYMBOL(atm_lane_ops_set);
#endif
#endif
#endif
#endif
#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE)
#include <linux/atm_tcp.h>
#ifdef CONFIG_ATM_TCP_MODULE
struct
atm_tcp_ops
atm_tcp_ops
;
EXPORT_SYMBOL
(
atm_tcp_ops
);
#endif
#endif
static
DECLARE_MUTEX
(
ioctl_mutex
);
static
DECLARE_MUTEX
(
ioctl_mutex
);
static
LIST_HEAD
(
ioctl_list
);
static
LIST_HEAD
(
ioctl_list
);
...
@@ -185,49 +177,6 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
...
@@ -185,49 +177,6 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
}
else
}
else
error
=
-
ENOSYS
;
error
=
-
ENOSYS
;
goto
done
;
goto
done
;
#endif
#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE)
case
SIOCSIFATMTCP
:
if
(
!
capable
(
CAP_NET_ADMIN
))
{
error
=
-
EPERM
;
goto
done
;
}
if
(
!
atm_tcp_ops
.
attach
)
{
error
=
-
ENOPKG
;
goto
done
;
}
fops_get
(
&
atm_tcp_ops
);
error
=
atm_tcp_ops
.
attach
(
vcc
,
(
int
)
arg
);
if
(
error
>=
0
)
sock
->
state
=
SS_CONNECTED
;
else
fops_put
(
&
atm_tcp_ops
);
goto
done
;
case
ATMTCP_CREATE
:
if
(
!
capable
(
CAP_NET_ADMIN
))
{
error
=
-
EPERM
;
goto
done
;
}
if
(
!
atm_tcp_ops
.
create_persistent
)
{
error
=
-
ENOPKG
;
goto
done
;
}
error
=
atm_tcp_ops
.
create_persistent
((
int
)
arg
);
if
(
error
<
0
)
fops_put
(
&
atm_tcp_ops
);
goto
done
;
case
ATMTCP_REMOVE
:
if
(
!
capable
(
CAP_NET_ADMIN
))
{
error
=
-
EPERM
;
goto
done
;
}
if
(
!
atm_tcp_ops
.
remove_persistent
)
{
error
=
-
ENOPKG
;
goto
done
;
}
error
=
atm_tcp_ops
.
remove_persistent
((
int
)
arg
);
fops_put
(
&
atm_tcp_ops
);
goto
done
;
#endif
#endif
default:
default:
break
;
break
;
...
...
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