Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
949d4e94
Commit
949d4e94
authored
Oct 16, 2002
by
Kai Germaschewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ISDN/PPP: CCP flags handling
Let isdn_ppp_ccp.c take care of keeping state / flags by itself.
parent
4edfad00
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
19 deletions
+35
-19
drivers/isdn/i4l/isdn_ppp.c
drivers/isdn/i4l/isdn_ppp.c
+8
-6
drivers/isdn/i4l/isdn_ppp_ccp.c
drivers/isdn/i4l/isdn_ppp_ccp.c
+9
-2
drivers/isdn/i4l/isdn_ppp_ccp.h
drivers/isdn/i4l/isdn_ppp_ccp.h
+18
-2
include/linux/isdn_ppp.h
include/linux/isdn_ppp.h
+0
-9
No files found.
drivers/isdn/i4l/isdn_ppp.c
View file @
949d4e94
...
...
@@ -49,7 +49,7 @@ isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp,
/* New CCP stuff */
static
void
isdn_ppp_ccp_kick_up
(
void
*
priv
,
unsigned
int
flags
);
isdn_ppp_ccp_kick_up
(
void
*
priv
);
static
void
isdn_ppp_ccp_xmit_reset
(
void
*
priv
,
int
proto
,
unsigned
char
code
,
...
...
@@ -438,6 +438,7 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, unsigned lon
int
r
;
struct
ipppd
*
is
;
struct
isdn_ppp_comp_data
data
;
unsigned
int
cfg
;
is
=
(
struct
ipppd
*
)
file
->
private_data
;
idev
=
is
->
idev
;
...
...
@@ -488,7 +489,8 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, unsigned lon
case
PPPIOCGFLAGS
:
/* get configuration flags */
if
(
!
idev
)
return
-
ENODEV
;
if
((
r
=
set_arg
((
void
*
)
arg
,
&
idev
->
pppcfg
,
sizeof
(
idev
->
pppcfg
)
)))
cfg
=
idev
->
pppcfg
|
ippp_ccp_get_flags
(
idev
->
ccp
);
if
((
r
=
set_arg
((
void
*
)
arg
,
&
cfg
,
sizeof
(
cfg
)
)))
return
r
;
break
;
case
PPPIOCSFLAGS
:
/* set configuration flags */
...
...
@@ -498,8 +500,10 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, unsigned lon
return
r
;
}
if
((
val
&
SC_ENABLE_IP
)
&&
!
(
idev
->
pppcfg
&
SC_ENABLE_IP
))
{
idev
->
pppcfg
=
val
;
/* OK .. we are ready to send buffers */
isdn_net_online
(
idev
);
break
;
}
idev
->
pppcfg
=
val
;
break
;
...
...
@@ -1926,15 +1930,14 @@ isdn_ppp_hangup_slave(char *name)
/* Push an empty CCP Data Frame up to the daemon to wake it up and let it
generate a CCP Reset-Request or tear down CCP altogether */
static
void
isdn_ppp_ccp_kick_up
(
void
*
priv
,
unsigned
int
flags
)
static
void
isdn_ppp_ccp_kick_up
(
void
*
priv
)
{
isdn_net_dev
*
idev
=
priv
;
idev
->
pppcfg
|=
flags
;
isdn_ppp_fill_rq
(
NULL
,
0
,
PPP_COMP
,
idev
->
ppp_slot
);
}
static
void
isdn_ppp_ccp_lp_kick_up
(
void
*
priv
,
unsigned
int
flags
)
static
void
isdn_ppp_ccp_lp_kick_up
(
void
*
priv
)
{
isdn_net_local
*
lp
=
priv
;
isdn_net_dev
*
idev
;
...
...
@@ -1944,7 +1947,6 @@ static void isdn_ppp_ccp_lp_kick_up(void *priv, unsigned int flags)
return
;
}
idev
=
list_entry
(
lp
->
online
.
next
,
isdn_net_dev
,
online
);
idev
->
pppcfg
|=
flags
;
isdn_ppp_fill_rq
(
NULL
,
0
,
PPP_COMP
,
idev
->
ppp_slot
);
}
...
...
drivers/isdn/i4l/isdn_ppp_ccp.c
View file @
949d4e94
...
...
@@ -185,7 +185,7 @@ ippp_ccp_alloc(int proto, void *priv,
void
(
*
xmit_reset
)(
void
*
priv
,
int
proto
,
unsigned
char
code
,
unsigned
char
id
,
unsigned
char
*
data
,
int
len
),
void
(
*
kick_up
)(
void
*
priv
,
unsigned
int
flags
))
void
(
*
kick_up
)(
void
*
priv
))
{
struct
ippp_ccp
*
ccp
;
...
...
@@ -230,6 +230,12 @@ ippp_ccp_set_mru(struct ippp_ccp *ccp, unsigned int mru)
return
0
;
}
unsigned
int
ippp_ccp_get_flags
(
struct
ippp_ccp
*
ccp
);
{
return
idev
->
ccp
->
compflags
&
(
SC_DC_ERROR
|
SC_DC_FERROR
);
}
/*
* compress a frame
* returns original skb if we did not compress the frame
...
...
@@ -322,8 +328,9 @@ ippp_ccp_decompress(struct ippp_ccp *ccp, struct sk_buff *skb_in, int *proto)
ippp_ccp_reset_xmit
(
ccp
,
&
rsparm
);
break
;
case
DECOMP_FATALERROR
:
ccp
->
compflags
|=
SC_DC_FERROR
;
/* Kick ipppd to recognize the error */
ccp
->
kick_up
(
ccp
->
priv
,
SC_DC_FERROR
);
ccp
->
kick_up
(
ccp
->
priv
);
break
;
}
kfree_skb
(
skb
);
...
...
drivers/isdn/i4l/isdn_ppp_ccp.h
View file @
949d4e94
...
...
@@ -2,6 +2,19 @@
#include <linux/kernel.h>
#include <linux/isdn_ppp.h>
/* for ippp_ccp::flags */
#define SC_DECOMP_ON 0x01
#define SC_COMP_ON 0x02
#define SC_DECOMP_DISCARD 0x04
#define SC_COMP_DISCARD 0x08
/* SC_DC_ERROR/FERROR go in here as well, but are defined elsewhere
#define SC_DC_FERROR 0x00800000
#define SC_DC_ERROR 0x00400000
*/
struct
ippp_ccp
{
int
proto
;
struct
isdn_ppp_compressor
*
compressor
;
...
...
@@ -15,7 +28,7 @@ struct ippp_ccp {
void
*
priv
;
void
(
*
xmit_reset
)(
void
*
priv
,
int
proto
,
unsigned
char
code
,
unsigned
char
id
,
unsigned
char
*
data
,
int
len
);
void
(
*
kick_up
)(
void
*
priv
,
unsigned
int
flags
);
void
(
*
kick_up
)(
void
*
priv
);
};
struct
ippp_ccp
*
...
...
@@ -23,7 +36,7 @@ ippp_ccp_alloc(int proto, void *priv,
void
(
*
xmit_reset
)(
void
*
priv
,
int
proto
,
unsigned
char
code
,
unsigned
char
id
,
unsigned
char
*
data
,
int
len
),
void
(
*
kick_up
)(
void
*
priv
,
unsigned
int
flags
));
void
(
*
kick_up
)(
void
*
priv
));
void
ippp_ccp_free
(
struct
ippp_ccp
*
ccp
);
...
...
@@ -31,6 +44,9 @@ ippp_ccp_free(struct ippp_ccp *ccp);
int
ippp_ccp_set_mru
(
struct
ippp_ccp
*
ccp
,
unsigned
int
mru
);
unsigned
int
ippp_ccp_get_flags
(
struct
ippp_ccp
*
ccp
);
struct
sk_buff
*
ippp_ccp_compress
(
struct
ippp_ccp
*
ccp
,
struct
sk_buff
*
skb
,
int
*
proto
);
...
...
include/linux/isdn_ppp.h
View file @
949d4e94
...
...
@@ -38,15 +38,6 @@ struct pppcallinfo
#define SC_OUT_SHORT_SEQ 0x00000800
#define SC_IN_SHORT_SEQ 0x00004000
#define SC_DECOMP_ON 0x01
#define SC_COMP_ON 0x02
#define SC_DECOMP_DISCARD 0x04
#define SC_COMP_DISCARD 0x08
#define SC_LINK_DECOMP_ON 0x10
#define SC_LINK_COMP_ON 0x20
#define SC_LINK_DECOMP_DISCARD 0x40
#define SC_LINK_COMP_DISCARD 0x80
#define ISDN_PPP_COMP_MAX_OPTIONS 16
#define IPPP_COMP_FLAG_XMIT 0x1
...
...
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