Commit 1bd35408 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/PPP: Move CCP related stuff into isdn_ppp_ccp.c

Create the new files isdn_ppp_ccp.[hc] which deal with PPP CCP
(compression control protocol) related stuff. Move most of the CCP
related stuff from isdn_ppp.c into isdn_ppp_ccp.c, putting CCP
state into a new "struct ippp_ccp".
parent 43db5879
......@@ -19,7 +19,7 @@ isdn-objs := isdn_net.o isdn_net_lib.o \
# Optional parts of multipart objects.
isdn-objs-$(CONFIG_ISDN_PPP) += isdn_ppp.o
isdn-objs-$(CONFIG_ISDN_PPP) += isdn_ppp.o isdn_ppp_ccp.o
isdn-objs-$(CONFIG_ISDN_X25) += isdn_concap.o isdn_x25iface.o
isdn-objs-$(CONFIG_ISDN_AUDIO) += isdn_audio.o
isdn-objs-$(CONFIG_ISDN_TTY_FAX) += isdn_ttyfax.o
......
......@@ -2054,18 +2054,12 @@ static inline void
isdn_net_dec_frame_cnt(isdn_net_dev *idev)
{
isdn_net_local *mlp = idev->mlp;
int was_busy;
was_busy = isdn_net_local_busy(mlp);
idev->frame_cnt--;
if (isdn_net_dev_busy(idev))
isdn_BUG();
if (!was_busy)
return;
if (!skb_queue_empty(&idev->super_tx_queue))
tasklet_schedule(&idev->tlet);
else
......@@ -2257,10 +2251,11 @@ isdn_net_start_xmit(struct sk_buff *skb, struct net_device *ndev)
void
isdn_net_write_super(isdn_net_dev *idev, struct sk_buff *skb)
{
if (!isdn_net_dev_busy(idev))
if (!isdn_net_dev_busy(idev)) {
isdn_net_writebuf_skb(idev, skb);
else
} else {
skb_queue_tail(&idev->super_tx_queue, skb);
}
}
/* ====================================================================== */
......
This diff is collapsed.
......@@ -15,10 +15,16 @@
extern struct file_operations isdn_ppp_fops;
extern struct isdn_netif_ops isdn_ppp_ops;
extern int isdn_ppp_init(void);
extern void isdn_ppp_cleanup(void);
extern int isdn_ppp_dial_slave(char *);
extern int isdn_ppp_hangup_slave(char *);
int isdn_ppp_init(void);
void isdn_ppp_cleanup(void);
int isdn_ppp_dial_slave(char *);
int isdn_ppp_hangup_slave(char *);
void
isdn_ppp_frame_log(char *info, char *data, int len, int maxlen,
int unit, int slot);
int
isdn_ppp_strip_proto(struct sk_buff *skb);
#define IPPP_OPEN 0x01
#define IPPP_CONNECT 0x02
......
This diff is collapsed.
#include <linux/kernel.h>
#include <linux/isdn_ppp.h>
struct ippp_ccp {
int proto;
struct isdn_ppp_compressor *compressor;
struct isdn_ppp_compressor *decompressor;
void *comp_stat;
void *decomp_stat;
unsigned long compflags;
struct ippp_ccp_reset *reset;
int mru;
int debug;
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);
};
struct ippp_ccp *
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
ippp_ccp_free(struct ippp_ccp *ccp);
int
ippp_ccp_set_mru(struct ippp_ccp *ccp, unsigned int mru);
struct sk_buff *
ippp_ccp_compress(struct ippp_ccp *ccp, struct sk_buff *skb, int *proto);
struct sk_buff *
ippp_ccp_decompress(struct ippp_ccp *ccp, struct sk_buff *skb, int *proto);
void
ippp_ccp_send_ccp(struct ippp_ccp *ccp, struct sk_buff *skb);
void
ippp_ccp_receive_ccp(struct ippp_ccp *ccp, struct sk_buff *skb);
void
ippp_ccp_get_compressors(unsigned long protos[8]);
int
ippp_ccp_set_compressor(struct ippp_ccp *ccp, int unit,
struct isdn_ppp_comp_data *data);
......@@ -359,14 +359,7 @@ typedef struct isdn_net_local_s {
#ifdef CONFIG_ISDN_PPP
unsigned int mpppcfg;
long mp_seqno;
struct isdn_ppp_compressor *compressor;
struct isdn_ppp_compressor *decompressor;
void *comp_stat;
void *decomp_stat;
unsigned long compflags;
struct ippp_ccp_reset *reset;
struct ippp_ccp *ccp;
unsigned long debug;
#ifdef CONFIG_ISDN_PPP_VJ
unsigned char *cbuf;
......@@ -434,15 +427,8 @@ typedef struct isdn_net_dev_s {
struct list_head global_list; /* global list of all isdn_net_devs */
#ifdef CONFIG_ISDN_PPP
unsigned int pppcfg;
unsigned int pppmru;
unsigned int pppseq; /* last seq no seen */
struct isdn_ppp_compressor *compressor;
struct isdn_ppp_compressor *decompressor;
void *comp_stat;
void *decomp_stat;
unsigned long compflags;
struct ippp_ccp_reset *reset;
struct ippp_ccp *ccp;
unsigned long debug;
ippp_bundle * pb; /* pointer to the common bundle structure
......
......@@ -8,7 +8,6 @@
#ifndef _LINUX_ISDN_PPP_H
#define _LINUX_ISDN_PPP_H
#define CALLTYPE_INCOMING 0x1
#define CALLTYPE_OUTGOING 0x2
#define CALLTYPE_CALLBACK 0x4
......@@ -64,7 +63,8 @@ struct isdn_ppp_comp_data {
#include <linux/config.h>
#include <linux/skbuff.h>
#include <linux/ppp_defs.h>
#define DECOMP_ERR_NOMEM (-10)
......@@ -172,8 +172,8 @@ enum ippp_ccp_reset_states {
struct ippp_ccp_reset_state {
enum ippp_ccp_reset_states state; /* State of this transaction */
struct ippp_ccp_reset *icr; /* Backlink */
unsigned char id; /* Backlink id index */
struct ippp_ccp *ccp; /* Backlink */
unsigned char id; /* id index */
unsigned char ta:1; /* The timer is active (flag) */
unsigned char expra:1; /* We expect a ResetAck at all */
int dlen; /* Databytes stored in data */
......@@ -189,10 +189,6 @@ struct ippp_ccp_reset_state {
struct ippp_ccp_reset {
struct ippp_ccp_reset_state *rs[256]; /* One per possible id */
unsigned char lastid; /* Last id allocated by the engine */
void (*xmit_reset)(void *priv, int proto, unsigned char code,
unsigned char id, unsigned char *data, int len);
void (*kick_up)(void *priv);
void *priv;
};
#endif /* __KERNEL__ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment