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
2267e86d
Commit
2267e86d
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][2/8] Add registration functions (from levon@movementarian.org)
parent
f962d6bc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
2 deletions
+62
-2
include/linux/atmdev.h
include/linux/atmdev.h
+22
-0
net/atm/ioctl.c
net/atm/ioctl.c
+40
-2
No files found.
include/linux/atmdev.h
View file @
2267e86d
...
@@ -445,6 +445,28 @@ int atm_pcr_goal(struct atm_trafprm *tp);
...
@@ -445,6 +445,28 @@ int atm_pcr_goal(struct atm_trafprm *tp);
void
vcc_release_async
(
struct
atm_vcc
*
vcc
,
int
reply
);
void
vcc_release_async
(
struct
atm_vcc
*
vcc
,
int
reply
);
struct
atm_ioctl
{
struct
module
*
owner
;
/* A module reference is kept if appropriate over this call.
* Return -ENOIOCTLCMD if you don't handle it. */
int
(
*
ioctl
)(
struct
socket
*
,
unsigned
int
cmd
,
unsigned
long
arg
);
struct
list_head
list
;
};
/**
* register_atm_ioctl - register handler for ioctl operations
*
* Special (non-device) handlers of ioctl's should
* register here. If you're a normal device, you should
* set .ioctl in your atmdev_ops instead.
*/
void
register_atm_ioctl
(
struct
atm_ioctl
*
);
/**
* deregister_atm_ioctl - remove the ioctl handler
*/
void
deregister_atm_ioctl
(
struct
atm_ioctl
*
);
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
#endif
#endif
net/atm/ioctl.c
View file @
2267e86d
/*
net/atm/common.c - ATM sockets (common part for PVC and SVC)
*/
/*
ATM ioctl handling
*/
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */
/* 2003 John Levon <levon@movementarian.org> */
#include <linux/config.h>
#include <linux/config.h>
...
@@ -18,7 +19,7 @@
...
@@ -18,7 +19,7 @@
#ifdef CONFIG_ATM_CLIP
#ifdef CONFIG_ATM_CLIP
#include <net/atmclip.h>
/* for clip_create */
#include <net/atmclip.h>
/* for clip_create */
#endif
#endif
#include "resources.h"
/* atm_find_dev */
#include "resources.h"
#include "signaling.h"
/* for WAITING and sigd_attach */
#include "signaling.h"
/* for WAITING and sigd_attach */
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE)
...
@@ -153,11 +154,32 @@ EXPORT_SYMBOL(br2684_ioctl_set);
...
@@ -153,11 +154,32 @@ EXPORT_SYMBOL(br2684_ioctl_set);
#endif
#endif
#endif
#endif
static
DECLARE_MUTEX
(
ioctl_mutex
);
static
LIST_HEAD
(
ioctl_list
);
void
register_atm_ioctl
(
struct
atm_ioctl
*
ioctl
)
{
down
(
&
ioctl_mutex
);
list_add_tail
(
&
ioctl
->
list
,
&
ioctl_list
);
up
(
&
ioctl_mutex
);
}
void
deregister_atm_ioctl
(
struct
atm_ioctl
*
ioctl
)
{
down
(
&
ioctl_mutex
);
list_del
(
&
ioctl
->
list
);
up
(
&
ioctl_mutex
);
}
EXPORT_SYMBOL
(
register_atm_ioctl
);
EXPORT_SYMBOL
(
deregister_atm_ioctl
);
int
vcc_ioctl
(
struct
socket
*
sock
,
unsigned
int
cmd
,
unsigned
long
arg
)
int
vcc_ioctl
(
struct
socket
*
sock
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
{
struct
atm_vcc
*
vcc
;
struct
atm_vcc
*
vcc
;
int
error
;
int
error
;
struct
list_head
*
pos
;
vcc
=
ATM_SD
(
sock
);
vcc
=
ATM_SD
(
sock
);
switch
(
cmd
)
{
switch
(
cmd
)
{
...
@@ -396,6 +418,22 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
...
@@ -396,6 +418,22 @@ int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
break
;
break
;
}
}
error
=
-
ENOIOCTLCMD
;
error
=
-
ENOIOCTLCMD
;
down
(
&
ioctl_mutex
);
list_for_each
(
pos
,
&
ioctl_list
)
{
struct
atm_ioctl
*
ic
=
list_entry
(
pos
,
struct
atm_ioctl
,
list
);
if
(
try_module_get
(
ic
->
owner
))
{
error
=
ic
->
ioctl
(
sock
,
cmd
,
arg
);
module_put
(
ic
->
owner
);
if
(
error
!=
-
ENOIOCTLCMD
)
break
;
}
}
up
(
&
ioctl_mutex
);
if
(
error
!=
-
ENOIOCTLCMD
)
goto
done
;
#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE)
#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE)
down
(
&
pppoatm_ioctl_mutex
);
down
(
&
pppoatm_ioctl_mutex
);
if
(
pppoatm_ioctl_hook
)
if
(
pppoatm_ioctl_hook
)
...
...
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