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
41d0ff2e
Commit
41d0ff2e
authored
May 15, 2003
by
Arnaldo Carvalho de Melo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
o wanrouter: kill netdevice_t, do as all the rest of the tree, use struct net_device
parent
7a2d9c10
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
419 additions
and
396 deletions
+419
-396
drivers/net/wan/sdla_chdlc.c
drivers/net/wan/sdla_chdlc.c
+49
-47
drivers/net/wan/sdla_fr.c
drivers/net/wan/sdla_fr.c
+95
-87
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
+45
-44
drivers/net/wan/sdla_x25.c
drivers/net/wan/sdla_x25.c
+106
-89
drivers/net/wan/sdlamain.c
drivers/net/wan/sdlamain.c
+4
-6
drivers/net/wan/wanpipe_multppp.c
drivers/net/wan/wanpipe_multppp.c
+35
-35
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
+12
-14
include/linux/wanrouter.h
include/linux/wanrouter.h
+8
-8
net/wanrouter/af_wanpipe.c
net/wanrouter/af_wanpipe.c
+40
-35
net/wanrouter/wanmain.c
net/wanrouter/wanmain.c
+20
-19
No files found.
drivers/net/wan/sdla_chdlc.c
View file @
41d0ff2e
...
@@ -187,20 +187,21 @@ extern void enable_irq(unsigned int);
...
@@ -187,20 +187,21 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
struct
wan_device
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
/* Network device interface */
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
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
);
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
);
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
);
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 */
/* CHDLC Firmware interface functions */
static
int
chdlc_configure
(
sdla_t
*
card
,
void
*
data
);
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);
...
@@ -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
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 */
/* Miscellaneous CHDLC Functions */
static
int
set_chdlc_config
(
sdla_t
*
card
);
static
int
set_chdlc_config
(
sdla_t
*
card
);
...
@@ -230,8 +231,8 @@ static void port_set_state (sdla_t *card, int);
...
@@ -230,8 +231,8 @@ static void port_set_state (sdla_t *card, int);
static
int
config_chdlc
(
sdla_t
*
card
);
static
int
config_chdlc
(
sdla_t
*
card
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
trigger_chdlc_poll
(
netdevice_t
*
);
static
void
trigger_chdlc_poll
(
struct
net_device
*
dev
);
static
void
chdlc_poll
(
netdevice_t
*
);
static
void
chdlc_poll
(
struct
net_device
*
dev
);
static
void
chdlc_poll_delay
(
unsigned
long
dev_ptr
);
static
void
chdlc_poll_delay
(
unsigned
long
dev_ptr
);
...
@@ -245,20 +246,20 @@ static void rx_intr (sdla_t* card);
...
@@ -245,20 +246,20 @@ static void rx_intr (sdla_t* card);
static
void
timer_intr
(
sdla_t
*
);
static
void
timer_intr
(
sdla_t
*
);
/* Bottom half handlers */
/* Bottom half handlers */
static
void
chdlc_work
(
netdevice_t
*
);
static
void
chdlc_work
(
struct
net_device
*
dev
);
static
int
chdlc_work_cleanup
(
netdevice_t
*
);
static
int
chdlc_work_cleanup
(
struct
net_device
*
dev
);
static
int
bh_enqueue
(
netdevice_t
*
,
struct
sk_buff
*
);
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
/* Miscellaneous functions */
/* 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
);
struct
sk_buff
*
skb
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
static
int
intr_test
(
sdla_t
*
card
);
static
int
intr_test
(
sdla_t
*
card
);
static
int
udp_pkt_type
(
struct
sk_buff
*
skb
,
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
,
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
);
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
);
chdlc_private_area_t
*
chdlc_priv_area
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
static
void
s508_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
static
void
s508_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
...
@@ -601,7 +602,7 @@ int wpc_init (sdla_t* card, wandev_conf_t* conf)
...
@@ -601,7 +602,7 @@ int wpc_init (sdla_t* card, wandev_conf_t* conf)
static
int
update
(
struct
wan_device
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
volatile
chdlc_private_area_t
*
chdlc_priv_area
;
volatile
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
;
SHARED_MEMORY_INFO_STRUCT
*
flags
;
unsigned
long
timeout
;
unsigned
long
timeout
;
...
@@ -666,7 +667,7 @@ static int update(struct wan_device* wandev)
...
@@ -666,7 +667,7 @@ static int update(struct wan_device* wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
...
@@ -898,7 +899,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* dev,
...
@@ -898,7 +899,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* dev,
* interface registration. Returning anything but zero will fail interface
* interface registration. Returning anything but zero will fail interface
* registration.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -961,7 +962,7 @@ static int if_init (netdevice_t* dev)
...
@@ -961,7 +962,7 @@ static int if_init (netdevice_t* dev)
*
*
* Return 0 if O.k. or errno.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -1014,7 +1015,7 @@ static int if_open (netdevice_t* dev)
...
@@ -1014,7 +1015,7 @@ static int if_open (netdevice_t* dev)
* o if this is the last close, then disable communications and interrupts.
* o if this is the last close, then disable communications and interrupts.
* o reset flags.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -1085,8 +1086,9 @@ static void disable_comm (sdla_t *card)
...
@@ -1085,8 +1086,9 @@ static void disable_comm (sdla_t *card)
*
*
* Return: media header length.
* 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
)
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
{
{
skb
->
protocol
=
htons
(
type
);
skb
->
protocol
=
htons
(
type
);
...
@@ -1097,7 +1099,7 @@ static int if_header (struct sk_buff* skb, netdevice_t* dev,
...
@@ -1097,7 +1099,7 @@ static int if_header (struct sk_buff* skb, netdevice_t* dev,
/*============================================================================
/*============================================================================
* Handle transmit timeout event from netif watchdog
* 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
;
chdlc_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1145,7 +1147,7 @@ static int if_rebuild_hdr (struct sk_buff *skb)
...
@@ -1145,7 +1147,7 @@ static int if_rebuild_hdr (struct sk_buff *skb)
* 2. Setting tbusy flag will inhibit further transmit requests from the
* 2. Setting tbusy flag will inhibit further transmit requests from the
* protocol stack and can be used for flow control with protocol layer.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -1279,7 +1281,7 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
...
@@ -1279,7 +1281,7 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
* multicast source IP address.
* 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
)
struct
sk_buff
*
skb
)
{
{
u32
src_ip_addr
;
u32
src_ip_addr
;
...
@@ -1422,7 +1424,7 @@ unsigned short calc_checksum (char *data, int len)
...
@@ -1422,7 +1424,7 @@ unsigned short calc_checksum (char *data, int len)
* Get ethernet-style interface statistics.
* Get ethernet-style interface statistics.
* Return a pointer to struct enet_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
;
sdla_t
*
my_card
;
chdlc_private_area_t
*
chdlc_priv_area
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
@@ -1711,7 +1713,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb)
...
@@ -1711,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
* PREPROCESSOR STATEMENT ABOVE, UNLESS YOU KNOW WHAT YOU ARE
* DOING */
* DOING */
static
void
chdlc_work
(
netdevice_t
*
dev
)
static
void
chdlc_work
(
struct
net_device
*
dev
)
{
{
chdlc_private_area_t
*
chan
=
dev
->
priv
;
chdlc_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1752,7 +1754,7 @@ static void chdlc_work (netdevice_t * dev)
...
@@ -1752,7 +1754,7 @@ static void chdlc_work (netdevice_t * dev)
return
;
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
;
chdlc_private_area_t
*
chan
=
dev
->
priv
;
...
@@ -1770,7 +1772,7 @@ static int chdlc_work_cleanup (netdevice_t *dev)
...
@@ -1770,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 */
/* Check for full */
chdlc_private_area_t
*
chan
=
dev
->
priv
;
chdlc_private_area_t
*
chan
=
dev
->
priv
;
...
@@ -1805,7 +1807,7 @@ static int bh_enqueue (netdevice_t *dev, struct sk_buff *skb)
...
@@ -1805,7 +1807,7 @@ static int bh_enqueue (netdevice_t *dev, struct sk_buff *skb)
*/
*/
static
void
wpc_isr
(
sdla_t
*
card
)
static
void
wpc_isr
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
int
i
;
int
i
;
sdla_t
*
my_card
;
sdla_t
*
my_card
;
...
@@ -1932,7 +1934,7 @@ static void wpc_isr (sdla_t* card)
...
@@ -1932,7 +1934,7 @@ static void wpc_isr (sdla_t* card)
*/
*/
static
void
rx_intr
(
sdla_t
*
card
)
static
void
rx_intr
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
chdlc_private_area_t
*
chdlc_priv_area
;
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
CHDLC_DATA_RX_STATUS_EL_STRUCT
*
rxbuf
=
card
->
u
.
c
.
rxmb
;
CHDLC_DATA_RX_STATUS_EL_STRUCT
*
rxbuf
=
card
->
u
.
c
.
rxmb
;
...
@@ -2084,7 +2086,7 @@ static void rx_intr (sdla_t* card)
...
@@ -2084,7 +2086,7 @@ static void rx_intr (sdla_t* card)
*/
*/
void
timer_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
;
chdlc_private_area_t
*
chdlc_priv_area
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
...
@@ -2173,7 +2175,7 @@ static int set_chdlc_config(sdla_t* card)
...
@@ -2173,7 +2175,7 @@ static int set_chdlc_config(sdla_t* card)
cfg
.
IP_netmask
=
0
;
cfg
.
IP_netmask
=
0
;
}
else
if
(
card
->
wandev
.
dev
){
}
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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
struct
in_device
*
in_dev
=
dev
->
ip_ptr
;
struct
in_device
*
in_dev
=
dev
->
ip_ptr
;
...
@@ -2403,7 +2405,7 @@ static int process_chdlc_exception(sdla_t *card)
...
@@ -2403,7 +2405,7 @@ static int process_chdlc_exception(sdla_t *card)
static
int
configure_ip
(
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
;
chdlc_private_area_t
*
chdlc_priv_area
;
char
err
;
char
err
;
...
@@ -2450,7 +2452,7 @@ static int configure_ip (sdla_t* card)
...
@@ -2450,7 +2452,7 @@ static int configure_ip (sdla_t* card)
static
int
unconfigure_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
;
chdlc_private_area_t
*
chdlc_priv_area
;
if
(
!
dev
)
if
(
!
dev
)
...
@@ -2478,7 +2480,7 @@ static int unconfigure_ip (sdla_t* card)
...
@@ -2478,7 +2480,7 @@ static int unconfigure_ip (sdla_t* card)
static
void
process_route
(
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
;
unsigned
char
port_num
;
chdlc_private_area_t
*
chdlc_priv_area
=
NULL
;
chdlc_private_area_t
*
chdlc_priv_area
=
NULL
;
u32
local_IP_addr
=
0
;
u32
local_IP_addr
=
0
;
...
@@ -2659,8 +2661,8 @@ static void process_route (sdla_t *card)
...
@@ -2659,8 +2661,8 @@ static void process_route (sdla_t *card)
*/
*/
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
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
)
chdlc_private_area_t
*
chdlc_priv_area
)
{
{
int
udp_pkt_stored
=
0
;
int
udp_pkt_stored
=
0
;
...
@@ -2687,7 +2689,7 @@ static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
...
@@ -2687,7 +2689,7 @@ static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
* Process UDP management packet.
* 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
)
chdlc_private_area_t
*
chdlc_priv_area
)
{
{
unsigned
char
*
buf
;
unsigned
char
*
buf
;
...
@@ -3264,7 +3266,7 @@ static void port_set_state (sdla_t *card, int state)
...
@@ -3264,7 +3266,7 @@ static void port_set_state (sdla_t *card, int state)
card
->
wandev
.
state
=
card
->
u
.
c
.
state
=
state
;
card
->
wandev
.
state
=
card
->
u
.
c
.
state
=
state
;
if
(
card
->
wandev
.
dev
){
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_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
chdlc_priv_area
->
common
.
state
=
state
;
chdlc_priv_area
->
common
.
state
=
state
;
}
}
...
@@ -3294,7 +3296,7 @@ static void port_set_state (sdla_t *card, int state)
...
@@ -3294,7 +3296,7 @@ static void port_set_state (sdla_t *card, int state)
static
int
config_chdlc
(
sdla_t
*
card
)
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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
...
@@ -3418,7 +3420,7 @@ static int config_chdlc (sdla_t *card)
...
@@ -3418,7 +3420,7 @@ static int config_chdlc (sdla_t *card)
* the chldc_poll routine.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
;
sdla_t
*
card
;
sdla_t
*
card
;
...
@@ -3568,7 +3570,7 @@ static void chdlc_poll (netdevice_t *dev)
...
@@ -3568,7 +3570,7 @@ static void chdlc_poll (netdevice_t *dev)
* a polling routine.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
;
sdla_t
*
card
;
sdla_t
*
card
;
...
@@ -3593,7 +3595,7 @@ static void trigger_chdlc_poll (netdevice_t *dev)
...
@@ -3593,7 +3595,7 @@ static void trigger_chdlc_poll (netdevice_t *dev)
static
void
chdlc_poll_delay
(
unsigned
long
dev_ptr
)
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
);
trigger_chdlc_poll
(
dev
);
}
}
...
...
drivers/net/wan/sdla_fr.c
View file @
41d0ff2e
...
@@ -324,27 +324,27 @@ static int Intr_test_counter;
...
@@ -324,27 +324,27 @@ static int Intr_test_counter;
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
struct
wan_device
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
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
(
sdla_t
*
card
);
/* WANPIPE-specific entry points */
/* WANPIPE-specific entry points */
static
int
wpf_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
static
int
wpf_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
/* Network device interface */
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
netdevice_t
*
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_rebuild_hdr
(
struct
sk_buff
*
skb
);
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
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
);
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 */
/* Interrupt handlers */
static
void
fr_isr
(
sdla_t
*
card
);
static
void
fr_isr
(
sdla_t
*
card
);
...
@@ -383,9 +383,9 @@ static int fr_modem_failure(sdla_t *card, fr_mbox_t *mbox);
...
@@ -383,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
);
static
int
fr_dlci_change
(
sdla_t
*
card
,
fr_mbox_t
*
mbox
);
/* Miscellaneous functions */
/* Miscellaneous functions */
static
int
update_chan_state
(
netdevice_t
*
dev
);
static
int
update_chan_state
(
struct
net_device
*
dev
);
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
);
static
void
set_chan_state
(
struct
net_device
*
dev
,
int
state
);
static
netdevice_t
*
find_channel
(
sdla_t
*
card
,
unsigned
dlci
);
static
struct
net_device
*
find_channel
(
sdla_t
*
card
,
unsigned
dlci
);
static
int
is_tx_ready
(
sdla_t
*
card
,
fr_channel_t
*
chan
);
static
int
is_tx_ready
(
sdla_t
*
card
,
fr_channel_t
*
chan
);
static
unsigned
int
dec_to_uint
(
unsigned
char
*
str
,
int
len
);
static
unsigned
int
dec_to_uint
(
unsigned
char
*
str
,
int
len
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
...
@@ -394,22 +394,23 @@ static int intr_test( sdla_t* card );
...
@@ -394,22 +394,23 @@ static int intr_test( sdla_t* card );
static
void
init_chan_statistics
(
fr_channel_t
*
chan
);
static
void
init_chan_statistics
(
fr_channel_t
*
chan
);
static
void
init_global_statistics
(
sdla_t
*
card
);
static
void
init_global_statistics
(
sdla_t
*
card
);
static
void
read_DLCI_IB_mapping
(
sdla_t
*
card
,
fr_channel_t
*
chan
);
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
*
);
struct
net_device
*
move_dev_to_next
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
int
check_tx_status
(
sdla_t
*
,
netdevice_t
*
);
static
int
check_tx_status
(
sdla_t
*
card
,
struct
net_device
*
dev
);
/* Frame Relay Socket API */
/* Frame Relay Socket API */
static
void
trigger_fr_bh
(
fr_channel_t
*
);
static
void
trigger_fr_bh
(
fr_channel_t
*
);
static
void
fr_bh
(
netdevice_t
*
);
static
void
fr_bh
(
struct
net_device
*
dev
);
static
int
fr_bh_cleanup
(
netdevice_t
*
);
static
int
fr_bh_cleanup
(
struct
net_device
*
dev
);
static
int
bh_enqueue
(
netdevice_t
*
,
struct
sk_buff
*
);
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
static
void
trigger_fr_poll
(
netdevice_t
*
);
static
void
trigger_fr_poll
(
struct
net_device
*
dev
);
static
void
fr_poll
(
netdevice_t
*
);
static
void
fr_poll
(
struct
net_device
*
dev
);
//static void add_gateway
(netdevice_t *
);
//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
unconfig_fr
(
sdla_t
*
);
static
void
trigger_config_fr
(
sdla_t
*
);
static
void
trigger_config_fr
(
sdla_t
*
);
...
@@ -417,11 +418,11 @@ static void config_fr (sdla_t *);
...
@@ -417,11 +418,11 @@ static void config_fr (sdla_t *);
/* Inverse ARP and Dynamic routing functions */
/* 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
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
);
static
void
fr_arp
(
unsigned
long
data
);
...
@@ -443,7 +444,8 @@ void s508_s514_unlock(sdla_t *card, unsigned long *smp_flags);
...
@@ -443,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
);
void
s508_s514_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
unsigned
short
calc_checksum
(
char
*
,
int
);
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 ****************************************************/
/****** Public Functions ****************************************************/
...
@@ -792,7 +794,7 @@ static int update(struct wan_device* wandev)
...
@@ -792,7 +794,7 @@ static int update(struct wan_device* wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
...
@@ -1022,7 +1024,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* dev,
...
@@ -1022,7 +1024,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* dev,
/*============================================================================
/*============================================================================
* Delete logical channel.
* Delete logical channel.
*/
*/
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
)
{
{
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
unsigned
long
smp_flags
=
0
;
unsigned
long
smp_flags
=
0
;
...
@@ -1118,7 +1120,7 @@ static int wpf_exec (struct sdla* card, void* u_cmd, void* u_data)
...
@@ -1118,7 +1120,7 @@ static int wpf_exec (struct sdla* card, void* u_cmd, void* u_data)
* interface registration. Returning anything but zero will fail interface
* interface registration. Returning anything but zero will fail interface
* registration.
* registration.
*/
*/
static
int
if_init
(
netdevice_t
*
dev
)
static
int
if_init
(
struct
net_device
*
dev
)
{
{
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1196,7 +1198,7 @@ static int if_init (netdevice_t* dev)
...
@@ -1196,7 +1198,7 @@ static int if_init (netdevice_t* dev)
*
*
* Return 0 if O.k. or errno.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1238,7 +1240,7 @@ static int if_open (netdevice_t* dev)
...
@@ -1238,7 +1240,7 @@ static int if_open (netdevice_t* dev)
* o if this is the last open, then disable communications and interrupts.
* o if this is the last open, then disable communications and interrupts.
* o reset flags.
* o reset flags.
*/
*/
static
int
if_close
(
netdevice_t
*
dev
)
static
int
if_close
(
struct
net_device
*
dev
)
{
{
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1261,8 +1263,7 @@ static int if_close (netdevice_t* dev)
...
@@ -1261,8 +1263,7 @@ static int if_close (netdevice_t* dev)
*/
*/
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
)
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
)
{
{
struct
net_device
*
dev
=
skb
->
dev
;
netdevice_t
*
dev
=
skb
->
dev
;
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1274,7 +1275,7 @@ static int if_rebuild_hdr (struct sk_buff* skb)
...
@@ -1274,7 +1275,7 @@ static int if_rebuild_hdr (struct sk_buff* skb)
/*============================================================================
/*============================================================================
* Handle transmit timeout event from netif watchdog
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1317,7 +1318,7 @@ static void if_tx_timeout (netdevice_t *dev)
...
@@ -1317,7 +1318,7 @@ static void if_tx_timeout (netdevice_t *dev)
* will inhibit further transmit requests from the protocol stack
* will inhibit further transmit requests from the protocol stack
* and can be used for flow control with protocol layer.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1564,7 +1565,8 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
...
@@ -1564,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
* Setup so that a frame can be transmitted on the occurrence of a transmit
* interrupt.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1616,7 +1618,7 @@ static int setup_for_delayed_transmit (netdevice_t* dev, struct sk_buff *skb)
...
@@ -1616,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.
* 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
)
struct
sk_buff
*
skb
)
{
{
u32
src_ip_addr
;
u32
src_ip_addr
;
...
@@ -1828,7 +1830,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
...
@@ -1828,7 +1830,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
* Get ethernet-style interface statistics.
* Get ethernet-style interface statistics.
* Return a pointer to struct enet_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
;
fr_channel_t
*
chan
=
dev
->
priv
;
...
@@ -1954,7 +1956,7 @@ static void rx_intr (sdla_t* card)
...
@@ -1954,7 +1956,7 @@ static void rx_intr (sdla_t* card)
fr_channel_t
*
chan
;
fr_channel_t
*
chan
;
char
*
ptr
=
&
flags
->
iflag
;
char
*
ptr
=
&
flags
->
iflag
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
void
*
buf
;
void
*
buf
;
unsigned
dlci
,
len
,
offs
,
len_incl_hdr
;
unsigned
dlci
,
len
,
offs
,
len_incl_hdr
;
int
i
,
udp_type
;
int
i
,
udp_type
;
...
@@ -2225,7 +2227,7 @@ static void tx_intr(sdla_t *card)
...
@@ -2225,7 +2227,7 @@ static void tx_intr(sdla_t *card)
{
{
fr508_flags_t
*
flags
=
card
->
flags
;
fr508_flags_t
*
flags
=
card
->
flags
;
fr_tx_buf_ctl_t
*
bctl
;
fr_tx_buf_ctl_t
*
bctl
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
fr_channel_t
*
chan
;
if
(
card
->
hw
.
type
==
SDLA_S514
){
if
(
card
->
hw
.
type
==
SDLA_S514
){
...
@@ -2354,9 +2356,10 @@ static void timer_intr(sdla_t *card)
...
@@ -2354,9 +2356,10 @@ static void timer_intr(sdla_t *card)
/* Update the channel state call. This is call is
/* Update the channel state call. This is call is
* triggered by if_send() function */
* triggered by if_send() function */
if
(
card
->
u
.
f
.
timer_int_enabled
&
TMR_INT_ENABLED_UPDATE_STATE
){
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
){
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
;
fr_channel_t
*
chan
=
dev
->
priv
;
if
(
chan
->
common
.
state
!=
WAN_CONNECTED
){
if
(
chan
->
common
.
state
!=
WAN_CONNECTED
){
update_chan_state
(
dev
);
update_chan_state
(
dev
);
...
@@ -2382,7 +2385,7 @@ static void timer_intr(sdla_t *card)
...
@@ -2382,7 +2385,7 @@ static void timer_intr(sdla_t *card)
/* Transmit ARP packets */
/* Transmit ARP packets */
if
(
card
->
u
.
f
.
timer_int_enabled
&
TMR_INT_ENABLED_ARP
){
if
(
card
->
u
.
f
.
timer_int_enabled
&
TMR_INT_ENABLED_ARP
){
int
i
=
0
;
int
i
=
0
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
if
(
card
->
u
.
f
.
arp_dev
==
NULL
)
if
(
card
->
u
.
f
.
arp_dev
==
NULL
)
card
->
u
.
f
.
arp_dev
=
card
->
wandev
.
dev
;
card
->
u
.
f
.
arp_dev
=
card
->
wandev
.
dev
;
...
@@ -2586,7 +2589,7 @@ static int handle_IPXWAN(unsigned char *sendpacket,
...
@@ -2586,7 +2589,7 @@ static int handle_IPXWAN(unsigned char *sendpacket,
* This function is called by fr_poll() polling funtion.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -2987,7 +2990,7 @@ static int fr_issue_isf (sdla_t* card, int isf)
...
@@ -2987,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
)
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
;
fr_channel_t
*
chan
;
if
(
!
dev
||
!
(
chan
=
dev
->
priv
))
if
(
!
dev
||
!
(
chan
=
dev
->
priv
))
...
@@ -3090,12 +3093,12 @@ static int fr_event (sdla_t *card, int event, fr_mbox_t* mbox)
...
@@ -3090,12 +3093,12 @@ static int fr_event (sdla_t *card, int event, fr_mbox_t* mbox)
case
FRRES_MODEM_FAILURE
:
case
FRRES_MODEM_FAILURE
:
return
fr_modem_failure
(
card
,
mbox
);
return
fr_modem_failure
(
card
,
mbox
);
case
FRRES_CHANNEL_DOWN
:
case
FRRES_CHANNEL_DOWN
:
{
{
struct
net_device
*
dev
;
netdevice_t
*
dev
;
/* Remove all routes from associated DLCI's */
/* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
if
(
chan
->
route_flag
==
ROUTE_ADDED
)
{
if
(
chan
->
route_flag
==
ROUTE_ADDED
)
{
chan
->
route_flag
=
REMOVE_ROUTE
;
chan
->
route_flag
=
REMOVE_ROUTE
;
...
@@ -3116,13 +3119,13 @@ static int fr_event (sdla_t *card, int event, fr_mbox_t* mbox)
...
@@ -3116,13 +3119,13 @@ static int fr_event (sdla_t *card, int event, fr_mbox_t* mbox)
return
1
;
return
1
;
}
}
case
FRRES_CHANNEL_UP
:
case
FRRES_CHANNEL_UP
:
{
{
struct
net_device
*
dev
;
netdevice_t
*
dev
;
/* FIXME: Only startup devices that are on the list */
/* 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
);
set_chan_state
(
dev
,
WAN_CONNECTED
);
}
}
...
@@ -3196,13 +3199,13 @@ static int fr_dlci_change (sdla_t *card, fr_mbox_t* mbox)
...
@@ -3196,13 +3199,13 @@ static int fr_dlci_change (sdla_t *card, fr_mbox_t* mbox)
dlci_status_t
*
status
=
(
void
*
)
mbox
->
data
;
dlci_status_t
*
status
=
(
void
*
)
mbox
->
data
;
int
cnt
=
mbox
->
cmd
.
length
/
sizeof
(
dlci_status_t
);
int
cnt
=
mbox
->
cmd
.
length
/
sizeof
(
dlci_status_t
);
fr_channel_t
*
chan
;
fr_channel_t
*
chan
;
netdevice_t
*
dev2
;
struct
net_device
*
dev2
;
for
(;
cnt
;
--
cnt
,
++
status
)
{
for
(;
cnt
;
--
cnt
,
++
status
)
{
unsigned
short
dlci
=
status
->
dlci
;
unsigned
short
dlci
=
status
->
dlci
;
netdevice_t
*
dev
=
find_channel
(
card
,
dlci
);
struct
net_device
*
dev
=
find_channel
(
card
,
dlci
);
if
(
dev
==
NULL
){
if
(
dev
==
NULL
){
printk
(
KERN_INFO
printk
(
KERN_INFO
...
@@ -3261,7 +3264,8 @@ static int fr_dlci_change (sdla_t *card, fr_mbox_t* mbox)
...
@@ -3261,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
;
chan
=
dev2
->
priv
;
...
@@ -3317,7 +3321,7 @@ static int fr_init_dlci (sdla_t *card, fr_channel_t *chan)
...
@@ -3317,7 +3321,7 @@ static int fr_init_dlci (sdla_t *card, fr_channel_t *chan)
/*============================================================================
/*============================================================================
* Update channel state.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -3363,7 +3367,7 @@ static int update_chan_state (netdevice_t* dev)
...
@@ -3363,7 +3367,7 @@ static int update_chan_state (netdevice_t* dev)
/*============================================================================
/*============================================================================
* Set channel state.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -3416,7 +3420,7 @@ static void set_chan_state (netdevice_t* dev, int state)
...
@@ -3416,7 +3420,7 @@ static void set_chan_state (netdevice_t* dev, int state)
* NOTE: del_if() functions updates this array, it uses
* NOTE: del_if() functions updates this array, it uses
* the spin locks to avoid corruption.
* 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
)
if
(
dlci
>
HIGHEST_VALID_DLCI
)
return
NULL
;
return
NULL
;
...
@@ -3473,7 +3477,7 @@ static int store_udp_mgmt_pkt(int udp_type, char udp_pkt_src, sdla_t* card,
...
@@ -3473,7 +3477,7 @@ static int store_udp_mgmt_pkt(int udp_type, char udp_pkt_src, sdla_t* card,
{
{
int
udp_pkt_stored
=
0
;
int
udp_pkt_stored
=
0
;
netdevice_t
*
dev
=
find_channel
(
card
,
dlci
);
struct
net_device
*
dev
=
find_channel
(
card
,
dlci
);
fr_channel_t
*
chan
;
fr_channel_t
*
chan
;
if
(
!
dev
||
!
(
chan
=
dev
->
priv
))
if
(
!
dev
||
!
(
chan
=
dev
->
priv
))
...
@@ -3519,7 +3523,7 @@ static int process_udp_mgmt_pkt(sdla_t* card)
...
@@ -3519,7 +3523,7 @@ static int process_udp_mgmt_pkt(sdla_t* card)
int
err
;
int
err
;
struct
timeval
tv
;
struct
timeval
tv
;
int
udp_mgmt_req_valid
=
1
;
int
udp_mgmt_req_valid
=
1
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
fr_channel_t
*
chan
;
fr_udp_pkt_t
*
fr_udp_pkt
;
fr_udp_pkt_t
*
fr_udp_pkt
;
unsigned
short
num_trc_els
;
unsigned
short
num_trc_els
;
...
@@ -3920,7 +3924,7 @@ static int process_udp_mgmt_pkt(sdla_t* card)
...
@@ -3920,7 +3924,7 @@ static int process_udp_mgmt_pkt(sdla_t* card)
* Send Inverse ARP Request
* 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
;
int
err
=
0
;
...
@@ -3997,7 +4001,7 @@ int is_arp(void *buf)
...
@@ -3997,7 +4001,7 @@ int is_arp(void *buf)
* Process ARP Packet Type
* 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
)
{
{
...
@@ -4154,7 +4158,7 @@ int process_ARP(arphdr_1490_t *ArpPacket, sdla_t *card, netdevice_t* dev)
...
@@ -4154,7 +4158,7 @@ int process_ARP(arphdr_1490_t *ArpPacket, sdla_t *card, netdevice_t* dev)
* at a later date.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
...
@@ -4175,7 +4179,7 @@ static void trigger_fr_arp (netdevice_t *dev)
...
@@ -4175,7 +4179,7 @@ static void trigger_fr_arp (netdevice_t *dev)
static
void
fr_arp
(
unsigned
long
data
)
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
;
fr_channel_t
*
chan
=
dev
->
priv
;
volatile
sdla_t
*
card
=
chan
->
card
;
volatile
sdla_t
*
card
=
chan
->
card
;
fr508_flags_t
*
flags
=
card
->
flags
;
fr508_flags_t
*
flags
=
card
->
flags
;
...
@@ -4367,7 +4371,7 @@ void s508_s514_unlock(sdla_t *card, unsigned long *smp_flags)
...
@@ -4367,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 */
/* Check for full */
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
...
@@ -4440,7 +4444,7 @@ static void trigger_fr_bh (fr_channel_t *chan)
...
@@ -4440,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
;
fr_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -4487,7 +4491,7 @@ static void fr_bh (netdevice_t * dev)
...
@@ -4487,7 +4491,7 @@ static void fr_bh (netdevice_t * dev)
return
;
return
;
}
}
static
int
fr_bh_cleanup
(
netdevice_t
*
dev
)
static
int
fr_bh_cleanup
(
struct
net_device
*
dev
)
{
{
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
...
@@ -4521,7 +4525,7 @@ static int fr_bh_cleanup (netdevice_t *dev)
...
@@ -4521,7 +4525,7 @@ static int fr_bh_cleanup (netdevice_t *dev)
* a polling routine.
* 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
;
fr_channel_t
*
chan
=
dev
->
priv
;
schedule_task
(
&
chan
->
fr_poll_task
);
schedule_task
(
&
chan
->
fr_poll_task
);
...
@@ -4551,7 +4555,7 @@ static void trigger_fr_poll (netdevice_t *dev)
...
@@ -4551,7 +4555,7 @@ static void trigger_fr_poll (netdevice_t *dev)
* the fr_poll routine.
* the fr_poll routine.
*/
*/
static
void
fr_poll
(
netdevice_t
*
dev
)
static
void
fr_poll
(
struct
net_device
*
dev
)
{
{
fr_channel_t
*
chan
;
fr_channel_t
*
chan
;
...
@@ -4638,7 +4642,7 @@ static void fr_poll (netdevice_t *dev)
...
@@ -4638,7 +4642,7 @@ static void fr_poll (netdevice_t *dev)
* an interrupt.
* 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
){
if
(
card
->
hw
.
type
==
SDLA_S514
){
...
@@ -4668,14 +4672,13 @@ static int check_tx_status(sdla_t *card, netdevice_t *dev)
...
@@ -4668,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
(
card
->
wandev
.
new_if_cnt
!=
1
){
if
(
*
((
netdevice_t
**
)
dev
->
priv
)
==
NULL
){
if
(
!*
((
struct
net_device
**
)
dev
->
priv
))
return
card
->
wandev
.
dev
;
return
card
->
wandev
.
dev
;
}
else
{
else
return
*
((
netdevice_t
**
)
dev
->
priv
);
return
*
((
struct
net_device
**
)
dev
->
priv
);
}
}
}
return
dev
;
return
dev
;
}
}
...
@@ -4725,10 +4728,11 @@ static void trigger_config_fr (sdla_t *card)
...
@@ -4725,10 +4728,11 @@ static void trigger_config_fr (sdla_t *card)
static
void
config_fr
(
sdla_t
*
card
)
static
void
config_fr
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
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
)
if
((
chan
=
dev
->
priv
)
==
NULL
)
continue
;
continue
;
...
@@ -4797,7 +4801,7 @@ static void config_fr (sdla_t *card)
...
@@ -4797,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
;
fr_channel_t
*
chan
=
dev
->
priv
;
volatile
sdla_t
*
card
=
chan
->
card
;
volatile
sdla_t
*
card
=
chan
->
card
;
...
@@ -4849,10 +4853,11 @@ static void trigger_unconfig_fr (netdevice_t *dev)
...
@@ -4849,10 +4853,11 @@ static void trigger_unconfig_fr (netdevice_t *dev)
static
void
unconfig_fr
(
sdla_t
*
card
)
static
void
unconfig_fr
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
fr_channel_t
*
chan
;
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
)
if
((
chan
=
dev
->
priv
)
==
NULL
)
continue
;
continue
;
...
@@ -4871,7 +4876,8 @@ static void unconfig_fr (sdla_t *card)
...
@@ -4871,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
;
struct
sk_buff
*
skb
=
*
skb_orig
;
fr_channel_t
*
chan
=
dev
->
priv
;
fr_channel_t
*
chan
=
dev
->
priv
;
...
@@ -4929,7 +4935,7 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
...
@@ -4929,7 +4935,7 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
fr_conf_t
*
conf
=
NULL
;
fr_conf_t
*
conf
=
NULL
;
unsigned
short
dlci_num
=
chan
->
dlci
;
unsigned
short
dlci_num
=
chan
->
dlci
;
int
dlci_offset
=
0
;
int
dlci_offset
=
0
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
mbox
->
cmd
.
command
=
FR_READ_CONFIG
;
mbox
->
cmd
.
command
=
FR_READ_CONFIG
;
mbox
->
cmd
.
length
=
0
;
mbox
->
cmd
.
length
=
0
;
...
@@ -4941,9 +4947,9 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
...
@@ -4941,9 +4947,9 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
return
0
;
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
);
set_chan_state
(
dev
,
WAN_DISCONNECTED
);
}
printk
(
KERN_INFO
"DLCI %i Not configured, configuring
\n
"
,
dlci_num
);
printk
(
KERN_INFO
"DLCI %i Not configured, configuring
\n
"
,
dlci_num
);
...
@@ -4971,7 +4977,8 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
...
@@ -4971,7 +4977,8 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
conf
=
(
fr_conf_t
*
)
mbox
->
data
;
conf
=
(
fr_conf_t
*
)
mbox
->
data
;
dlci_offset
=
0
;
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
;
fr_channel_t
*
chan_tmp
=
dev
->
priv
;
conf
->
dlci
[
dlci_offset
]
=
chan_tmp
->
dlci
;
conf
->
dlci
[
dlci_offset
]
=
chan_tmp
->
dlci
;
dlci_offset
++
;
dlci_offset
++
;
...
@@ -5005,7 +5012,8 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
...
@@ -5005,7 +5012,8 @@ static int check_dlci_config (sdla_t *card, fr_channel_t *chan)
printk
(
KERN_INFO
"Enabling Communications
\n
"
);
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_channel_t
*
chan_tmp
=
dev
->
priv
;
fr_init_dlci
(
card
,
chan_tmp
);
fr_init_dlci
(
card
,
chan_tmp
);
fr_add_dlci
(
card
,
chan_tmp
->
dlci
);
fr_add_dlci
(
card
,
chan_tmp
->
dlci
);
...
...
drivers/net/wan/sdla_ft1.c
View file @
41d0ff2e
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
typedef
struct
chdlc_private_area
typedef
struct
chdlc_private_area
{
{
netdevice_t
*
slave
;
struct
net_device
*
slave
;
sdla_t
*
card
;
sdla_t
*
card
;
int
TracingEnabled
;
/* For enabling Tracing */
int
TracingEnabled
;
/* For enabling Tracing */
unsigned
long
curr_trace_addr
;
/* Used for Tracing */
unsigned
long
curr_trace_addr
;
/* Used for Tracing */
...
...
drivers/net/wan/sdla_ppp.c
View file @
41d0ff2e
...
@@ -168,7 +168,7 @@
...
@@ -168,7 +168,7 @@
typedef
struct
ppp_private_area
typedef
struct
ppp_private_area
{
{
netdevice_t
*
slave
;
struct
net_device
*
slave
;
sdla_t
*
card
;
sdla_t
*
card
;
unsigned
long
router_start_time
;
/*router start time in sec */
unsigned
long
router_start_time
;
/*router start time in sec */
unsigned
long
tick_counter
;
/*used for 5 second counter*/
unsigned
long
tick_counter
;
/*used for 5 second counter*/
...
@@ -232,25 +232,26 @@ extern void enable_irq(unsigned int);
...
@@ -232,25 +232,26 @@ extern void enable_irq(unsigned int);
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
struct
wan_device
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
);
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
/* WANPIPE-specific entry points */
/* WANPIPE-specific entry points */
static
int
wpp_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
static
int
wpp_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
/* Network device interface */
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
static
int
if_header
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
,
static
int
if_header
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
);
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
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
);
/* PPP firmware interface functions */
/* PPP firmware interface functions */
...
@@ -279,10 +280,10 @@ static void retrigger_comm(sdla_t *card);
...
@@ -279,10 +280,10 @@ static void retrigger_comm(sdla_t *card);
static
int
read_info
(
sdla_t
*
card
);
static
int
read_info
(
sdla_t
*
card
);
static
int
read_connection_info
(
sdla_t
*
card
);
static
int
read_connection_info
(
sdla_t
*
card
);
static
void
remove_route
(
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
void
show_disc_cause
(
sdla_t
*
card
,
unsigned
cause
);
static
int
reply_udp
(
unsigned
char
*
data
,
unsigned
int
mbox_len
);
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
);
ppp_private_area_t
*
ppp_priv_area
);
static
void
init_ppp_tx_rx_buff
(
sdla_t
*
card
);
static
void
init_ppp_tx_rx_buff
(
sdla_t
*
card
);
static
int
intr_test
(
sdla_t
*
card
);
static
int
intr_test
(
sdla_t
*
card
);
...
@@ -291,12 +292,12 @@ static void init_ppp_priv_struct( ppp_private_area_t *ppp_priv_area);
...
@@ -291,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
void
init_global_statistics
(
sdla_t
*
card
);
static
int
tokenize
(
char
*
str
,
char
**
tokens
);
static
int
tokenize
(
char
*
str
,
char
**
tokens
);
static
char
*
strstrip
(
char
*
str
,
char
*
s
);
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
);
struct
sk_buff
*
skb
);
static
int
config_ppp
(
sdla_t
*
);
static
int
config_ppp
(
sdla_t
*
);
static
void
ppp_poll
(
netdevice_t
*
);
static
void
ppp_poll
(
struct
net_device
*
dev
);
static
void
trigger_ppp_poll
(
netdevice_t
*
);
static
void
trigger_ppp_poll
(
struct
net_device
*
dev
);
static
void
ppp_poll_delay
(
unsigned
long
dev_ptr
);
static
void
ppp_poll_delay
(
unsigned
long
dev_ptr
);
...
@@ -316,7 +317,7 @@ static void s508_lock (sdla_t *card, unsigned long *smp_flags);
...
@@ -316,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
void
s508_unlock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
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
,
ppp_private_area_t
*
ppp_priv_area
);
ppp_private_area_t
*
ppp_priv_area
);
static
unsigned
short
calc_checksum
(
char
*
data
,
int
len
);
static
unsigned
short
calc_checksum
(
char
*
data
,
int
len
);
static
void
disable_comm
(
sdla_t
*
card
);
static
void
disable_comm
(
sdla_t
*
card
);
...
@@ -448,7 +449,7 @@ int wpp_init(sdla_t *card, wandev_conf_t *conf)
...
@@ -448,7 +449,7 @@ int wpp_init(sdla_t *card, wandev_conf_t *conf)
static
int
update
(
struct
wan_device
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
volatile
ppp_private_area_t
*
ppp_priv_area
;
volatile
ppp_private_area_t
*
ppp_priv_area
;
ppp_flags_t
*
flags
=
card
->
flags
;
ppp_flags_t
*
flags
=
card
->
flags
;
unsigned
long
timeout
;
unsigned
long
timeout
;
...
@@ -505,7 +506,7 @@ static int update(struct wan_device *wandev)
...
@@ -505,7 +506,7 @@ static int update(struct wan_device *wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
...
@@ -624,7 +625,7 @@ static int new_if(struct wan_device *wandev, netdevice_t *dev,
...
@@ -624,7 +625,7 @@ static int new_if(struct wan_device *wandev, netdevice_t *dev,
/*============================================================================
/*============================================================================
* Delete logical channel.
* Delete logical channel.
*/
*/
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
)
{
{
return
0
;
return
0
;
}
}
...
@@ -683,7 +684,7 @@ static int wpp_exec(struct sdla *card, void *u_cmd, void *u_data)
...
@@ -683,7 +684,7 @@ static int wpp_exec(struct sdla *card, void *u_cmd, void *u_data)
* interface registration. Returning anything but zero will fail interface
* interface registration. Returning anything but zero will fail interface
* registration.
* 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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
@@ -732,7 +733,7 @@ static int if_init(netdevice_t *dev)
...
@@ -732,7 +733,7 @@ static int if_init(netdevice_t *dev)
*
*
* Return 0 if O.k. or errno.
* 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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
@@ -771,7 +772,7 @@ static int if_open (netdevice_t *dev)
...
@@ -771,7 +772,7 @@ static int if_open (netdevice_t *dev)
* o if this is the last open, then disable communications and interrupts.
* o if this is the last open, then disable communications and interrupts.
* o reset flags.
* 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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
@@ -792,7 +793,7 @@ static int if_close(netdevice_t *dev)
...
@@ -792,7 +793,7 @@ static int if_close(netdevice_t *dev)
*
*
* Return: media header length.
* 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
)
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
{
{
switch
(
type
)
switch
(
type
)
...
@@ -817,7 +818,7 @@ static int if_header(struct sk_buff *skb, netdevice_t *dev,
...
@@ -817,7 +818,7 @@ static int if_header(struct sk_buff *skb, netdevice_t *dev,
*/
*/
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
)
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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
@@ -829,7 +830,7 @@ static int if_rebuild_hdr (struct sk_buff *skb)
...
@@ -829,7 +830,7 @@ static int if_rebuild_hdr (struct sk_buff *skb)
/*============================================================================
/*============================================================================
* Handle transmit timeout event from netif watchdog
* 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
;
ppp_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -867,7 +868,7 @@ static void if_tx_timeout (netdevice_t *dev)
...
@@ -867,7 +868,7 @@ static void if_tx_timeout (netdevice_t *dev)
* 2. Setting tbusy flag will inhibit further transmit requests from the
* 2. Setting tbusy flag will inhibit further transmit requests from the
* protocol stack and can be used for flow control with protocol layer.
* 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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
sdla_t
*
card
=
ppp_priv_area
->
card
;
...
@@ -997,7 +998,7 @@ static int if_send (struct sk_buff *skb, netdevice_t *dev)
...
@@ -997,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
,
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
)
ppp_private_area_t
*
ppp_priv_area
)
{
{
int
udp_pkt_stored
=
0
;
int
udp_pkt_stored
=
0
;
...
@@ -1191,7 +1192,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
...
@@ -1191,7 +1192,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
* Get ethernet-style interface statistics.
* Get ethernet-style interface statistics.
* Return a pointer to struct net_device_stats.
* 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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
...
@@ -1571,7 +1572,7 @@ static void wpp_isr (sdla_t *card)
...
@@ -1571,7 +1572,7 @@ static void wpp_isr (sdla_t *card)
{
{
ppp_flags_t
*
flags
=
card
->
flags
;
ppp_flags_t
*
flags
=
card
->
flags
;
char
*
ptr
=
&
flags
->
iflag
;
char
*
ptr
=
&
flags
->
iflag
;
netdevice_t
*
dev
=
card
->
wandev
.
dev
;
struct
net_device
*
dev
=
card
->
wandev
.
dev
;
int
i
;
int
i
;
card
->
in_isr
=
1
;
card
->
in_isr
=
1
;
...
@@ -1651,7 +1652,7 @@ static void wpp_isr (sdla_t *card)
...
@@ -1651,7 +1652,7 @@ static void wpp_isr (sdla_t *card)
static
void
rx_intr
(
sdla_t
*
card
)
static
void
rx_intr
(
sdla_t
*
card
)
{
{
ppp_buf_ctl_t
*
rxbuf
=
card
->
rxmb
;
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
;
ppp_private_area_t
*
ppp_priv_area
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
unsigned
len
;
unsigned
len
;
...
@@ -1791,7 +1792,7 @@ static void rx_intr(sdla_t *card)
...
@@ -1791,7 +1792,7 @@ static void rx_intr(sdla_t *card)
void
event_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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
volatile
ppp_flags_t
*
flags
=
card
->
flags
;
volatile
ppp_flags_t
*
flags
=
card
->
flags
;
...
@@ -1910,7 +1911,7 @@ void event_intr (sdla_t *card)
...
@@ -1910,7 +1911,7 @@ void event_intr (sdla_t *card)
void
timer_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_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
ppp_flags_t
*
flags
=
card
->
flags
;
ppp_flags_t
*
flags
=
card
->
flags
;
...
@@ -2107,7 +2108,7 @@ static int handle_IPXWAN(unsigned char *sendpacket, char *devname, unsigned char
...
@@ -2107,7 +2108,7 @@ static int handle_IPXWAN(unsigned char *sendpacket, char *devname, unsigned char
static
void
process_route
(
sdla_t
*
card
)
static
void
process_route
(
sdla_t
*
card
)
{
{
ppp_flags_t
*
flags
=
card
->
flags
;
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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
if
((
card
->
u
.
p
.
ip_mode
==
WANOPT_PPP_PEER
)
&&
if
((
card
->
u
.
p
.
ip_mode
==
WANOPT_PPP_PEER
)
&&
...
@@ -2149,7 +2150,7 @@ static void process_route (sdla_t *card)
...
@@ -2149,7 +2150,7 @@ static void process_route (sdla_t *card)
*/
*/
static
void
retrigger_comm
(
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
))
{
if
(
dev
&&
((
jiffies
-
card
->
state_tick
)
>
HOLD_DOWN_TIME
))
{
...
@@ -2166,7 +2167,7 @@ static void retrigger_comm(sdla_t *card)
...
@@ -2166,7 +2167,7 @@ static void retrigger_comm(sdla_t *card)
/*============================================================================
/*============================================================================
* Configure S508 adapter.
* 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
;
ppp508_conf_t
cfg
;
struct
in_device
*
in_dev
=
dev
->
ip_ptr
;
struct
in_device
*
in_dev
=
dev
->
ip_ptr
;
...
@@ -2338,7 +2339,7 @@ static void show_disc_cause(sdla_t *card, unsigned cause)
...
@@ -2338,7 +2339,7 @@ static void show_disc_cause(sdla_t *card, unsigned cause)
/*=============================================================================
/*=============================================================================
* Process UDP call of type PTPIPEAB.
* 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
)
ppp_private_area_t
*
ppp_priv_area
)
{
{
unsigned
char
buf2
[
5
];
unsigned
char
buf2
[
5
];
...
@@ -2849,7 +2850,7 @@ static void init_ppp_tx_rx_buff( sdla_t *card )
...
@@ -2849,7 +2850,7 @@ static void init_ppp_tx_rx_buff( sdla_t *card )
*/
*/
static
int
read_info
(
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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
int
err
;
int
err
;
...
@@ -2898,7 +2899,7 @@ static int read_info( sdla_t *card )
...
@@ -2898,7 +2899,7 @@ static int read_info( sdla_t *card )
static
void
remove_route
(
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
;
long
ip_addr
;
int
err
;
int
err
;
...
@@ -3024,7 +3025,7 @@ static int udp_pkt_type( struct sk_buff *skb, sdla_t *card )
...
@@ -3024,7 +3025,7 @@ static int udp_pkt_type( struct sk_buff *skb, sdla_t *card )
* multicast source IP address.
* 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
)
struct
sk_buff
*
skb
)
{
{
u32
src_ip_addr
;
u32
src_ip_addr
;
...
@@ -3075,7 +3076,7 @@ void s508_unlock (sdla_t *card, unsigned long *smp_flags)
...
@@ -3075,7 +3076,7 @@ void s508_unlock (sdla_t *card, unsigned long *smp_flags)
static
int
read_connection_info
(
sdla_t
*
card
)
static
int
read_connection_info
(
sdla_t
*
card
)
{
{
ppp_mbox_t
*
mb
=
card
->
mbox
;
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
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
ppp508_connect_info_t
*
ppp508_connect_info
;
ppp508_connect_info_t
*
ppp508_connect_info
;
int
err
;
int
err
;
...
@@ -3124,7 +3125,7 @@ static int read_connection_info (sdla_t *card)
...
@@ -3124,7 +3125,7 @@ static int read_connection_info (sdla_t *card)
static
int
config_ppp
(
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_flags_t
*
flags
=
card
->
flags
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
ppp_private_area_t
*
ppp_priv_area
=
dev
->
priv
;
...
@@ -3232,7 +3233,7 @@ static int config_ppp (sdla_t *card)
...
@@ -3232,7 +3233,7 @@ static int config_ppp (sdla_t *card)
* trigger_ppp_poll() function is used to kick
* trigger_ppp_poll() function is used to kick
* the ppp_poll routine.
* 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
;
ppp_private_area_t
*
ppp_priv_area
;
sdla_t
*
card
;
sdla_t
*
card
;
...
@@ -3377,7 +3378,7 @@ static void ppp_poll (netdevice_t *dev)
...
@@ -3377,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
;
ppp_private_area_t
*
ppp_priv_area
;
if
((
ppp_priv_area
=
dev
->
priv
)
!=
NULL
){
if
((
ppp_priv_area
=
dev
->
priv
)
!=
NULL
){
...
@@ -3399,7 +3400,7 @@ static void trigger_ppp_poll (netdevice_t *dev)
...
@@ -3399,7 +3400,7 @@ static void trigger_ppp_poll (netdevice_t *dev)
static
void
ppp_poll_delay
(
unsigned
long
dev_ptr
)
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
);
trigger_ppp_poll
(
dev
);
}
}
...
...
drivers/net/wan/sdla_x25.c
View file @
41d0ff2e
...
@@ -241,7 +241,7 @@ static void dbg_kfree(void * v, int line) {
...
@@ -241,7 +241,7 @@ static void dbg_kfree(void * v, int line) {
*
*
* Assumptions:
* 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
* we create for each network interface to keep
* the rest of X.25 channel-specific data.
* the rest of X.25 channel-specific data.
*
*
...
@@ -271,7 +271,7 @@ typedef struct x25_channel
...
@@ -271,7 +271,7 @@ typedef struct x25_channel
atomic_t
bh_buff_used
;
atomic_t
bh_buff_used
;
sdla_t
*
card
;
/* -> owner */
sdla_t
*
card
;
/* -> owner */
netdevice_t
*
dev
;
/* -> bound devce */
struct
net_device
*
dev
;
/* -> bound devce */
int
ch_idx
;
int
ch_idx
;
unsigned
char
enable_IPX
;
unsigned
char
enable_IPX
;
...
@@ -331,9 +331,9 @@ typedef struct x25_call_info
...
@@ -331,9 +331,9 @@ typedef struct x25_call_info
* called by the WAN router module.
* called by the WAN router module.
*/
*/
static
int
update
(
struct
wan_device
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
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
(
sdla_t
*
card
);
static
void
disable_comm_shutdown
(
sdla_t
*
card
);
static
void
disable_comm_shutdown
(
sdla_t
*
card
);
...
@@ -343,24 +343,24 @@ static void disable_comm_shutdown(sdla_t *card);
...
@@ -343,24 +343,24 @@ static void disable_comm_shutdown(sdla_t *card);
* WANPIPE-specific entry points
* WANPIPE-specific entry points
*/
*/
static
int
wpx_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
static
int
wpx_exec
(
struct
sdla
*
card
,
void
*
u_cmd
,
void
*
u_data
);
static
void
x25api_bh
(
netdevice_t
*
);
static
void
x25api_bh
(
struct
net_device
*
dev
);
static
int
x25api_bh_cleanup
(
netdevice_t
*
);
static
int
x25api_bh_cleanup
(
struct
net_device
*
dev
);
static
int
bh_enqueue
(
netdevice_t
*
,
struct
sk_buff
*
);
static
int
bh_enqueue
(
struct
net_device
*
dev
,
struct
sk_buff
*
skb
);
/*=================================================
/*=================================================
* Network device interface
* Network device interface
*/
*/
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_close
(
struct
net_device
*
dev
);
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
);
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
);
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
);
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
);
static
int
if_send
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
static
int
if_send
(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
);
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
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
* Interrupt handlers
...
@@ -373,8 +373,9 @@ static void event_intr (sdla_t *);
...
@@ -373,8 +373,9 @@ static void event_intr (sdla_t *);
static
void
spur_intr
(
sdla_t
*
);
static
void
spur_intr
(
sdla_t
*
);
static
void
timer_intr
(
sdla_t
*
);
static
void
timer_intr
(
sdla_t
*
);
static
int
tx_intr_send
(
sdla_t
*
,
netdevice_t
*
);
static
int
tx_intr_send
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
netdevice_t
*
move_dev_to_next
(
sdla_t
*
,
netdevice_t
*
);
static
struct
net_device
*
move_dev_to_next
(
sdla_t
*
card
,
struct
net_device
*
dev
);
/*=================================================
/*=================================================
* Background polling routines
* Background polling routines
...
@@ -425,35 +426,41 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb);
...
@@ -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
connect
(
sdla_t
*
card
);
static
int
disconnect
(
sdla_t
*
card
);
static
int
disconnect
(
sdla_t
*
card
);
static
netdevice_t
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
unsigned
lcn
);
static
struct
net_device
*
get_dev_by_lcn
(
struct
wan_device
*
wandev
,
static
int
chan_connect
(
netdevice_t
*
dev
);
unsigned
lcn
);
static
int
chan_disc
(
netdevice_t
*
dev
);
static
int
chan_connect
(
struct
net_device
*
dev
);
static
void
set_chan_state
(
netdevice_t
*
dev
,
int
state
);
static
int
chan_disc
(
struct
net_device
*
dev
);
static
int
chan_send
(
netdevice_t
*
,
void
*
,
unsigned
,
unsigned
char
);
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
char
bps_to_speed_code
(
unsigned
long
bps
);
static
unsigned
int
dec_to_uint
(
unsigned
char
*
str
,
int
len
);
static
unsigned
int
dec_to_uint
(
unsigned
char
*
str
,
int
len
);
static
unsigned
int
hex_to_uint
(
unsigned
char
*
,
int
);
static
unsigned
int
hex_to_uint
(
unsigned
char
*
,
int
);
static
void
parse_call_info
(
unsigned
char
*
,
x25_call_info_t
*
);
static
void
parse_call_info
(
unsigned
char
*
,
x25_call_info_t
*
);
static
netdevice_t
*
find_channel
(
sdla_t
*
,
unsigned
);
static
struct
net_device
*
find_channel
(
sdla_t
*
card
,
unsigned
lcn
);
static
void
bind_lcn_to_dev
(
sdla_t
*
,
netdevice_t
*
,
unsigned
);
static
void
bind_lcn_to_dev
(
sdla_t
*
card
,
struct
net_device
*
dev
,
unsigned
lcn
);
static
void
setup_for_delayed_transmit
(
netdevice_t
*
,
void
*
,
unsigned
);
static
void
setup_for_delayed_transmit
(
struct
net_device
*
dev
,
void
*
buf
,
unsigned
len
);
/*=================================================
/*=================================================
* X25 API Functions
* 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
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
api_incoming_call
(
sdla_t
*
,
TX25Mbox
*
,
int
);
static
int
alloc_and_init_skb_buf
(
sdla_t
*
,
struct
sk_buff
**
,
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
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
int
timer_intr_cmd_exec
(
sdla_t
*
card
);
static
void
api_oob_event
(
sdla_t
*
card
,
TX25Mbox
*
mbox
);
static
void
api_oob_event
(
sdla_t
*
card
,
TX25Mbox
*
mbox
);
static
int
check_bad_command
(
sdla_t
*
,
netdevice_t
*
);
static
int
check_bad_command
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
int
channel_disconnect
(
sdla_t
*
,
netdevice_t
*
);
static
int
channel_disconnect
(
sdla_t
*
card
,
struct
net_device
*
dev
);
static
void
hdlc_link_down
(
sdla_t
*
);
static
void
hdlc_link_down
(
sdla_t
*
);
/*=================================================
/*=================================================
...
@@ -464,7 +471,9 @@ static int udp_pkt_type( struct sk_buff *, 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
int
reply_udp
(
unsigned
char
*
,
unsigned
int
);
static
void
init_x25_channel_struct
(
x25_channel_t
*
);
static
void
init_x25_channel_struct
(
x25_channel_t
*
);
static
void
init_global_statistics
(
sdla_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
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
...
@@ -895,7 +904,7 @@ static int update(struct wan_device* wandev)
...
@@ -895,7 +904,7 @@ static int update(struct wan_device* wandev)
* Return: 0 Ok
* Return: 0 Ok
* <0 Failed (channel will not be created)
* <0 Failed (channel will not be created)
*/
*/
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
)
wanif_conf_t
*
conf
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
...
@@ -1030,7 +1039,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* dev,
...
@@ -1030,7 +1039,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* dev,
//FIXME Del IF Should be taken out now.
//FIXME Del IF Should be taken out now.
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
)
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
)
{
{
return
0
;
return
0
;
}
}
...
@@ -1096,7 +1105,7 @@ static void disable_comm(sdla_t* card)
...
@@ -1096,7 +1105,7 @@ static void disable_comm(sdla_t* card)
*
*
* Return: 0 Ok : Void function.
* 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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1168,7 +1177,7 @@ static int if_init (netdevice_t* dev)
...
@@ -1168,7 +1177,7 @@ static int if_init (netdevice_t* dev)
* <0 Failur: Interface will not come up.
* <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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1261,7 +1270,7 @@ static int if_open (netdevice_t* dev)
...
@@ -1261,7 +1270,7 @@ static int if_open (netdevice_t* dev)
* Return: 0 Ok
* Return: 0 Ok
* <0 Failure: Interface will not exit properly.
* <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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1319,8 +1328,9 @@ static int if_close (netdevice_t* dev)
...
@@ -1319,8 +1328,9 @@ static int if_close (netdevice_t* dev)
* Return: media header length.
* 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
)
unsigned
short
type
,
void
*
daddr
,
void
*
saddr
,
unsigned
len
)
{
{
x25_channel_t
*
chan
=
dev
->
priv
;
x25_channel_t
*
chan
=
dev
->
priv
;
int
hdr_len
=
dev
->
hard_header_len
;
int
hdr_len
=
dev
->
hard_header_len
;
...
@@ -1345,7 +1355,7 @@ static int if_header (struct sk_buff* skb, netdevice_t* dev,
...
@@ -1345,7 +1355,7 @@ static int if_header (struct sk_buff* skb, netdevice_t* dev,
static
int
if_rebuild_hdr
(
struct
sk_buff
*
skb
)
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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1358,7 +1368,7 @@ static int if_rebuild_hdr (struct sk_buff* skb)
...
@@ -1358,7 +1368,7 @@ static int if_rebuild_hdr (struct sk_buff* skb)
/*============================================================================
/*============================================================================
* Handle transmit timeout event from netif watchdog
* 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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1395,7 +1405,7 @@ static void if_tx_timeout (netdevice_t *dev)
...
@@ -1395,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1528,8 +1538,8 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
...
@@ -1528,8 +1538,8 @@ static int if_send (struct sk_buff* skb, netdevice_t* dev)
* interrupt.
* 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
)
unsigned
len
)
{
{
x25_channel_t
*
chan
=
dev
->
priv
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -1580,7 +1590,7 @@ static void setup_for_delayed_transmit (netdevice_t* dev, void* buf,
...
@@ -1580,7 +1590,7 @@ static void setup_for_delayed_transmit (netdevice_t* dev, void* buf,
* Return a pointer to struct enet_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
)
{
{
x25_channel_t
*
chan
=
dev
->
priv
;
x25_channel_t
*
chan
=
dev
->
priv
;
...
@@ -1676,7 +1686,7 @@ static void rx_intr (sdla_t* card)
...
@@ -1676,7 +1686,7 @@ static void rx_intr (sdla_t* card)
{
{
TX25Mbox
*
rxmb
=
card
->
rxmb
;
TX25Mbox
*
rxmb
=
card
->
rxmb
;
unsigned
lcn
=
rxmb
->
cmd
.
lcn
;
unsigned
lcn
=
rxmb
->
cmd
.
lcn
;
netdevice_t
*
dev
=
find_channel
(
card
,
lcn
);
struct
net_device
*
dev
=
find_channel
(
card
,
lcn
);
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
struct
sk_buff
*
skb
=
NULL
;
struct
sk_buff
*
skb
=
NULL
;
...
@@ -1774,7 +1784,8 @@ static void rx_intr (sdla_t* card)
...
@@ -1774,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
;
void
*
bufptr
;
TX25Mbox
*
rxmb
=
card
->
rxmb
;
TX25Mbox
*
rxmb
=
card
->
rxmb
;
...
@@ -1884,7 +1895,7 @@ static int wanpipe_pull_data_in_skb (sdla_t *card, netdevice_t *dev, struct sk_b
...
@@ -1884,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
)
static
void
tx_intr
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
TX25Status
*
status
=
card
->
flags
;
TX25Status
*
status
=
card
->
flags
;
unsigned
char
more_to_tx
=
0
;
unsigned
char
more_to_tx
=
0
;
x25_channel_t
*
chan
=
NULL
;
x25_channel_t
*
chan
=
NULL
;
...
@@ -1978,14 +1989,13 @@ static void tx_intr (sdla_t* card)
...
@@ -1978,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
(
card
->
u
.
x
.
no_dev
!=
1
){
if
(
*
((
netdevice_t
**
)
dev
->
priv
)
==
NULL
){
if
(
!*
((
struct
net_device
**
)
dev
->
priv
))
return
card
->
wandev
.
dev
;
return
card
->
wandev
.
dev
;
}
else
{
else
return
*
((
netdevice_t
**
)
dev
->
priv
);
return
*
((
struct
net_device
**
)
dev
->
priv
);
}
}
}
return
dev
;
return
dev
;
}
}
...
@@ -1996,7 +2006,7 @@ netdevice_t * move_dev_to_next (sdla_t *card, netdevice_t *dev)
...
@@ -1996,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
...
@@ -2059,7 +2069,7 @@ static void timer_intr (sdla_t *card)
...
@@ -2059,7 +2069,7 @@ static void timer_intr (sdla_t *card)
}
else
if
(
card
->
u
.
x
.
timer_int_enabled
&
TMR_INT_ENABLED_POLL_ACTIVE
)
{
}
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
;
x25_channel_t
*
chan
=
NULL
;
if
(
!
dev
){
if
(
!
dev
){
...
@@ -2080,7 +2090,7 @@ static void timer_intr (sdla_t *card)
...
@@ -2080,7 +2090,7 @@ static void timer_intr (sdla_t *card)
wanpipe_set_state
(
card
,
WAN_CONNECTED
);
wanpipe_set_state
(
card
,
WAN_CONNECTED
);
if
(
card
->
u
.
x
.
LAPB_hdlc
){
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
);
set_chan_state
(
dev
,
WAN_CONNECTED
);
send_delayed_cmd_result
(
card
,
dev
,
card
->
mbox
);
send_delayed_cmd_result
(
card
,
dev
,
card
->
mbox
);
}
}
...
@@ -2136,7 +2146,7 @@ static void status_intr (sdla_t* card)
...
@@ -2136,7 +2146,7 @@ static void status_intr (sdla_t* card)
TX25Mbox
*
mbox
=
card
->
mbox
;
TX25Mbox
*
mbox
=
card
->
mbox
;
TX25ModemStatus
*
modem_status
;
TX25ModemStatus
*
modem_status
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
int
err
;
int
err
;
...
@@ -2165,7 +2175,8 @@ static void status_intr (sdla_t* card)
...
@@ -2165,7 +2175,8 @@ static void status_intr (sdla_t* card)
mbox
->
cmd
.
result
=
0x08
;
mbox
->
cmd
.
result
=
0x08
;
/* Send a OOB to all connected sockets */
/* 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
;
chan
=
dev
->
priv
;
if
(
chan
->
common
.
usedby
==
API
){
if
(
chan
->
common
.
usedby
==
API
){
send_oob_msg
(
card
,
dev
,
mbox
);
send_oob_msg
(
card
,
dev
,
mbox
);
...
@@ -2295,7 +2306,7 @@ static void poll_connecting (sdla_t* card)
...
@@ -2295,7 +2306,7 @@ static void poll_connecting (sdla_t* card)
static
void
poll_disconnected
(
sdla_t
*
card
)
static
void
poll_disconnected
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
TX25Status
*
status
=
card
->
flags
;
TX25Status
*
status
=
card
->
flags
;
...
@@ -2332,10 +2343,11 @@ static void poll_disconnected (sdla_t* card)
...
@@ -2332,10 +2343,11 @@ static void poll_disconnected (sdla_t* card)
static
void
poll_active
(
sdla_t
*
card
)
static
void
poll_active
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
TX25Status
*
status
=
card
->
flags
;
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
;
x25_channel_t
*
chan
=
dev
->
priv
;
/* If SVC has been idle long enough, close virtual circuit */
/* If SVC has been idle long enough, close virtual circuit */
...
@@ -3104,7 +3116,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3104,7 +3116,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
{
{
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
int
new_lcn
=
mb
->
cmd
.
lcn
;
int
new_lcn
=
mb
->
cmd
.
lcn
;
netdevice_t
*
dev
=
get_dev_by_lcn
(
wandev
,
new_lcn
);
struct
net_device
*
dev
=
get_dev_by_lcn
(
wandev
,
new_lcn
);
x25_channel_t
*
chan
=
NULL
;
x25_channel_t
*
chan
=
NULL
;
int
accept
=
0
;
/* set to '1' if o.k. to accept call */
int
accept
=
0
;
/* set to '1' if o.k. to accept call */
unsigned
int
user_data
;
unsigned
int
user_data
;
...
@@ -3156,7 +3168,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3156,7 +3168,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
user_data
=
hex_to_uint
(
info
->
user
,
2
);
user_data
=
hex_to_uint
(
info
->
user
,
2
);
/* Find available channel */
/* 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
;
chan
=
dev
->
priv
;
if
(
chan
->
common
.
usedby
==
API
)
if
(
chan
->
common
.
usedby
==
API
)
...
@@ -3253,7 +3265,7 @@ static int incoming_call (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3253,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
)
static
int
call_accepted
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
{
{
unsigned
new_lcn
=
mb
->
cmd
.
lcn
;
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
;
x25_channel_t
*
chan
;
if
(
dev
==
NULL
){
if
(
dev
==
NULL
){
...
@@ -3293,7 +3305,7 @@ static int call_accepted (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3293,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
)
static
int
call_cleared
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
{
{
unsigned
new_lcn
=
mb
->
cmd
.
lcn
;
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
;
x25_channel_t
*
chan
;
unsigned
char
old_state
;
unsigned
char
old_state
;
...
@@ -3338,7 +3350,7 @@ static int call_cleared (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3338,7 +3350,7 @@ static int call_cleared (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
static
int
restart_event
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
static
int
restart_event
(
sdla_t
*
card
,
int
cmd
,
int
lcn
,
TX25Mbox
*
mb
)
{
{
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
unsigned
char
old_state
;
unsigned
char
old_state
;
...
@@ -3347,7 +3359,7 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3347,7 +3359,7 @@ static int restart_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
card
->
devname
,
mb
->
cmd
.
cause
,
mb
->
cmd
.
diagn
);
card
->
devname
,
mb
->
cmd
.
cause
,
mb
->
cmd
.
diagn
);
/* down all logical channels */
/* 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
;
chan
=
dev
->
priv
;
old_state
=
chan
->
common
.
state
;
old_state
=
chan
->
common
.
state
;
...
@@ -3378,7 +3390,7 @@ static int timeout_event (sdla_t* card, int cmd, int lcn, TX25Mbox* mb)
...
@@ -3378,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 */
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
"
,
printk
(
KERN_INFO
"%s: X.25 call timed timeout on LCN %d!
\n
"
,
card
->
devname
,
new_lcn
);
card
->
devname
,
new_lcn
);
...
@@ -3448,11 +3460,12 @@ static int disconnect (sdla_t* card)
...
@@ -3448,11 +3460,12 @@ static int disconnect (sdla_t* card)
* Find network device by its channel number.
* Find network device by its channel number.
*/
*/
static
netdevice_t
*
get_dev_by_lcn
(
struct
wan_device
*
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
)
if
(((
x25_channel_t
*
)
dev
->
priv
)
->
common
.
lcn
==
lcn
)
break
;
break
;
return
dev
;
return
dev
;
...
@@ -3468,7 +3481,7 @@ static netdevice_t* get_dev_by_lcn(struct wan_device* wandev, unsigned lcn)
...
@@ -3468,7 +3481,7 @@ static netdevice_t* get_dev_by_lcn(struct wan_device* wandev, unsigned lcn)
* <0 failure
* <0 failure
*/
*/
static
int
chan_connect
(
netdevice_t
*
dev
)
static
int
chan_connect
(
struct
net_device
*
dev
)
{
{
x25_channel_t
*
chan
=
dev
->
priv
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -3501,7 +3514,7 @@ static int chan_connect (netdevice_t* dev)
...
@@ -3501,7 +3514,7 @@ static int chan_connect (netdevice_t* dev)
* o if SVC then clear X.25 call
* 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
;
x25_channel_t
*
chan
=
dev
->
priv
;
...
@@ -3524,7 +3537,7 @@ static int chan_disc (netdevice_t* dev)
...
@@ -3524,7 +3537,7 @@ static int chan_disc (netdevice_t* dev)
* Set logical channel state.
* 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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -3614,7 +3627,8 @@ static void set_chan_state (netdevice_t* dev, int state)
...
@@ -3614,7 +3627,8 @@ static void set_chan_state (netdevice_t* dev, int state)
* to the router.
* 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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -4081,7 +4095,7 @@ static void switch_net_numbers(unsigned char *sendpacket, unsigned long network_
...
@@ -4081,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
){
if
(
card
->
u
.
x
.
LAPB_hdlc
){
...
@@ -4128,7 +4142,7 @@ netdevice_t * find_channel(sdla_t *card, unsigned lcn)
...
@@ -4128,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
...
@@ -4155,7 +4169,7 @@ void bind_lcn_to_dev (sdla_t *card, netdevice_t *dev,unsigned lcn)
...
@@ -4155,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -4231,7 +4245,7 @@ static void x25api_bh (netdevice_t * dev)
...
@@ -4231,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -4270,7 +4284,7 @@ static int x25api_bh_cleanup (netdevice_t *dev)
...
@@ -4270,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -4310,7 +4324,7 @@ static int bh_enqueue (netdevice_t *dev, struct sk_buff *skb)
...
@@ -4310,7 +4324,7 @@ static int bh_enqueue (netdevice_t *dev, struct sk_buff *skb)
static
int
timer_intr_cmd_exec
(
sdla_t
*
card
)
static
int
timer_intr_cmd_exec
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
unsigned
char
more_to_exec
=
0
;
unsigned
char
more_to_exec
=
0
;
volatile
x25_channel_t
*
chan
=
NULL
;
volatile
x25_channel_t
*
chan
=
NULL
;
int
i
=
0
,
bad_cmd
=
0
,
err
=
0
;
int
i
=
0
,
bad_cmd
=
0
,
err
=
0
;
...
@@ -4437,7 +4451,8 @@ static int timer_intr_cmd_exec (sdla_t* card)
...
@@ -4437,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
;
TX25Mbox
*
mbox
=
card
->
mbox
;
int
err
;
int
err
;
...
@@ -4670,7 +4685,8 @@ static int api_incoming_call (sdla_t* card, TX25Mbox *mbox, int lcn)
...
@@ -4670,7 +4685,8 @@ static int api_incoming_call (sdla_t* card, TX25Mbox *mbox, int lcn)
* the result to a waiting sock.
* 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
;
x25_channel_t
*
chan
=
dev
->
priv
;
mbox_cmd_t
*
usr_cmd
=
(
mbox_cmd_t
*
)
chan
->
common
.
mbox
;
mbox_cmd_t
*
usr_cmd
=
(
mbox_cmd_t
*
)
chan
->
common
.
mbox
;
...
@@ -4725,7 +4741,7 @@ static void send_delayed_cmd_result(sdla_t *card, netdevice_t *dev, TX25Mbox* mb
...
@@ -4725,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
)
static
int
clear_confirm_event
(
sdla_t
*
card
,
TX25Mbox
*
mb
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
unsigned
char
old_state
;
unsigned
char
old_state
;
...
@@ -4773,7 +4789,7 @@ static int clear_confirm_event (sdla_t *card, TX25Mbox* mb)
...
@@ -4773,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
mbox_cmd_t
*
usr_cmd
=
(
mbox_cmd_t
*
)
chan
->
common
.
mbox
;
mbox_cmd_t
*
usr_cmd
=
(
mbox_cmd_t
*
)
chan
->
common
.
mbox
;
...
@@ -4871,7 +4887,7 @@ static int alloc_and_init_skb_buf (sdla_t *card, struct sk_buff **skb, int len)
...
@@ -4871,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
)
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
;
x25_channel_t
*
chan
;
if
(
!
dev
)
if
(
!
dev
)
...
@@ -4887,7 +4903,7 @@ static void api_oob_event (sdla_t *card,TX25Mbox *mbox)
...
@@ -4887,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
;
int
err
;
...
@@ -4961,7 +4977,7 @@ static void hdlc_link_down (sdla_t *card)
...
@@ -4961,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
;
x25_channel_t
*
chan
=
dev
->
priv
;
int
bad_cmd
=
0
;
int
bad_cmd
=
0
;
...
@@ -5014,7 +5030,7 @@ static int process_udp_mgmt_pkt(sdla_t *card)
...
@@ -5014,7 +5030,7 @@ static int process_udp_mgmt_pkt(sdla_t *card)
TX25Mbox
*
mbox
=
card
->
mbox
;
TX25Mbox
*
mbox
=
card
->
mbox
;
int
err
;
int
err
;
int
udp_mgmt_req_valid
=
1
;
int
udp_mgmt_req_valid
=
1
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
x25_channel_t
*
chan
;
x25_channel_t
*
chan
;
unsigned
short
lcn
;
unsigned
short
lcn
;
struct
timeval
tv
;
struct
timeval
tv
;
...
@@ -5338,7 +5354,8 @@ unsigned short calc_checksum (char *data, int len)
...
@@ -5338,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
,
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
;
int
udp_pkt_stored
=
0
;
...
...
drivers/net/wan/sdlamain.c
View file @
41d0ff2e
...
@@ -64,8 +64,6 @@
...
@@ -64,8 +64,6 @@
#include <linux/sdlapci.h>
#include <linux/sdlapci.h>
#include <linux/if_wanpipe_common.h>
#include <linux/if_wanpipe_common.h>
#define netdevice_t struct net_device
#include <asm/uaccess.h>
/* kernel <-> user copy */
#include <asm/uaccess.h>
/* kernel <-> user copy */
#include <linux/inetdevice.h>
#include <linux/inetdevice.h>
...
@@ -1255,7 +1253,7 @@ void wanpipe_mark_bh (void)
...
@@ -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
;
wanpipe_common_t
*
chan
=
dev
->
priv
;
...
@@ -1268,7 +1266,7 @@ void wakeup_sk_bh (netdevice_t *dev)
...
@@ -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
;
struct
ifreq
if_info
;
mm_segment_t
fs
=
get_fs
();
mm_segment_t
fs
=
get_fs
();
...
@@ -1285,7 +1283,7 @@ int change_dev_flags (netdevice_t *dev, unsigned flags)
...
@@ -1285,7 +1283,7 @@ int change_dev_flags (netdevice_t *dev, unsigned flags)
return
err
;
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
;
struct
in_ifaddr
*
ifaddr
;
...
@@ -1323,7 +1321,7 @@ unsigned long get_ip_address (netdevice_t *dev, int option)
...
@@ -1323,7 +1321,7 @@ unsigned long get_ip_address (netdevice_t *dev, int option)
return
0
;
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
;
mm_segment_t
oldfs
;
struct
rtentry
route
;
struct
rtentry
route
;
...
...
drivers/net/wan/wanpipe_multppp.c
View file @
41d0ff2e
...
@@ -131,18 +131,18 @@ extern void enable_irq(unsigned int);
...
@@ -131,18 +131,18 @@ extern void enable_irq(unsigned int);
/****** Function Prototypes *************************************************/
/****** Function Prototypes *************************************************/
/* WAN link driver entry points. These are called by the WAN router module. */
/* WAN link driver entry points. These are called by the WAN router module. */
static
int
update
(
struct
wan_device
*
wandev
);
static
int
update
(
struct
wan_device
*
wandev
);
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
,
wanif_conf_t
*
conf
);
wanif_conf_t
*
conf
);
static
int
del_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
dev
);
static
int
del_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
dev
);
/* Network device interface */
/* Network device interface */
static
int
if_init
(
netdevice_t
*
dev
);
static
int
if_init
(
struct
net_device
*
dev
);
static
int
if_open
(
netdevice_t
*
dev
);
static
int
if_open
(
struct
net_device
*
dev
);
static
int
if_close
(
netdevice_t
*
dev
);
static
int
if_close
(
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
);
static
struct
net_device_stats
*
if_stats
(
netdevice_t
*
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 */
/* CHDLC Firmware interface functions */
static
int
chdlc_configure
(
sdla_t
*
card
,
void
*
data
);
static
int
chdlc_configure
(
sdla_t
*
card
,
void
*
data
);
...
@@ -158,7 +158,7 @@ static int config_chdlc (sdla_t *card);
...
@@ -158,7 +158,7 @@ static int config_chdlc (sdla_t *card);
/* Miscellaneous CHDLC Functions */
/* Miscellaneous CHDLC Functions */
static
int
set_chdlc_config
(
sdla_t
*
card
);
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
chdlc_error
(
sdla_t
*
card
,
int
err
,
CHDLC_MAILBOX_STRUCT
*
mb
);
static
int
process_chdlc_exception
(
sdla_t
*
card
);
static
int
process_chdlc_exception
(
sdla_t
*
card
);
static
int
process_global_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 );
...
@@ -176,14 +176,14 @@ static int reply_udp( unsigned char *data, unsigned int mbox_len );
static
int
intr_test
(
sdla_t
*
card
);
static
int
intr_test
(
sdla_t
*
card
);
static
int
udp_pkt_type
(
struct
sk_buff
*
skb
,
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
,
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
);
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
);
chdlc_private_area_t
*
chdlc_priv_area
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
static
unsigned
short
calc_checksum
(
char
*
,
int
);
static
void
s508_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
static
void
s508_lock
(
sdla_t
*
card
,
unsigned
long
*
smp_flags
);
static
void
s508_unlock
(
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
;
static
int
Intr_test_counter
;
...
@@ -459,7 +459,7 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
...
@@ -459,7 +459,7 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
static
int
update
(
struct
wan_device
*
wandev
)
static
int
update
(
struct
wan_device
*
wandev
)
{
{
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
volatile
chdlc_private_area_t
*
chdlc_priv_area
;
volatile
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
;
SHARED_MEMORY_INFO_STRUCT
*
flags
;
unsigned
long
timeout
;
unsigned
long
timeout
;
...
@@ -522,12 +522,12 @@ static int update(struct wan_device* wandev)
...
@@ -522,12 +522,12 @@ static int update(struct wan_device* wandev)
* Return: 0 o.k.
* Return: 0 o.k.
* < 0 failure (channel will not be created)
* < 0 failure (channel will not be created)
*/
*/
static
int
new_if
(
struct
wan_device
*
wandev
,
netdevice_t
*
pdev
,
static
int
new_if
(
struct
wan_device
*
wandev
,
struct
net_device
*
pdev
,
wanif_conf_t
*
conf
)
wanif_conf_t
*
conf
)
{
{
struct
ppp_device
*
pppdev
=
(
struct
ppp_device
*
)
pdev
;
struct
ppp_device
*
pppdev
=
(
struct
ppp_device
*
)
pdev
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
struct
sppp
*
sp
;
struct
sppp
*
sp
;
sdla_t
*
card
=
wandev
->
private
;
sdla_t
*
card
=
wandev
->
private
;
chdlc_private_area_t
*
chdlc_priv_area
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
@@ -617,7 +617,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* pdev,
...
@@ -617,7 +617,7 @@ static int new_if(struct wan_device* wandev, netdevice_t* pdev,
/*============================================================================
/*============================================================================
* Delete logical channel.
* Delete logical channel.
*/
*/
static
int
del_if
(
struct
wan_device
*
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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -652,8 +652,8 @@ static int del_if(struct wan_device* wandev, netdevice_t* dev)
...
@@ -652,8 +652,8 @@ static int del_if(struct wan_device* wandev, netdevice_t* dev)
* interface registration. Returning anything but zero will fail interface
* interface registration. Returning anything but zero will fail interface
* registration.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
struct
wan_device
*
wandev
=
&
card
->
wandev
;
...
@@ -695,7 +695,7 @@ static int if_init (netdevice_t* dev)
...
@@ -695,7 +695,7 @@ static int if_init (netdevice_t* dev)
/*============================================================================
/*============================================================================
* Handle transmit timeout event from netif watchdog
* 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
;
chdlc_private_area_t
*
chan
=
dev
->
priv
;
sdla_t
*
card
=
chan
->
card
;
sdla_t
*
card
=
chan
->
card
;
...
@@ -720,7 +720,7 @@ static void if_tx_timeout (netdevice_t *dev)
...
@@ -720,7 +720,7 @@ static void if_tx_timeout (netdevice_t *dev)
*
*
* Return 0 if O.k. or errno.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -753,7 +753,7 @@ static int if_open (netdevice_t* dev)
...
@@ -753,7 +753,7 @@ static int if_open (netdevice_t* dev)
* o if this is the last close, then disable communications and interrupts.
* o if this is the last close, then disable communications and interrupts.
* o reset flags.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -784,7 +784,7 @@ static int if_close (netdevice_t* dev)
...
@@ -784,7 +784,7 @@ static int if_close (netdevice_t* dev)
* 2. Setting tbusy flag will inhibit further transmit requests from the
* 2. Setting tbusy flag will inhibit further transmit requests from the
* protocol stack and can be used for flow control with protocol layer.
* 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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
sdla_t
*
card
=
chdlc_priv_area
->
card
;
...
@@ -974,7 +974,7 @@ unsigned short calc_checksum (char *data, int len)
...
@@ -974,7 +974,7 @@ unsigned short calc_checksum (char *data, int len)
* Get ethernet-style interface statistics.
* Get ethernet-style interface statistics.
* Return a pointer to struct enet_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
;
sdla_t
*
my_card
;
chdlc_private_area_t
*
chdlc_priv_area
;
chdlc_private_area_t
*
chdlc_priv_area
;
...
@@ -1243,7 +1243,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb)
...
@@ -1243,7 +1243,7 @@ static int chdlc_error (sdla_t *card, int err, CHDLC_MAILBOX_STRUCT *mb)
*/
*/
STATIC
void
wsppp_isr
(
sdla_t
*
card
)
STATIC
void
wsppp_isr
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
int
i
;
int
i
;
sdla_t
*
my_card
;
sdla_t
*
my_card
;
...
@@ -1356,7 +1356,7 @@ STATIC void wsppp_isr (sdla_t* card)
...
@@ -1356,7 +1356,7 @@ STATIC void wsppp_isr (sdla_t* card)
*/
*/
static
void
rx_intr
(
sdla_t
*
card
)
static
void
rx_intr
(
sdla_t
*
card
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
chdlc_private_area_t
*
chdlc_priv_area
;
chdlc_private_area_t
*
chdlc_priv_area
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
CHDLC_DATA_RX_STATUS_EL_STRUCT
*
rxbuf
=
card
->
u
.
c
.
rxmb
;
CHDLC_DATA_RX_STATUS_EL_STRUCT
*
rxbuf
=
card
->
u
.
c
.
rxmb
;
...
@@ -1478,7 +1478,7 @@ static void rx_intr (sdla_t* card)
...
@@ -1478,7 +1478,7 @@ static void rx_intr (sdla_t* card)
*/
*/
void
timer_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
;
chdlc_private_area_t
*
chdlc_priv_area
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
NULL
;
...
@@ -1666,8 +1666,8 @@ static int process_chdlc_exception(sdla_t *card)
...
@@ -1666,8 +1666,8 @@ static int process_chdlc_exception(sdla_t *card)
*/
*/
static
int
store_udp_mgmt_pkt
(
char
udp_pkt_src
,
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
)
chdlc_private_area_t
*
chdlc_priv_area
)
{
{
int
udp_pkt_stored
=
0
;
int
udp_pkt_stored
=
0
;
...
@@ -1693,7 +1693,7 @@ static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
...
@@ -1693,7 +1693,7 @@ static int store_udp_mgmt_pkt(char udp_pkt_src, sdla_t* card,
* Process UDP management packet.
* 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
)
chdlc_private_area_t
*
chdlc_priv_area
)
{
{
unsigned
char
*
buf
;
unsigned
char
*
buf
;
...
@@ -2077,7 +2077,7 @@ static int process_udp_mgmt_pkt(sdla_t* card, netdevice_t* dev,
...
@@ -2077,7 +2077,7 @@ static int process_udp_mgmt_pkt(sdla_t* card, netdevice_t* dev,
* Initialize Receive and Transmit Buffers.
* 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_MAILBOX_STRUCT
*
mb
=
card
->
mbox
;
CHDLC_TX_STATUS_EL_CFG_STRUCT
*
tx_config
;
CHDLC_TX_STATUS_EL_CFG_STRUCT
*
tx_config
;
...
@@ -2214,7 +2214,7 @@ static int udp_pkt_type(struct sk_buff *skb, sdla_t* card)
...
@@ -2214,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
)
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
;
chdlc_private_area_t
*
chdlc_priv_area
=
dev
->
priv
;
if
(
card
->
u
.
c
.
state
!=
state
)
if
(
card
->
u
.
c
.
state
!=
state
)
...
@@ -2285,7 +2285,7 @@ void s508_unlock (sdla_t *card, unsigned long *smp_flags)
...
@@ -2285,7 +2285,7 @@ void s508_unlock (sdla_t *card, unsigned long *smp_flags)
static
int
config_chdlc
(
sdla_t
*
card
)
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
;
SHARED_MEMORY_INFO_STRUCT
*
flags
=
card
->
u
.
c
.
flags
;
if
(
card
->
u
.
c
.
comm_enabled
){
if
(
card
->
u
.
c
.
comm_enabled
){
...
@@ -2331,7 +2331,7 @@ static int config_chdlc (sdla_t *card)
...
@@ -2331,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
;
struct
sk_buff
*
new_skb
;
unsigned
char
*
buf
;
unsigned
char
*
buf
;
...
...
include/linux/if_wanpipe.h
View file @
41d0ff2e
...
@@ -101,16 +101,12 @@ typedef struct
...
@@ -101,16 +101,12 @@ typedef struct
#ifdef __KERNEL__
#ifdef __KERNEL__
#ifndef netdevice_t
#define netdevice_t struct net_device
#endif
/* Private wanpipe socket structures. */
/* Private wanpipe socket structures. */
struct
wanpipe_opt
struct
wanpipe_opt
{
{
void
*
mbox
;
/* Mail box */
void
*
mbox
;
/* Mail box */
void
*
card
;
/* Card bouded to */
void
*
card
;
/* Card bouded to */
netdevice_t
*
dev
;
/* Bounded device */
struct
net_device
*
dev
;
/* Bounded device */
unsigned
short
lcn
;
/* Binded LCN */
unsigned
short
lcn
;
/* Binded LCN */
unsigned
char
svc
;
/* 0=pvc, 1=svc */
unsigned
char
svc
;
/* 0=pvc, 1=svc */
unsigned
char
timer
;
/* flag for delayed transmit*/
unsigned
char
timer
;
/* flag for delayed transmit*/
...
...
include/linux/if_wanpipe_common.h
View file @
41d0ff2e
...
@@ -19,11 +19,8 @@
...
@@ -19,11 +19,8 @@
#include <linux/version.h>
#include <linux/version.h>
#define netdevice_t struct net_device
typedef
struct
{
typedef
struct
{
netdevice_t
*
slave
;
struct
net_device
*
slave
;
atomic_t
packet_sent
;
atomic_t
packet_sent
;
atomic_t
receive_block
;
atomic_t
receive_block
;
atomic_t
command
;
atomic_t
command
;
...
@@ -32,8 +29,8 @@ typedef struct {
...
@@ -32,8 +29,8 @@ typedef struct {
long
common_critical
;
long
common_critical
;
struct
timer_list
*
tx_timer
;
struct
timer_list
*
tx_timer
;
struct
sock
*
sk
;
/* Wanpipe Sock bind's here */
struct
sock
*
sk
;
/* Wanpipe Sock bind's here */
int
(
*
func
)
(
struct
sk_buff
*
,
netdevice_t
*
,
int
(
*
func
)(
struct
sk_buff
*
skb
,
struct
net_device
*
dev
,
struct
sock
*
);
struct
sock
*
sk
);
struct
work_struct
wanpipe_work
;
/* deferred keventd work */
struct
work_struct
wanpipe_work
;
/* deferred keventd work */
unsigned
char
rw_bind
;
/* Sock bind state */
unsigned
char
rw_bind
;
/* Sock bind state */
...
...
include/linux/wanpipe.h
View file @
41d0ff2e
...
@@ -39,8 +39,6 @@
...
@@ -39,8 +39,6 @@
#ifndef _WANPIPE_H
#ifndef _WANPIPE_H
#define _WANPIPE_H
#define _WANPIPE_H
#define netdevice_t struct net_device
#include <linux/wanrouter.h>
#include <linux/wanrouter.h>
/* Defines */
/* Defines */
...
@@ -335,22 +333,22 @@ typedef struct sdla
...
@@ -335,22 +333,22 @@ typedef struct sdla
u32
hi_pvc
;
u32
hi_pvc
;
u32
lo_svc
;
u32
lo_svc
;
u32
hi_svc
;
u32
hi_svc
;
netdevice_t
*
svc_to_dev_map
[
MAX_X25_LCN
];
struct
net_device
*
svc_to_dev_map
[
MAX_X25_LCN
];
netdevice_t
*
pvc_to_dev_map
[
MAX_X25_LCN
];
struct
net_device
*
pvc_to_dev_map
[
MAX_X25_LCN
];
netdevice_t
*
tx_dev
;
struct
net_device
*
tx_dev
;
netdevice_t
*
cmd_dev
;
struct
net_device
*
cmd_dev
;
u32
no_dev
;
u32
no_dev
;
volatile
u8
*
hdlc_buf_status
;
volatile
u8
*
hdlc_buf_status
;
u32
tx_interrupts_pending
;
u32
tx_interrupts_pending
;
u16
timer_int_enabled
;
u16
timer_int_enabled
;
netdevice_t
*
poll_device
;
struct
net_device
*
poll_device
;
atomic_t
command_busy
;
atomic_t
command_busy
;
u16
udp_pkt_lgth
;
u16
udp_pkt_lgth
;
u32
udp_type
;
u32
udp_type
;
u8
udp_pkt_src
;
u8
udp_pkt_src
;
u32
udp_lcn
;
u32
udp_lcn
;
netdevice_t
*
udp_dev
;
struct
net_device
*
udp_dev
;
s8
udp_pkt_data
[
MAX_LGTH_UDP_MGNT_PKT
];
s8
udp_pkt_data
[
MAX_LGTH_UDP_MGNT_PKT
];
u8
LAPB_hdlc
;
/* Option to turn off X25 and run only LAPB */
u8
LAPB_hdlc
;
/* Option to turn off X25 and run only LAPB */
...
@@ -369,7 +367,7 @@ typedef struct sdla
...
@@ -369,7 +367,7 @@ typedef struct sdla
unsigned
rx_top
;
/* S508 receive buffer end */
unsigned
rx_top
;
/* S508 receive buffer end */
unsigned
short
node_dlci
[
100
];
unsigned
short
node_dlci
[
100
];
unsigned
short
dlci_num
;
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
tx_interrupts_pending
;
unsigned
short
timer_int_enabled
;
unsigned
short
timer_int_enabled
;
unsigned
short
udp_pkt_lgth
;
unsigned
short
udp_pkt_lgth
;
...
@@ -382,7 +380,7 @@ typedef struct sdla
...
@@ -382,7 +380,7 @@ typedef struct sdla
void
*
curr_trc_el
;
/* current trace element */
void
*
curr_trc_el
;
/* current trace element */
unsigned
short
trc_bfr_space
;
/* trace buffer space */
unsigned
short
trc_bfr_space
;
/* trace buffer space */
unsigned
char
update_comms_stats
;
unsigned
char
update_comms_stats
;
netdevice_t
*
arp_dev
;
struct
net_device
*
arp_dev
;
spinlock_t
if_send_lock
;
spinlock_t
if_send_lock
;
}
f
;
}
f
;
struct
/****** PPP-specific data ***********/
struct
/****** PPP-specific data ***********/
...
@@ -483,10 +481,10 @@ extern sdla_t * wanpipe_find_card_num (int);
...
@@ -483,10 +481,10 @@ extern sdla_t * wanpipe_find_card_num (int);
extern
void
wanpipe_queue_work
(
struct
work_struct
*
);
extern
void
wanpipe_queue_work
(
struct
work_struct
*
);
extern
void
wanpipe_mark_bh
(
void
);
extern
void
wanpipe_mark_bh
(
void
);
extern
void
wakeup_sk_bh
(
netdevice_t
*
);
extern
void
wakeup_sk_bh
(
struct
net_device
*
dev
);
extern
int
change_dev_flags
(
netdevice_t
*
,
unsigned
);
extern
int
change_dev_flags
(
struct
net_device
*
dev
,
unsigned
flags
);
extern
unsigned
long
get_ip_address
(
netdevice_t
*
dev
,
int
option
);
extern
unsigned
long
get_ip_address
(
struct
net_device
*
dev
,
int
option
);
extern
void
add_gateway
(
sdla_t
*
,
netdevice_t
*
);
extern
void
add_gateway
(
sdla_t
*
card
,
struct
net_device
*
dev
);
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
...
...
include/linux/wanrouter.h
View file @
41d0ff2e
...
@@ -44,8 +44,6 @@
...
@@ -44,8 +44,6 @@
* Jan 02, 1997 Gene Kozin Initial version (based on wanpipe.h).
* 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 */
#include <linux/spinlock.h>
/* Support for SMP Locking */
#ifndef _ROUTER_H
#ifndef _ROUTER_H
...
@@ -505,12 +503,12 @@ struct wan_device {
...
@@ -505,12 +503,12 @@ struct wan_device {
int
(
*
update
)
(
struct
wan_device
*
wandev
);
int
(
*
update
)
(
struct
wan_device
*
wandev
);
int
(
*
ioctl
)
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
int
(
*
ioctl
)
(
struct
wan_device
*
wandev
,
unsigned
cmd
,
unsigned
long
arg
);
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
);
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 ****/
/****** maintained by the router ****/
struct
wan_device
*
next
;
/* -> next device */
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 */
unsigned
ndev
;
/* number of interfaces */
struct
proc_dir_entry
*
dent
;
/* proc filesystem entry */
struct
proc_dir_entry
*
dent
;
/* proc filesystem entry */
};
};
...
@@ -518,8 +516,10 @@ struct wan_device {
...
@@ -518,8 +516,10 @@ struct wan_device {
/* Public functions available for device drivers */
/* Public functions available for device drivers */
extern
int
register_wan_device
(
struct
wan_device
*
wandev
);
extern
int
register_wan_device
(
struct
wan_device
*
wandev
);
extern
int
unregister_wan_device
(
char
*
name
);
extern
int
unregister_wan_device
(
char
*
name
);
unsigned
short
wanrouter_type_trans
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
);
unsigned
short
wanrouter_type_trans
(
struct
sk_buff
*
skb
,
int
wanrouter_encapsulate
(
struct
sk_buff
*
skb
,
netdevice_t
*
dev
,
unsigned
short
type
);
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! */
/* Proc interface functions. These must not be called by the drivers! */
extern
int
wanrouter_proc_init
(
void
);
extern
int
wanrouter_proc_init
(
void
);
...
...
net/wanrouter/af_wanpipe.c
View file @
41d0ff2e
...
@@ -170,7 +170,7 @@ struct wanpipe_opt
...
@@ -170,7 +170,7 @@ struct wanpipe_opt
{
{
void *mbox; /* Mail box */
void *mbox; /* Mail box */
void *card; /* Card bouded to */
void *card; /* Card bouded to */
netdevice_t
*dev; /* Bounded device */
struct net_device
*dev; /* Bounded device */
unsigned short lcn; /* Binded LCN */
unsigned short lcn; /* Binded LCN */
unsigned char svc; /* 0=pvc, 1=svc */
unsigned char svc; /* 0=pvc, 1=svc */
unsigned char timer; /* flag for delayed transmit*/
unsigned char timer; /* flag for delayed transmit*/
...
@@ -185,25 +185,26 @@ static int sk_count;
...
@@ -185,25 +185,26 @@ static int sk_count;
extern
struct
proto_ops
wanpipe_ops
;
extern
struct
proto_ops
wanpipe_ops
;
static
unsigned
long
find_free_critical
;
static
unsigned
long
find_free_critical
;
static
void
wanpipe_unlink_driver
(
struct
sock
*
);
static
void
wanpipe_unlink_driver
(
struct
sock
*
sk
);
static
void
wanpipe_link_driver
(
netdevice_t
*
,
struct
sock
*
sk
);
static
void
wanpipe_link_driver
(
struct
net_device
*
dev
,
struct
sock
*
sk
);
static
void
wanpipe_wakeup_driver
(
struct
sock
*
sk
);
static
void
wanpipe_wakeup_driver
(
struct
sock
*
sk
);
static
int
execute_command
(
struct
sock
*
,
unsigned
char
,
unsigned
int
);
static
int
execute_command
(
struct
sock
*
,
unsigned
char
,
unsigned
int
);
static
int
check_dev
(
netdevice_t
*
,
sdla_t
*
);
static
int
check_dev
(
struct
net_device
*
dev
,
sdla_t
*
card
);
netdevice_t
*
wanpipe_find_free_dev
(
sdla_t
*
);
struct
net_device
*
wanpipe_find_free_dev
(
sdla_t
*
card
);
static
void
wanpipe_unlink_card
(
struct
sock
*
);
static
void
wanpipe_unlink_card
(
struct
sock
*
);
static
int
wanpipe_link_card
(
struct
sock
*
);
static
int
wanpipe_link_card
(
struct
sock
*
);
static
struct
sock
*
wanpipe_make_new
(
struct
sock
*
);
static
struct
sock
*
wanpipe_make_new
(
struct
sock
*
);
static
struct
sock
*
wanpipe_alloc_socket
(
void
);
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
wanpipe_exec_cmd
(
struct
sock
*
,
int
,
unsigned
int
);
static
int
get_ioctl_cmd
(
struct
sock
*
,
void
*
);
static
int
get_ioctl_cmd
(
struct
sock
*
,
void
*
);
static
int
set_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_timer
(
unsigned
long
data
);
static
void
wanpipe_kill_sock_irq
(
struct
sock
*
);
static
void
wanpipe_kill_sock_irq
(
struct
sock
*
);
static
void
wanpipe_kill_sock_accept
(
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
*
);
struct
sock
*
get_newsk_from_skb
(
struct
sk_buff
*
);
static
int
wanpipe_debug
(
struct
sock
*
,
void
*
);
static
int
wanpipe_debug
(
struct
sock
*
,
void
*
);
static
void
wanpipe_delayed_transmit
(
unsigned
long
data
);
static
void
wanpipe_delayed_transmit
(
unsigned
long
data
);
...
@@ -225,7 +226,8 @@ static int check_driver_busy (struct sock *);
...
@@ -225,7 +226,8 @@ static int check_driver_busy (struct sock *);
* WANPIPE driver private.
* 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
;
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
skb
->
cb
;
wanpipe_common_t
*
chan
=
dev
->
priv
;
wanpipe_common_t
*
chan
=
dev
->
priv
;
...
@@ -323,7 +325,7 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
...
@@ -323,7 +325,7 @@ static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk)
wanpipe_opt
*
wp
=
wp_sk
(
sk
),
*
newwp
;
wanpipe_opt
*
wp
=
wp_sk
(
sk
),
*
newwp
;
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
skb
->
cb
;
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
skb
->
cb
;
struct
sock
*
newsk
;
struct
sock
*
newsk
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
sdla_t
*
card
;
sdla_t
*
card
;
mbox_cmd_t
*
mbox_ptr
;
mbox_cmd_t
*
mbox_ptr
;
wanpipe_common_t
*
chan
;
wanpipe_common_t
*
chan
;
...
@@ -539,7 +541,7 @@ static int wanpipe_sendmsg(struct kiocb *iocb, struct socket *sock,
...
@@ -539,7 +541,7 @@ static int wanpipe_sendmsg(struct kiocb *iocb, struct socket *sock,
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
wan_sockaddr_ll
*
saddr
=
(
struct
wan_sockaddr_ll
*
)
msg
->
msg_name
;
struct
wan_sockaddr_ll
*
saddr
=
(
struct
wan_sockaddr_ll
*
)
msg
->
msg_name
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
unsigned
short
proto
;
unsigned
short
proto
;
unsigned
char
*
addr
;
unsigned
char
*
addr
;
int
ifindex
,
err
,
reserve
=
0
;
int
ifindex
,
err
,
reserve
=
0
;
...
@@ -664,7 +666,7 @@ static void wanpipe_delayed_transmit (unsigned long data)
...
@@ -664,7 +666,7 @@ static void wanpipe_delayed_transmit (unsigned long data)
struct
sock
*
sk
=
(
struct
sock
*
)
data
;
struct
sock
*
sk
=
(
struct
sock
*
)
data
;
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
netdevice_t
*
dev
=
wp
->
dev
;
struct
net_device
*
dev
=
wp
->
dev
;
sdla_t
*
card
=
(
sdla_t
*
)
wp
->
card
;
sdla_t
*
card
=
(
sdla_t
*
)
wp
->
card
;
if
(
!
card
||
!
dev
){
if
(
!
card
||
!
dev
){
...
@@ -756,7 +758,7 @@ static void wanpipe_delayed_transmit (unsigned long data)
...
@@ -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
)
static
int
execute_command
(
struct
sock
*
sk
,
unsigned
char
cmd
,
unsigned
int
flags
)
{
{
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
netdevice_t
*
dev
;
struct
net_device
*
dev
;
wanpipe_common_t
*
chan
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
int
err
=
0
;
int
err
=
0
;
DECLARE_WAITQUEUE
(
wait
,
current
);
DECLARE_WAITQUEUE
(
wait
,
current
);
...
@@ -861,7 +863,7 @@ static void wanpipe_destroy_timer(unsigned long data)
...
@@ -861,7 +863,7 @@ static void wanpipe_destroy_timer(unsigned long data)
*===========================================================*/
*===========================================================*/
static
void
wanpipe_unlink_driver
(
struct
sock
*
sk
)
static
void
wanpipe_unlink_driver
(
struct
sock
*
sk
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
wanpipe_common_t
*
chan
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
sk
->
zapped
=
0
;
sk
->
zapped
=
0
;
...
@@ -901,7 +903,7 @@ static void wanpipe_unlink_driver (struct sock *sk)
...
@@ -901,7 +903,7 @@ static void wanpipe_unlink_driver (struct sock *sk)
* data up the socket.
* 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_opt
*
wp
=
wp_sk
(
sk
);
wanpipe_common_t
*
chan
=
dev
->
priv
;
wanpipe_common_t
*
chan
=
dev
->
priv
;
...
@@ -926,7 +928,7 @@ static void wanpipe_link_driver (netdevice_t *dev, struct sock *sk)
...
@@ -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
;
wanpipe_common_t
*
chan
=
dev
->
priv
;
clear_bit
(
0
,(
void
*
)
&
chan
->
rw_bind
);
clear_bit
(
0
,(
void
*
)
&
chan
->
rw_bind
);
...
@@ -965,7 +967,7 @@ static int wanpipe_release(struct socket *sock)
...
@@ -965,7 +967,7 @@ static int wanpipe_release(struct socket *sock)
if
(
wp
->
num
==
htons
(
X25_PROT
)
&&
if
(
wp
->
num
==
htons
(
X25_PROT
)
&&
sk
->
state
!=
WANSOCK_DISCONNECTED
&&
sk
->
zapped
)
{
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
;
wanpipe_common_t
*
chan
;
if
(
dev
){
if
(
dev
){
chan
=
dev
->
priv
;
chan
=
dev
->
priv
;
...
@@ -1153,7 +1155,7 @@ static void wanpipe_kill_sock_timer (unsigned long data)
...
@@ -1153,7 +1155,7 @@ static void wanpipe_kill_sock_timer (unsigned long data)
if
(
wp_sk
(
sk
)
->
num
==
htons
(
X25_PROT
)
&&
if
(
wp_sk
(
sk
)
->
num
==
htons
(
X25_PROT
)
&&
sk
->
state
!=
WANSOCK_DISCONNECTED
){
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
;
wanpipe_common_t
*
chan
;
if
(
dev
){
if
(
dev
){
chan
=
dev
->
priv
;
chan
=
dev
->
priv
;
...
@@ -1268,7 +1270,8 @@ static void wanpipe_kill_sock_irq (struct sock *sk)
...
@@ -1268,7 +1270,8 @@ static void wanpipe_kill_sock_irq (struct sock *sk)
* sock to the driver.
* 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_opt
*
wp
=
wp_sk
(
sk
);
wanpipe_common_t
*
chan
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
...
@@ -1341,7 +1344,7 @@ static int wanpipe_bind(struct socket *sock, struct sockaddr *uaddr, int addr_le
...
@@ -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
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
wanpipe_opt
*
wp
=
wp_sk
(
sk
);
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
sdla_t
*
card
=
NULL
;
sdla_t
*
card
=
NULL
;
char
name
[
15
];
char
name
[
15
];
...
@@ -1436,7 +1439,7 @@ static int wanpipe_bind(struct socket *sock, struct sockaddr *uaddr, int addr_le
...
@@ -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
;
wanpipe_common_t
*
chan
=
dev
->
priv
;
if
(
!
test_and_set_bit
(
0
,(
void
*
)
&
chan
->
rw_bind
)){
if
(
!
test_and_set_bit
(
0
,(
void
*
)
&
chan
->
rw_bind
)){
...
@@ -1451,11 +1454,12 @@ static inline int get_atomic_device (netdevice_t *dev)
...
@@ -1451,11 +1454,12 @@ static inline int get_atomic_device (netdevice_t *dev)
* Check that device name belongs to a particular card.
* 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
){
if
(
tmp_dev
->
ifindex
==
dev
->
ifindex
){
return
0
;
return
0
;
}
}
...
@@ -1471,16 +1475,17 @@ static int check_dev (netdevice_t *dev, sdla_t *card)
...
@@ -1471,16 +1475,17 @@ static int check_dev (netdevice_t *dev, sdla_t *card)
* X25API Specific.
* 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
;
volatile
wanpipe_common_t
*
chan
;
if
(
test_and_set_bit
(
0
,
&
find_free_critical
)){
if
(
test_and_set_bit
(
0
,
&
find_free_critical
)){
printk
(
KERN_INFO
"CRITICAL in Find Free
\n
"
);
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
;
chan
=
dev
->
priv
;
if
(
!
chan
)
if
(
!
chan
)
continue
;
continue
;
...
@@ -1646,7 +1651,7 @@ static int wanpipe_recvmsg(struct kiocb *iocb, struct socket *sock,
...
@@ -1646,7 +1651,7 @@ static int wanpipe_recvmsg(struct kiocb *iocb, struct socket *sock,
static
void
wanpipe_wakeup_driver
(
struct
sock
*
sk
)
static
void
wanpipe_wakeup_driver
(
struct
sock
*
sk
)
{
{
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
dev
=
dev_get_by_index
(
sk
->
bound_dev_if
);
...
@@ -1680,7 +1685,7 @@ static void wanpipe_wakeup_driver(struct sock *sk)
...
@@ -1680,7 +1685,7 @@ static void wanpipe_wakeup_driver(struct sock *sk)
static
int
wanpipe_getname
(
struct
socket
*
sock
,
struct
sockaddr
*
uaddr
,
static
int
wanpipe_getname
(
struct
socket
*
sock
,
struct
sockaddr
*
uaddr
,
int
*
uaddr_len
,
int
peer
)
int
*
uaddr_len
,
int
peer
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
struct
wan_sockaddr_ll
*
sll
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
...
@@ -1718,7 +1723,7 @@ static int wanpipe_getname(struct socket *sock, struct sockaddr *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
)
static
int
wanpipe_notifier
(
struct
notifier_block
*
this
,
unsigned
long
msg
,
void
*
data
)
{
{
struct
sock
*
sk
;
struct
sock
*
sk
;
netdevice_t
*
dev
=
(
netdevice_t
*
)
data
;
struct
net_device
*
dev
=
(
struct
net_device
*
)
data
;
struct
wanpipe_opt
*
po
;
struct
wanpipe_opt
*
po
;
for
(
sk
=
wanpipe_sklist
;
sk
;
sk
=
sk
->
next
)
{
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
...
@@ -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
)
static
int
wanpipe_debug
(
struct
sock
*
origsk
,
void
*
arg
)
{
{
struct
sock
*
sk
=
NULL
;
struct
sock
*
sk
=
NULL
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
wanpipe_common_t
*
chan
=
NULL
;
int
cnt
=
0
,
err
=
0
;
int
cnt
=
0
,
err
=
0
;
wan_debug_t
*
dbg_data
=
(
wan_debug_t
*
)
arg
;
wan_debug_t
*
dbg_data
=
(
wan_debug_t
*
)
arg
;
...
@@ -2010,7 +2015,7 @@ static int set_ioctl_cmd (struct sock *sk, void *arg)
...
@@ -2010,7 +2015,7 @@ static int set_ioctl_cmd (struct sock *sk, void *arg)
if
(
!
wp_sk
(
sk
)
->
mbox
)
{
if
(
!
wp_sk
(
sk
)
->
mbox
)
{
void
*
mbox_ptr
;
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
)
if
(
!
dev
)
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -2351,7 +2356,7 @@ static int wanpipe_exec_cmd(struct sock *sk, int cmd, unsigned int flags)
...
@@ -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
)
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
;
wanpipe_common_t
*
chan
;
if
(
!
dev
)
if
(
!
dev
)
...
@@ -2456,7 +2461,7 @@ static int wanpipe_accept(struct socket *sock, struct socket *newsock, int flags
...
@@ -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
)
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
;
wanpipe_common_t
*
chan
;
if
(
!
dev
){
if
(
!
dev
){
...
@@ -2486,7 +2491,7 @@ static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr
...
@@ -2486,7 +2491,7 @@ static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr
{
{
struct
sock
*
sk
=
sock
->
sk
;
struct
sock
*
sk
=
sock
->
sk
;
struct
wan_sockaddr_ll
*
addr
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
struct
wan_sockaddr_ll
*
addr
=
(
struct
wan_sockaddr_ll
*
)
uaddr
;
netdevice_t
*
dev
;
struct
net_device
*
dev
;
int
err
;
int
err
;
if
(
wp_sk
(
sk
)
->
num
!=
htons
(
X25_PROT
))
if
(
wp_sk
(
sk
)
->
num
!=
htons
(
X25_PROT
))
...
...
net/wanrouter/wanmain.c
View file @
41d0ff2e
...
@@ -363,8 +363,8 @@ int unregister_wan_device(char *name)
...
@@ -363,8 +363,8 @@ 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
)
unsigned
short
type
)
{
{
int
hdr_len
=
0
;
int
hdr_len
=
0
;
...
@@ -406,7 +406,7 @@ int wanrouter_encapsulate (struct sk_buff *skb, netdevice_t *dev,
...
@@ -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 */
int
cnt
=
skb
->
data
[
0
]
?
0
:
1
;
/* there may be a pad present */
unsigned
short
ethertype
;
unsigned
short
ethertype
;
...
@@ -597,7 +597,7 @@ static int device_setup(struct wan_device *wandev, wandev_conf_t *u_conf)
...
@@ -597,7 +597,7 @@ static int device_setup(struct wan_device *wandev, wandev_conf_t *u_conf)
static
int
device_shutdown
(
struct
wan_device
*
wandev
)
static
int
device_shutdown
(
struct
wan_device
*
wandev
)
{
{
netdevice_t
*
dev
;
struct
net_device
*
dev
;
int
err
=
0
;
int
err
=
0
;
if
(
wandev
->
state
==
WAN_UNCONFIGURED
)
if
(
wandev
->
state
==
WAN_UNCONFIGURED
)
...
@@ -661,7 +661,7 @@ static int device_stat(struct wan_device *wandev, wandev_stat_t *u_stat)
...
@@ -661,7 +661,7 @@ static int device_stat(struct wan_device *wandev, wandev_stat_t *u_stat)
static
int
device_new_if
(
struct
wan_device
*
wandev
,
wanif_conf_t
*
u_conf
)
static
int
device_new_if
(
struct
wan_device
*
wandev
,
wanif_conf_t
*
u_conf
)
{
{
wanif_conf_t
conf
;
wanif_conf_t
conf
;
netdevice_t
*
dev
=
NULL
;
struct
net_device
*
dev
=
NULL
;
#ifdef CONFIG_WANPIPE_MULTPPP
#ifdef CONFIG_WANPIPE_MULTPPP
struct
ppp_device
*
pppdev
=
NULL
;
struct
ppp_device
*
pppdev
=
NULL
;
#endif
#endif
...
@@ -682,13 +682,14 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
...
@@ -682,13 +682,14 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
if
(
pppdev
==
NULL
)
if
(
pppdev
==
NULL
)
return
-
ENOBUFS
;
return
-
ENOBUFS
;
memset
(
pppdev
,
0
,
sizeof
(
struct
ppp_device
));
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
)
{
if
(
pppdev
->
dev
==
NULL
)
{
kfree
(
pppdev
);
kfree
(
pppdev
);
return
-
ENOBUFS
;
return
-
ENOBUFS
;
}
}
memset
(
pppdev
->
dev
,
0
,
sizeof
(
netdevice_t
));
memset
(
pppdev
->
dev
,
0
,
sizeof
(
struct
net_device
));
err
=
wandev
->
new_if
(
wandev
,
(
netdevice_t
*
)
pppdev
,
&
conf
);
err
=
wandev
->
new_if
(
wandev
,
(
struct
net_device
*
)
pppdev
,
&
conf
);
dev
=
pppdev
->
dev
;
dev
=
pppdev
->
dev
;
#else
#else
printk
(
KERN_INFO
"%s: Wanpipe Mulit-Port PPP support has not been compiled in!
\n
"
,
printk
(
KERN_INFO
"%s: Wanpipe Mulit-Port PPP support has not been compiled in!
\n
"
,
...
@@ -696,10 +697,10 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
...
@@ -696,10 +697,10 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
return
-
EPROTONOSUPPORT
;
return
-
EPROTONOSUPPORT
;
#endif
#endif
}
else
{
}
else
{
dev
=
kmalloc
(
sizeof
(
netdevice_t
),
GFP_KERNEL
);
dev
=
kmalloc
(
sizeof
(
struct
net_device
),
GFP_KERNEL
);
if
(
dev
==
NULL
)
if
(
dev
==
NULL
)
return
-
ENOBUFS
;
return
-
ENOBUFS
;
memset
(
dev
,
0
,
sizeof
(
netdevice_t
));
memset
(
dev
,
0
,
sizeof
(
struct
net_device
));
err
=
wandev
->
new_if
(
wandev
,
dev
,
&
conf
);
err
=
wandev
->
new_if
(
wandev
,
dev
,
&
conf
);
}
}
...
@@ -722,7 +723,7 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
...
@@ -722,7 +723,7 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
err
=
register_netdev
(
dev
);
err
=
register_netdev
(
dev
);
if
(
!
err
)
{
if
(
!
err
)
{
netdevice_t
*
slave
=
NULL
;
struct
net_device
*
slave
=
NULL
;
unsigned
long
smp_flags
=
0
;
unsigned
long
smp_flags
=
0
;
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
...
@@ -731,10 +732,10 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
...
@@ -731,10 +732,10 @@ static int device_new_if(struct wan_device *wandev, wanif_conf_t *u_conf)
wandev
->
dev
=
dev
;
wandev
->
dev
=
dev
;
}
else
{
}
else
{
for
(
slave
=
wandev
->
dev
;
for
(
slave
=
wandev
->
dev
;
*
((
netdevice_t
**
)
slave
->
priv
);
*
((
struct
net_device
**
)
slave
->
priv
);
slave
=*
((
netdevice_t
**
)
slave
->
priv
));
slave
=
*
((
struct
net_device
**
)
slave
->
priv
));
*
((
netdevice_t
**
)
slave
->
priv
)
=
dev
;
*
((
struct
net_device
**
)
slave
->
priv
)
=
dev
;
}
}
++
wandev
->
ndev
;
++
wandev
->
ndev
;
...
@@ -843,14 +844,14 @@ static struct wan_device *find_device(char *name)
...
@@ -843,14 +844,14 @@ static struct wan_device *find_device(char *name)
static
int
delete_interface
(
struct
wan_device
*
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
;
unsigned
long
smp_flags
=
0
;
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
dev
=
wandev
->
dev
;
dev
=
wandev
->
dev
;
prev
=
NULL
;
prev
=
NULL
;
while
(
dev
&&
strcmp
(
name
,
dev
->
name
))
{
while
(
dev
&&
strcmp
(
name
,
dev
->
name
))
{
netdevice_t
**
slave
=
dev
->
priv
;
struct
net_device
**
slave
=
dev
->
priv
;
prev
=
dev
;
prev
=
dev
;
dev
=
*
slave
;
dev
=
*
slave
;
}
}
...
@@ -867,12 +868,12 @@ static int delete_interface(struct wan_device *wandev, char *name)
...
@@ -867,12 +868,12 @@ static int delete_interface(struct wan_device *wandev, char *name)
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
lock_adapter_irq
(
&
wandev
->
lock
,
&
smp_flags
);
if
(
prev
)
{
if
(
prev
)
{
netdevice_t
**
prev_slave
=
prev
->
priv
;
struct
net_device
**
prev_slave
=
prev
->
priv
;
netdevice_t
**
slave
=
dev
->
priv
;
struct
net_device
**
slave
=
dev
->
priv
;
*
prev_slave
=
*
slave
;
*
prev_slave
=
*
slave
;
}
else
{
}
else
{
netdevice_t
**
slave
=
dev
->
priv
;
struct
net_device
**
slave
=
dev
->
priv
;
wandev
->
dev
=
*
slave
;
wandev
->
dev
=
*
slave
;
}
}
--
wandev
->
ndev
;
--
wandev
->
ndev
;
...
...
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