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
7a2d9c10
Commit
7a2d9c10
authored
May 15, 2003
by
Arnaldo Carvalho de Melo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o wanrouter: don't use typedefs for wan_device, just struct wan_device
parent
77b3055a
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
123 additions
and
115 deletions
+123
-115
drivers/net/wan/cycx_main.c
drivers/net/wan/cycx_main.c
+7
-7
drivers/net/wan/cycx_x25.c
drivers/net/wan/cycx_x25.c
+23
-21
drivers/net/wan/sdla_chdlc.c
drivers/net/wan/sdla_chdlc.c
+7
-6
drivers/net/wan/sdla_fr.c
drivers/net/wan/sdla_fr.c
+9
-7
drivers/net/wan/sdla_ppp.c
drivers/net/wan/sdla_ppp.c
+9
-7
drivers/net/wan/sdla_x25.c
drivers/net/wan/sdla_x25.c
+13
-12
drivers/net/wan/sdlamain.c
drivers/net/wan/sdlamain.c
+7
-7
drivers/net/wan/wanpipe_multppp.c
drivers/net/wan/wanpipe_multppp.c
+8
-7
include/linux/cyclomx.h
include/linux/cyclomx.h
+1
-1
include/linux/wanpipe.h
include/linux/wanpipe.h
+1
-1
include/linux/wanrouter.h
include/linux/wanrouter.h
+6
-7
net/wanrouter/wanmain.c
net/wanrouter/wanmain.c
+23
-23
net/wanrouter/wanproc.c
net/wanrouter/wanproc.c
+9
-9
No files found.
drivers/net/wan/cycx_main.c
View file @
7a2d9c10
...
@@ -70,9 +70,9 @@ MODULE_PARM_DESC(cycx_debug, "cyclomx debug level");
...
@@ -70,9 +70,9 @@ MODULE_PARM_DESC(cycx_debug, "cyclomx debug level");
/* Function Prototypes */
/* Function Prototypes */
/* WAN link driver entry points */
/* WAN link driver entry points */
static
int
setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
conf
);
static
int
setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
conf
);
static
int
shutdown
(
wan_device_t
*
wandev
);
static
int
shutdown
(
struct
wan_device
*
wandev
);
static
int
ioctl
(
wan_device_t
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
ioctl
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
/* Miscellaneous functions */
/* Miscellaneous functions */
static
irqreturn_t
cycx_isr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
static
irqreturn_t
cycx_isr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
...
@@ -122,7 +122,7 @@ int __init cyclomx_init (void)
...
@@ -122,7 +122,7 @@ int __init cyclomx_init (void)
/* Register adapters with WAN router */
/* Register adapters with WAN router */
for
(
cnt
=
0
;
cnt
<
ncards
;
++
cnt
)
{
for
(
cnt
=
0
;
cnt
<
ncards
;
++
cnt
)
{
cycx_t
*
card
=
&
card_array
[
cnt
];
cycx_t
*
card
=
&
card_array
[
cnt
];
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
sprintf
(
card
->
devname
,
"%s%d"
,
drvname
,
cnt
+
1
);
sprintf
(
card
->
devname
,
"%s%d"
,
drvname
,
cnt
+
1
);
wandev
->
magic
=
ROUTER_MAGIC
;
wandev
->
magic
=
ROUTER_MAGIC
;
...
@@ -181,7 +181,7 @@ static void __exit cyclomx_cleanup (void)
...
@@ -181,7 +181,7 @@ static void __exit cyclomx_cleanup (void)
* configuration structure is in kernel memory (including extended data, if
* configuration structure is in kernel memory (including extended data, if
* any).
* any).
*/
*/
static
int
setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
conf
)
static
int
setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
conf
)
{
{
int
err
=
-
EFAULT
;
int
err
=
-
EFAULT
;
cycx_t
*
card
;
cycx_t
*
card
;
...
@@ -273,7 +273,7 @@ out: return err;
...
@@ -273,7 +273,7 @@ out: return err;
* This function is called by the router when device is being unregistered or
* This function is called by the router when device is being unregistered or
* when it handles ROUTER_DOWN IOCTL.
* when it handles ROUTER_DOWN IOCTL.
*/
*/
static
int
shutdown
(
wan_device_t
*
wandev
)
static
int
shutdown
(
struct
wan_device
*
wandev
)
{
{
int
ret
=
-
EFAULT
;
int
ret
=
-
EFAULT
;
cycx_t
*
card
;
cycx_t
*
card
;
...
@@ -305,7 +305,7 @@ out: return ret;
...
@@ -305,7 +305,7 @@ out: return ret;
*
*
* no reserved ioctls for the cyclom 2x up to now
* no reserved ioctls for the cyclom 2x up to now
*/
*/
static
int
ioctl
(
wan_device_t
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
)
static
int
ioctl
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
)
{
{
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
...
drivers/net/wan/cycx_x25.c
View file @
7a2d9c10
...
@@ -120,10 +120,10 @@ typedef struct x25_channel {
...
@@ -120,10 +120,10 @@ typedef struct x25_channel {
/* Function Prototypes */
/* Function Prototypes */
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
),
static
int
update
(
struct
wan_device
*
wandev
),
new_if
(
wan_device_t
*
wandev
,
struct
net_device
*
dev
,
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
),
wanif_conf_t
*
conf
),
del_if
(
wan_device_t
*
wandev
,
struct
net_device
*
dev
);
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
/* Network device interface */
/* Network device interface */
static
int
if_init
(
struct
net_device
*
dev
),
static
int
if_init
(
struct
net_device
*
dev
),
...
@@ -175,14 +175,15 @@ static u8 log2 (u32 n);
...
@@ -175,14 +175,15 @@ static u8 log2 (u32 n);
static
unsigned
dec_to_uint
(
u8
*
str
,
int
len
);
static
unsigned
dec_to_uint
(
u8
*
str
,
int
len
);
static
struct
net_device
*
get_dev_by_lcn
(
wan_device_t
*
wandev
,
s16
lcn
);
static
struct
net_device
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
s16
lcn
);
static
struct
net_device
*
get_dev_by_dte_addr
(
wan_device_t
*
wandev
,
char
*
dte
);
static
struct
net_device
*
get_dev_by_dte_addr
(
struct
wan_device
*
wandev
,
char
*
dte
);
#ifdef CYCLOMX_X25_DEBUG
#ifdef CYCLOMX_X25_DEBUG
static
void
hex_dump
(
char
*
msg
,
unsigned
char
*
p
,
int
len
);
static
void
hex_dump
(
char
*
msg
,
unsigned
char
*
p
,
int
len
);
static
void
x25_dump_config
(
TX25Config
*
conf
);
static
void
x25_dump_config
(
TX25Config
*
conf
);
static
void
x25_dump_stats
(
TX25Stats
*
stats
);
static
void
x25_dump_stats
(
TX25Stats
*
stats
);
static
void
x25_dump_devs
(
wan_device_t
*
wandev
);
static
void
x25_dump_devs
(
struct
wan_device
*
wandev
);
#else
#else
#define hex_dump(msg, p, len)
#define hex_dump(msg, p, len)
#define x25_dump_config(conf)
#define x25_dump_config(conf)
...
@@ -318,7 +319,7 @@ int cyx_init (cycx_t *card, wandev_conf_t *conf)
...
@@ -318,7 +319,7 @@ int cyx_init (cycx_t *card, wandev_conf_t *conf)
/* WAN Device Driver Entry Points */
/* WAN Device Driver Entry Points */
/* Update device status & statistics. */
/* Update device status & statistics. */
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
/* sanity checks */
/* sanity checks */
if
(
!
wandev
||
!
wandev
->
private
)
if
(
!
wandev
||
!
wandev
->
private
)
...
@@ -342,7 +343,7 @@ static int update (wan_device_t *wandev)
...
@@ -342,7 +343,7 @@ static int update (wan_device_t *wandev)
*
*
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created) */
* < 0 failure (channel will not be created) */
static
int
new_if
(
wan_device_t
*
wandev
,
struct
net_device
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
wanif_conf_t
*
conf
)
{
{
cycx_t
*
card
=
wandev
->
private
;
cycx_t
*
card
=
wandev
->
private
;
...
@@ -431,7 +432,7 @@ static int new_if (wan_device_t *wandev, struct net_device *dev,
...
@@ -431,7 +432,7 @@ static int new_if (wan_device_t *wandev, struct net_device *dev,
}
}
/* Delete logical channel. */
/* Delete logical channel. */
static
int
del_if
(
wan_device_t
*
wandev
,
struct
net_device
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
)
{
{
if
(
dev
->
priv
)
{
if
(
dev
->
priv
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
x25_channel_t
*
chan
=
dev
->
priv
;
...
@@ -461,7 +462,7 @@ static int if_init (struct net_device *dev)
...
@@ -461,7 +462,7 @@ static int if_init (struct net_device *dev)
{
{
x25_channel_t
*
chan
=
dev
->
priv
;
x25_channel_t
*
chan
=
dev
->
priv
;
cycx_t
*
card
=
chan
->
card
;
cycx_t
*
card
=
chan
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
/* Initialize device driver entry points */
dev
->
open
=
if_open
;
dev
->
open
=
if_open
;
...
@@ -711,7 +712,7 @@ static void cyx_isr (cycx_t *card)
...
@@ -711,7 +712,7 @@ static void cyx_isr (cycx_t *card)
static
void
tx_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
static
void
tx_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
{
{
struct
net_device
*
dev
;
struct
net_device
*
dev
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
u8
lcn
;
u8
lcn
;
cycx_peek
(
&
card
->
hw
,
cmd
->
buf
,
&
lcn
,
sizeof
(
lcn
));
cycx_peek
(
&
card
->
hw
,
cmd
->
buf
,
&
lcn
,
sizeof
(
lcn
));
...
@@ -741,7 +742,7 @@ static void tx_intr (cycx_t *card, TX25Cmd *cmd)
...
@@ -741,7 +742,7 @@ static void tx_intr (cycx_t *card, TX25Cmd *cmd)
* socket buffers available) the whole packet sequence must be discarded. */
* socket buffers available) the whole packet sequence must be discarded. */
static
void
rx_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
static
void
rx_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
{
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
net_device
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
...
@@ -825,7 +826,7 @@ static void rx_intr (cycx_t *card, TX25Cmd *cmd)
...
@@ -825,7 +826,7 @@ static void rx_intr (cycx_t *card, TX25Cmd *cmd)
/* Connect interrupt handler. */
/* Connect interrupt handler. */
static
void
connect_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
static
void
connect_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
{
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
net_device
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
u8
d
[
32
],
u8
d
[
32
],
...
@@ -867,7 +868,7 @@ static void connect_intr (cycx_t *card, TX25Cmd *cmd)
...
@@ -867,7 +868,7 @@ static void connect_intr (cycx_t *card, TX25Cmd *cmd)
/* Connect confirm interrupt handler. */
/* Connect confirm interrupt handler. */
static
void
connect_confirm_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
static
void
connect_confirm_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
{
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
net_device
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
u8
lcn
,
key
;
u8
lcn
,
key
;
...
@@ -894,7 +895,7 @@ static void connect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
...
@@ -894,7 +895,7 @@ static void connect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
/* Disconnect confirm interrupt handler. */
/* Disconnect confirm interrupt handler. */
static
void
disconnect_confirm_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
static
void
disconnect_confirm_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
{
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
net_device
*
dev
;
struct
net_device
*
dev
;
u8
lcn
;
u8
lcn
;
...
@@ -914,7 +915,7 @@ static void disconnect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
...
@@ -914,7 +915,7 @@ static void disconnect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
/* disconnect interrupt handler. */
/* disconnect interrupt handler. */
static
void
disconnect_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
static
void
disconnect_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
{
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
net_device
*
dev
;
struct
net_device
*
dev
;
u8
lcn
;
u8
lcn
;
...
@@ -1255,7 +1256,7 @@ static int x25_send (cycx_t *card, u8 link, u8 lcn, u8 bitm, int len, void *buf)
...
@@ -1255,7 +1256,7 @@ static int x25_send (cycx_t *card, u8 link, u8 lcn, u8 bitm, int len, void *buf)
/* Miscellaneous */
/* Miscellaneous */
/* Find network device by its channel number. */
/* Find network device by its channel number. */
static
struct
net_device
*
get_dev_by_lcn
(
wan_device_t
*
wandev
,
s16
lcn
)
static
struct
net_device
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
s16
lcn
)
{
{
struct
net_device
*
dev
=
wandev
->
dev
;
struct
net_device
*
dev
=
wandev
->
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
...
@@ -1271,7 +1272,8 @@ static struct net_device *get_dev_by_lcn (wan_device_t *wandev, s16 lcn)
...
@@ -1271,7 +1272,8 @@ static struct net_device *get_dev_by_lcn (wan_device_t *wandev, s16 lcn)
}
}
/* Find network device by its remote dte address. */
/* Find network device by its remote dte address. */
static
struct
net_device
*
get_dev_by_dte_addr
(
wan_device_t
*
wandev
,
char
*
dte
)
static
struct
net_device
*
get_dev_by_dte_addr
(
struct
wan_device
*
wandev
,
char
*
dte
)
{
{
struct
net_device
*
dev
=
wandev
->
dev
;
struct
net_device
*
dev
=
wandev
->
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
...
@@ -1556,7 +1558,7 @@ static void x25_dump_stats(TX25Stats *stats)
...
@@ -1556,7 +1558,7 @@ static void x25_dump_stats(TX25Stats *stats)
printk
(
KERN_INFO
"rx_aborts=%d
\n
"
,
stats
->
rx_aborts
);
printk
(
KERN_INFO
"rx_aborts=%d
\n
"
,
stats
->
rx_aborts
);
}
}
static
void
x25_dump_devs
(
wan_device_t
*
wandev
)
static
void
x25_dump_devs
(
struct
wan_device
*
wandev
)
{
{
struct
net_device
*
dev
=
wandev
->
dev
;
struct
net_device
*
dev
=
wandev
->
dev
;
...
...
drivers/net/wan/sdla_chdlc.c
View file @
7a2d9c10
...
@@ -186,8 +186,8 @@ extern void enable_irq(unsigned int);
...
@@ -186,8 +186,8 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
/* Network device interface */
/* Network device interface */
...
@@ -598,7 +598,7 @@ int wpc_init (sdla_t* card, wandev_conf_t* conf)
...
@@ -598,7 +598,7 @@ int wpc_init (sdla_t* card, wandev_conf_t* conf)
* as to minimize the time that we are inside the interrupt handler.
* as to minimize the time that we are inside the interrupt handler.
*
*
*/
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
netdevice_t
*
dev
;
netdevice_t
*
dev
;
...
@@ -666,7 +666,8 @@ static int update (wan_device_t* wandev)
...
@@ -666,7 +666,8 @@ static int update (wan_device_t* wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
chdlc_private_area_t
*
chdlc_priv_area
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
@@ -898,10 +899,10 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
...
@@ -898,10 +899,10 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
* registration.
* registration.
*/
*/
static
int
if_init
(
netdevice_t
*
dev
)
static
int
if_init
(
netdevice_t
*
dev
)
{
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
dev
->
open
=
&
if_open
;
...
...
drivers/net/wan/sdla_fr.c
View file @
7a2d9c10
...
@@ -323,9 +323,10 @@ static int Intr_test_counter;
...
@@ -323,9 +323,10 @@ static int Intr_test_counter;
/****** Function Prototypes *************************************************/
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
);
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
disable_comm
(
sdla_t
*
card
);
/* WANPIPE-specific entry points */
/* WANPIPE-specific entry points */
...
@@ -746,7 +747,7 @@ int wpf_init(sdla_t *card, wandev_conf_t *conf)
...
@@ -746,7 +747,7 @@ int wpf_init(sdla_t *card, wandev_conf_t *conf)
/*============================================================================
/*============================================================================
* Update device status & statistics.
* Update device status & statistics.
*/
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
volatile
sdla_t
*
card
;
volatile
sdla_t
*
card
;
unsigned
long
timeout
;
unsigned
long
timeout
;
...
@@ -791,7 +792,8 @@ static int update (wan_device_t* wandev)
...
@@ -791,7 +792,8 @@ static int update (wan_device_t* wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
fr_channel_t
*
chan
;
fr_channel_t
*
chan
;
...
@@ -1020,7 +1022,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
...
@@ -1020,7 +1022,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
/*============================================================================
/*============================================================================
* Delete logical channel.
* Delete logical channel.
*/
*/
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
)
{
{
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
unsigned
long
smp_flags
=
0
;
unsigned
long
smp_flags
=
0
;
...
@@ -1120,7 +1122,7 @@ static int if_init (netdevice_t* dev)
...
@@ -1120,7 +1122,7 @@ static int if_init (netdevice_t* dev)
{
{
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
dev
->
open
=
&
if_open
;
...
...
drivers/net/wan/sdla_ppp.c
View file @
7a2d9c10
...
@@ -231,9 +231,10 @@ extern void enable_irq(unsigned int);
...
@@ -231,9 +231,10 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
);
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
);
/* WANPIPE-specific entry points */
/* WANPIPE-specific entry points */
static
int
wpp_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
static
int
wpp_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
...
@@ -444,7 +445,7 @@ int wpp_init(sdla_t *card, wandev_conf_t *conf)
...
@@ -444,7 +445,7 @@ int wpp_init(sdla_t *card, wandev_conf_t *conf)
/*============================================================================
/*============================================================================
* Update device status & statistics.
* Update device status & statistics.
*/
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
netdevice_t
*
dev
;
netdevice_t
*
dev
;
...
@@ -504,7 +505,8 @@ static int update(wan_device_t *wandev)
...
@@ -504,7 +505,8 @@ static int update(wan_device_t *wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
ppp_private_area_t
*
ppp_priv_area
;
ppp_private_area_t
*
ppp_priv_area
;
...
@@ -622,7 +624,7 @@ static int new_if(wan_device_t *wandev, netdevice_t *dev, wanif_conf_t *conf)
...
@@ -622,7 +624,7 @@ static int new_if(wan_device_t *wandev, netdevice_t *dev, wanif_conf_t *conf)
/*============================================================================
/*============================================================================
* Delete logical channel.
* Delete logical channel.
*/
*/
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
)
{
{
return
0
;
return
0
;
}
}
...
@@ -685,7 +687,7 @@ static int if_init(netdevice_t *dev)
...
@@ -685,7 +687,7 @@ static int if_init(netdevice_t *dev)
{
{
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
dev
->
open
=
&
if_open
;
...
...
drivers/net/wan/sdla_x25.c
View file @
7a2d9c10
...
@@ -330,10 +330,10 @@ typedef struct x25_call_info
...
@@ -330,10 +330,10 @@ typedef struct x25_call_info
* WAN link driver entry points. These are
* WAN link driver entry points. These are
* called by the WAN router module.
* called by the WAN router module.
*/
*/
static
int
update
(
wan_device_t
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
disable_comm_shutdown
(
sdla_t
*
card
);
static
void
disable_comm_shutdown
(
sdla_t
*
card
);
...
@@ -425,7 +425,7 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb);
...
@@ -425,7 +425,7 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb);
*/
*/
static
int
connect
(
sdla_t
*
card
);
static
int
connect
(
sdla_t
*
card
);
static
int
disconnect
(
sdla_t
*
card
);
static
int
disconnect
(
sdla_t
*
card
);
static
netdevice_t
*
get_dev_by_lcn
(
wan_device_t
*
wandev
,
unsigned
lcn
);
static
netdevice_t
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
unsigned
lcn
);
static
int
chan_connect
(
netdevice_t
*
dev
);
static
int
chan_connect
(
netdevice_t
*
dev
);
static
int
chan_disc
(
netdevice_t
*
dev
);
static
int
chan_disc
(
netdevice_t
*
dev
);
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
);
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
);
...
@@ -830,7 +830,7 @@ int wpx_init (sdla_t* card, wandev_conf_t* conf)
...
@@ -830,7 +830,7 @@ int wpx_init (sdla_t* card, wandev_conf_t* conf)
* <0 Failed (or busy).
* <0 Failed (or busy).
*/
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
volatile
sdla_t
*
card
;
volatile
sdla_t
*
card
;
TX25Status
*
status
;
TX25Status
*
status
;
...
@@ -895,7 +895,8 @@ static int update (wan_device_t* wandev)
...
@@ -895,7 +895,8 @@ static int update (wan_device_t* wandev)
* Return: 0 Ok
* Return: 0 Ok
* <0 Failed (channel will not be created)
* <0 Failed (channel will not be created)
*/
*/
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
...
@@ -1029,7 +1030,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
...
@@ -1029,7 +1030,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
//FIXME Del IF Should be taken out now.
//FIXME Del IF Should be taken out now.
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
)
{
{
return
0
;
return
0
;
}
}
...
@@ -1099,7 +1100,7 @@ static int if_init (netdevice_t* dev)
...
@@ -1099,7 +1100,7 @@ static int if_init (netdevice_t* dev)
{
{
x25_channel_t
*
chan
=
dev
->
priv
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
dev
->
open
=
&
if_open
;
...
@@ -3101,7 +3102,7 @@ static int x25_error (sdla_t* card, int err, int cmd, int lcn)
...
@@ -3101,7 +3102,7 @@ static int x25_error (sdla_t* card, int err, int cmd, int lcn)
static
int
incoming_call
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
static
int
incoming_call
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
{
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
int
new_lcn
=
mb
->
cmd
.
lcn
;
int
new_lcn
=
mb
->
cmd
.
lcn
;
netdevice_t
*
dev
=
get_dev_by_lcn
(
wandev
,
new_lcn
);
netdevice_t
*
dev
=
get_dev_by_lcn
(
wandev
,
new_lcn
);
x25_channel_t
*
chan
=
NULL
;
x25_channel_t
*
chan
=
NULL
;
...
@@ -3336,7 +3337,7 @@ static int call_cleared (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3336,7 +3337,7 @@ static int call_cleared (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
static
int
restart_event
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
static
int
restart_event
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
{
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
netdevice_t
*
dev
;
netdevice_t
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
unsigned
char
old_state
;
unsigned
char
old_state
;
...
@@ -3447,7 +3448,7 @@ static int disconnect (sdla_t* card)
...
@@ -3447,7 +3448,7 @@ static int disconnect (sdla_t* card)
* Find network device by its channel number.
* Find network device by its channel number.
*/
*/
static
netdevice_t
*
get_dev_by_lcn
(
wan_device_t
*
wandev
,
unsigned
lcn
)
static
netdevice_t
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
unsigned
lcn
)
{
{
netdevice_t
*
dev
;
netdevice_t
*
dev
;
...
...
drivers/net/wan/sdlamain.c
View file @
7a2d9c10
...
@@ -184,9 +184,9 @@ int init_module (void);
...
@@ -184,9 +184,9 @@ int init_module (void);
void
cleanup_module
(
void
);
void
cleanup_module
(
void
);
/* WAN link driver entry points */
/* WAN link driver entry points */
static
int
setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
conf
);
static
int
setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
conf
);
static
int
shutdown
(
wan_device_t
*
wandev
);
static
int
shutdown
(
struct
wan_device
*
wandev
);
static
int
ioctl
(
wan_device_t
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
ioctl
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
/* IOCTL handlers */
/* IOCTL handlers */
static
int
ioctl_dump
(
sdla_t
*
card
,
sdla_dump_t
*
u_dump
);
static
int
ioctl_dump
(
sdla_t
*
card
,
sdla_dump_t
*
u_dump
);
...
@@ -279,7 +279,7 @@ int wanpipe_init(void)
...
@@ -279,7 +279,7 @@ int wanpipe_init(void)
/* Register adapters with WAN router */
/* Register adapters with WAN router */
for
(
cnt
=
0
;
cnt
<
ncards
;
++
cnt
)
{
for
(
cnt
=
0
;
cnt
<
ncards
;
++
cnt
)
{
sdla_t
*
card
=
&
card_array
[
cnt
];
sdla_t
*
card
=
&
card_array
[
cnt
];
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
card
->
next
=
NULL
;
card
->
next
=
NULL
;
sprintf
(
card
->
devname
,
"%s%d"
,
drvname
,
cnt
+
1
);
sprintf
(
card
->
devname
,
"%s%d"
,
drvname
,
cnt
+
1
);
...
@@ -352,7 +352,7 @@ void cleanup_module (void)
...
@@ -352,7 +352,7 @@ void cleanup_module (void)
* any).
* any).
*/
*/
static
int
setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
conf
)
static
int
setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
conf
)
{
{
sdla_t
*
card
;
sdla_t
*
card
;
int
err
=
0
;
int
err
=
0
;
...
@@ -779,7 +779,7 @@ static int check_s514_conflicts(sdla_t* card,wandev_conf_t* conf, int *irq)
...
@@ -779,7 +779,7 @@ static int check_s514_conflicts(sdla_t* card,wandev_conf_t* conf, int *irq)
* This function is called by the router when device is being unregistered or
* This function is called by the router when device is being unregistered or
* when it handles ROUTER_DOWN IOCTL.
* when it handles ROUTER_DOWN IOCTL.
*/
*/
static
int
shutdown
(
wan_device_t
*
wandev
)
static
int
shutdown
(
struct
wan_device
*
wandev
)
{
{
sdla_t
*
card
;
sdla_t
*
card
;
int
err
=
0
;
int
err
=
0
;
...
@@ -888,7 +888,7 @@ static void release_hw (sdla_t *card)
...
@@ -888,7 +888,7 @@ static void release_hw (sdla_t *card)
* This function is called when router handles one of the reserved user
* This function is called when router handles one of the reserved user
* IOCTLs. Note that 'arg' stil points to user address space.
* IOCTLs. Note that 'arg' stil points to user address space.
*/
*/
static
int
ioctl
(
wan_device_t
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
)
static
int
ioctl
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
)
{
{
sdla_t
*
card
;
sdla_t
*
card
;
int
err
;
int
err
;
...
...
drivers/net/wan/wanpipe_multppp.c
View file @
7a2d9c10
...
@@ -130,10 +130,10 @@ extern void enable_irq(unsigned int);
...
@@ -130,10 +130,10 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
);
/* Network device interface */
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_init
(
netdevice_t
*
dev
);
...
@@ -456,7 +456,7 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
...
@@ -456,7 +456,7 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
* as to minimize the time that we are inside the interrupt handler.
* as to minimize the time that we are inside the interrupt handler.
*
*
*/
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
netdevice_t
*
dev
;
netdevice_t
*
dev
;
...
@@ -522,7 +522,8 @@ static int update (wan_device_t* wandev)
...
@@ -522,7 +522,8 @@ static int update (wan_device_t* wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
pdev
,
wanif_conf_t
*
conf
)
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
pdev
,
wanif_conf_t
*
conf
)
{
{
struct
ppp_device
*
pppdev
=
(
struct
ppp_device
*
)
pdev
;
struct
ppp_device
*
pppdev
=
(
struct
ppp_device
*
)
pdev
;
...
@@ -616,7 +617,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* pdev, wanif_conf_t* conf)
...
@@ -616,7 +617,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* pdev, wanif_conf_t* conf)
/*============================================================================
/*============================================================================
* Delete logical channel.
* Delete logical channel.
*/
*/
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
)
{
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -655,7 +656,7 @@ static int if_init (netdevice_t* dev)
...
@@ -655,7 +656,7 @@ static int if_init (netdevice_t* dev)
{
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* NOTE: Most of the dev initialization was
/* NOTE: Most of the dev initialization was
* done in sppp_attach(), called by new_if()
* done in sppp_attach(), called by new_if()
...
...
include/linux/cyclomx.h
View file @
7a2d9c10
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
typedef
struct
cycx
{
typedef
struct
cycx
{
char
devname
[
WAN_DRVNAME_SZ
+
1
];
/* card name */
char
devname
[
WAN_DRVNAME_SZ
+
1
];
/* card name */
cycxhw_t
hw
;
/* hardware configuration */
cycxhw_t
hw
;
/* hardware configuration */
wan_device_t
wandev
;
/* WAN device data space */
struct
wan_device
wandev
;
/* WAN device data space */
u32
open_cnt
;
/* number of open interfaces */
u32
open_cnt
;
/* number of open interfaces */
u32
state_tick
;
/* link state timestamp */
u32
state_tick
;
/* link state timestamp */
spinlock_t
lock
;
spinlock_t
lock
;
...
...
include/linux/wanpipe.h
View file @
7a2d9c10
...
@@ -286,7 +286,7 @@ typedef struct sdla
...
@@ -286,7 +286,7 @@ typedef struct sdla
{
{
char
devname
[
WAN_DRVNAME_SZ
+
1
];
/* card name */
char
devname
[
WAN_DRVNAME_SZ
+
1
];
/* card name */
sdlahw_t
hw
;
/* hardware configuration */
sdlahw_t
hw
;
/* hardware configuration */
wan_device_t
wandev
;
/* WAN device data space */
struct
wan_device
wandev
;
/* WAN device data space */
unsigned
open_cnt
;
/* number of open interfaces */
unsigned
open_cnt
;
/* number of open interfaces */
unsigned
long
state_tick
;
/* link state timestamp */
unsigned
long
state_tick
;
/* link state timestamp */
...
...
include/linux/wanrouter.h
View file @
7a2d9c10
...
@@ -462,8 +462,7 @@ typedef struct wanif_conf
...
@@ -462,8 +462,7 @@ typedef struct wanif_conf
/*----------------------------------------------------------------------------
/*----------------------------------------------------------------------------
* WAN device data space.
* WAN device data space.
*/
*/
typedef
struct
wan_device
struct
wan_device
{
{
unsigned
magic
;
/* magic number */
unsigned
magic
;
/* magic number */
char
*
name
;
/* -> WAN device name (ASCIIZ) */
char
*
name
;
/* -> WAN device name (ASCIIZ) */
void
*
private
;
/* -> driver private data */
void
*
private
;
/* -> driver private data */
...
@@ -514,10 +513,10 @@ typedef struct wan_device
...
@@ -514,10 +513,10 @@ typedef struct wan_device
netdevice_t
*
dev
;
/* list of network interfaces */
netdevice_t
*
dev
;
/* list of network interfaces */
unsigned
ndev
;
/* number of interfaces */
unsigned
ndev
;
/* number of interfaces */
struct
proc_dir_entry
*
dent
;
/* proc filesystem entry */
struct
proc_dir_entry
*
dent
;
/* proc filesystem entry */
}
wan_device_t
;
};
/* Public functions available for device drivers */
/* Public functions available for device drivers */
extern
int
register_wan_device
(
wan_device_t
*
wandev
);
extern
int
register_wan_device
(
struct
wan_device
*
wandev
);
extern
int
unregister_wan_device
(
char
*
name
);
extern
int
unregister_wan_device
(
char
*
name
);
unsigned
short
wanrouter_type_trans
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
unsigned
short
wanrouter_type_trans
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
int
wanrouter_encapsulate
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
);
int
wanrouter_encapsulate
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
);
...
@@ -525,8 +524,8 @@ int wanrouter_encapsulate(struct sk_buff *skb, netdevice_t *dev,unsigned short t
...
@@ -525,8 +524,8 @@ int wanrouter_encapsulate(struct sk_buff *skb, netdevice_t *dev,unsigned short t
/* Proc interface functions. These must not be called by the drivers! */
/* Proc interface functions. These must not be called by the drivers! */
extern
int
wanrouter_proc_init
(
void
);
extern
int
wanrouter_proc_init
(
void
);
extern
void
wanrouter_proc_cleanup
(
void
);
extern
void
wanrouter_proc_cleanup
(
void
);
extern
int
wanrouter_proc_add
(
wan_device_t
*
wandev
);
extern
int
wanrouter_proc_add
(
struct
wan_device
*
wandev
);
extern
int
wanrouter_proc_delete
(
wan_device_t
*
wandev
);
extern
int
wanrouter_proc_delete
(
struct
wan_device
*
wandev
);
extern
int
wanrouter_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
int
wanrouter_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
);
extern
void
lock_adapter_irq
(
spinlock_t
*
lock
,
unsigned
long
*
smp_flags
);
extern
void
lock_adapter_irq
(
spinlock_t
*
lock
,
unsigned
long
*
smp_flags
);
...
@@ -535,7 +534,7 @@ extern void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
...
@@ -535,7 +534,7 @@ extern void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
/* Public Data */
/* Public Data */
extern
wan_device_t
*
router_devlist
;
/* list of registered devices */
extern
struct
wan_device
*
router_devlist
;
/* list of registered devices */
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
#endif
/* _ROUTER_H */
#endif
/* _ROUTER_H */
net/wanrouter/wanmain.c
View file @
7a2d9c10
...
@@ -127,18 +127,18 @@ static void dbg_kfree(void * v, int line) {
...
@@ -127,18 +127,18 @@ static void dbg_kfree(void * v, int line) {
* WAN device IOCTL handlers
* WAN device IOCTL handlers
*/
*/
static
int
device_setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
u_conf
);
static
int
device_setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
u_conf
);
static
int
device_stat
(
wan_device_t
*
wandev
,
wandev_stat_t
*
u_stat
);
static
int
device_stat
(
struct
wan_device
*
wandev
,
wandev_stat_t
*
u_stat
);
static
int
device_shutdown
(
wan_device_t
*
wandev
);
static
int
device_shutdown
(
struct
wan_device
*
wandev
);
static
int
device_new_if
(
wan_device_t
*
wandev
,
wanif_conf_t
*
u_conf
);
static
int
device_new_if
(
struct
wan_device
*
wandev
,
wanif_conf_t
*
u_conf
);
static
int
device_del_if
(
wan_device_t
*
wandev
,
char
*
u_name
);
static
int
device_del_if
(
struct
wan_device
*
wandev
,
char
*
u_name
);
/*
/*
* Miscellaneous
* Miscellaneous
*/
*/
static
wan_device_t
*
find_device
(
char
*
name
);
static
struct
wan_device
*
find_device
(
char
*
name
);
static
int
delete_interface
(
wan_device_t
*
wandev
,
char
*
name
);
static
int
delete_interface
(
struct
wan_device
*
wandev
,
char
*
name
);
void
lock_adapter_irq
(
spinlock_t
*
lock
,
unsigned
long
*
smp_flags
);
void
lock_adapter_irq
(
spinlock_t
*
lock
,
unsigned
long
*
smp_flags
);
void
unlock_adapter_irq
(
spinlock_t
*
lock
,
unsigned
long
*
smp_flags
);
void
unlock_adapter_irq
(
spinlock_t
*
lock
,
unsigned
long
*
smp_flags
);
...
@@ -151,8 +151,8 @@ void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
...
@@ -151,8 +151,8 @@ void unlock_adapter_irq(spinlock_t *lock, unsigned long *smp_flags);
static
char
fullname
[]
=
"Sangoma WANPIPE Router"
;
static
char
fullname
[]
=
"Sangoma WANPIPE Router"
;
static
char
copyright
[]
=
"(c) 1995-2000 Sangoma Technologies Inc."
;
static
char
copyright
[]
=
"(c) 1995-2000 Sangoma Technologies Inc."
;
static
char
modname
[]
=
ROUTER_NAME
;
/* short module name */
static
char
modname
[]
=
ROUTER_NAME
;
/* short module name */
wan_device_t
*
router_devlist
=
NULL
;
/* list of registered devices */
struct
wan_device
*
router_devlist
;
/* list of registered devices */
static
int
devcnt
=
0
;
static
int
devcnt
;
/*
/*
* Organize Unique Identifiers for encapsulation/decapsulation
* Organize Unique Identifiers for encapsulation/decapsulation
...
@@ -262,7 +262,7 @@ void cleanup_module (void)
...
@@ -262,7 +262,7 @@ void cleanup_module (void)
*/
*/
int
register_wan_device
(
wan_device_t
*
wandev
)
int
register_wan_device
(
struct
wan_device
*
wandev
)
{
{
int
err
,
namelen
;
int
err
,
namelen
;
...
@@ -322,7 +322,7 @@ int register_wan_device(wan_device_t *wandev)
...
@@ -322,7 +322,7 @@ int register_wan_device(wan_device_t *wandev)
int
unregister_wan_device
(
char
*
name
)
int
unregister_wan_device
(
char
*
name
)
{
{
wan_device_t
*
wandev
,
*
prev
;
struct
wan_device
*
wandev
,
*
prev
;
if
(
name
==
NULL
)
if
(
name
==
NULL
)
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -457,7 +457,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
...
@@ -457,7 +457,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
{
{
int
err
=
0
;
int
err
=
0
;
struct
proc_dir_entry
*
dent
;
struct
proc_dir_entry
*
dent
;
wan_device_t
*
wandev
;
struct
wan_device
*
wandev
;
if
(
!
capable
(
CAP_NET_ADMIN
))
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
return
-
EPERM
;
...
@@ -519,7 +519,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
...
@@ -519,7 +519,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
* o call driver's setup() entry point
* o call driver's setup() entry point
*/
*/
static
int
device_setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
u_conf
)
static
int
device_setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
u_conf
)
{
{
void
*
data
=
NULL
;
void
*
data
=
NULL
;
wandev_conf_t
*
conf
;
wandev_conf_t
*
conf
;
...
@@ -595,7 +595,7 @@ static int device_setup (wan_device_t *wandev, wandev_conf_t *u_conf)
...
@@ -595,7 +595,7 @@ static int device_setup (wan_device_t *wandev, wandev_conf_t *u_conf)
* o call driver's shutdown() entry point
* o call driver's shutdown() entry point
*/
*/
static
int
device_shutdown
(
wan_device_t
*
wandev
)
static
int
device_shutdown
(
struct
wan_device
*
wandev
)
{
{
netdevice_t
*
dev
;
netdevice_t
*
dev
;
int
err
=
0
;
int
err
=
0
;
...
@@ -628,7 +628,7 @@ static int device_shutdown (wan_device_t *wandev)
...
@@ -628,7 +628,7 @@ static int device_shutdown (wan_device_t *wandev)
* Get WAN device status & statistics.
* Get WAN device status & statistics.
*/
*/
static
int
device_stat
(
wan_device_t
*
wandev
,
wandev_stat_t
*
u_stat
)
static
int
device_stat
(
struct
wan_device
*
wandev
,
wandev_stat_t
*
u_stat
)
{
{
wandev_stat_t
stat
;
wandev_stat_t
stat
;
...
@@ -658,7 +658,7 @@ static int device_stat (wan_device_t *wandev, wandev_stat_t *u_stat)
...
@@ -658,7 +658,7 @@ static int device_stat (wan_device_t *wandev, wandev_stat_t *u_stat)
* o register network interface
* o register network interface
*/
*/
static
int
device_new_if
(
wan_device_t
*
wandev
,
wanif_conf_t
*
u_conf
)
static
int
device_new_if
(
struct
wan_device
*
wandev
,
wanif_conf_t
*
u_conf
)
{
{
wanif_conf_t
conf
;
wanif_conf_t
conf
;
netdevice_t
*
dev
=
NULL
;
netdevice_t
*
dev
=
NULL
;
...
@@ -774,7 +774,7 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
...
@@ -774,7 +774,7 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
* o copy configuration data to kernel address space
* o copy configuration data to kernel address space
*/
*/
static
int
device_del_if
(
wan_device_t
*
wandev
,
char
*
u_name
)
static
int
device_del_if
(
struct
wan_device
*
wandev
,
char
*
u_name
)
{
{
char
name
[
WAN_IFNAME_SZ
+
1
];
char
name
[
WAN_IFNAME_SZ
+
1
];
int
err
=
0
;
int
err
=
0
;
...
@@ -815,9 +815,9 @@ static int device_del_if (wan_device_t *wandev, char *u_name)
...
@@ -815,9 +815,9 @@ static int device_del_if (wan_device_t *wandev, char *u_name)
* Return pointer to the WAN device data space or NULL if device not found.
* Return pointer to the WAN device data space or NULL if device not found.
*/
*/
static
wan_device_t
*
find_device
(
char
*
name
)
static
struct
wan_device
*
find_device
(
char
*
name
)
{
{
wan_device_t
*
wandev
;
struct
wan_device
*
wandev
;
for
(
wandev
=
router_devlist
;
wandev
&&
strcmp
(
wandev
->
name
,
name
);
for
(
wandev
=
router_devlist
;
wandev
&&
strcmp
(
wandev
->
name
,
name
);
wandev
=
wandev
->
next
);
wandev
=
wandev
->
next
);
...
@@ -841,7 +841,7 @@ static wan_device_t *find_device(char *name)
...
@@ -841,7 +841,7 @@ static wan_device_t *find_device(char *name)
* sure that opened interfaces are not removed!
* sure that opened interfaces are not removed!
*/
*/
static
int
delete_interface
(
wan_device_t
*
wandev
,
char
*
name
)
static
int
delete_interface
(
struct
wan_device
*
wandev
,
char
*
name
)
{
{
netdevice_t
*
dev
=
NULL
,
*
prev
=
NULL
;
netdevice_t
*
dev
=
NULL
,
*
prev
=
NULL
;
unsigned
long
smp_flags
=
0
;
unsigned
long
smp_flags
=
0
;
...
...
net/wanrouter/wanproc.c
View file @
7a2d9c10
...
@@ -96,7 +96,7 @@ static struct proc_dir_entry *proc_router;
...
@@ -96,7 +96,7 @@ static struct proc_dir_entry *proc_router;
*/
*/
static
void
*
r_start
(
struct
seq_file
*
m
,
loff_t
*
pos
)
static
void
*
r_start
(
struct
seq_file
*
m
,
loff_t
*
pos
)
{
{
wan_device_t
*
wandev
;
struct
wan_device
*
wandev
;
loff_t
l
=
*
pos
;
loff_t
l
=
*
pos
;
lock_kernel
();
lock_kernel
();
...
@@ -108,7 +108,7 @@ static void *r_start(struct seq_file *m, loff_t *pos)
...
@@ -108,7 +108,7 @@ static void *r_start(struct seq_file *m, loff_t *pos)
}
}
static
void
*
r_next
(
struct
seq_file
*
m
,
void
*
v
,
loff_t
*
pos
)
static
void
*
r_next
(
struct
seq_file
*
m
,
void
*
v
,
loff_t
*
pos
)
{
{
wan_device_t
*
wandev
=
v
;
struct
wan_device
*
wandev
=
v
;
(
*
pos
)
++
;
(
*
pos
)
++
;
return
(
v
==
(
void
*
)
1
)
?
router_devlist
:
wandev
->
next
;
return
(
v
==
(
void
*
)
1
)
?
router_devlist
:
wandev
->
next
;
}
}
...
@@ -119,7 +119,7 @@ static void r_stop(struct seq_file *m, void *v)
...
@@ -119,7 +119,7 @@ static void r_stop(struct seq_file *m, void *v)
static
int
config_show
(
struct
seq_file
*
m
,
void
*
v
)
static
int
config_show
(
struct
seq_file
*
m
,
void
*
v
)
{
{
wan_device_t
*
p
=
v
;
struct
wan_device
*
p
=
v
;
if
(
v
==
(
void
*
)
1
)
{
if
(
v
==
(
void
*
)
1
)
{
seq_puts
(
m
,
"Device name | port |IRQ|DMA| mem.addr |"
);
seq_puts
(
m
,
"Device name | port |IRQ|DMA| mem.addr |"
);
seq_puts
(
m
,
"mem.size|option1|option2|option3|option4
\n
"
);
seq_puts
(
m
,
"mem.size|option1|option2|option3|option4
\n
"
);
...
@@ -135,7 +135,7 @@ static int config_show(struct seq_file *m, void *v)
...
@@ -135,7 +135,7 @@ static int config_show(struct seq_file *m, void *v)
static
int
status_show
(
struct
seq_file
*
m
,
void
*
v
)
static
int
status_show
(
struct
seq_file
*
m
,
void
*
v
)
{
{
wan_device_t
*
p
=
v
;
struct
wan_device
*
p
=
v
;
if
(
v
==
(
void
*
)
1
)
{
if
(
v
==
(
void
*
)
1
)
{
seq_puts
(
m
,
"Device name |protocol|station|interface|"
);
seq_puts
(
m
,
"Device name |protocol|station|interface|"
);
seq_puts
(
m
,
"clocking|baud rate| MTU |ndev|link state
\n
"
);
seq_puts
(
m
,
"clocking|baud rate| MTU |ndev|link state
\n
"
);
...
@@ -221,7 +221,7 @@ static struct file_operations status_fops =
...
@@ -221,7 +221,7 @@ static struct file_operations status_fops =
static
int
wandev_show
(
struct
seq_file
*
m
,
void
*
v
)
static
int
wandev_show
(
struct
seq_file
*
m
,
void
*
v
)
{
{
wan_device_t
*
wandev
=
v
;
struct
wan_device
*
wandev
=
v
;
if
(
wandev
->
magic
!=
ROUTER_MAGIC
)
if
(
wandev
->
magic
!=
ROUTER_MAGIC
)
return
0
;
return
0
;
...
@@ -339,7 +339,7 @@ void wanrouter_proc_cleanup (void)
...
@@ -339,7 +339,7 @@ void wanrouter_proc_cleanup (void)
* Add directory entry for WAN device.
* Add directory entry for WAN device.
*/
*/
int
wanrouter_proc_add
(
wan_device_t
*
wandev
)
int
wanrouter_proc_add
(
struct
wan_device
*
wandev
)
{
{
if
(
wandev
->
magic
!=
ROUTER_MAGIC
)
if
(
wandev
->
magic
!=
ROUTER_MAGIC
)
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -356,7 +356,7 @@ int wanrouter_proc_add (wan_device_t* wandev)
...
@@ -356,7 +356,7 @@ int wanrouter_proc_add (wan_device_t* wandev)
* Delete directory entry for WAN device.
* Delete directory entry for WAN device.
*/
*/
int
wanrouter_proc_delete
(
wan_device_t
*
wandev
)
int
wanrouter_proc_delete
(
struct
wan_device
*
wandev
)
{
{
if
(
wandev
->
magic
!=
ROUTER_MAGIC
)
if
(
wandev
->
magic
!=
ROUTER_MAGIC
)
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -379,12 +379,12 @@ void wanrouter_proc_cleanup(void)
...
@@ -379,12 +379,12 @@ void wanrouter_proc_cleanup(void)
{
{
}
}
int
wanrouter_proc_add
(
wan_device_t
*
wandev
)
int
wanrouter_proc_add
(
struct
wan_device
*
wandev
)
{
{
return
0
;
return
0
;
}
}
int
wanrouter_proc_delete
(
wan_device_t
*
wandev
)
int
wanrouter_proc_delete
(
struct
wan_device
*
wandev
)
{
{
return
0
;
return
0
;
}
}
...
...
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