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
5a4a60ae
Commit
5a4a60ae
authored
May 15, 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
d29e0365
41d0ff2e
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
522 additions
and
491 deletions
+522
-491
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
+54
-51
drivers/net/wan/sdla_fr.c
drivers/net/wan/sdla_fr.c
+100
-90
drivers/net/wan/sdla_ft1.c
drivers/net/wan/sdla_ft1.c
+1
-1
drivers/net/wan/sdla_ppp.c
drivers/net/wan/sdla_ppp.c
+50
-47
drivers/net/wan/sdla_x25.c
drivers/net/wan/sdla_x25.c
+113
-95
drivers/net/wan/sdlamain.c
drivers/net/wan/sdlamain.c
+11
-13
drivers/net/wan/wanpipe_multppp.c
drivers/net/wan/wanpipe_multppp.c
+39
-38
include/linux/cyclomx.h
include/linux/cyclomx.h
+1
-1
include/linux/if_wanpipe.h
include/linux/if_wanpipe.h
+1
-5
include/linux/if_wanpipe_common.h
include/linux/if_wanpipe_common.h
+3
-6
include/linux/wanpipe.h
include/linux/wanpipe.h
+13
-15
include/linux/wanrouter.h
include/linux/wanrouter.h
+14
-15
net/wanrouter/af_wanpipe.c
net/wanrouter/af_wanpipe.c
+40
-35
net/wanrouter/wanmain.c
net/wanrouter/wanmain.c
+43
-42
net/wanrouter/wanproc.c
net/wanrouter/wanproc.c
+9
-9
No files found.
drivers/net/wan/cycx_main.c
View file @
5a4a60ae
...
...
@@ -70,9 +70,9 @@ MODULE_PARM_DESC(cycx_debug, "cyclomx debug level");
/* Function Prototypes */
/* WAN link driver entry points */
static
int
setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
conf
);
static
int
shutdown
(
wan_device_t
*
wandev
);
static
int
ioctl
(
wan_device_t
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
conf
);
static
int
shutdown
(
struct
wan_device
*
wandev
);
static
int
ioctl
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
/* Miscellaneous functions */
static
irqreturn_t
cycx_isr
(
int
irq
,
void
*
dev_id
,
struct
pt_regs
*
regs
);
...
...
@@ -122,7 +122,7 @@ int __init cyclomx_init (void)
/* Register adapters with WAN router */
for
(
cnt
=
0
;
cnt
<
ncards
;
++
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
);
wandev
->
magic
=
ROUTER_MAGIC
;
...
...
@@ -181,7 +181,7 @@ static void __exit cyclomx_cleanup (void)
* configuration structure is in kernel memory (including extended data, if
* 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
;
cycx_t
*
card
;
...
...
@@ -273,7 +273,7 @@ out: return err;
* This function is called by the router when device is being unregistered or
* when it handles ROUTER_DOWN IOCTL.
*/
static
int
shutdown
(
wan_device_t
*
wandev
)
static
int
shutdown
(
struct
wan_device
*
wandev
)
{
int
ret
=
-
EFAULT
;
cycx_t
*
card
;
...
...
@@ -305,7 +305,7 @@ out: return ret;
*
* 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
;
}
...
...
drivers/net/wan/cycx_x25.c
View file @
5a4a60ae
...
...
@@ -120,10 +120,10 @@ typedef struct x25_channel {
/* Function Prototypes */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
),
new_if
(
wan_device_t
*
wandev
,
struct
net_device
*
dev
,
static
int
update
(
struct
wan_device
*
wandev
),
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
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 */
static
int
if_init
(
struct
net_device
*
dev
),
...
...
@@ -175,14 +175,15 @@ static u8 log2 (u32 n);
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_dte_addr
(
wan_device_t
*
wandev
,
char
*
dte
);
static
struct
net_device
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
s16
lcn
);
static
struct
net_device
*
get_dev_by_dte_addr
(
struct
wan_device
*
wandev
,
char
*
dte
);
#ifdef CYCLOMX_X25_DEBUG
static
void
hex_dump
(
char
*
msg
,
unsigned
char
*
p
,
int
len
);
static
void
x25_dump_config
(
TX25Config
*
conf
);
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
#define hex_dump(msg, p, len)
#define x25_dump_config(conf)
...
...
@@ -318,7 +319,7 @@ int cyx_init (cycx_t *card, wandev_conf_t *conf)
/* WAN Device Driver Entry Points */
/* Update device status & statistics. */
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
/* sanity checks */
if
(
!
wandev
||
!
wandev
->
private
)
...
...
@@ -342,7 +343,7 @@ static int update (wan_device_t *wandev)
*
* Return: 0 o.k.
* < 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
)
{
cycx_t
*
card
=
wandev
->
private
;
...
...
@@ -431,7 +432,7 @@ static int new_if (wan_device_t *wandev, struct net_device *dev,
}
/* 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
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -461,7 +462,7 @@ static int if_init (struct net_device *dev)
{
x25_channel_t
*
chan
=
dev
->
priv
;
cycx_t
*
card
=
chan
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
dev
->
open
=
if_open
;
...
...
@@ -711,7 +712,7 @@ static void cyx_isr (cycx_t *card)
static
void
tx_intr
(
cycx_t
*
card
,
TX25Cmd
*
cmd
)
{
struct
net_device
*
dev
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
u8
lcn
;
cycx_peek
(
&
card
->
hw
,
cmd
->
buf
,
&
lcn
,
sizeof
(
lcn
));
...
...
@@ -741,7 +742,7 @@ static void tx_intr (cycx_t *card, TX25Cmd *cmd)
* socket buffers available) the whole packet sequence must be discarded. */
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
;
x25_channel_t
*
chan
;
struct
sk_buff
*
skb
;
...
...
@@ -825,7 +826,7 @@ static void rx_intr (cycx_t *card, TX25Cmd *cmd)
/* Connect interrupt handler. */
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
;
x25_channel_t
*
chan
;
u8
d
[
32
],
...
...
@@ -867,7 +868,7 @@ static void connect_intr (cycx_t *card, TX25Cmd *cmd)
/* Connect confirm interrupt handler. */
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
;
x25_channel_t
*
chan
;
u8
lcn
,
key
;
...
...
@@ -894,7 +895,7 @@ static void connect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
/* Disconnect confirm interrupt handler. */
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
;
u8
lcn
;
...
...
@@ -914,7 +915,7 @@ static void disconnect_confirm_intr (cycx_t *card, TX25Cmd *cmd)
/* disconnect interrupt handler. */
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
;
u8
lcn
;
...
...
@@ -1255,7 +1256,7 @@ static int x25_send (cycx_t *card, u8 link, u8 lcn, u8 bitm, int len, void *buf)
/* Miscellaneous */
/* 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
;
x25_channel_t
*
chan
;
...
...
@@ -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. */
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
;
x25_channel_t
*
chan
;
...
...
@@ -1556,7 +1558,7 @@ static void x25_dump_stats(TX25Stats *stats)
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
;
...
...
drivers/net/wan/sdla_chdlc.c
View file @
5a4a60ae
...
...
@@ -186,21 +186,22 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_header
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
static
int
if_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
);
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
);
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
);
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
/* CHDLC Firmware interface functions */
static
int
chdlc_configure
(
sdla_t
*
card
,
void
*
data
);
...
...
@@ -214,7 +215,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb);
static
int
chdlc_disable_comm_shutdown
(
sdla_t
*
card
);
static
void
if_tx_timeout
(
netdevice_t
*
dev
);
static
void
if_tx_timeout
(
struct
net_device
*
dev
);
/* Miscellaneous CHDLC Functions */
static
int
set_chdlc_config
(
sdla_t
*
card
);
...
...
@@ -230,8 +231,8 @@ static void port_set_state (sdla_t *card, int);
static
int
config_chdlc
(
sdla_t
*
card
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
trigger_chdlc_poll
(
netdevice_t
*
);
static
void
chdlc_poll
(
netdevice_t
*
);
static
void
trigger_chdlc_poll
(
struct
net_device
*
dev
);
static
void
chdlc_poll
(
struct
net_device
*
dev
);
static
void
chdlc_poll_delay
(
unsigned
long
dev_ptr
);
...
...
@@ -245,20 +246,20 @@ static void rx_intr (sdla_t* card);
static
void
timer_intr
(
sdla_t
*
);
/* Bottom half handlers */
static
void
chdlc_work
(
netdevice_t
*
);
static
int
chdlc_work_cleanup
(
netdevice_t
*
);
static
int
bh_enqueue
(
netdevice_t
*
,
struct
sk_buff
*
);
static
void
chdlc_work
(
struct
net_device
*
dev
);
static
int
chdlc_work_cleanup
(
struct
net_device
*
dev
);
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
/* Miscellaneous functions */
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
static
int
intr_test
(
sdla_t
*
card
);
static
int
udp_pkt_type
(
struct
sk_buff
*
skb
,
sdla_t
*
card
);
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
sdla_t
*
card
,
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
);
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
static
void
s508_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
...
...
@@ -598,10 +599,10 @@ int wpc_init (sdla_t* card, wandev_conf_t* conf)
* 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
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
volatile
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
;
unsigned
long
timeout
;
...
...
@@ -666,7 +667,8 @@ static int update (wan_device_t* wandev)
* Return: 0 o.k.
* < 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
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
{
sdla_t
*
card
=
wandev
->
private
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
...
@@ -897,11 +899,11 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
* interface registration. Returning anything but zero will fail interface
* registration.
*/
static
int
if_init
(
netdevice_t
*
dev
)
{
static
int
if_init
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
...
...
@@ -960,7 +962,7 @@ static int if_init (netdevice_t* dev)
*
* Return 0 if O.k. or errno.
*/
static
int
if_open
(
netdevice_t
*
dev
)
static
int
if_open
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
...
@@ -1013,7 +1015,7 @@ static int if_open (netdevice_t* dev)
* o if this is the last close, then disable communications and interrupts.
* o reset flags.
*/
static
int
if_close
(
netdevice_t
*
dev
)
static
int
if_close
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
...
@@ -1084,8 +1086,9 @@ static void disable_comm (sdla_t *card)
*
* Return: media header length.
*/
static
int
if_header
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
static
int
if_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
{
skb
->
protocol
=
htons
(
type
);
...
...
@@ -1096,7 +1099,7 @@ static int if_header (struct sk_buff* skb, netdevice_t* dev,
/*============================================================================
* Handle transmit timeout event from netif watchdog
*/
static
void
if_tx_timeout
(
netdevice_t
*
dev
)
static
void
if_tx_timeout
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1144,7 +1147,7 @@ static int if_rebuild_hdr (struct sk_buff *skb)
* 2. Setting tbusy flag will inhibit further transmit requests from the
* protocol stack and can be used for flow control with protocol layer.
*/
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
)
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
...
@@ -1278,7 +1281,7 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
* multicast source IP address.
*/
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
u32
src_ip_addr
;
...
...
@@ -1421,7 +1424,7 @@ unsigned short calc_checksum (char *data, int len)
* Get ethernet-style interface statistics.
* Return a pointer to struct enet_statistics.
*/
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
)
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
)
{
sdla_t
*
my_card
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
...
@@ -1710,7 +1713,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb)
* PREPROCESSOR STATEMENT ABOVE, UNLESS YOU KNOW WHAT YOU ARE
* DOING */
static
void
chdlc_work
(
netdevice_t
*
dev
)
static
void
chdlc_work
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1751,7 +1754,7 @@ static void chdlc_work (netdevice_t * dev)
return
;
}
static
int
chdlc_work_cleanup
(
netdevice_t
*
dev
)
static
int
chdlc_work_cleanup
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chan
=
dev
->
priv
;
...
...
@@ -1769,7 +1772,7 @@ static int chdlc_work_cleanup (netdevice_t *dev)
static
int
bh_enqueue
(
netdevice_t
*
dev
,
struct
sk_buff
*
skb
)
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
/* Check for full */
chdlc_private_area_t
*
chan
=
dev
->
priv
;
...
...
@@ -1804,7 +1807,7 @@ static int bh_enqueue (netdevice_t *dev, struct sk_buff *skb)
*/
static
void
wpc_isr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
int
i
;
sdla_t
*
my_card
;
...
...
@@ -1931,7 +1934,7 @@ static void wpc_isr (sdla_t* card)
*/
static
void
rx_intr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
CHDLC_DATA_RX_STATUS_EL_STRUCT
*
rxbuf
=
card
->
u
.
c
.
rxmb
;
...
...
@@ -2083,7 +2086,7 @@ static void rx_intr (sdla_t* card)
*/
void
timer_intr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
chdlc_private_area_t
*
chdlc_priv_area
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
...
...
@@ -2172,7 +2175,7 @@ static int set_chdlc_config(sdla_t* card)
cfg
.
IP_netmask
=
0
;
}
else
if
(
card
->
wandev
.
dev
){
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
struct
in_device
*
in_dev
=
dev
->
ip_ptr
;
...
...
@@ -2402,7 +2405,7 @@ static int process_chdlc_exception(sdla_t *card)
static
int
configure_ip
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
chdlc_private_area_t
*
chdlc_priv_area
;
char
err
;
...
...
@@ -2449,7 +2452,7 @@ static int configure_ip (sdla_t* card)
static
int
unconfigure_ip
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
chdlc_private_area_t
*
chdlc_priv_area
;
if
(
!
dev
)
...
...
@@ -2477,7 +2480,7 @@ static int unconfigure_ip (sdla_t* card)
static
void
process_route
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
unsigned
char
port_num
;
chdlc_private_area_t
*
chdlc_priv_area
=
NULL
;
u32
local_IP_addr
=
0
;
...
...
@@ -2658,8 +2661,8 @@ static void process_route (sdla_t *card)
*/
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
sdla_t
*
card
,
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
)
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
)
{
int
udp_pkt_stored
=
0
;
...
...
@@ -2686,7 +2689,7 @@ static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
* Process UDP management packet.
*/
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
)
{
unsigned
char
*
buf
;
...
...
@@ -3263,7 +3266,7 @@ static void port_set_state (sdla_t *card, int state)
card
->
wandev
.
state
=
card
->
u
.
c
.
state
=
state
;
if
(
card
->
wandev
.
dev
){
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
chdlc_priv_area
->
common
.
state
=
state
;
}
...
...
@@ -3293,7 +3296,7 @@ static void port_set_state (sdla_t *card, int state)
static
int
config_chdlc
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
...
...
@@ -3417,7 +3420,7 @@ static int config_chdlc (sdla_t *card)
* the chldc_poll routine.
*/
static
void
chdlc_poll
(
netdevice_t
*
dev
)
static
void
chdlc_poll
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
;
sdla_t
*
card
;
...
...
@@ -3567,7 +3570,7 @@ static void chdlc_poll (netdevice_t *dev)
* a polling routine.
*
*/
static
void
trigger_chdlc_poll
(
netdevice_t
*
dev
)
static
void
trigger_chdlc_poll
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
;
sdla_t
*
card
;
...
...
@@ -3592,7 +3595,7 @@ static void trigger_chdlc_poll (netdevice_t *dev)
static
void
chdlc_poll_delay
(
unsigned
long
dev_ptr
)
{
netdevice_t
*
dev
=
(
netdevice_t
*
)
dev_ptr
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_ptr
;
trigger_chdlc_poll
(
dev
);
}
...
...
drivers/net/wan/sdla_fr.c
View file @
5a4a60ae
...
...
@@ -323,27 +323,28 @@ static int Intr_test_counter;
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
);
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
static
void
disable_comm
(
sdla_t
*
card
);
/* WANPIPE-specific entry points */
static
int
wpf_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
static
void
if_tx_timeout
(
netdevice_t
*
dev
);
static
void
if_tx_timeout
(
struct
net_device
*
dev
);
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
);
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
);
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
);
/* Interrupt handlers */
static
void
fr_isr
(
sdla_t
*
card
);
...
...
@@ -382,9 +383,9 @@ static int fr_modem_failure(sdla_t *card, fr_mbox_t *mbox);
static
int
fr_dlci_change
(
sdla_t
*
card
,
fr_mbox_t
*
mbox
);
/* Miscellaneous functions */
static
int
update_chan_state
(
netdevice_t
*
dev
);
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
);
static
netdevice_t
*
find_channel
(
sdla_t
*
card
,
unsigned
dlci
);
static
int
update_chan_state
(
struct
net_device
*
dev
);
static
void
set_chan_state
(
struct
net_device
*
dev
,
int
state
);
static
struct
net_device
*
find_channel
(
sdla_t
*
card
,
unsigned
dlci
);
static
int
is_tx_ready
(
sdla_t
*
card
,
fr_channel_t
*
chan
);
static
unsigned
int
dec_to_uint
(
unsigned
char
*
str
,
int
len
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
...
...
@@ -393,22 +394,23 @@ static int intr_test( sdla_t* card );
static
void
init_chan_statistics
(
fr_channel_t
*
chan
);
static
void
init_global_statistics
(
sdla_t
*
card
);
static
void
read_DLCI_IB_mapping
(
sdla_t
*
card
,
fr_channel_t
*
chan
);
static
int
setup_for_delayed_transmit
(
netdevice_t
*
dev
,
struct
sk_buff
*
skb
);
static
int
setup_for_delayed_transmit
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
netdevice_t
*
move_dev_to_next
(
sdla_t
*
,
netdevice_t
*
);
static
int
check_tx_status
(
sdla_t
*
,
netdevice_t
*
);
struct
net_device
*
move_dev_to_next
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
int
check_tx_status
(
sdla_t
*
card
,
struct
net_device
*
dev
);
/* Frame Relay Socket API */
static
void
trigger_fr_bh
(
fr_channel_t
*
);
static
void
fr_bh
(
netdevice_t
*
);
static
int
fr_bh_cleanup
(
netdevice_t
*
);
static
int
bh_enqueue
(
netdevice_t
*
,
struct
sk_buff
*
);
static
void
fr_bh
(
struct
net_device
*
dev
);
static
int
fr_bh_cleanup
(
struct
net_device
*
dev
);
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
static
void
trigger_fr_poll
(
netdevice_t
*
);
static
void
fr_poll
(
netdevice_t
*
);
//static void add_gateway
(netdevice_t *
);
static
void
trigger_fr_poll
(
struct
net_device
*
dev
);
static
void
fr_poll
(
struct
net_device
*
dev
);
//static void add_gateway
(struct net_device *dev
);
static
void
trigger_unconfig_fr
(
netdevice_t
*
dev
);
static
void
trigger_unconfig_fr
(
struct
net_device
*
dev
);
static
void
unconfig_fr
(
sdla_t
*
);
static
void
trigger_config_fr
(
sdla_t
*
);
...
...
@@ -416,11 +418,11 @@ static void config_fr (sdla_t *);
/* Inverse ARP and Dynamic routing functions */
int
process_ARP
(
arphdr_1490_t
*
ArpPacket
,
sdla_t
*
card
,
netdevice_t
*
dev
);
int
process_ARP
(
arphdr_1490_t
*
ArpPacket
,
sdla_t
*
card
,
struct
net_device
*
dev
);
int
is_arp
(
void
*
buf
);
int
send_inarp_request
(
sdla_t
*
card
,
netdevice_t
*
dev
);
int
send_inarp_request
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
void
trigger_fr_arp
(
netdevice_t
*
);
static
void
trigger_fr_arp
(
struct
net_device
*
dev
);
static
void
fr_arp
(
unsigned
long
data
);
...
...
@@ -442,7 +444,8 @@ void s508_s514_unlock(sdla_t *card, unsigned long *smp_flags);
void
s508_s514_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
unsigned
short
calc_checksum
(
char
*
,
int
);
static
int
setup_fr_header
(
struct
sk_buff
**
skb
,
netdevice_t
*
dev
,
char
op_mode
);
static
int
setup_fr_header
(
struct
sk_buff
**
skb
,
struct
net_device
*
dev
,
char
op_mode
);
/****** Public Functions ****************************************************/
...
...
@@ -746,7 +749,7 @@ int wpf_init(sdla_t *card, wandev_conf_t *conf)
/*============================================================================
* Update device status & statistics.
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
volatile
sdla_t
*
card
;
unsigned
long
timeout
;
...
...
@@ -791,7 +794,8 @@ static int update (wan_device_t* wandev)
* Return: 0 o.k.
* < 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
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
{
sdla_t
*
card
=
wandev
->
private
;
fr_channel_t
*
chan
;
...
...
@@ -1020,7 +1024,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
/*============================================================================
* Delete logical channel.
*/
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
unsigned
long
smp_flags
=
0
;
...
...
@@ -1116,11 +1120,11 @@ static int wpf_exec (struct sdla* card, void* u_cmd, void* u_data)
* interface registration. Returning anything but zero will fail interface
* registration.
*/
static
int
if_init
(
netdevice_t
*
dev
)
static
int
if_init
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
...
...
@@ -1194,7 +1198,7 @@ static int if_init (netdevice_t* dev)
*
* Return 0 if O.k. or errno.
*/
static
int
if_open
(
netdevice_t
*
dev
)
static
int
if_open
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1236,7 +1240,7 @@ static int if_open (netdevice_t* dev)
* o if this is the last open, then disable communications and interrupts.
* o reset flags.
*/
static
int
if_close
(
netdevice_t
*
dev
)
static
int
if_close
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1259,8 +1263,7 @@ static int if_close (netdevice_t* dev)
*/
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
)
{
netdevice_t
*
dev
=
skb
->
dev
;
struct
net_device
*
dev
=
skb
->
dev
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1272,7 +1275,7 @@ static int if_rebuild_hdr (struct sk_buff* skb)
/*============================================================================
* Handle transmit timeout event from netif watchdog
*/
static
void
if_tx_timeout
(
netdevice_t
*
dev
)
static
void
if_tx_timeout
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1315,7 +1318,7 @@ static void if_tx_timeout (netdevice_t *dev)
* will inhibit further transmit requests from the protocol stack
* and can be used for flow control with protocol layer.
*/
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
)
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1562,7 +1565,8 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
* Setup so that a frame can be transmitted on the occurrence of a transmit
* interrupt.
*/
static
int
setup_for_delayed_transmit
(
netdevice_t
*
dev
,
struct
sk_buff
*
skb
)
static
int
setup_for_delayed_transmit
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1614,7 +1618,7 @@ static int setup_for_delayed_transmit (netdevice_t* dev, struct sk_buff *skb)
* Return 0 if not broadcast/multicast address, otherwise return 1.
*/
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
u32
src_ip_addr
;
...
...
@@ -1826,7 +1830,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
* Get ethernet-style interface statistics.
* Return a pointer to struct enet_statistics.
*/
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
)
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -1952,7 +1956,7 @@ static void rx_intr (sdla_t* card)
fr_channel_t
*
chan
;
char
*
ptr
=
&
flags
->
iflag
;
struct
sk_buff
*
skb
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
void
*
buf
;
unsigned
dlci
,
len
,
offs
,
len_incl_hdr
;
int
i
,
udp_type
;
...
...
@@ -2223,7 +2227,7 @@ static void tx_intr(sdla_t *card)
{
fr508_flags_t
*
flags
=
card
->
flags
;
fr_tx_buf_ctl_t
*
bctl
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
if
(
card
->
hw
.
type
==
SDLA_S514
){
...
...
@@ -2352,9 +2356,10 @@ static void timer_intr(sdla_t *card)
/* Update the channel state call. This is call is
* triggered by if_send() function */
if
(
card
->
u
.
f
.
timer_int_enabled
&
TMR_INT_ENABLED_UPDATE_STATE
){
netdevice_t
*
dev
;
struct
net_device
*
dev
;
if
(
card
->
wandev
.
state
==
WAN_CONNECTED
){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
)){
fr_channel_t
*
chan
=
dev
->
priv
;
if
(
chan
->
common
.
state
!=
WAN_CONNECTED
){
update_chan_state
(
dev
);
...
...
@@ -2380,7 +2385,7 @@ static void timer_intr(sdla_t *card)
/* Transmit ARP packets */
if
(
card
->
u
.
f
.
timer_int_enabled
&
TMR_INT_ENABLED_ARP
){
int
i
=
0
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
if
(
card
->
u
.
f
.
arp_dev
==
NULL
)
card
->
u
.
f
.
arp_dev
=
card
->
wandev
.
dev
;
...
...
@@ -2584,7 +2589,7 @@ static int handle_IPXWAN(unsigned char *sendpacket,
* This function is called by fr_poll() polling funtion.
*/
static
void
process_route
(
netdevice_t
*
dev
)
static
void
process_route
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -2985,7 +2990,7 @@ static int fr_issue_isf (sdla_t* card, int isf)
static
unsigned
int
fr_send_hdr
(
sdla_t
*
card
,
int
dlci
,
unsigned
int
offset
)
{
netdevice_t
*
dev
=
find_channel
(
card
,
dlci
);
struct
net_device
*
dev
=
find_channel
(
card
,
dlci
);
fr_channel_t
*
chan
;
if
(
!
dev
||
!
(
chan
=
dev
->
priv
))
...
...
@@ -3088,12 +3093,12 @@ static int fr_event (sdla_t *card, int event, fr_mbox_t* mbox)
case
FRRES_MODEM_FAILURE
:
return
fr_modem_failure
(
card
,
mbox
);
case
FRRES_CHANNEL_DOWN
:
{
netdevice_t
*
dev
;
case
FRRES_CHANNEL_DOWN
:
{
struct
net_device
*
dev
;
/* Remove all routes from associated DLCI's */
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
))
{
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
fr_channel_t
*
chan
=
dev
->
priv
;
if
(
chan
->
route_flag
==
ROUTE_ADDED
)
{
chan
->
route_flag
=
REMOVE_ROUTE
;
...
...
@@ -3114,13 +3119,13 @@ static int fr_event (sdla_t *card, int event, fr_mbox_t* mbox)
return
1
;
}
case
FRRES_CHANNEL_UP
:
{
netdevice_t
*
dev
;
case
FRRES_CHANNEL_UP
:
{
struct
net_device
*
dev
;
/* FIXME: Only startup devices that are on the list */
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
))
{
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
set_chan_state
(
dev
,
WAN_CONNECTED
);
}
...
...
@@ -3194,13 +3199,13 @@ static int fr_dlci_change (sdla_t *card, fr_mbox_t* mbox)
dlci_status_t
*
status
=
(
void
*
)
mbox
->
data
;
int
cnt
=
mbox
->
cmd
.
length
/
sizeof
(
dlci_status_t
);
fr_channel_t
*
chan
;
netdevice_t
*
dev2
;
struct
net_device
*
dev2
;
for
(;
cnt
;
--
cnt
,
++
status
)
{
unsigned
short
dlci
=
status
->
dlci
;
netdevice_t
*
dev
=
find_channel
(
card
,
dlci
);
struct
net_device
*
dev
=
find_channel
(
card
,
dlci
);
if
(
dev
==
NULL
){
printk
(
KERN_INFO
...
...
@@ -3259,7 +3264,8 @@ static int fr_dlci_change (sdla_t *card, fr_mbox_t* mbox)
}
}
for
(
dev2
=
card
->
wandev
.
dev
;
dev2
;
dev2
=
*
((
netdevice_t
**
)
dev2
->
priv
)){
for
(
dev2
=
card
->
wandev
.
dev
;
dev2
;
dev2
=
*
((
struct
net_device
**
)
dev2
->
priv
)){
chan
=
dev2
->
priv
;
...
...
@@ -3315,7 +3321,7 @@ static int fr_init_dlci (sdla_t *card, fr_channel_t *chan)
/*============================================================================
* Update channel state.
*/
static
int
update_chan_state
(
netdevice_t
*
dev
)
static
int
update_chan_state
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -3361,7 +3367,7 @@ static int update_chan_state (netdevice_t* dev)
/*============================================================================
* Set channel state.
*/
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
)
static
void
set_chan_state
(
struct
net_device
*
dev
,
int
state
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -3414,7 +3420,7 @@ static void set_chan_state (netdevice_t* dev, int state)
* NOTE: del_if() functions updates this array, it uses
* the spin locks to avoid corruption.
*/
static
netdevice_t
*
find_channel
(
sdla_t
*
card
,
unsigned
dlci
)
static
struct
net_device
*
find_channel
(
sdla_t
*
card
,
unsigned
dlci
)
{
if
(
dlci
>
HIGHEST_VALID_DLCI
)
return
NULL
;
...
...
@@ -3471,7 +3477,7 @@ static int store_udp_mgmt_pkt(int udp_type, char udp_pkt_src, sdla_t* card,
{
int
udp_pkt_stored
=
0
;
netdevice_t
*
dev
=
find_channel
(
card
,
dlci
);
struct
net_device
*
dev
=
find_channel
(
card
,
dlci
);
fr_channel_t
*
chan
;
if
(
!
dev
||
!
(
chan
=
dev
->
priv
))
...
...
@@ -3517,7 +3523,7 @@ static int process_udp_mgmt_pkt(sdla_t* card)
int
err
;
struct
timeval
tv
;
int
udp_mgmt_req_valid
=
1
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
fr_udp_pkt_t
*
fr_udp_pkt
;
unsigned
short
num_trc_els
;
...
...
@@ -3918,7 +3924,7 @@ static int process_udp_mgmt_pkt(sdla_t* card)
* Send Inverse ARP Request
*/
int
send_inarp_request
(
sdla_t
*
card
,
netdevice_t
*
dev
)
int
send_inarp_request
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
int
err
=
0
;
...
...
@@ -3995,7 +4001,7 @@ int is_arp(void *buf)
* Process ARP Packet Type
*/
int
process_ARP
(
arphdr_1490_t
*
ArpPacket
,
sdla_t
*
card
,
netdevice_t
*
dev
)
int
process_ARP
(
arphdr_1490_t
*
ArpPacket
,
sdla_t
*
card
,
struct
net_device
*
dev
)
{
...
...
@@ -4152,7 +4158,7 @@ int process_ARP(arphdr_1490_t *ArpPacket, sdla_t *card, netdevice_t* dev)
* at a later date.
*/
static
void
trigger_fr_arp
(
netdevice_t
*
dev
)
static
void
trigger_fr_arp
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -4173,7 +4179,7 @@ static void trigger_fr_arp (netdevice_t *dev)
static
void
fr_arp
(
unsigned
long
data
)
{
netdevice_t
*
dev
=
(
netdevice_t
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
fr_channel_t
*
chan
=
dev
->
priv
;
volatile
sdla_t
*
card
=
chan
->
card
;
fr508_flags_t
*
flags
=
card
->
flags
;
...
...
@@ -4365,7 +4371,7 @@ void s508_s514_unlock(sdla_t *card, unsigned long *smp_flags)
*
*/
static
int
bh_enqueue
(
netdevice_t
*
dev
,
struct
sk_buff
*
skb
)
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
/* Check for full */
fr_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -4438,7 +4444,7 @@ static void trigger_fr_bh (fr_channel_t *chan)
*
*/
static
void
fr_bh
(
netdevice_t
*
dev
)
static
void
fr_bh
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -4485,7 +4491,7 @@ static void fr_bh (netdevice_t * dev)
return
;
}
static
int
fr_bh_cleanup
(
netdevice_t
*
dev
)
static
int
fr_bh_cleanup
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -4519,7 +4525,7 @@ static int fr_bh_cleanup (netdevice_t *dev)
* a polling routine.
*
*/
static
void
trigger_fr_poll
(
netdevice_t
*
dev
)
static
void
trigger_fr_poll
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
schedule_task
(
&
chan
->
fr_poll_task
);
...
...
@@ -4549,7 +4555,7 @@ static void trigger_fr_poll (netdevice_t *dev)
* the fr_poll routine.
*/
static
void
fr_poll
(
netdevice_t
*
dev
)
static
void
fr_poll
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
;
...
...
@@ -4636,7 +4642,7 @@ static void fr_poll (netdevice_t *dev)
* an interrupt.
*/
static
int
check_tx_status
(
sdla_t
*
card
,
netdevice_t
*
dev
)
static
int
check_tx_status
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
if
(
card
->
hw
.
type
==
SDLA_S514
){
...
...
@@ -4666,14 +4672,13 @@ static int check_tx_status(sdla_t *card, netdevice_t *dev)
*
*/
netdevice_t
*
move_dev_to_next
(
sdla_t
*
card
,
netdevice_t
*
dev
)
struct
net_device
*
move_dev_to_next
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
if
(
card
->
wandev
.
new_if_cnt
!=
1
){
if
(
*
((
netdevice_t
**
)
dev
->
priv
)
==
NULL
){
if
(
!*
((
struct
net_device
**
)
dev
->
priv
))
return
card
->
wandev
.
dev
;
}
else
{
return
*
((
netdevice_t
**
)
dev
->
priv
);
}
else
return
*
((
struct
net_device
**
)
dev
->
priv
);
}
return
dev
;
}
...
...
@@ -4723,10 +4728,11 @@ static void trigger_config_fr (sdla_t *card)
static
void
config_fr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
if
((
chan
=
dev
->
priv
)
==
NULL
)
continue
;
...
...
@@ -4795,7 +4801,7 @@ static void config_fr (sdla_t *card)
*
*/
static
void
trigger_unconfig_fr
(
netdevice_t
*
dev
)
static
void
trigger_unconfig_fr
(
struct
net_device
*
dev
)
{
fr_channel_t
*
chan
=
dev
->
priv
;
volatile
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -4847,10 +4853,11 @@ static void trigger_unconfig_fr (netdevice_t *dev)
static
void
unconfig_fr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
)){
if
((
chan
=
dev
->
priv
)
==
NULL
)
continue
;
...
...
@@ -4869,7 +4876,8 @@ static void unconfig_fr (sdla_t *card)
}
}
static
int
setup_fr_header
(
struct
sk_buff
**
skb_orig
,
netdevice_t
*
dev
,
char
op_mode
)
static
int
setup_fr_header
(
struct
sk_buff
**
skb_orig
,
struct
net_device
*
dev
,
char
op_mode
)
{
struct
sk_buff
*
skb
=
*
skb_orig
;
fr_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -4927,7 +4935,7 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
fr_conf_t
*
conf
=
NULL
;
unsigned
short
dlci_num
=
chan
->
dlci
;
int
dlci_offset
=
0
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
mbox
->
cmd
.
command
=
FR_READ_CONFIG
;
mbox
->
cmd
.
length
=
0
;
...
...
@@ -4939,9 +4947,9 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
return
0
;
}
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=*
((
struct
net_device
**
)
dev
->
priv
))
set_chan_state
(
dev
,
WAN_DISCONNECTED
);
}
printk
(
KERN_INFO
"DLCI %i Not configured, configuring
\n
"
,
dlci_num
);
...
...
@@ -4969,7 +4977,8 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
conf
=
(
fr_conf_t
*
)
mbox
->
data
;
dlci_offset
=
0
;
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
fr_channel_t
*
chan_tmp
=
dev
->
priv
;
conf
->
dlci
[
dlci_offset
]
=
chan_tmp
->
dlci
;
dlci_offset
++
;
...
...
@@ -5003,7 +5012,8 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
printk
(
KERN_INFO
"Enabling Communications
\n
"
);
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
fr_channel_t
*
chan_tmp
=
dev
->
priv
;
fr_init_dlci
(
card
,
chan_tmp
);
fr_add_dlci
(
card
,
chan_tmp
->
dlci
);
...
...
drivers/net/wan/sdla_ft1.c
View file @
5a4a60ae
...
...
@@ -70,7 +70,7 @@
typedef
struct
chdlc_private_area
{
netdevice_t
*
slave
;
struct
net_device
*
slave
;
sdla_t
*
card
;
int
TracingEnabled
;
/* For enabling Tracing */
unsigned
long
curr_trace_addr
;
/* Used for Tracing */
...
...
drivers/net/wan/sdla_ppp.c
View file @
5a4a60ae
...
...
@@ -168,7 +168,7 @@
typedef
struct
ppp_private_area
{
netdevice_t
*
slave
;
struct
net_device
*
slave
;
sdla_t
*
card
;
unsigned
long
router_start_time
;
/*router start time in sec */
unsigned
long
tick_counter
;
/*used for 5 second counter*/
...
...
@@ -231,25 +231,27 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
wanif_conf_t
*
conf
);
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
/* WANPIPE-specific entry points */
static
int
wpp_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_header
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
,
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
static
int
if_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
);
static
void
if_tx_timeout
(
netdevice_t
*
dev
);
static
void
if_tx_timeout
(
struct
net_device
*
dev
);
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
);
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
/* PPP firmware interface functions */
...
...
@@ -278,10 +280,10 @@ static void retrigger_comm(sdla_t *card);
static
int
read_info
(
sdla_t
*
card
);
static
int
read_connection_info
(
sdla_t
*
card
);
static
void
remove_route
(
sdla_t
*
card
);
static
int
config508
(
netdevice_t
*
dev
,
sdla_t
*
card
);
static
int
config508
(
struct
net_device
*
dev
,
sdla_t
*
card
);
static
void
show_disc_cause
(
sdla_t
*
card
,
unsigned
cause
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
static
void
process_udp_mgmt_pkt
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
void
process_udp_mgmt_pkt
(
sdla_t
*
card
,
struct
net_device
*
dev
,
ppp_private_area_t
*
ppp_priv_area
);
static
void
init_ppp_tx_rx_buff
(
sdla_t
*
card
);
static
int
intr_test
(
sdla_t
*
card
);
...
...
@@ -290,12 +292,12 @@ static void init_ppp_priv_struct( ppp_private_area_t *ppp_priv_area);
static
void
init_global_statistics
(
sdla_t
*
card
);
static
int
tokenize
(
char
*
str
,
char
**
tokens
);
static
char
*
strstrip
(
char
*
str
,
char
*
s
);
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
static
int
config_ppp
(
sdla_t
*
);
static
void
ppp_poll
(
netdevice_t
*
);
static
void
trigger_ppp_poll
(
netdevice_t
*
);
static
void
ppp_poll
(
struct
net_device
*
dev
);
static
void
trigger_ppp_poll
(
struct
net_device
*
dev
);
static
void
ppp_poll_delay
(
unsigned
long
dev_ptr
);
...
...
@@ -315,7 +317,7 @@ static void s508_lock (sdla_t *card, unsigned long *smp_flags);
static
void
s508_unlock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
sdla_t
*
card
,
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
ppp_private_area_t
*
ppp_priv_area
);
static
unsigned
short
calc_checksum
(
char
*
data
,
int
len
);
static
void
disable_comm
(
sdla_t
*
card
);
...
...
@@ -444,10 +446,10 @@ int wpp_init(sdla_t *card, wandev_conf_t *conf)
/*============================================================================
* Update device status & statistics.
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
sdla_t
*
card
=
wandev
->
private
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
volatile
ppp_private_area_t
*
ppp_priv_area
;
ppp_flags_t
*
flags
=
card
->
flags
;
unsigned
long
timeout
;
...
...
@@ -504,7 +506,8 @@ static int update(wan_device_t *wandev)
* Return: 0 o.k.
* < 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
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
{
sdla_t
*
card
=
wandev
->
private
;
ppp_private_area_t
*
ppp_priv_area
;
...
...
@@ -622,7 +625,7 @@ static int new_if(wan_device_t *wandev, netdevice_t *dev, wanif_conf_t *conf)
/*============================================================================
* Delete logical channel.
*/
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
)
{
return
0
;
}
...
...
@@ -681,11 +684,11 @@ static int wpp_exec(struct sdla *card, void *u_cmd, void *u_data)
* interface registration. Returning anything but zero will fail interface
* registration.
*/
static
int
if_init
(
netdevice_t
*
dev
)
static
int
if_init
(
struct
net_device
*
dev
)
{
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
...
...
@@ -730,7 +733,7 @@ static int if_init(netdevice_t *dev)
*
* Return 0 if O.k. or errno.
*/
static
int
if_open
(
netdevice_t
*
dev
)
static
int
if_open
(
struct
net_device
*
dev
)
{
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
...
@@ -769,7 +772,7 @@ static int if_open (netdevice_t *dev)
* o if this is the last open, then disable communications and interrupts.
* o reset flags.
*/
static
int
if_close
(
netdevice_t
*
dev
)
static
int
if_close
(
struct
net_device
*
dev
)
{
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
...
@@ -790,7 +793,7 @@ static int if_close(netdevice_t *dev)
*
* Return: media header length.
*/
static
int
if_header
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
static
int
if_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
{
switch
(
type
)
...
...
@@ -815,7 +818,7 @@ static int if_header(struct sk_buff *skb, netdevice_t *dev,
*/
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
)
{
netdevice_t
*
dev
=
skb
->
dev
;
struct
net_device
*
dev
=
skb
->
dev
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
...
@@ -827,7 +830,7 @@ static int if_rebuild_hdr (struct sk_buff *skb)
/*============================================================================
* Handle transmit timeout event from netif watchdog
*/
static
void
if_tx_timeout
(
netdevice_t
*
dev
)
static
void
if_tx_timeout
(
struct
net_device
*
dev
)
{
ppp_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -865,7 +868,7 @@ static void if_tx_timeout (netdevice_t *dev)
* 2. Setting tbusy flag will inhibit further transmit requests from the
* protocol stack and can be used for flow control with protocol layer.
*/
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
)
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
...
@@ -995,7 +998,7 @@ static int if_send (struct sk_buff *skb, netdevice_t *dev)
*/
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
sdla_t
*
card
,
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
ppp_private_area_t
*
ppp_priv_area
)
{
int
udp_pkt_stored
=
0
;
...
...
@@ -1189,7 +1192,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
* Get ethernet-style interface statistics.
* Return a pointer to struct net_device_stats.
*/
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
)
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
)
{
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
...
...
@@ -1569,7 +1572,7 @@ static void wpp_isr (sdla_t *card)
{
ppp_flags_t
*
flags
=
card
->
flags
;
char
*
ptr
=
&
flags
->
iflag
;
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
int
i
;
card
->
in_isr
=
1
;
...
...
@@ -1649,7 +1652,7 @@ static void wpp_isr (sdla_t *card)
static
void
rx_intr
(
sdla_t
*
card
)
{
ppp_buf_ctl_t
*
rxbuf
=
card
->
rxmb
;
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
ppp_private_area_t
*
ppp_priv_area
;
struct
sk_buff
*
skb
;
unsigned
len
;
...
...
@@ -1789,7 +1792,7 @@ static void rx_intr(sdla_t *card)
void
event_intr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
volatile
ppp_flags_t
*
flags
=
card
->
flags
;
...
...
@@ -1908,7 +1911,7 @@ void event_intr (sdla_t *card)
void
timer_intr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
ppp_flags_t
*
flags
=
card
->
flags
;
...
...
@@ -2105,7 +2108,7 @@ static int handle_IPXWAN(unsigned char *sendpacket, char *devname, unsigned char
static
void
process_route
(
sdla_t
*
card
)
{
ppp_flags_t
*
flags
=
card
->
flags
;
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
if
((
card
->
u
.
p
.
ip_mode
==
WANOPT_PPP_PEER
)
&&
...
...
@@ -2147,7 +2150,7 @@ static void process_route (sdla_t *card)
*/
static
void
retrigger_comm
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
if
(
dev
&&
((
jiffies
-
card
->
state_tick
)
>
HOLD_DOWN_TIME
))
{
...
...
@@ -2164,7 +2167,7 @@ static void retrigger_comm(sdla_t *card)
/*============================================================================
* Configure S508 adapter.
*/
static
int
config508
(
netdevice_t
*
dev
,
sdla_t
*
card
)
static
int
config508
(
struct
net_device
*
dev
,
sdla_t
*
card
)
{
ppp508_conf_t
cfg
;
struct
in_device
*
in_dev
=
dev
->
ip_ptr
;
...
...
@@ -2336,7 +2339,7 @@ static void show_disc_cause(sdla_t *card, unsigned cause)
/*=============================================================================
* Process UDP call of type PTPIPEAB.
*/
static
void
process_udp_mgmt_pkt
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
void
process_udp_mgmt_pkt
(
sdla_t
*
card
,
struct
net_device
*
dev
,
ppp_private_area_t
*
ppp_priv_area
)
{
unsigned
char
buf2
[
5
];
...
...
@@ -2847,7 +2850,7 @@ static void init_ppp_tx_rx_buff( sdla_t *card )
*/
static
int
read_info
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
int
err
;
...
...
@@ -2896,7 +2899,7 @@ static int read_info( sdla_t *card )
static
void
remove_route
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
long
ip_addr
;
int
err
;
...
...
@@ -3022,7 +3025,7 @@ static int udp_pkt_type( struct sk_buff *skb, sdla_t *card )
* multicast source IP address.
*/
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
chk_bcast_mcast_addr
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
u32
src_ip_addr
;
...
...
@@ -3073,7 +3076,7 @@ void s508_unlock (sdla_t *card, unsigned long *smp_flags)
static
int
read_connection_info
(
sdla_t
*
card
)
{
ppp_mbox_t
*
mb
=
card
->
mbox
;
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
ppp508_connect_info_t
*
ppp508_connect_info
;
int
err
;
...
...
@@ -3122,7 +3125,7 @@ static int read_connection_info (sdla_t *card)
static
int
config_ppp
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
ppp_flags_t
*
flags
=
card
->
flags
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
...
...
@@ -3230,7 +3233,7 @@ static int config_ppp (sdla_t *card)
* trigger_ppp_poll() function is used to kick
* the ppp_poll routine.
*/
static
void
ppp_poll
(
netdevice_t
*
dev
)
static
void
ppp_poll
(
struct
net_device
*
dev
)
{
ppp_private_area_t
*
ppp_priv_area
;
sdla_t
*
card
;
...
...
@@ -3375,7 +3378,7 @@ static void ppp_poll (netdevice_t *dev)
*
*/
static
void
trigger_ppp_poll
(
netdevice_t
*
dev
)
static
void
trigger_ppp_poll
(
struct
net_device
*
dev
)
{
ppp_private_area_t
*
ppp_priv_area
;
if
((
ppp_priv_area
=
dev
->
priv
)
!=
NULL
){
...
...
@@ -3397,7 +3400,7 @@ static void trigger_ppp_poll (netdevice_t *dev)
static
void
ppp_poll_delay
(
unsigned
long
dev_ptr
)
{
netdevice_t
*
dev
=
(
netdevice_t
*
)
dev_ptr
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
dev_ptr
;
trigger_ppp_poll
(
dev
);
}
...
...
drivers/net/wan/sdla_x25.c
View file @
5a4a60ae
...
...
@@ -241,7 +241,7 @@ static void dbg_kfree(void * v, int line) {
*
* Assumptions:
*
* Description: This is an extention of the
'netdevice_t'
* Description: This is an extention of the
struct net_device
* we create for each network interface to keep
* the rest of X.25 channel-specific data.
*
...
...
@@ -271,7 +271,7 @@ typedef struct x25_channel
atomic_t
bh_buff_used
;
sdla_t
*
card
;
/* -> owner */
netdevice_t
*
dev
;
/* -> bound devce */
struct
net_device
*
dev
;
/* -> bound devce */
int
ch_idx
;
unsigned
char
enable_IPX
;
...
...
@@ -330,10 +330,10 @@ typedef struct x25_call_info
* WAN link driver entry points. These are
* called by the WAN router module.
*/
static
int
update
(
wan_device_t
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
disable_comm_shutdown
(
sdla_t
*
card
);
...
...
@@ -343,24 +343,24 @@ static void disable_comm_shutdown(sdla_t *card);
* WANPIPE-specific entry points
*/
static
int
wpx_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
static
void
x25api_bh
(
netdevice_t
*
);
static
int
x25api_bh_cleanup
(
netdevice_t
*
);
static
int
bh_enqueue
(
netdevice_t
*
,
struct
sk_buff
*
);
static
void
x25api_bh
(
struct
net_device
*
dev
);
static
int
x25api_bh_cleanup
(
struct
net_device
*
dev
);
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
/*=================================================
* Network device interface
*/
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_header
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
static
int
if_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
);
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
);
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
);
static
void
if_tx_timeout
(
netdevice_t
*
dev
);
static
void
if_tx_timeout
(
struct
net_device
*
dev
);
/*=================================================
* Interrupt handlers
...
...
@@ -373,8 +373,9 @@ static void event_intr (sdla_t *);
static
void
spur_intr
(
sdla_t
*
);
static
void
timer_intr
(
sdla_t
*
);
static
int
tx_intr_send
(
sdla_t
*
,
netdevice_t
*
);
static
netdevice_t
*
move_dev_to_next
(
sdla_t
*
,
netdevice_t
*
);
static
int
tx_intr_send
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
struct
net_device
*
move_dev_to_next
(
sdla_t
*
card
,
struct
net_device
*
dev
);
/*=================================================
* Background polling routines
...
...
@@ -425,35 +426,41 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb);
*/
static
int
connect
(
sdla_t
*
card
);
static
int
disconnect
(
sdla_t
*
card
);
static
netdevice_t
*
get_dev_by_lcn
(
wan_device_t
*
wandev
,
unsigned
lcn
);
static
int
chan_connect
(
netdevice_t
*
dev
);
static
int
chan_disc
(
netdevice_t
*
dev
);
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
);
static
int
chan_send
(
netdevice_t
*
,
void
*
,
unsigned
,
unsigned
char
);
static
struct
net_device
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
unsigned
lcn
);
static
int
chan_connect
(
struct
net_device
*
dev
);
static
int
chan_disc
(
struct
net_device
*
dev
);
static
void
set_chan_state
(
struct
net_device
*
dev
,
int
state
);
static
int
chan_send
(
struct
net_device
*
dev
,
void
*
buff
,
unsigned
data_len
,
unsigned
char
tx_intr
);
static
unsigned
char
bps_to_speed_code
(
unsigned
long
bps
);
static
unsigned
int
dec_to_uint
(
unsigned
char
*
str
,
int
len
);
static
unsigned
int
hex_to_uint
(
unsigned
char
*
,
int
);
static
void
parse_call_info
(
unsigned
char
*
,
x25_call_info_t
*
);
static
netdevice_t
*
find_channel
(
sdla_t
*
,
unsigned
);
static
void
bind_lcn_to_dev
(
sdla_t
*
,
netdevice_t
*
,
unsigned
);
static
void
setup_for_delayed_transmit
(
netdevice_t
*
,
void
*
,
unsigned
);
static
struct
net_device
*
find_channel
(
sdla_t
*
card
,
unsigned
lcn
);
static
void
bind_lcn_to_dev
(
sdla_t
*
card
,
struct
net_device
*
dev
,
unsigned
lcn
);
static
void
setup_for_delayed_transmit
(
struct
net_device
*
dev
,
void
*
buf
,
unsigned
len
);
/*=================================================
* X25 API Functions
*/
static
int
wanpipe_pull_data_in_skb
(
sdla_t
*
,
netdevice_t
*
,
struct
sk_buff
**
);
static
int
wanpipe_pull_data_in_skb
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
**
);
static
void
timer_intr_exec
(
sdla_t
*
,
unsigned
char
);
static
int
execute_delayed_cmd
(
sdla_t
*
,
netdevice_t
*
,
mbox_cmd_t
*
,
char
);
static
int
execute_delayed_cmd
(
sdla_t
*
card
,
struct
net_device
*
dev
,
mbox_cmd_t
*
usr_cmd
,
char
bad_cmd
);
static
int
api_incoming_call
(
sdla_t
*
,
TX25Mbox
*
,
int
);
static
int
alloc_and_init_skb_buf
(
sdla_t
*
,
struct
sk_buff
**
,
int
);
static
void
send_delayed_cmd_result
(
sdla_t
*
,
netdevice_t
*
dev
,
TX25Mbox
*
);
static
void
send_delayed_cmd_result
(
sdla_t
*
card
,
struct
net_device
*
dev
,
TX25Mbox
*
mbox
);
static
int
clear_confirm_event
(
sdla_t
*
,
TX25Mbox
*
);
static
void
send_oob_msg
(
sdla_t
*
,
netdevice_t
*
,
TX25Mbox
*
);
static
void
send_oob_msg
(
sdla_t
*
card
,
struct
net_device
*
dev
,
TX25Mbox
*
mbox
);
static
int
timer_intr_cmd_exec
(
sdla_t
*
card
);
static
void
api_oob_event
(
sdla_t
*
card
,
TX25Mbox
*
mbox
);
static
int
check_bad_command
(
sdla_t
*
,
netdevice_t
*
);
static
int
channel_disconnect
(
sdla_t
*
,
netdevice_t
*
);
static
int
check_bad_command
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
int
channel_disconnect
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
void
hdlc_link_down
(
sdla_t
*
);
/*=================================================
...
...
@@ -464,7 +471,9 @@ static int udp_pkt_type( struct sk_buff *, sdla_t*);
static
int
reply_udp
(
unsigned
char
*
,
unsigned
int
);
static
void
init_x25_channel_struct
(
x25_channel_t
*
);
static
void
init_global_statistics
(
sdla_t
*
);
static
int
store_udp_mgmt_pkt
(
int
,
char
,
sdla_t
*
,
netdevice_t
*
,
struct
sk_buff
*
,
int
);
static
int
store_udp_mgmt_pkt
(
int
udp_type
,
char
udp_pkt_src
,
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
*
skb
,
int
lcn
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
...
...
@@ -830,7 +839,7 @@ int wpx_init (sdla_t* card, wandev_conf_t* conf)
* <0 Failed (or busy).
*/
static
int
update
(
wan_device_t
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
volatile
sdla_t
*
card
;
TX25Status
*
status
;
...
...
@@ -895,7 +904,8 @@ static int update (wan_device_t* wandev)
* Return: 0 Ok
* <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
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
{
sdla_t
*
card
=
wandev
->
private
;
x25_channel_t
*
chan
;
...
...
@@ -1029,7 +1039,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* dev, wanif_conf_t* conf)
//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
,
struct
net_device
*
dev
)
{
return
0
;
}
...
...
@@ -1095,11 +1105,11 @@ static void disable_comm(sdla_t* card)
*
* Return: 0 Ok : Void function.
*/
static
int
if_init
(
netdevice_t
*
dev
)
static
int
if_init
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
/* Initialize device driver entry points */
dev
->
open
=
&
if_open
;
...
...
@@ -1167,7 +1177,7 @@ static int if_init (netdevice_t* dev)
* <0 Failur: Interface will not come up.
*/
static
int
if_open
(
netdevice_t
*
dev
)
static
int
if_open
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1260,7 +1270,7 @@ static int if_open (netdevice_t* dev)
* Return: 0 Ok
* <0 Failure: Interface will not exit properly.
*/
static
int
if_close
(
netdevice_t
*
dev
)
static
int
if_close
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1318,8 +1328,9 @@ static int if_close (netdevice_t* dev)
* Return: media header length.
*======================================================================*/
static
int
if_header
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
static
int
if_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
int
hdr_len
=
dev
->
hard_header_len
;
...
...
@@ -1344,7 +1355,7 @@ static int if_header (struct sk_buff* skb, netdevice_t* dev,
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
)
{
netdevice_t
*
dev
=
skb
->
dev
;
struct
net_device
*
dev
=
skb
->
dev
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1357,7 +1368,7 @@ static int if_rebuild_hdr (struct sk_buff* skb)
/*============================================================================
* Handle transmit timeout event from netif watchdog
*/
static
void
if_tx_timeout
(
netdevice_t
*
dev
)
static
void
if_tx_timeout
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1394,7 +1405,7 @@ static void if_tx_timeout (netdevice_t *dev)
*
*========================================================================*/
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
)
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -1527,7 +1538,7 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
* interrupt.
*===========================================================================*/
static
void
setup_for_delayed_transmit
(
netdevice_t
*
dev
,
void
*
buf
,
static
void
setup_for_delayed_transmit
(
struct
net_device
*
dev
,
void
*
buf
,
unsigned
len
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -1579,7 +1590,7 @@ static void setup_for_delayed_transmit (netdevice_t* dev, void* buf,
* Return a pointer to struct enet_statistics.
*
*==============================================================*/
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
)
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -1675,7 +1686,7 @@ static void rx_intr (sdla_t* card)
{
TX25Mbox
*
rxmb
=
card
->
rxmb
;
unsigned
lcn
=
rxmb
->
cmd
.
lcn
;
netdevice_t
*
dev
=
find_channel
(
card
,
lcn
);
struct
net_device
*
dev
=
find_channel
(
card
,
lcn
);
x25_channel_t
*
chan
;
struct
sk_buff
*
skb
=
NULL
;
...
...
@@ -1773,7 +1784,8 @@ static void rx_intr (sdla_t* card)
}
static
int
wanpipe_pull_data_in_skb
(
sdla_t
*
card
,
netdevice_t
*
dev
,
struct
sk_buff
**
skb
)
static
int
wanpipe_pull_data_in_skb
(
sdla_t
*
card
,
struct
net_device
*
dev
,
struct
sk_buff
**
skb
)
{
void
*
bufptr
;
TX25Mbox
*
rxmb
=
card
->
rxmb
;
...
...
@@ -1883,7 +1895,7 @@ static int wanpipe_pull_data_in_skb (sdla_t *card, netdevice_t *dev, struct sk_b
static
void
tx_intr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
TX25Status
*
status
=
card
->
flags
;
unsigned
char
more_to_tx
=
0
;
x25_channel_t
*
chan
=
NULL
;
...
...
@@ -1977,14 +1989,13 @@ static void tx_intr (sdla_t* card)
*===============================================================*/
netdevice_t
*
move_dev_to_next
(
sdla_t
*
card
,
netdevice_t
*
dev
)
struct
net_device
*
move_dev_to_next
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
if
(
card
->
u
.
x
.
no_dev
!=
1
){
if
(
*
((
netdevice_t
**
)
dev
->
priv
)
==
NULL
){
if
(
!*
((
struct
net_device
**
)
dev
->
priv
))
return
card
->
wandev
.
dev
;
}
else
{
return
*
((
netdevice_t
**
)
dev
->
priv
);
}
else
return
*
((
struct
net_device
**
)
dev
->
priv
);
}
return
dev
;
}
...
...
@@ -1995,7 +2006,7 @@ netdevice_t * move_dev_to_next (sdla_t *card, netdevice_t *dev)
*
*===============================================================*/
static
int
tx_intr_send
(
sdla_t
*
card
,
netdevice_t
*
dev
)
static
int
tx_intr_send
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -2058,7 +2069,7 @@ static void timer_intr (sdla_t *card)
}
else
if
(
card
->
u
.
x
.
timer_int_enabled
&
TMR_INT_ENABLED_POLL_ACTIVE
)
{
netdevice_t
*
dev
=
card
->
u
.
x
.
poll_device
;
struct
net_device
*
dev
=
card
->
u
.
x
.
poll_device
;
x25_channel_t
*
chan
=
NULL
;
if
(
!
dev
){
...
...
@@ -2079,7 +2090,7 @@ static void timer_intr (sdla_t *card)
wanpipe_set_state
(
card
,
WAN_CONNECTED
);
if
(
card
->
u
.
x
.
LAPB_hdlc
){
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
set_chan_state
(
dev
,
WAN_CONNECTED
);
send_delayed_cmd_result
(
card
,
dev
,
card
->
mbox
);
}
...
...
@@ -2135,7 +2146,7 @@ static void status_intr (sdla_t* card)
TX25Mbox
*
mbox
=
card
->
mbox
;
TX25ModemStatus
*
modem_status
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
int
err
;
...
...
@@ -2164,7 +2175,8 @@ static void status_intr (sdla_t* card)
mbox
->
cmd
.
result
=
0x08
;
/* Send a OOB to all connected sockets */
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
chan
=
dev
->
priv
;
if
(
chan
->
common
.
usedby
==
API
){
send_oob_msg
(
card
,
dev
,
mbox
);
...
...
@@ -2294,7 +2306,7 @@ static void poll_connecting (sdla_t* card)
static
void
poll_disconnected
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
TX25Status
*
status
=
card
->
flags
;
...
...
@@ -2331,10 +2343,11 @@ static void poll_disconnected (sdla_t* card)
static
void
poll_active
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
TX25Status
*
status
=
card
->
flags
;
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
)){
x25_channel_t
*
chan
=
dev
->
priv
;
/* If SVC has been idle long enough, close virtual circuit */
...
...
@@ -3101,9 +3114,9 @@ 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
)
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
int
new_lcn
=
mb
->
cmd
.
lcn
;
netdevice_t
*
dev
=
get_dev_by_lcn
(
wandev
,
new_lcn
);
struct
net_device
*
dev
=
get_dev_by_lcn
(
wandev
,
new_lcn
);
x25_channel_t
*
chan
=
NULL
;
int
accept
=
0
;
/* set to '1' if o.k. to accept call */
unsigned
int
user_data
;
...
...
@@ -3155,7 +3168,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
user_data
=
hex_to_uint
(
info
->
user
,
2
);
/* Find available channel */
for
(
dev
=
wandev
->
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
))
{
for
(
dev
=
wandev
->
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
chan
=
dev
->
priv
;
if
(
chan
->
common
.
usedby
==
API
)
...
...
@@ -3252,7 +3265,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
static
int
call_accepted
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
{
unsigned
new_lcn
=
mb
->
cmd
.
lcn
;
netdevice_t
*
dev
=
find_channel
(
card
,
new_lcn
);
struct
net_device
*
dev
=
find_channel
(
card
,
new_lcn
);
x25_channel_t
*
chan
;
if
(
dev
==
NULL
){
...
...
@@ -3292,7 +3305,7 @@ static int call_accepted (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
static
int
call_cleared
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
{
unsigned
new_lcn
=
mb
->
cmd
.
lcn
;
netdevice_t
*
dev
=
find_channel
(
card
,
new_lcn
);
struct
net_device
*
dev
=
find_channel
(
card
,
new_lcn
);
x25_channel_t
*
chan
;
unsigned
char
old_state
;
...
...
@@ -3336,8 +3349,8 @@ 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
)
{
wan_device_t
*
wandev
=
&
card
->
wandev
;
netdevice_t
*
dev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
unsigned
char
old_state
;
...
...
@@ -3346,7 +3359,7 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
card
->
devname
,
mb
->
cmd
.
cause
,
mb
->
cmd
.
diagn
);
/* down all logical channels */
for
(
dev
=
wandev
->
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
))
{
for
(
dev
=
wandev
->
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
chan
=
dev
->
priv
;
old_state
=
chan
->
common
.
state
;
...
...
@@ -3377,7 +3390,7 @@ static int timeout_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
if
(
mb
->
cmd
.
pktType
==
0x05
)
/* call request time out */
{
netdevice_t
*
dev
=
find_channel
(
card
,
new_lcn
);
struct
net_device
*
dev
=
find_channel
(
card
,
new_lcn
);
printk
(
KERN_INFO
"%s: X.25 call timed timeout on LCN %d!
\n
"
,
card
->
devname
,
new_lcn
);
...
...
@@ -3447,11 +3460,12 @@ static int disconnect (sdla_t* card)
* Find network device by its channel number.
*/
static
netdevice_t
*
get_dev_by_lcn
(
wan_device_t
*
wandev
,
unsigned
lcn
)
static
struct
net_device
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
unsigned
lcn
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
for
(
dev
=
wandev
->
dev
;
dev
;
dev
=
*
((
netdevice_t
**
)
dev
->
priv
))
for
(
dev
=
wandev
->
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
if
(((
x25_channel_t
*
)
dev
->
priv
)
->
common
.
lcn
==
lcn
)
break
;
return
dev
;
...
...
@@ -3467,7 +3481,7 @@ static netdevice_t* get_dev_by_lcn (wan_device_t* wandev, unsigned lcn)
* <0 failure
*/
static
int
chan_connect
(
netdevice_t
*
dev
)
static
int
chan_connect
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -3500,7 +3514,7 @@ static int chan_connect (netdevice_t* dev)
* o if SVC then clear X.25 call
*/
static
int
chan_disc
(
netdevice_t
*
dev
)
static
int
chan_disc
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -3523,7 +3537,7 @@ static int chan_disc (netdevice_t* dev)
* Set logical channel state.
*/
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
)
static
void
set_chan_state
(
struct
net_device
*
dev
,
int
state
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -3613,7 +3627,8 @@ static void set_chan_state (netdevice_t* dev, int state)
* to the router.
*/
static
int
chan_send
(
netdevice_t
*
dev
,
void
*
buff
,
unsigned
data_len
,
unsigned
char
tx_intr
)
static
int
chan_send
(
struct
net_device
*
dev
,
void
*
buff
,
unsigned
data_len
,
unsigned
char
tx_intr
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -4080,7 +4095,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
*===============================================================*/
netdevice_t
*
find_channel
(
sdla_t
*
card
,
unsigned
lcn
)
struct
net_device
*
find_channel
(
sdla_t
*
card
,
unsigned
lcn
)
{
if
(
card
->
u
.
x
.
LAPB_hdlc
){
...
...
@@ -4127,7 +4142,7 @@ netdevice_t * find_channel(sdla_t *card, unsigned lcn)
}
}
void
bind_lcn_to_dev
(
sdla_t
*
card
,
netdevice_t
*
dev
,
unsigned
lcn
)
void
bind_lcn_to_dev
(
sdla_t
*
card
,
struct
net_device
*
dev
,
unsigned
lcn
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
...
...
@@ -4154,7 +4169,7 @@ void bind_lcn_to_dev (sdla_t *card, netdevice_t *dev,unsigned lcn)
*
*==============================================================*/
static
void
x25api_bh
(
netdevice_t
*
dev
)
static
void
x25api_bh
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -4230,7 +4245,7 @@ static void x25api_bh (netdevice_t * dev)
*
*==============================================================*/
static
int
x25api_bh_cleanup
(
netdevice_t
*
dev
)
static
int
x25api_bh_cleanup
(
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -4269,7 +4284,7 @@ static int x25api_bh_cleanup (netdevice_t *dev)
*
*==============================================================*/
static
int
bh_enqueue
(
netdevice_t
*
dev
,
struct
sk_buff
*
skb
)
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -4309,7 +4324,7 @@ static int bh_enqueue (netdevice_t *dev, struct sk_buff *skb)
static
int
timer_intr_cmd_exec
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
unsigned
char
more_to_exec
=
0
;
volatile
x25_channel_t
*
chan
=
NULL
;
int
i
=
0
,
bad_cmd
=
0
,
err
=
0
;
...
...
@@ -4436,7 +4451,8 @@ static int timer_intr_cmd_exec (sdla_t* card)
*
*===============================================================*/
static
int
execute_delayed_cmd
(
sdla_t
*
card
,
netdevice_t
*
dev
,
mbox_cmd_t
*
usr_cmd
,
char
bad_cmd
)
static
int
execute_delayed_cmd
(
sdla_t
*
card
,
struct
net_device
*
dev
,
mbox_cmd_t
*
usr_cmd
,
char
bad_cmd
)
{
TX25Mbox
*
mbox
=
card
->
mbox
;
int
err
;
...
...
@@ -4669,7 +4685,8 @@ static int api_incoming_call (sdla_t* card, TX25Mbox *mbox, int lcn)
* the result to a waiting sock.
*
*===============================================================*/
static
void
send_delayed_cmd_result
(
sdla_t
*
card
,
netdevice_t
*
dev
,
TX25Mbox
*
mbox
)
static
void
send_delayed_cmd_result
(
sdla_t
*
card
,
struct
net_device
*
dev
,
TX25Mbox
*
mbox
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
mbox_cmd_t
*
usr_cmd
=
(
mbox_cmd_t
*
)
chan
->
common
.
mbox
;
...
...
@@ -4724,7 +4741,7 @@ static void send_delayed_cmd_result(sdla_t *card, netdevice_t *dev, TX25Mbox* mb
static
int
clear_confirm_event
(
sdla_t
*
card
,
TX25Mbox
*
mb
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
unsigned
char
old_state
;
...
...
@@ -4772,7 +4789,7 @@ static int clear_confirm_event (sdla_t *card, TX25Mbox* mb)
*
*===============================================================*/
static
void
send_oob_msg
(
sdla_t
*
card
,
netdevice_t
*
dev
,
TX25Mbox
*
mbox
)
static
void
send_oob_msg
(
sdla_t
*
card
,
struct
net_device
*
dev
,
TX25Mbox
*
mbox
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
mbox_cmd_t
*
usr_cmd
=
(
mbox_cmd_t
*
)
chan
->
common
.
mbox
;
...
...
@@ -4870,7 +4887,7 @@ static int alloc_and_init_skb_buf (sdla_t *card, struct sk_buff **skb, int len)
static
void
api_oob_event
(
sdla_t
*
card
,
TX25Mbox
*
mbox
)
{
netdevice_t
*
dev
=
find_channel
(
card
,
mbox
->
cmd
.
lcn
);
struct
net_device
*
dev
=
find_channel
(
card
,
mbox
->
cmd
.
lcn
);
x25_channel_t
*
chan
;
if
(
!
dev
)
...
...
@@ -4886,7 +4903,7 @@ static void api_oob_event (sdla_t *card,TX25Mbox *mbox)
static
int
channel_disconnect
(
sdla_t
*
card
,
netdevice_t
*
dev
)
static
int
channel_disconnect
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
int
err
;
...
...
@@ -4960,7 +4977,7 @@ static void hdlc_link_down (sdla_t *card)
}
static
int
check_bad_command
(
sdla_t
*
card
,
netdevice_t
*
dev
)
static
int
check_bad_command
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
x25_channel_t
*
chan
=
dev
->
priv
;
int
bad_cmd
=
0
;
...
...
@@ -5013,7 +5030,7 @@ static int process_udp_mgmt_pkt(sdla_t *card)
TX25Mbox
*
mbox
=
card
->
mbox
;
int
err
;
int
udp_mgmt_req_valid
=
1
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
unsigned
short
lcn
;
struct
timeval
tv
;
...
...
@@ -5337,7 +5354,8 @@ unsigned short calc_checksum (char *data, int len)
*/
static
int
store_udp_mgmt_pkt
(
int
udp_type
,
char
udp_pkt_src
,
sdla_t
*
card
,
netdevice_t
*
dev
,
struct
sk_buff
*
skb
,
int
lcn
)
struct
net_device
*
dev
,
struct
sk_buff
*
skb
,
int
lcn
)
{
int
udp_pkt_stored
=
0
;
...
...
drivers/net/wan/sdlamain.c
View file @
5a4a60ae
...
...
@@ -64,8 +64,6 @@
#include <linux/sdlapci.h>
#include <linux/if_wanpipe_common.h>
#define netdevice_t struct net_device
#include <asm/uaccess.h>
/* kernel <-> user copy */
#include <linux/inetdevice.h>
...
...
@@ -184,9 +182,9 @@ int init_module (void);
void
cleanup_module
(
void
);
/* WAN link driver entry points */
static
int
setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
conf
);
static
int
shutdown
(
wan_device_t
*
wandev
);
static
int
ioctl
(
wan_device_t
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
static
int
setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
conf
);
static
int
shutdown
(
struct
wan_device
*
wandev
);
static
int
ioctl
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
/* IOCTL handlers */
static
int
ioctl_dump
(
sdla_t
*
card
,
sdla_dump_t
*
u_dump
);
...
...
@@ -279,7 +277,7 @@ int wanpipe_init(void)
/* Register adapters with WAN router */
for
(
cnt
=
0
;
cnt
<
ncards
;
++
cnt
)
{
sdla_t
*
card
=
&
card_array
[
cnt
];
wan_device_t
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
card
->
next
=
NULL
;
sprintf
(
card
->
devname
,
"%s%d"
,
drvname
,
cnt
+
1
);
...
...
@@ -352,7 +350,7 @@ void cleanup_module (void)
* 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
;
int
err
=
0
;
...
...
@@ -779,7 +777,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
* when it handles ROUTER_DOWN IOCTL.
*/
static
int
shutdown
(
wan_device_t
*
wandev
)
static
int
shutdown
(
struct
wan_device
*
wandev
)
{
sdla_t
*
card
;
int
err
=
0
;
...
...
@@ -888,7 +886,7 @@ static void release_hw (sdla_t *card)
* This function is called when router handles one of the reserved user
* 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
;
int
err
;
...
...
@@ -1255,7 +1253,7 @@ void wanpipe_mark_bh (void)
}
}
void
wakeup_sk_bh
(
netdevice_t
*
dev
)
void
wakeup_sk_bh
(
struct
net_device
*
dev
)
{
wanpipe_common_t
*
chan
=
dev
->
priv
;
...
...
@@ -1268,7 +1266,7 @@ void wakeup_sk_bh (netdevice_t *dev)
}
}
int
change_dev_flags
(
netdevice_t
*
dev
,
unsigned
flags
)
int
change_dev_flags
(
struct
net_device
*
dev
,
unsigned
flags
)
{
struct
ifreq
if_info
;
mm_segment_t
fs
=
get_fs
();
...
...
@@ -1285,7 +1283,7 @@ int change_dev_flags (netdevice_t *dev, unsigned flags)
return
err
;
}
unsigned
long
get_ip_address
(
netdevice_t
*
dev
,
int
option
)
unsigned
long
get_ip_address
(
struct
net_device
*
dev
,
int
option
)
{
struct
in_ifaddr
*
ifaddr
;
...
...
@@ -1323,7 +1321,7 @@ unsigned long get_ip_address (netdevice_t *dev, int option)
return
0
;
}
void
add_gateway
(
sdla_t
*
card
,
netdevice_t
*
dev
)
void
add_gateway
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
mm_segment_t
oldfs
;
struct
rtentry
route
;
...
...
drivers/net/wan/wanpipe_multppp.c
View file @
5a4a60ae
...
...
@@ -130,19 +130,19 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
wan_device_t
*
wandev
);
static
int
new_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
,
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
);
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
);
static
void
if_tx_timeout
(
netdevice_t
*
dev
);
static
void
if_tx_timeout
(
struct
net_device
*
dev
);
/* CHDLC Firmware interface functions */
static
int
chdlc_configure
(
sdla_t
*
card
,
void
*
data
);
...
...
@@ -158,7 +158,7 @@ static int config_chdlc (sdla_t *card);
/* Miscellaneous CHDLC Functions */
static
int
set_chdlc_config
(
sdla_t
*
card
);
static
void
init_chdlc_tx_rx_buff
(
sdla_t
*
card
,
netdevice_t
*
dev
);
static
void
init_chdlc_tx_rx_buff
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
int
chdlc_error
(
sdla_t
*
card
,
int
err
,
CHDLC_MAILBOX_STRUCT
*
mb
);
static
int
process_chdlc_exception
(
sdla_t
*
card
);
static
int
process_global_exception
(
sdla_t
*
card
);
...
...
@@ -176,14 +176,14 @@ static int reply_udp( unsigned char *data, unsigned int mbox_len );
static
int
intr_test
(
sdla_t
*
card
);
static
int
udp_pkt_type
(
struct
sk_buff
*
skb
,
sdla_t
*
card
);
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
sdla_t
*
card
,
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
);
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
static
void
s508_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
static
void
s508_unlock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
static
void
send_ppp_term_request
(
netdevice_t
*
);
static
void
send_ppp_term_request
(
struct
net_device
*
dev
);
static
int
Intr_test_counter
;
...
...
@@ -456,10 +456,10 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
* 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
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
volatile
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
;
unsigned
long
timeout
;
...
...
@@ -522,11 +522,12 @@ static int update (wan_device_t* wandev)
* Return: 0 o.k.
* < 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
,
struct
net_device
*
pdev
,
wanif_conf_t
*
conf
)
{
struct
ppp_device
*
pppdev
=
(
struct
ppp_device
*
)
pdev
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
struct
sppp
*
sp
;
sdla_t
*
card
=
wandev
->
private
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
...
@@ -616,7 +617,7 @@ static int new_if (wan_device_t* wandev, netdevice_t* pdev, wanif_conf_t* conf)
/*============================================================================
* Delete logical channel.
*/
static
int
del_if
(
wan_device_t
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
...
@@ -651,11 +652,11 @@ static int del_if (wan_device_t* wandev, netdevice_t* dev)
* interface registration. Returning anything but zero will fail interface
* registration.
*/
static
int
if_init
(
netdevice_t
*
dev
)
{
static
int
if_init
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
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
* done in sppp_attach(), called by new_if()
...
...
@@ -694,7 +695,7 @@ static int if_init (netdevice_t* dev)
/*============================================================================
* Handle transmit timeout event from netif watchdog
*/
static
void
if_tx_timeout
(
netdevice_t
*
dev
)
static
void
if_tx_timeout
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
...
...
@@ -719,7 +720,7 @@ static void if_tx_timeout (netdevice_t *dev)
*
* Return 0 if O.k. or errno.
*/
static
int
if_open
(
netdevice_t
*
dev
)
static
int
if_open
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
...
@@ -752,7 +753,7 @@ static int if_open (netdevice_t* dev)
* o if this is the last close, then disable communications and interrupts.
* o reset flags.
*/
static
int
if_close
(
netdevice_t
*
dev
)
static
int
if_close
(
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
...
@@ -783,7 +784,7 @@ static int if_close (netdevice_t* dev)
* 2. Setting tbusy flag will inhibit further transmit requests from the
* protocol stack and can be used for flow control with protocol layer.
*/
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
)
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
...
@@ -973,7 +974,7 @@ unsigned short calc_checksum (char *data, int len)
* Get ethernet-style interface statistics.
* Return a pointer to struct enet_statistics.
*/
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
dev
)
static
struct
net_device_stats
*
if_stats
(
struct
net_device
*
dev
)
{
sdla_t
*
my_card
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
...
@@ -1242,7 +1243,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb)
*/
STATIC
void
wsppp_isr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
int
i
;
sdla_t
*
my_card
;
...
...
@@ -1355,7 +1356,7 @@ STATIC void wsppp_isr (sdla_t* card)
*/
static
void
rx_intr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
CHDLC_DATA_RX_STATUS_EL_STRUCT
*
rxbuf
=
card
->
u
.
c
.
rxmb
;
...
...
@@ -1477,7 +1478,7 @@ static void rx_intr (sdla_t* card)
*/
void
timer_intr
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
chdlc_private_area_t
*
chdlc_priv_area
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
...
...
@@ -1665,7 +1666,7 @@ static int process_chdlc_exception(sdla_t *card)
*/
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
sdla_t
*
card
,
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
)
{
int
udp_pkt_stored
=
0
;
...
...
@@ -1692,7 +1693,7 @@ static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
* Process UDP management packet.
*/
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
netdevice_t
*
dev
,
static
int
process_udp_mgmt_pkt
(
sdla_t
*
card
,
struct
net_device
*
dev
,
chdlc_private_area_t
*
chdlc_priv_area
)
{
unsigned
char
*
buf
;
...
...
@@ -2076,7 +2077,7 @@ static int process_udp_mgmt_pkt(sdla_t* card, netdevice_t* dev,
* Initialize Receive and Transmit Buffers.
*/
static
void
init_chdlc_tx_rx_buff
(
sdla_t
*
card
,
netdevice_t
*
dev
)
static
void
init_chdlc_tx_rx_buff
(
sdla_t
*
card
,
struct
net_device
*
dev
)
{
CHDLC_MAILBOX_STRUCT
*
mb
=
card
->
mbox
;
CHDLC_TX_STATUS_EL_CFG_STRUCT
*
tx_config
;
...
...
@@ -2213,7 +2214,7 @@ static int udp_pkt_type(struct sk_buff *skb, sdla_t* card)
*/
static
void
port_set_state
(
sdla_t
*
card
,
int
state
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
if
(
card
->
u
.
c
.
state
!=
state
)
...
...
@@ -2284,7 +2285,7 @@ void s508_unlock (sdla_t *card, unsigned long *smp_flags)
static
int
config_chdlc
(
sdla_t
*
card
)
{
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
if
(
card
->
u
.
c
.
comm_enabled
){
...
...
@@ -2330,7 +2331,7 @@ static int config_chdlc (sdla_t *card)
}
static
void
send_ppp_term_request
(
netdevice_t
*
dev
)
static
void
send_ppp_term_request
(
struct
net_device
*
dev
)
{
struct
sk_buff
*
new_skb
;
unsigned
char
*
buf
;
...
...
include/linux/cyclomx.h
View file @
5a4a60ae
...
...
@@ -46,7 +46,7 @@
typedef
struct
cycx
{
char
devname
[
WAN_DRVNAME_SZ
+
1
];
/* card name */
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
state_tick
;
/* link state timestamp */
spinlock_t
lock
;
...
...
include/linux/if_wanpipe.h
View file @
5a4a60ae
...
...
@@ -101,16 +101,12 @@ typedef struct
#ifdef __KERNEL__
#ifndef netdevice_t
#define netdevice_t struct net_device
#endif
/* Private wanpipe socket structures. */
struct
wanpipe_opt
{
void
*
mbox
;
/* Mail box */
void
*
card
;
/* Card bouded to */
netdevice_t
*
dev
;
/* Bounded device */
struct
net_device
*
dev
;
/* Bounded device */
unsigned
short
lcn
;
/* Binded LCN */
unsigned
char
svc
;
/* 0=pvc, 1=svc */
unsigned
char
timer
;
/* flag for delayed transmit*/
...
...
include/linux/if_wanpipe_common.h
View file @
5a4a60ae
...
...
@@ -19,11 +19,8 @@
#include <linux/version.h>
#define netdevice_t struct net_device
typedef
struct
{
netdevice_t
*
slave
;
struct
net_device
*
slave
;
atomic_t
packet_sent
;
atomic_t
receive_block
;
atomic_t
command
;
...
...
@@ -32,8 +29,8 @@ typedef struct {
long
common_critical
;
struct
timer_list
*
tx_timer
;
struct
sock
*
sk
;
/* Wanpipe Sock bind's here */
int
(
*
func
)
(
struct
sk_buff
*
,
netdevice_t
*
,
struct
sock
*
);
int
(
*
func
)(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
sock
*
sk
);
struct
work_struct
wanpipe_work
;
/* deferred keventd work */
unsigned
char
rw_bind
;
/* Sock bind state */
...
...
include/linux/wanpipe.h
View file @
5a4a60ae
...
...
@@ -39,8 +39,6 @@
#ifndef _WANPIPE_H
#define _WANPIPE_H
#define netdevice_t struct net_device
#include <linux/wanrouter.h>
/* Defines */
...
...
@@ -286,7 +284,7 @@ typedef struct sdla
{
char
devname
[
WAN_DRVNAME_SZ
+
1
];
/* card name */
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
long
state_tick
;
/* link state timestamp */
...
...
@@ -335,22 +333,22 @@ typedef struct sdla
u32
hi_pvc
;
u32
lo_svc
;
u32
hi_svc
;
netdevice_t
*
svc_to_dev_map
[
MAX_X25_LCN
];
netdevice_t
*
pvc_to_dev_map
[
MAX_X25_LCN
];
netdevice_t
*
tx_dev
;
netdevice_t
*
cmd_dev
;
struct
net_device
*
svc_to_dev_map
[
MAX_X25_LCN
];
struct
net_device
*
pvc_to_dev_map
[
MAX_X25_LCN
];
struct
net_device
*
tx_dev
;
struct
net_device
*
cmd_dev
;
u32
no_dev
;
volatile
u8
*
hdlc_buf_status
;
u32
tx_interrupts_pending
;
u16
timer_int_enabled
;
netdevice_t
*
poll_device
;
struct
net_device
*
poll_device
;
atomic_t
command_busy
;
u16
udp_pkt_lgth
;
u32
udp_type
;
u8
udp_pkt_src
;
u32
udp_lcn
;
netdevice_t
*
udp_dev
;
struct
net_device
*
udp_dev
;
s8
udp_pkt_data
[
MAX_LGTH_UDP_MGNT_PKT
];
u8
LAPB_hdlc
;
/* Option to turn off X25 and run only LAPB */
...
...
@@ -369,7 +367,7 @@ typedef struct sdla
unsigned
rx_top
;
/* S508 receive buffer end */
unsigned
short
node_dlci
[
100
];
unsigned
short
dlci_num
;
netdevice_t
*
dlci_to_dev_map
[
991
+
1
];
struct
net_device
*
dlci_to_dev_map
[
991
+
1
];
unsigned
tx_interrupts_pending
;
unsigned
short
timer_int_enabled
;
unsigned
short
udp_pkt_lgth
;
...
...
@@ -382,7 +380,7 @@ typedef struct sdla
void
*
curr_trc_el
;
/* current trace element */
unsigned
short
trc_bfr_space
;
/* trace buffer space */
unsigned
char
update_comms_stats
;
netdevice_t
*
arp_dev
;
struct
net_device
*
arp_dev
;
spinlock_t
if_send_lock
;
}
f
;
struct
/****** PPP-specific data ***********/
...
...
@@ -483,10 +481,10 @@ extern sdla_t * wanpipe_find_card_num (int);
extern
void
wanpipe_queue_work
(
struct
work_struct
*
);
extern
void
wanpipe_mark_bh
(
void
);
extern
void
wakeup_sk_bh
(
netdevice_t
*
);
extern
int
change_dev_flags
(
netdevice_t
*
,
unsigned
);
extern
unsigned
long
get_ip_address
(
netdevice_t
*
dev
,
int
option
);
extern
void
add_gateway
(
sdla_t
*
,
netdevice_t
*
);
extern
void
wakeup_sk_bh
(
struct
net_device
*
dev
);
extern
int
change_dev_flags
(
struct
net_device
*
dev
,
unsigned
flags
);
extern
unsigned
long
get_ip_address
(
struct
net_device
*
dev
,
int
option
);
extern
void
add_gateway
(
sdla_t
*
card
,
struct
net_device
*
dev
);
#endif
/* __KERNEL__ */
...
...
include/linux/wanrouter.h
View file @
5a4a60ae
...
...
@@ -44,8 +44,6 @@
* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
*****************************************************************************/
#define netdevice_t struct net_device
#include <linux/spinlock.h>
/* Support for SMP Locking */
#ifndef _ROUTER_H
...
...
@@ -462,8 +460,7 @@ typedef struct wanif_conf
/*----------------------------------------------------------------------------
* WAN device data space.
*/
typedef
struct
wan_device
{
struct
wan_device
{
unsigned
magic
;
/* magic number */
char
*
name
;
/* -> WAN device name (ASCIIZ) */
void
*
private
;
/* -> driver private data */
...
...
@@ -506,27 +503,29 @@ typedef struct wan_device
int
(
*
update
)
(
struct
wan_device
*
wandev
);
int
(
*
ioctl
)
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
int
(
*
new_if
)
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
int
(
*
new_if
)
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
int
(
*
del_if
)
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
);
int
(
*
del_if
)
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
/****** maintained by the router ****/
struct
wan_device
*
next
;
/* -> next device */
netdevice_t
*
dev
;
/* list of network interfaces */
struct
net_device
*
dev
;
/* list of network interfaces */
unsigned
ndev
;
/* number of interfaces */
struct
proc_dir_entry
*
dent
;
/* proc filesystem entry */
}
wan_device_t
;
};
/* 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
);
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
);
unsigned
short
wanrouter_type_trans
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
int
wanrouter_encapsulate
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
);
/* Proc interface functions. These must not be called by the drivers! */
extern
int
wanrouter_proc_init
(
void
);
extern
void
wanrouter_proc_cleanup
(
void
);
extern
int
wanrouter_proc_add
(
wan_device_t
*
wandev
);
extern
int
wanrouter_proc_delete
(
wan_device_t
*
wandev
);
extern
int
wanrouter_proc_add
(
struct
wan_device
*
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
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);
/* 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
/* _ROUTER_H */
net/wanrouter/af_wanpipe.c
View file @
5a4a60ae
...
...
@@ -170,7 +170,7 @@ struct wanpipe_opt
{
void *mbox; /* Mail box */
void *card; /* Card bouded to */
netdevice_t
*dev; /* Bounded device */
struct net_device
*dev; /* Bounded device */
unsigned short lcn; /* Binded LCN */
unsigned char svc; /* 0=pvc, 1=svc */
unsigned char timer; /* flag for delayed transmit*/
...
...
@@ -185,25 +185,26 @@ static int sk_count;
extern
struct
proto_ops
wanpipe_ops
;
static
unsigned
long
find_free_critical
;
static
void
wanpipe_unlink_driver
(
struct
sock
*
);
static
void
wanpipe_link_driver
(
netdevice_t
*
,
struct
sock
*
sk
);
static
void
wanpipe_unlink_driver
(
struct
sock
*
sk
);
static
void
wanpipe_link_driver
(
struct
net_device
*
dev
,
struct
sock
*
sk
);
static
void
wanpipe_wakeup_driver
(
struct
sock
*
sk
);
static
int
execute_command
(
struct
sock
*
,
unsigned
char
,
unsigned
int
);
static
int
check_dev
(
netdevice_t
*
,
sdla_t
*
);
netdevice_t
*
wanpipe_find_free_dev
(
sdla_t
*
);
static
int
check_dev
(
struct
net_device
*
dev
,
sdla_t
*
card
);
struct
net_device
*
wanpipe_find_free_dev
(
sdla_t
*
card
);
static
void
wanpipe_unlink_card
(
struct
sock
*
);
static
int
wanpipe_link_card
(
struct
sock
*
);
static
struct
sock
*
wanpipe_make_new
(
struct
sock
*
);
static
struct
sock
*
wanpipe_alloc_socket
(
void
);
static
inline
int
get_atomic_device
(
netdevice_t
*
);
static
inline
int
get_atomic_device
(
struct
net_device
*
dev
);
static
int
wanpipe_exec_cmd
(
struct
sock
*
,
int
,
unsigned
int
);
static
int
get_ioctl_cmd
(
struct
sock
*
,
void
*
);
static
int
set_ioctl_cmd
(
struct
sock
*
,
void
*
);
static
void
release_device
(
netdevice_t
*
);
static
void
release_device
(
struct
net_device
*
dev
);
static
void
wanpipe_kill_sock_timer
(
unsigned
long
data
);
static
void
wanpipe_kill_sock_irq
(
struct
sock
*
);
static
void
wanpipe_kill_sock_accept
(
struct
sock
*
);
static
int
wanpipe_do_bind
(
struct
sock
*
,
netdevice_t
*
,
int
);
static
int
wanpipe_do_bind
(
struct
sock
*
sk
,
struct
net_device
*
dev
,
int
protocol
);
struct
sock
*
get_newsk_from_skb
(
struct
sk_buff
*
);
static
int
wanpipe_debug
(
struct
sock
*
,
void
*
);
static
void
wanpipe_delayed_transmit
(
unsigned
long
data
);
...
...
@@ -225,7 +226,8 @@ static int check_driver_busy (struct sock *);
* WANPIPE driver private.
*===========================================================*/
static
int
wanpipe_rcv
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
struct
sock
*
sk
)
static
int
wanpipe_rcv
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
sock
*
sk
)
{
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
skb
->
cb
;
wanpipe_common_t
*
chan
=
dev
->
priv
;
...
...
@@ -323,7 +325,7 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
wanpipe_opt
*
wp
=
wp_sk
(
sk
),
*
newwp
;
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
skb
->
cb
;
struct
sock
*
newsk
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
sdla_t
*
card
;
mbox_cmd_t
*
mbox_ptr
;
wanpipe_common_t
*
chan
;
...
...
@@ -539,7 +541,7 @@ static int wanpipe_sendmsg(struct kiocb *iocb, struct socket *sock,
struct
sock
*
sk
=
sock
->
sk
;
struct
wan_sockaddr_ll
*
saddr
=
(
struct
wan_sockaddr_ll
*
)
msg
->
msg_name
;
struct
sk_buff
*
skb
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
unsigned
short
proto
;
unsigned
char
*
addr
;
int
ifindex
,
err
,
reserve
=
0
;
...
...
@@ -664,7 +666,7 @@ static void wanpipe_delayed_transmit (unsigned long data)
struct
sock
*
sk
=
(
struct
sock
*
)
data
;
struct
sk_buff
*
skb
;
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
netdevice_t
*
dev
=
wp
->
dev
;
struct
net_device
*
dev
=
wp
->
dev
;
sdla_t
*
card
=
(
sdla_t
*
)
wp
->
card
;
if
(
!
card
||
!
dev
){
...
...
@@ -756,7 +758,7 @@ static void wanpipe_delayed_transmit (unsigned long data)
static
int
execute_command
(
struct
sock
*
sk
,
unsigned
char
cmd
,
unsigned
int
flags
)
{
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
netdevice_t
*
dev
;
struct
net_device
*
dev
;
wanpipe_common_t
*
chan
=
NULL
;
int
err
=
0
;
DECLARE_WAITQUEUE
(
wait
,
current
);
...
...
@@ -861,7 +863,7 @@ static void wanpipe_destroy_timer(unsigned long data)
*===========================================================*/
static
void
wanpipe_unlink_driver
(
struct
sock
*
sk
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
wanpipe_common_t
*
chan
=
NULL
;
sk
->
zapped
=
0
;
...
...
@@ -901,7 +903,7 @@ static void wanpipe_unlink_driver (struct sock *sk)
* data up the socket.
*===========================================================*/
static
void
wanpipe_link_driver
(
netdevice_t
*
dev
,
struct
sock
*
sk
)
static
void
wanpipe_link_driver
(
struct
net_device
*
dev
,
struct
sock
*
sk
)
{
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
wanpipe_common_t
*
chan
=
dev
->
priv
;
...
...
@@ -926,7 +928,7 @@ static void wanpipe_link_driver (netdevice_t *dev, struct sock *sk)
*===========================================================*/
static
void
release_device
(
netdevice_t
*
dev
)
static
void
release_device
(
struct
net_device
*
dev
)
{
wanpipe_common_t
*
chan
=
dev
->
priv
;
clear_bit
(
0
,(
void
*
)
&
chan
->
rw_bind
);
...
...
@@ -965,7 +967,7 @@ static int wanpipe_release(struct socket *sock)
if
(
wp
->
num
==
htons
(
X25_PROT
)
&&
sk
->
state
!=
WANSOCK_DISCONNECTED
&&
sk
->
zapped
)
{
netdevice_t
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
struct
net_device
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
wanpipe_common_t
*
chan
;
if
(
dev
){
chan
=
dev
->
priv
;
...
...
@@ -1153,7 +1155,7 @@ static void wanpipe_kill_sock_timer (unsigned long data)
if
(
wp_sk
(
sk
)
->
num
==
htons
(
X25_PROT
)
&&
sk
->
state
!=
WANSOCK_DISCONNECTED
){
netdevice_t
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
struct
net_device
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
wanpipe_common_t
*
chan
;
if
(
dev
){
chan
=
dev
->
priv
;
...
...
@@ -1268,7 +1270,8 @@ static void wanpipe_kill_sock_irq (struct sock *sk)
* sock to the driver.
*===========================================================*/
static
int
wanpipe_do_bind
(
struct
sock
*
sk
,
netdevice_t
*
dev
,
int
protocol
)
static
int
wanpipe_do_bind
(
struct
sock
*
sk
,
struct
net_device
*
dev
,
int
protocol
)
{
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
wanpipe_common_t
*
chan
=
NULL
;
...
...
@@ -1341,7 +1344,7 @@ static int wanpipe_bind(struct socket *sock, struct sockaddr *uaddr, int addr_le
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
struct
sock
*
sk
=
sock
->
sk
;
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
sdla_t
*
card
=
NULL
;
char
name
[
15
];
...
...
@@ -1436,7 +1439,7 @@ static int wanpipe_bind(struct socket *sock, struct sockaddr *uaddr, int addr_le
*===========================================================*/
static
inline
int
get_atomic_device
(
netdevice_t
*
dev
)
static
inline
int
get_atomic_device
(
struct
net_device
*
dev
)
{
wanpipe_common_t
*
chan
=
dev
->
priv
;
if
(
!
test_and_set_bit
(
0
,(
void
*
)
&
chan
->
rw_bind
)){
...
...
@@ -1451,11 +1454,12 @@ static inline int get_atomic_device (netdevice_t *dev)
* Check that device name belongs to a particular card.
*===========================================================*/
static
int
check_dev
(
netdevice_t
*
dev
,
sdla_t
*
card
)
static
int
check_dev
(
struct
net_device
*
dev
,
sdla_t
*
card
)
{
netdevice_t
*
tmp_dev
;
struct
net_device
*
tmp_dev
;
for
(
tmp_dev
=
card
->
wandev
.
dev
;
tmp_dev
;
tmp_dev
=*
((
netdevice_t
**
)
tmp_dev
->
priv
)){
for
(
tmp_dev
=
card
->
wandev
.
dev
;
tmp_dev
;
tmp_dev
=
*
((
struct
net_device
**
)
tmp_dev
->
priv
))
{
if
(
tmp_dev
->
ifindex
==
dev
->
ifindex
){
return
0
;
}
...
...
@@ -1471,16 +1475,17 @@ static int check_dev (netdevice_t *dev, sdla_t *card)
* X25API Specific.
*===========================================================*/
netdevice_t
*
wanpipe_find_free_dev
(
sdla_t
*
card
)
struct
net_device
*
wanpipe_find_free_dev
(
sdla_t
*
card
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
volatile
wanpipe_common_t
*
chan
;
if
(
test_and_set_bit
(
0
,
&
find_free_critical
)){
printk
(
KERN_INFO
"CRITICAL in Find Free
\n
"
);
}
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=*
((
netdevice_t
**
)
dev
->
priv
)){
for
(
dev
=
card
->
wandev
.
dev
;
dev
;
dev
=
*
((
struct
net_device
**
)
dev
->
priv
))
{
chan
=
dev
->
priv
;
if
(
!
chan
)
continue
;
...
...
@@ -1646,7 +1651,7 @@ static int wanpipe_recvmsg(struct kiocb *iocb, struct socket *sock,
static
void
wanpipe_wakeup_driver
(
struct
sock
*
sk
)
{
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
...
...
@@ -1680,7 +1685,7 @@ static void wanpipe_wakeup_driver(struct sock *sk)
static
int
wanpipe_getname
(
struct
socket
*
sock
,
struct
sockaddr
*
uaddr
,
int
*
uaddr_len
,
int
peer
)
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
struct
sock
*
sk
=
sock
->
sk
;
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
...
...
@@ -1718,7 +1723,7 @@ static int wanpipe_getname(struct socket *sock, struct sockaddr *uaddr,
static
int
wanpipe_notifier
(
struct
notifier_block
*
this
,
unsigned
long
msg
,
void
*
data
)
{
struct
sock
*
sk
;
netdevice_t
*
dev
=
(
netdevice_t
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
wanpipe_opt
*
po
;
for
(
sk
=
wanpipe_sklist
;
sk
;
sk
=
sk
->
next
)
{
...
...
@@ -1867,7 +1872,7 @@ static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long ar
static
int
wanpipe_debug
(
struct
sock
*
origsk
,
void
*
arg
)
{
struct
sock
*
sk
=
NULL
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
int
cnt
=
0
,
err
=
0
;
wan_debug_t
*
dbg_data
=
(
wan_debug_t
*
)
arg
;
...
...
@@ -2010,7 +2015,7 @@ static int set_ioctl_cmd (struct sock *sk, void *arg)
if
(
!
wp_sk
(
sk
)
->
mbox
)
{
void
*
mbox_ptr
;
netdevice_t
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
struct
net_device
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
if
(
!
dev
)
return
-
ENODEV
;
...
...
@@ -2351,7 +2356,7 @@ static int wanpipe_exec_cmd(struct sock *sk, int cmd, unsigned int flags)
static
int
check_driver_busy
(
struct
sock
*
sk
)
{
netdevice_t
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
struct
net_device
*
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
wanpipe_common_t
*
chan
;
if
(
!
dev
)
...
...
@@ -2456,7 +2461,7 @@ static int wanpipe_accept(struct socket *sock, struct socket *newsock, int flags
struct
sock
*
get_newsk_from_skb
(
struct
sk_buff
*
skb
)
{
netdevice_t
*
dev
=
skb
->
dev
;
struct
net_device
*
dev
=
skb
->
dev
;
wanpipe_common_t
*
chan
;
if
(
!
dev
){
...
...
@@ -2486,7 +2491,7 @@ static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr
{
struct
sock
*
sk
=
sock
->
sk
;
struct
wan_sockaddr_ll
*
addr
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
int
err
;
if
(
wp_sk
(
sk
)
->
num
!=
htons
(
X25_PROT
))
...
...
net/wanrouter/wanmain.c
View file @
5a4a60ae
...
...
@@ -127,18 +127,18 @@ static void dbg_kfree(void * v, int line) {
* WAN device IOCTL handlers
*/
static
int
device_setup
(
wan_device_t
*
wandev
,
wandev_conf_t
*
u_conf
);
static
int
device_stat
(
wan_device_t
*
wandev
,
wandev_stat_t
*
u_stat
);
static
int
device_shutdown
(
wan_device_t
*
wandev
);
static
int
device_new_if
(
wan_device_t
*
wandev
,
wanif_conf_t
*
u_conf
);
static
int
device_del_if
(
wan_device_t
*
wandev
,
char
*
u_name
);
static
int
device_setup
(
struct
wan_device
*
wandev
,
wandev_conf_t
*
u_conf
);
static
int
device_stat
(
struct
wan_device
*
wandev
,
wandev_stat_t
*
u_stat
);
static
int
device_shutdown
(
struct
wan_device
*
wandev
);
static
int
device_new_if
(
struct
wan_device
*
wandev
,
wanif_conf_t
*
u_conf
);
static
int
device_del_if
(
struct
wan_device
*
wandev
,
char
*
u_name
);
/*
* Miscellaneous
*/
static
wan_device_t
*
find_device
(
char
*
name
);
static
int
delete_interface
(
wan_device_t
*
wandev
,
char
*
name
);
static
struct
wan_device
*
find_device
(
char
*
name
);
static
int
delete_interface
(
struct
wan_device
*
wandev
,
char
*
name
);
void
lock_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);
static
char
fullname
[]
=
"Sangoma WANPIPE Router"
;
static
char
copyright
[]
=
"(c) 1995-2000 Sangoma Technologies Inc."
;
static
char
modname
[]
=
ROUTER_NAME
;
/* short module name */
wan_device_t
*
router_devlist
=
NULL
;
/* list of registered devices */
static
int
devcnt
=
0
;
struct
wan_device
*
router_devlist
;
/* list of registered devices */
static
int
devcnt
;
/*
* Organize Unique Identifiers for encapsulation/decapsulation
...
...
@@ -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
;
...
...
@@ -322,7 +322,7 @@ int register_wan_device(wan_device_t *wandev)
int
unregister_wan_device
(
char
*
name
)
{
wan_device_t
*
wandev
,
*
prev
;
struct
wan_device
*
wandev
,
*
prev
;
if
(
name
==
NULL
)
return
-
EINVAL
;
...
...
@@ -363,7 +363,7 @@ int unregister_wan_device(char *name)
*/
int
wanrouter_encapsulate
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
int
wanrouter_encapsulate
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
)
{
int
hdr_len
=
0
;
...
...
@@ -406,7 +406,7 @@ int wanrouter_encapsulate (struct sk_buff *skb, netdevice_t *dev,
*/
unsigned
short
wanrouter_type_trans
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
)
unsigned
short
wanrouter_type_trans
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
)
{
int
cnt
=
skb
->
data
[
0
]
?
0
:
1
;
/* there may be a pad present */
unsigned
short
ethertype
;
...
...
@@ -457,7 +457,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
{
int
err
=
0
;
struct
proc_dir_entry
*
dent
;
wan_device_t
*
wandev
;
struct
wan_device
*
wandev
;
if
(
!
capable
(
CAP_NET_ADMIN
))
return
-
EPERM
;
...
...
@@ -519,7 +519,7 @@ int wanrouter_ioctl(struct inode *inode, struct file *file,
* 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
;
wandev_conf_t
*
conf
;
...
...
@@ -595,9 +595,9 @@ static int device_setup (wan_device_t *wandev, wandev_conf_t *u_conf)
* 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
;
struct
net_device
*
dev
;
int
err
=
0
;
if
(
wandev
->
state
==
WAN_UNCONFIGURED
)
...
...
@@ -628,7 +628,7 @@ static int device_shutdown (wan_device_t *wandev)
* 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
;
...
...
@@ -658,10 +658,10 @@ static int device_stat (wan_device_t *wandev, wandev_stat_t *u_stat)
* 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
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
#ifdef CONFIG_WANPIPE_MULTPPP
struct
ppp_device
*
pppdev
=
NULL
;
#endif
...
...
@@ -682,13 +682,14 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
if
(
pppdev
==
NULL
)
return
-
ENOBUFS
;
memset
(
pppdev
,
0
,
sizeof
(
struct
ppp_device
));
pppdev
->
dev
=
kmalloc
(
sizeof
(
netdevice_t
),
GFP_KERNEL
);
pppdev
->
dev
=
kmalloc
(
sizeof
(
struct
net_device
),
GFP_KERNEL
);
if
(
pppdev
->
dev
==
NULL
)
{
kfree
(
pppdev
);
return
-
ENOBUFS
;
}
memset
(
pppdev
->
dev
,
0
,
sizeof
(
netdevice_t
));
err
=
wandev
->
new_if
(
wandev
,
(
netdevice_t
*
)
pppdev
,
&
conf
);
memset
(
pppdev
->
dev
,
0
,
sizeof
(
struct
net_device
));
err
=
wandev
->
new_if
(
wandev
,
(
struct
net_device
*
)
pppdev
,
&
conf
);
dev
=
pppdev
->
dev
;
#else
printk
(
KERN_INFO
"%s: Wanpipe Mulit-Port PPP support has not been compiled in!
\n
"
,
...
...
@@ -696,10 +697,10 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
return
-
EPROTONOSUPPORT
;
#endif
}
else
{
dev
=
kmalloc
(
sizeof
(
netdevice_t
),
GFP_KERNEL
);
dev
=
kmalloc
(
sizeof
(
struct
net_device
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
return
-
ENOBUFS
;
memset
(
dev
,
0
,
sizeof
(
netdevice_t
));
memset
(
dev
,
0
,
sizeof
(
struct
net_device
));
err
=
wandev
->
new_if
(
wandev
,
dev
,
&
conf
);
}
...
...
@@ -722,7 +723,7 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
err
=
register_netdev
(
dev
);
if
(
!
err
)
{
netdevice_t
*
slave
=
NULL
;
struct
net_device
*
slave
=
NULL
;
unsigned
long
smp_flags
=
0
;
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
...
...
@@ -731,10 +732,10 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
wandev
->
dev
=
dev
;
}
else
{
for
(
slave
=
wandev
->
dev
;
*
((
netdevice_t
**
)
slave
->
priv
);
slave
=*
((
netdevice_t
**
)
slave
->
priv
));
*
((
struct
net_device
**
)
slave
->
priv
);
slave
=
*
((
struct
net_device
**
)
slave
->
priv
));
*
((
netdevice_t
**
)
slave
->
priv
)
=
dev
;
*
((
struct
net_device
**
)
slave
->
priv
)
=
dev
;
}
++
wandev
->
ndev
;
...
...
@@ -774,7 +775,7 @@ static int device_new_if (wan_device_t *wandev, wanif_conf_t *u_conf)
* 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
];
int
err
=
0
;
...
...
@@ -815,9 +816,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.
*/
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
);
wandev
=
wandev
->
next
);
...
...
@@ -841,16 +842,16 @@ static wan_device_t *find_device(char *name)
* 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
;
struct
net_device
*
dev
=
NULL
,
*
prev
=
NULL
;
unsigned
long
smp_flags
=
0
;
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
dev
=
wandev
->
dev
;
prev
=
NULL
;
while
(
dev
&&
strcmp
(
name
,
dev
->
name
))
{
netdevice_t
**
slave
=
dev
->
priv
;
struct
net_device
**
slave
=
dev
->
priv
;
prev
=
dev
;
dev
=
*
slave
;
}
...
...
@@ -867,12 +868,12 @@ static int delete_interface (wan_device_t *wandev, char *name)
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
if
(
prev
)
{
netdevice_t
**
prev_slave
=
prev
->
priv
;
netdevice_t
**
slave
=
dev
->
priv
;
struct
net_device
**
prev_slave
=
prev
->
priv
;
struct
net_device
**
slave
=
dev
->
priv
;
*
prev_slave
=
*
slave
;
}
else
{
netdevice_t
**
slave
=
dev
->
priv
;
struct
net_device
**
slave
=
dev
->
priv
;
wandev
->
dev
=
*
slave
;
}
--
wandev
->
ndev
;
...
...
net/wanrouter/wanproc.c
View file @
5a4a60ae
...
...
@@ -96,7 +96,7 @@ static struct proc_dir_entry *proc_router;
*/
static
void
*
r_start
(
struct
seq_file
*
m
,
loff_t
*
pos
)
{
wan_device_t
*
wandev
;
struct
wan_device
*
wandev
;
loff_t
l
=
*
pos
;
lock_kernel
();
...
...
@@ -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
)
{
wan_device_t
*
wandev
=
v
;
struct
wan_device
*
wandev
=
v
;
(
*
pos
)
++
;
return
(
v
==
(
void
*
)
1
)
?
router_devlist
:
wandev
->
next
;
}
...
...
@@ -119,7 +119,7 @@ static void r_stop(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
)
{
seq_puts
(
m
,
"Device name | port |IRQ|DMA| mem.addr |"
);
seq_puts
(
m
,
"mem.size|option1|option2|option3|option4
\n
"
);
...
...
@@ -135,7 +135,7 @@ static int config_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
)
{
seq_puts
(
m
,
"Device name |protocol|station|interface|"
);
seq_puts
(
m
,
"clocking|baud rate| MTU |ndev|link state
\n
"
);
...
...
@@ -221,7 +221,7 @@ static struct file_operations status_fops =
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
)
return
0
;
...
...
@@ -339,7 +339,7 @@ void wanrouter_proc_cleanup (void)
* 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
)
return
-
EINVAL
;
...
...
@@ -356,7 +356,7 @@ int wanrouter_proc_add (wan_device_t* wandev)
* 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
)
return
-
EINVAL
;
...
...
@@ -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
;
}
int
wanrouter_proc_delete
(
wan_device_t
*
wandev
)
int
wanrouter_proc_delete
(
struct
wan_device
*
wandev
)
{
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