Commit 851785c4 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Convert ISDN/PPP to inl_priv / ind_priv

Interface type specific stuff is now gone from isdn_net_lib and
taken care of in the individual interface type modules.
parent d26d04dc
...@@ -83,20 +83,15 @@ struct isdn_net_phone { ...@@ -83,20 +83,15 @@ struct isdn_net_phone {
char num[ISDN_MSNLEN]; char num[ISDN_MSNLEN];
}; };
/*
Principles when extending structures for generic encapsulation protocol
("concap") support:
- Stuff which is hardware specific (here i4l-specific) goes in
the netdev -> local structure (here: isdn_net_local)
- Stuff which is encapsulation protocol specific goes in the structure
which holds the linux device structure (here: isdn_net_device)
*/
/* per network interface data (dev->priv) */ /* per network interface data (dev->priv) */
struct isdn_net_local_s { struct isdn_net_local_s {
ulong magic; ulong magic;
struct net_device dev; /* interface to upper levels */
struct net_device_stats stats; /* Ethernet Statistics */ struct net_device_stats stats; /* Ethernet Statistics */
struct isdn_netif_ops *ops;
void *inl_priv; /* interface types can put their
private data here */
int flags; /* Connection-flags */ int flags; /* Connection-flags */
int dialmax; /* Max. Number of Dial-retries */ int dialmax; /* Max. Number of Dial-retries */
int dialtimeout; /* How long shall we try on dialing */ int dialtimeout; /* How long shall we try on dialing */
...@@ -134,25 +129,6 @@ struct isdn_net_local_s { ...@@ -134,25 +129,6 @@ struct isdn_net_local_s {
struct list_head running_devs; /* member of global running_devs */ struct list_head running_devs; /* member of global running_devs */
atomic_t refcnt; /* references held by ISDN code */ atomic_t refcnt; /* references held by ISDN code */
#ifdef CONFIG_ISDN_PPP
unsigned int mp_cfg;
u32 mp_txseq;
struct sk_buff_head mp_frags; /* fragments sl list */
u32 mp_rxseq; /* last processed packet seq #: any
packets with smaller seq # will
be dropped unconditionally */
struct ippp_ccp *ccp;
unsigned long debug;
#ifdef CONFIG_ISDN_PPP_VJ
unsigned char *cbuf;
struct slcompress *slcomp;
#endif
#endif
void *inl_priv; /* interface types can put their
private data here */
struct isdn_netif_ops *ops;
struct net_device dev; /* interface to upper levels */
}; };
...@@ -184,7 +160,6 @@ struct isdn_net_dev_s { ...@@ -184,7 +160,6 @@ struct isdn_net_dev_s {
int chargeint; /* Interval between charge-infos */ int chargeint; /* Interval between charge-infos */
int pppbind; /* ippp device for bindings */ int pppbind; /* ippp device for bindings */
struct ipppd *ipppd; /* /dev/ipppX which controls us */
struct sk_buff_head super_tx_queue; /* List of supervisory frames to */ struct sk_buff_head super_tx_queue; /* List of supervisory frames to */
/* be transmitted asap */ /* be transmitted asap */
...@@ -199,12 +174,6 @@ struct isdn_net_dev_s { ...@@ -199,12 +174,6 @@ struct isdn_net_dev_s {
char name[10]; /* Name of device */ char name[10]; /* Name of device */
struct list_head global_list; /* global list of all isdn_net_devs */ struct list_head global_list; /* global list of all isdn_net_devs */
#ifdef CONFIG_ISDN_PPP
unsigned int pppcfg;
u32 mp_rxseq; /* last seq no seen on this channel */
struct ippp_ccp *ccp;
unsigned long debug;
#endif
void *ind_priv; /* interface types can put their void *ind_priv; /* interface types can put their
private data here */ private data here */
}; };
......
...@@ -212,6 +212,8 @@ static ssize_t ...@@ -212,6 +212,8 @@ static ssize_t
ipppd_write(struct file *file, const char *buf, size_t count, loff_t *off) ipppd_write(struct file *file, const char *buf, size_t count, loff_t *off)
{ {
isdn_net_dev *idev; isdn_net_dev *idev;
struct inl_ppp *inl_ppp;
struct ind_ppp *ind_ppp;
struct ipppd *ipppd; struct ipppd *ipppd;
struct sk_buff *skb; struct sk_buff *skb;
char *p; char *p;
...@@ -235,6 +237,8 @@ ipppd_write(struct file *file, const char *buf, size_t count, loff_t *off) ...@@ -235,6 +237,8 @@ ipppd_write(struct file *file, const char *buf, size_t count, loff_t *off)
retval = -ENODEV; retval = -ENODEV;
goto out; goto out;
} }
ind_ppp = idev->ind_priv;
inl_ppp = idev->mlp->inl_priv;
/* Daemon needs to send at least full header, AC + proto */ /* Daemon needs to send at least full header, AC + proto */
if (count < 4) { if (count < 4) {
retval = -EMSGSIZE; retval = -EMSGSIZE;
...@@ -259,10 +263,10 @@ ipppd_write(struct file *file, const char *buf, size_t count, loff_t *off) ...@@ -259,10 +263,10 @@ ipppd_write(struct file *file, const char *buf, size_t count, loff_t *off)
/* Keeps CCP/compression states in sync */ /* Keeps CCP/compression states in sync */
switch (proto) { switch (proto) {
case PPP_CCP: case PPP_CCP:
ippp_ccp_send_ccp(idev->mlp->ccp, skb); ippp_ccp_send_ccp(inl_ppp->ccp, skb);
break; break;
case PPP_CCPFRAG: case PPP_CCPFRAG:
ippp_ccp_send_ccp(idev->ccp, skb); ippp_ccp_send_ccp(ind_ppp->ccp, skb);
break; break;
} }
/* FIXME: Somewhere we need protection against the /* FIXME: Somewhere we need protection against the
...@@ -334,6 +338,8 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, ...@@ -334,6 +338,8 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
isdn_net_dev *idev; isdn_net_dev *idev;
struct ind_ppp *ind_ppp = NULL;
struct inl_ppp *inl_ppp = NULL;
unsigned long val; unsigned long val;
int r; int r;
struct ipppd *is; struct ipppd *is;
...@@ -346,7 +352,10 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, ...@@ -346,7 +352,10 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd,
// FIXME that needs locking? // FIXME that needs locking?
idev = is->idev; idev = is->idev;
if (idev) {
ind_ppp = idev->ind_priv;
inl_ppp = idev->mlp->inl_priv;
}
switch (cmd) { switch (cmd) {
case PPPIOCGUNIT: /* get ppp/isdn unit number */ case PPPIOCGUNIT: /* get ppp/isdn unit number */
r = set_arg(arg, &is->unit, sizeof(is->unit)); r = set_arg(arg, &is->unit, sizeof(is->unit));
...@@ -360,8 +369,8 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, ...@@ -360,8 +369,8 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd,
break; break;
is->debug = val; is->debug = val;
if (idev) { if (idev) {
idev->debug = val; ind_ppp->debug = val;
idev->mlp->debug = val; inl_ppp->debug = val;
} }
break; break;
case PPPIOCGCOMPRESSORS: case PPPIOCGCOMPRESSORS:
...@@ -396,29 +405,29 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, ...@@ -396,29 +405,29 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd,
r = set_arg(arg, idev->name, strlen(idev->name)+1); r = set_arg(arg, idev->name, strlen(idev->name)+1);
break; break;
case PPPIOCGMPFLAGS: /* get configuration flags */ case PPPIOCGMPFLAGS: /* get configuration flags */
r = set_arg(arg, &idev->mlp->mp_cfg, sizeof(idev->mlp->mp_cfg)); r = set_arg(arg, &inl_ppp->mp_cfg, sizeof(inl_ppp->mp_cfg));
break; break;
case PPPIOCSMPFLAGS: /* set configuration flags */ case PPPIOCSMPFLAGS: /* set configuration flags */
r = get_arg(arg, &val, sizeof(val)); r = get_arg(arg, &val, sizeof(val));
if (r) if (r)
break; break;
idev->mlp->mp_cfg = val; inl_ppp->mp_cfg = val;
break; break;
case PPPIOCGFLAGS: /* get configuration flags */ case PPPIOCGFLAGS: /* get configuration flags */
cfg = idev->pppcfg | ippp_ccp_get_flags(idev->ccp); cfg = ind_ppp->pppcfg | ippp_ccp_get_flags(ind_ppp->ccp);
r = set_arg(arg, &cfg, sizeof(cfg)); r = set_arg(arg, &cfg, sizeof(cfg));
break; break;
case PPPIOCSFLAGS: /* set configuration flags */ case PPPIOCSFLAGS: /* set configuration flags */
r = get_arg(arg, &val, sizeof(val)); r = get_arg(arg, &val, sizeof(val));
if (r) if (r)
break; break;
if ((val & SC_ENABLE_IP) && !(idev->pppcfg & SC_ENABLE_IP)) { if ((val & SC_ENABLE_IP) && !(ind_ppp->pppcfg & SC_ENABLE_IP)) {
idev->pppcfg = val; ind_ppp->pppcfg = val;
/* OK .. we are ready to send buffers */ /* OK .. we are ready to send buffers */
isdn_net_online(idev); isdn_net_online(idev);
break; break;
} }
idev->pppcfg = val; ind_ppp->pppcfg = val;
break; break;
case PPPIOCGIDLE: /* get idle time information */ case PPPIOCGIDLE: /* get idle time information */
{ {
...@@ -431,7 +440,7 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd, ...@@ -431,7 +440,7 @@ ipppd_ioctl(struct inode *ino, struct file *file, unsigned int cmd,
r = get_arg(arg, &val, sizeof(val)); r = get_arg(arg, &val, sizeof(val));
if (r) if (r)
break; break;
r = ippp_ccp_set_mru(idev->ccp, val); r = ippp_ccp_set_mru(ind_ppp->ccp, val);
break; break;
case PPPIOCSMPMRU: case PPPIOCSMPMRU:
break; break;
...@@ -580,13 +589,13 @@ isdn_ppp_frame_log(char *info, char *data, int len, int maxlen,int unit,int slot ...@@ -580,13 +589,13 @@ isdn_ppp_frame_log(char *info, char *data, int len, int maxlen,int unit,int slot
} }
void void
ippp_push_proto(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ippp_push_proto(struct ind_ppp *ind_ppp, struct sk_buff *skb, u16 proto)
{ {
if (skb_headroom(skb) < 2) { if (skb_headroom(skb) < 2) {
isdn_BUG(); isdn_BUG();
return; return;
} }
if ((idev->pppcfg & SC_COMP_PROT) && proto <= 0xff) if ((ind_ppp->pppcfg & SC_COMP_PROT) && proto <= 0xff)
put_u8(skb_push(skb, 1), proto); put_u8(skb_push(skb, 1), proto);
else else
put_u16(skb_push(skb, 2), proto); put_u16(skb_push(skb, 2), proto);
...@@ -594,7 +603,7 @@ ippp_push_proto(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ...@@ -594,7 +603,7 @@ ippp_push_proto(isdn_net_dev *idev, struct sk_buff *skb, u16 proto)
} }
static void static void
ippp_push_ac(isdn_net_dev *idev, struct sk_buff *skb) ippp_push_ac(struct ind_ppp *ind_ppp, struct sk_buff *skb)
{ {
unsigned char *p; unsigned char *p;
...@@ -602,7 +611,7 @@ ippp_push_ac(isdn_net_dev *idev, struct sk_buff *skb) ...@@ -602,7 +611,7 @@ ippp_push_ac(isdn_net_dev *idev, struct sk_buff *skb)
isdn_BUG(); isdn_BUG();
return; return;
} }
if (idev->pppcfg & SC_COMP_AC) if (ind_ppp->pppcfg & SC_COMP_AC)
return; return;
p = skb_push(skb, 2); p = skb_push(skb, 2);
...@@ -618,13 +627,13 @@ ippp_push_ac(isdn_net_dev *idev, struct sk_buff *skb) ...@@ -618,13 +627,13 @@ ippp_push_ac(isdn_net_dev *idev, struct sk_buff *skb)
static void static void
isdn_ppp_unbind(isdn_net_dev *idev) isdn_ppp_unbind(isdn_net_dev *idev)
{ {
struct ipppd *is = idev->ipppd; struct ind_ppp *ind_ppp = idev->ind_priv;
struct ipppd *is = ind_ppp->ipppd;
if (!is) { if (!is) {
isdn_BUG(); isdn_BUG();
return; return;
} }
ipppd_debug(is, ""); ipppd_debug(is, "");
if (is->state != IPPPD_ST_ASSIGNED) if (is->state != IPPPD_ST_ASSIGNED)
...@@ -633,12 +642,15 @@ isdn_ppp_unbind(isdn_net_dev *idev) ...@@ -633,12 +642,15 @@ isdn_ppp_unbind(isdn_net_dev *idev)
is->state = IPPPD_ST_OPEN; is->state = IPPPD_ST_OPEN;
/* is->idev will be invalid shortly */ /* is->idev will be invalid shortly */
ippp_ccp_free(idev->ccp); ippp_ccp_free(ind_ppp->ccp);
is->idev = NULL; is->idev = NULL;
/* lose the reference we took on isdn_ppp_bind */ /* lose the reference we took on isdn_ppp_bind */
ipppd_put(is); ipppd_put(is);
idev->ipppd = NULL; ind_ppp->ipppd = NULL;
kfree(ind_ppp);
idev->ind_priv = NULL;
return; return;
} }
...@@ -649,15 +661,19 @@ isdn_ppp_unbind(isdn_net_dev *idev) ...@@ -649,15 +661,19 @@ isdn_ppp_unbind(isdn_net_dev *idev)
int int
isdn_ppp_bind(isdn_net_dev *idev) isdn_ppp_bind(isdn_net_dev *idev)
{ {
struct ind_ppp *ind_ppp;
int unit = 0; int unit = 0;
unsigned long flags; unsigned long flags;
int retval = 0; int retval = 0;
struct ipppd *ipppd; struct ipppd *ipppd;
if (idev->ipppd) { if (idev->ind_priv) {
isdn_BUG(); isdn_BUG();
return 0; return -EIO;
} }
ind_ppp = kmalloc(sizeof(struct ind_ppp), GFP_KERNEL);
if (!ind_ppp)
return -ENOMEM;
spin_lock_irqsave(&ipppds_lock, flags); spin_lock_irqsave(&ipppds_lock, flags);
if (idev->pppbind < 0) { /* device bound to ippp device ? */ if (idev->pppbind < 0) { /* device bound to ippp device ? */
...@@ -709,21 +725,22 @@ isdn_ppp_bind(isdn_net_dev *idev) ...@@ -709,21 +725,22 @@ isdn_ppp_bind(isdn_net_dev *idev)
ipppd->state = IPPPD_ST_ASSIGNED; ipppd->state = IPPPD_ST_ASSIGNED;
ipppd->idev = idev; ipppd->idev = idev;
/* we hold a reference until isdn_ppp_unbind() */ /* we hold a reference until isdn_ppp_unbind() */
idev->ipppd = ipppd_get(ipppd); ipppd_get(ipppd);
spin_unlock_irqrestore(&ipppds_lock, flags); spin_unlock_irqrestore(&ipppds_lock, flags);
idev->pppcfg = 0; /* config flags */ idev->ind_priv = ind_ppp;
ind_ppp->pppcfg = 0; /* config flags */
idev->ccp = ippp_ccp_alloc(); ind_ppp->ipppd = ipppd;
if (!idev->ccp) { ind_ppp->ccp = ippp_ccp_alloc();
if (!ind_ppp->ccp) {
retval = -ENOMEM; retval = -ENOMEM;
goto out; goto out;
} }
idev->ccp->proto = PPP_COMPFRAG; ind_ppp->ccp->proto = PPP_COMPFRAG;
idev->ccp->priv = idev; ind_ppp->ccp->priv = idev;
idev->ccp->alloc_skb = isdn_ppp_dev_alloc_skb; ind_ppp->ccp->alloc_skb = isdn_ppp_dev_alloc_skb;
idev->ccp->xmit = isdn_ppp_dev_xmit; ind_ppp->ccp->xmit = isdn_ppp_dev_xmit;
idev->ccp->kick_up = isdn_ppp_dev_kick_up; ind_ppp->ccp->kick_up = isdn_ppp_dev_kick_up;
retval = ippp_mp_bind(idev); retval = ippp_mp_bind(idev);
if (retval) if (retval)
...@@ -732,13 +749,16 @@ isdn_ppp_bind(isdn_net_dev *idev) ...@@ -732,13 +749,16 @@ isdn_ppp_bind(isdn_net_dev *idev)
return 0; return 0;
out: out:
idev->ipppd->state = IPPPD_ST_OPEN; ipppd->state = IPPPD_ST_OPEN;
ipppd_put(idev->ipppd); ipppd_put(ipppd);
idev->ipppd = NULL; ind_ppp->ipppd = NULL;
kfree(ind_ppp);
idev->ind_priv = NULL;
return retval; return retval;
err: err:
spin_unlock_irqrestore(&ipppds_lock, flags); spin_unlock_irqrestore(&ipppds_lock, flags);
kfree(ind_ppp);
return retval; return retval;
} }
...@@ -750,7 +770,8 @@ isdn_ppp_bind(isdn_net_dev *idev) ...@@ -750,7 +770,8 @@ isdn_ppp_bind(isdn_net_dev *idev)
static void static void
isdn_ppp_connected(isdn_net_dev *idev) isdn_ppp_connected(isdn_net_dev *idev)
{ {
struct ipppd *ipppd = idev->ipppd; struct ind_ppp *ind_ppp = idev->ind_priv;
struct ipppd *ipppd = ind_ppp->ipppd;
ipppd_debug(ipppd, ""); ipppd_debug(ipppd, "");
...@@ -762,11 +783,12 @@ isdn_ppp_connected(isdn_net_dev *idev) ...@@ -762,11 +783,12 @@ isdn_ppp_connected(isdn_net_dev *idev)
static void static void
isdn_ppp_disconnected(isdn_net_dev *idev) isdn_ppp_disconnected(isdn_net_dev *idev)
{ {
struct ipppd *ipppd = idev->ipppd; struct ind_ppp *ind_ppp = idev->ind_priv;
struct ipppd *ipppd = ind_ppp->ipppd;
ipppd_debug(ipppd, ""); ipppd_debug(ipppd, "");
if (idev->pppcfg & SC_ENABLE_IP) if (ind_ppp->pppcfg & SC_ENABLE_IP)
isdn_net_offline(idev); isdn_net_offline(idev);
if (ipppd->state != IPPPD_ST_CONNECTED) if (ipppd->state != IPPPD_ST_CONNECTED)
...@@ -799,7 +821,7 @@ isdn_ppp_cleanup(void) ...@@ -799,7 +821,7 @@ isdn_ppp_cleanup(void)
* retval != 0 -> discard packet silently * retval != 0 -> discard packet silently
*/ */
static int static int
isdn_ppp_skip_ac(isdn_net_dev *idev, struct sk_buff *skb) isdn_ppp_skip_ac(struct ind_ppp *ind_ppp, struct sk_buff *skb)
{ {
u8 val; u8 val;
...@@ -810,7 +832,7 @@ isdn_ppp_skip_ac(isdn_net_dev *idev, struct sk_buff *skb) ...@@ -810,7 +832,7 @@ isdn_ppp_skip_ac(isdn_net_dev *idev, struct sk_buff *skb)
if (val != PPP_ALLSTATIONS) { if (val != PPP_ALLSTATIONS) {
/* if AC compression was not negotiated, but no AC present, /* if AC compression was not negotiated, but no AC present,
discard packet */ discard packet */
if (idev->pppcfg & SC_REJ_COMP_AC) if (ind_ppp->pppcfg & SC_REJ_COMP_AC)
return -EINVAL; return -EINVAL;
return 0; return 0;
...@@ -859,10 +881,10 @@ isdn_ppp_strip_proto(struct sk_buff *skb, u16 *proto) ...@@ -859,10 +881,10 @@ isdn_ppp_strip_proto(struct sk_buff *skb, u16 *proto)
static void static void
isdn_ppp_receive(isdn_net_local *lp, isdn_net_dev *idev, struct sk_buff *skb) isdn_ppp_receive(isdn_net_local *lp, isdn_net_dev *idev, struct sk_buff *skb)
{ {
struct ipppd *is; struct ind_ppp *ind_ppp = idev->ind_priv;
struct ipppd *is = ind_ppp->ipppd;
u16 proto; u16 proto;
is = idev->ipppd;
if (!is) if (!is)
goto err; goto err;
...@@ -872,7 +894,7 @@ isdn_ppp_receive(isdn_net_local *lp, isdn_net_dev *idev, struct sk_buff *skb) ...@@ -872,7 +894,7 @@ isdn_ppp_receive(isdn_net_local *lp, isdn_net_dev *idev, struct sk_buff *skb)
isdn_ppp_frame_log("receive", skb->data, skb->len, 32,is->unit,-1); isdn_ppp_frame_log("receive", skb->data, skb->len, 32,is->unit,-1);
} }
if (isdn_ppp_skip_ac(idev, skb) < 0) if (isdn_ppp_skip_ac(ind_ppp, skb) < 0)
goto err; goto err;
if (isdn_ppp_strip_proto(skb, &proto)) if (isdn_ppp_strip_proto(skb, &proto))
...@@ -887,22 +909,22 @@ isdn_ppp_receive(isdn_net_local *lp, isdn_net_dev *idev, struct sk_buff *skb) ...@@ -887,22 +909,22 @@ isdn_ppp_receive(isdn_net_local *lp, isdn_net_dev *idev, struct sk_buff *skb)
} }
/* /*
* we receive a reassembled frame, MPPP has been taken care of before.
* address/control and protocol have been stripped from the skb * address/control and protocol have been stripped from the skb
* note: net_dev has to be master net_dev
*/ */
void void
ippp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ippp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto)
{ {
isdn_net_local *lp = idev->mlp; isdn_net_local *lp = idev->mlp;
struct ipppd *is = idev->ipppd; struct inl_ppp *inl_ppp = lp->inl_priv;
struct ind_ppp *ind_ppp = idev->ind_priv;
struct ipppd *is = ind_ppp->ipppd;
if (is->debug & 0x10) { if (is->debug & 0x10) {
printk(KERN_DEBUG "push, skb %d %04x\n", (int) skb->len, proto); printk(KERN_DEBUG "push, skb %d %04x\n", (int) skb->len, proto);
isdn_ppp_frame_log("rpush", skb->data, skb->len, 256, is->unit, -1); isdn_ppp_frame_log("rpush", skb->data, skb->len, 256, is->unit, -1);
} }
/* all packets need to be passed through the compressor */ /* all packets need to be passed through the compressor */
skb = ippp_ccp_decompress(lp->ccp, skb, &proto); skb = ippp_ccp_decompress(inl_ppp->ccp, skb, &proto);
if (!skb) /* decompression error */ if (!skb) /* decompression error */
goto error; goto error;
...@@ -926,10 +948,10 @@ ippp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ...@@ -926,10 +948,10 @@ ippp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto)
ippp_vj_decompress(idev, skb, proto); ippp_vj_decompress(idev, skb, proto);
break; break;
case PPP_CCPFRAG: case PPP_CCPFRAG:
ippp_ccp_receive_ccp(idev->ccp, skb); ippp_ccp_receive_ccp(ind_ppp->ccp, skb);
goto ccp; goto ccp;
case PPP_CCP: case PPP_CCP:
ippp_ccp_receive_ccp(lp->ccp, skb); ippp_ccp_receive_ccp(inl_ppp->ccp, skb);
ccp: ccp:
/* Dont pop up ResetReq/Ack stuff to the daemon any /* Dont pop up ResetReq/Ack stuff to the daemon any
longer - the job is done already */ longer - the job is done already */
...@@ -966,6 +988,8 @@ static int ...@@ -966,6 +988,8 @@ static int
isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev) isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev)
{ {
isdn_net_local *mlp = ndev->priv; isdn_net_local *mlp = ndev->priv;
struct inl_ppp *inl_ppp = mlp->inl_priv;
struct ind_ppp *ind_ppp;
isdn_net_dev *idev = list_entry(mlp->online.next, isdn_net_dev, online); isdn_net_dev *idev = list_entry(mlp->online.next, isdn_net_dev, online);
u16 proto = PPP_IP; /* 0x21 */ u16 proto = PPP_IP; /* 0x21 */
struct ipppd *ipppd; struct ipppd *ipppd;
...@@ -993,11 +1017,12 @@ isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -993,11 +1017,12 @@ isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev)
printk(KERN_INFO "%s: IP frame delayed.\n", ndev->name); printk(KERN_INFO "%s: IP frame delayed.\n", ndev->name);
goto stop; goto stop;
} }
if (!(idev->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */ ind_ppp = idev->ind_priv;
if (!(ind_ppp->pppcfg & SC_ENABLE_IP)) { /* PPP connected ? */
isdn_BUG(); isdn_BUG();
goto stop; goto stop;
} }
ipppd = idev->ipppd; ipppd = ind_ppp->ipppd;
idev->huptimer = 0; idev->huptimer = 0;
if (ipppd->debug & 0x40) if (ipppd->debug & 0x40)
...@@ -1007,12 +1032,12 @@ isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -1007,12 +1032,12 @@ isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev)
skb = ippp_vj_compress(idev, skb, &proto); skb = ippp_vj_compress(idev, skb, &proto);
/* normal (single link) or bundle compression */ /* normal (single link) or bundle compression */
skb = ippp_ccp_compress(mlp->ccp, skb, &proto); skb = ippp_ccp_compress(inl_ppp->ccp, skb, &proto);
if (ipppd->debug & 0x40) if (ipppd->debug & 0x40)
isdn_ppp_frame_log("xmit1", skb->data, skb->len, 32, ipppd->unit, -1); isdn_ppp_frame_log("xmit1", skb->data, skb->len, 32, ipppd->unit, -1);
ippp_push_proto(idev, skb, proto); ippp_push_proto(ind_ppp, skb, proto);
ippp_mp_xmit(idev, skb, proto); ippp_mp_xmit(idev, skb, proto);
return 0; return 0;
...@@ -1029,9 +1054,10 @@ isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev) ...@@ -1029,9 +1054,10 @@ isdn_ppp_start_xmit(struct sk_buff *skb, struct net_device *ndev)
void void
ippp_xmit(isdn_net_dev *idev, struct sk_buff *skb) ippp_xmit(isdn_net_dev *idev, struct sk_buff *skb)
{ {
struct ipppd *ipppd = idev->ipppd; struct ind_ppp *ind_ppp = idev->ind_priv;
struct ipppd *ipppd = ind_ppp->ipppd;
ippp_push_ac(idev, skb); ippp_push_ac(ind_ppp, skb);
if (ipppd->debug & 0x40) { if (ipppd->debug & 0x40) {
isdn_ppp_frame_log("xmit3", skb->data, skb->len, 32, ipppd->unit, -1); isdn_ppp_frame_log("xmit3", skb->data, skb->len, 32, ipppd->unit, -1);
...@@ -1049,6 +1075,7 @@ isdn_ppp_dev_ioctl_stats(struct ifreq *ifr, struct net_device *dev) ...@@ -1049,6 +1075,7 @@ isdn_ppp_dev_ioctl_stats(struct ifreq *ifr, struct net_device *dev)
{ {
struct ppp_stats *res, t; struct ppp_stats *res, t;
isdn_net_local *lp = (isdn_net_local *) dev->priv; isdn_net_local *lp = (isdn_net_local *) dev->priv;
struct inl_ppp *inl_ppp = lp->inl_priv;
struct slcompress *slcomp; struct slcompress *slcomp;
int err; int err;
...@@ -1069,7 +1096,7 @@ isdn_ppp_dev_ioctl_stats(struct ifreq *ifr, struct net_device *dev) ...@@ -1069,7 +1096,7 @@ isdn_ppp_dev_ioctl_stats(struct ifreq *ifr, struct net_device *dev)
t.p.ppp_obytes = lp->stats.tx_bytes; t.p.ppp_obytes = lp->stats.tx_bytes;
t.p.ppp_oerrors = lp->stats.tx_errors; t.p.ppp_oerrors = lp->stats.tx_errors;
#ifdef CONFIG_ISDN_PPP_VJ #ifdef CONFIG_ISDN_PPP_VJ
slcomp = lp->slcomp; slcomp = inl_ppp->slcomp;
if (slcomp) { if (slcomp) {
t.vj.vjs_packets = slcomp->sls_o_compressed + slcomp->sls_o_uncompressed; t.vj.vjs_packets = slcomp->sls_o_compressed + slcomp->sls_o_uncompressed;
t.vj.vjs_compressed = slcomp->sls_o_compressed; t.vj.vjs_compressed = slcomp->sls_o_compressed;
...@@ -1152,21 +1179,24 @@ isdn_ppp_if_get_unit(char *name) ...@@ -1152,21 +1179,24 @@ isdn_ppp_if_get_unit(char *name)
static void isdn_ppp_dev_kick_up(void *priv) static void isdn_ppp_dev_kick_up(void *priv)
{ {
isdn_net_dev *idev = priv; isdn_net_dev *idev = priv;
struct ind_ppp *ind_ppp = idev->ind_priv;
ipppd_queue_read(idev->ipppd, PPP_COMPFRAG, NULL, 0); ipppd_queue_read(ind_ppp->ipppd, PPP_COMPFRAG, NULL, 0);
} }
static void isdn_ppp_lp_kick_up(void *priv) static void isdn_ppp_lp_kick_up(void *priv)
{ {
isdn_net_local *lp = priv; isdn_net_local *lp = priv;
isdn_net_dev *idev; isdn_net_dev *idev;
struct ind_ppp *ind_ppp;
if (list_empty(&lp->online)) { if (list_empty(&lp->online)) {
isdn_BUG(); isdn_BUG();
return; return;
} }
idev = list_entry(lp->online.next, isdn_net_dev, online); idev = list_entry(lp->online.next, isdn_net_dev, online);
ipppd_queue_read(idev->ipppd, PPP_COMP, NULL, 0); ind_ppp = idev->ind_priv;
ipppd_queue_read(ind_ppp->ipppd, PPP_COMP, NULL, 0);
} }
/* Send a CCP Reset-Request or Reset-Ack directly from the kernel. */ /* Send a CCP Reset-Request or Reset-Ack directly from the kernel. */
...@@ -1211,9 +1241,10 @@ static void ...@@ -1211,9 +1241,10 @@ static void
isdn_ppp_dev_xmit(void *priv, struct sk_buff *skb, u16 proto) isdn_ppp_dev_xmit(void *priv, struct sk_buff *skb, u16 proto)
{ {
isdn_net_dev *idev = priv; isdn_net_dev *idev = priv;
struct ind_ppp *ind_ppp = idev->ind_priv;
ippp_push_proto(idev, skb, proto); ippp_push_proto(ind_ppp, skb, proto);
ippp_push_ac(idev, skb); ippp_push_ac(ind_ppp, skb);
isdn_net_write_super(idev, skb); isdn_net_write_super(idev, skb);
} }
...@@ -1222,14 +1253,16 @@ isdn_ppp_lp_xmit(void *priv, struct sk_buff *skb, u16 proto) ...@@ -1222,14 +1253,16 @@ isdn_ppp_lp_xmit(void *priv, struct sk_buff *skb, u16 proto)
{ {
isdn_net_local *lp = priv; isdn_net_local *lp = priv;
isdn_net_dev *idev; isdn_net_dev *idev;
struct ind_ppp *ind_ppp;
if (list_empty(&lp->online)) { if (list_empty(&lp->online)) {
isdn_BUG(); isdn_BUG();
return; return;
} }
idev = list_entry(lp->online.next, isdn_net_dev, online); idev = list_entry(lp->online.next, isdn_net_dev, online);
ippp_push_proto(idev, skb, proto); ind_ppp = idev->ind_priv;
ippp_push_ac(idev, skb); ippp_push_proto(ind_ppp, skb, proto);
ippp_push_ac(ind_ppp, skb);
isdn_net_write_super(idev, skb); isdn_net_write_super(idev, skb);
} }
...@@ -1237,13 +1270,15 @@ static int ...@@ -1237,13 +1270,15 @@ static int
isdn_ppp_set_compressor(isdn_net_dev *idev, struct isdn_ppp_comp_data *data) isdn_ppp_set_compressor(isdn_net_dev *idev, struct isdn_ppp_comp_data *data)
{ {
struct ippp_ccp *ccp; struct ippp_ccp *ccp;
struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
struct ind_ppp *ind_ppp = idev->ind_priv;
if (data->flags & IPPP_COMP_FLAG_LINK) if (data->flags & IPPP_COMP_FLAG_LINK)
ccp = idev->ccp; ccp = ind_ppp->ccp;
else else
ccp = idev->mlp->ccp; ccp = inl_ppp->ccp;
return ippp_ccp_set_compressor(ccp, idev->ipppd->unit, data); return ippp_ccp_set_compressor(ccp, ind_ppp->ipppd->unit, data);
} }
// ISDN_NET_ENCAP_SYNCPPP // ISDN_NET_ENCAP_SYNCPPP
...@@ -1252,37 +1287,48 @@ isdn_ppp_set_compressor(isdn_net_dev *idev, struct isdn_ppp_comp_data *data) ...@@ -1252,37 +1287,48 @@ isdn_ppp_set_compressor(isdn_net_dev *idev, struct isdn_ppp_comp_data *data)
static int static int
isdn_ppp_open(isdn_net_local *lp) isdn_ppp_open(isdn_net_local *lp)
{ {
lp->slcomp = ippp_vj_alloc(); struct inl_ppp *inl_ppp;
if (!lp->slcomp)
inl_ppp = kmalloc(sizeof(*inl_ppp), GFP_KERNEL);
if (!inl_ppp)
return -ENOMEM;
lp->inl_priv = inl_ppp;
inl_ppp->slcomp = ippp_vj_alloc();
if (!inl_ppp->slcomp)
goto err; goto err;
lp->ccp = ippp_ccp_alloc(); inl_ppp->ccp = ippp_ccp_alloc();
if (!lp->ccp) if (!inl_ppp->ccp)
goto err_vj; goto err_vj;
lp->ccp->proto = PPP_COMP; inl_ppp->ccp->proto = PPP_COMP;
lp->ccp->priv = lp; inl_ppp->ccp->priv = lp;
lp->ccp->alloc_skb = isdn_ppp_lp_alloc_skb; inl_ppp->ccp->alloc_skb = isdn_ppp_lp_alloc_skb;
lp->ccp->xmit = isdn_ppp_lp_xmit; inl_ppp->ccp->xmit = isdn_ppp_lp_xmit;
lp->ccp->kick_up = isdn_ppp_lp_kick_up; inl_ppp->ccp->kick_up = isdn_ppp_lp_kick_up;
return 0; return 0;
err_vj: err_vj:
ippp_vj_free(lp->slcomp); ippp_vj_free(inl_ppp->slcomp);
lp->slcomp = NULL;
err: err:
kfree(inl_ppp);
lp->inl_priv = NULL;
return -ENOMEM; return -ENOMEM;
} }
static void static void
isdn_ppp_close(isdn_net_local *lp) isdn_ppp_close(isdn_net_local *lp)
{ {
struct inl_ppp *inl_ppp = lp->inl_priv;
ippp_ccp_free(lp->ccp); ippp_ccp_free(inl_ppp->ccp);
lp->ccp = NULL; ippp_vj_free(inl_ppp->slcomp);
ippp_vj_free(lp->slcomp);
lp->slcomp = NULL; kfree(inl_ppp);
lp->inl_priv = NULL;
} }
struct isdn_netif_ops isdn_ppp_ops = { struct isdn_netif_ops isdn_ppp_ops = {
......
...@@ -17,6 +17,24 @@ void isdn_ppp_cleanup(void); ...@@ -17,6 +17,24 @@ void isdn_ppp_cleanup(void);
int isdn_ppp_dial_slave(char *); int isdn_ppp_dial_slave(char *);
int isdn_ppp_hangup_slave(char *); int isdn_ppp_hangup_slave(char *);
struct inl_ppp {
unsigned long debug;
struct slcompress *slcomp;
struct ippp_ccp *ccp; /* CCP for this channel */
unsigned int mp_cfg;
struct sk_buff_head mp_frags; /* fragments list */
u32 mp_rxseq; /* last processed packet seq # */
u32 mp_txseq; /* current tx seq # */
};
struct ind_ppp {
struct ipppd *ipppd; /* /dev/ipppX which controls us */
unsigned int pppcfg;
unsigned long debug;
struct ippp_ccp *ccp; /* CCP for this channel (multilink) */
u32 mp_rxseq; /* last seq no seen on this channel */
};
void void
isdn_ppp_frame_log(char *info, char *data, int len, int maxlen, isdn_ppp_frame_log(char *info, char *data, int len, int maxlen,
int unit, int slot); int unit, int slot);
...@@ -25,7 +43,7 @@ int ...@@ -25,7 +43,7 @@ int
isdn_ppp_strip_proto(struct sk_buff *skb, u16 *proto); isdn_ppp_strip_proto(struct sk_buff *skb, u16 *proto);
void void
ippp_push_proto(isdn_net_dev *idev, struct sk_buff *skb, u16 proto); ippp_push_proto(struct ind_ppp *ind_ppp, struct sk_buff *skb, u16 proto);
void void
ippp_xmit(isdn_net_dev *idev, struct sk_buff *skb); ippp_xmit(isdn_net_dev *idev, struct sk_buff *skb);
......
...@@ -27,20 +27,21 @@ ...@@ -27,20 +27,21 @@
int int
ippp_mp_bind(isdn_net_dev *idev) ippp_mp_bind(isdn_net_dev *idev)
{ {
isdn_net_local *lp = idev->mlp; struct ind_ppp *ind_ppp = idev->ind_priv;
struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
/* seq no last seen, maybe set to bundle min, when joining? */ /* seq no last seen, maybe set to bundle min, when joining? */
idev->mp_rxseq = 0; ind_ppp->mp_rxseq = 0;
if (!list_empty(&lp->online)) if (!list_empty(&idev->mlp->online))
return 0; return 0;
/* first channel for this link, do some setup */ /* first channel for this link, do some setup */
lp->mp_cfg = 0; /* MPPP configuration */ inl_ppp->mp_cfg = 0; /* MPPP configuration */
lp->mp_txseq = 0; /* MPPP tx sequence number */ inl_ppp->mp_txseq = 0; /* MPPP tx sequence number */
lp->mp_rxseq = (u32) -1; inl_ppp->mp_rxseq = (u32) -1;
skb_queue_head_init(&lp->mp_frags); skb_queue_head_init(&inl_ppp->mp_frags);
return 0; return 0;
} }
...@@ -51,6 +52,7 @@ ippp_mp_bundle(isdn_net_dev *idev, int unit) ...@@ -51,6 +52,7 @@ ippp_mp_bundle(isdn_net_dev *idev, int unit)
isdn_net_local *lp = idev->mlp; isdn_net_local *lp = idev->mlp;
char ifn[IFNAMSIZ + 1]; char ifn[IFNAMSIZ + 1];
isdn_net_dev *n_idev; isdn_net_dev *n_idev;
struct ind_ppp *ind_ppp;
printk(KERN_DEBUG "%s: %s: slave unit: %d\n", printk(KERN_DEBUG "%s: %s: slave unit: %d\n",
__FUNCTION__, idev->name, unit); __FUNCTION__, idev->name, unit);
...@@ -65,11 +67,12 @@ ippp_mp_bundle(isdn_net_dev *idev, int unit) ...@@ -65,11 +67,12 @@ ippp_mp_bundle(isdn_net_dev *idev, int unit)
return -ENODEV; return -ENODEV;
found: found:
if (!n_idev->ipppd) { ind_ppp = n_idev->ind_priv;
if (!ind_ppp->ipppd) {
printk(KERN_INFO "%s: no ipppd?\n", __FUNCTION__); printk(KERN_INFO "%s: no ipppd?\n", __FUNCTION__);
return -ENXIO; return -ENXIO;
} }
n_idev->pppcfg |= SC_ENABLE_IP; ind_ppp->pppcfg |= SC_ENABLE_IP;
isdn_net_online(n_idev); isdn_net_online(n_idev);
return 0; return 0;
...@@ -78,32 +81,33 @@ ippp_mp_bundle(isdn_net_dev *idev, int unit) ...@@ -78,32 +81,33 @@ ippp_mp_bundle(isdn_net_dev *idev, int unit)
void void
ippp_mp_disconnected(isdn_net_dev *idev) ippp_mp_disconnected(isdn_net_dev *idev)
{ {
isdn_net_local *lp = idev->mlp; struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
if (!list_empty(&lp->online)) if (!list_empty(&idev->mlp->online))
return; return;
/* we're the last link going down */ /* we're the last link going down */
skb_queue_purge(&lp->mp_frags); skb_queue_purge(&inl_ppp->mp_frags);
} }
void void
ippp_mp_xmit(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ippp_mp_xmit(isdn_net_dev *idev, struct sk_buff *skb, u16 proto)
{ {
isdn_net_local *lp = idev->mlp; struct ind_ppp *ind_ppp = idev->ind_priv;
struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
unsigned char *p; unsigned char *p;
long txseq; long txseq;
if (!(lp->mp_cfg & SC_MP_PROT)) { if (!(inl_ppp->mp_cfg & SC_MP_PROT)) {
return ippp_xmit(idev, skb); return ippp_xmit(idev, skb);
} }
/* we could do something smarter than just sending /* we could do something smarter than just sending
* the complete packet as fragment... */ * the complete packet as fragment... */
txseq = lp->mp_txseq++; txseq = inl_ppp->mp_txseq++;
if (lp->mp_cfg & SC_OUT_SHORT_SEQ) { if (inl_ppp->mp_cfg & SC_OUT_SHORT_SEQ) {
/* sequence number: 12bit */ /* sequence number: 12bit */
p = skb_push(skb, 2); p = skb_push(skb, 2);
p[0] = MP_BEGIN_FRAG | MP_END_FRAG | ((txseq >> 8) & 0xf); p[0] = MP_BEGIN_FRAG | MP_END_FRAG | ((txseq >> 8) & 0xf);
...@@ -117,8 +121,8 @@ ippp_mp_xmit(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ...@@ -117,8 +121,8 @@ ippp_mp_xmit(isdn_net_dev *idev, struct sk_buff *skb, u16 proto)
p[3] = (txseq >> 0) & 0xff; p[3] = (txseq >> 0) & 0xff;
} }
proto = PPP_MP; proto = PPP_MP;
skb = ippp_ccp_compress(idev->ccp, skb, &proto); skb = ippp_ccp_compress(ind_ppp->ccp, skb, &proto);
ippp_push_proto(idev, skb, proto); ippp_push_proto(ind_ppp, skb, proto);
ippp_xmit(idev, skb); ippp_xmit(idev, skb);
} }
...@@ -127,12 +131,13 @@ static void mp_receive(isdn_net_dev *idev, struct sk_buff *skb); ...@@ -127,12 +131,13 @@ static void mp_receive(isdn_net_dev *idev, struct sk_buff *skb);
void void
ippp_mp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ippp_mp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto)
{ {
isdn_net_local *lp = idev->mlp; struct ind_ppp *ind_ppp = idev->ind_priv;
struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
if (lp->mp_cfg & SC_REJ_MP_PROT) if (inl_ppp->mp_cfg & SC_REJ_MP_PROT)
goto out; goto out;
skb = ippp_ccp_decompress(idev->ccp, skb, &proto); skb = ippp_ccp_decompress(ind_ppp->ccp, skb, &proto);
if (!skb) if (!skb)
goto drop; goto drop;
...@@ -143,7 +148,7 @@ ippp_mp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto) ...@@ -143,7 +148,7 @@ ippp_mp_receive(isdn_net_dev *idev, struct sk_buff *skb, u16 proto)
return ippp_receive(idev, skb, proto); return ippp_receive(idev, skb, proto);
drop: drop:
lp->stats.rx_errors++; idev->mlp->stats.rx_errors++;
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -257,9 +262,10 @@ mp_complete_seq(isdn_net_local *lp, struct sk_buff *b, struct sk_buff *e) ...@@ -257,9 +262,10 @@ mp_complete_seq(isdn_net_local *lp, struct sk_buff *b, struct sk_buff *e)
struct sk_buff * struct sk_buff *
mp_reassemble(isdn_net_local *lp) mp_reassemble(isdn_net_local *lp)
{ {
struct sk_buff_head *frags = &lp->mp_frags; struct inl_ppp *inl_ppp = lp->inl_priv;
struct sk_buff_head *frags = &inl_ppp->mp_frags;
struct sk_buff *p, *n, *pp, *start; struct sk_buff *p, *n, *pp, *start;
u32 min_seq = lp->mp_rxseq; u32 min_seq = inl_ppp->mp_rxseq;
u32 next_seq = 0; u32 next_seq = 0;
again: again:
...@@ -307,32 +313,35 @@ static void ...@@ -307,32 +313,35 @@ static void
mp_receive(isdn_net_dev *idev, struct sk_buff *skb) mp_receive(isdn_net_dev *idev, struct sk_buff *skb)
{ {
isdn_net_local *lp = idev->mlp; isdn_net_local *lp = idev->mlp;
struct inl_ppp *inl_ppp = lp->inl_priv;
struct ind_ppp *ind_ppp = idev->ind_priv;
isdn_net_dev *qdev; isdn_net_dev *qdev;
struct sk_buff_head *frags = &lp->mp_frags; struct sk_buff_head *frags = &inl_ppp->mp_frags;
u32 seq; u32 seq;
u16 proto; u16 proto;
print_recv_pkt(-1, skb); print_recv_pkt(-1, skb);
if (skb->len < (lp->mp_cfg & SC_IN_SHORT_SEQ ? 2 : 4)) if (skb->len < (inl_ppp->mp_cfg & SC_IN_SHORT_SEQ ? 2 : 4))
goto drop; goto drop;
seq = get_seq(skb, idev->mp_rxseq, lp->mp_cfg & SC_IN_SHORT_SEQ); seq = get_seq(skb, ind_ppp->mp_rxseq, inl_ppp->mp_cfg & SC_IN_SHORT_SEQ);
idev->mp_rxseq = seq; ind_ppp->mp_rxseq = seq;
if (lp->mp_rxseq == (u32) -1) { if (inl_ppp->mp_rxseq == (u32) -1) {
/* first packet */ /* first packet */
lp->mp_rxseq = seq; inl_ppp->mp_rxseq = seq;
} }
if (MP_LT(seq, lp->mp_rxseq)) { if (MP_LT(seq, inl_ppp->mp_rxseq)) {
goto drop; goto drop;
} }
/* Find the minimum sequence number received over all channels. /* Find the minimum sequence number received over all channels.
* No fragments with numbers lower than this will arrive later. */ * No fragments with numbers lower than this will arrive later. */
lp->mp_rxseq = seq; inl_ppp->mp_rxseq = seq;
list_for_each_entry(qdev, &lp->online, online) { list_for_each_entry(qdev, &lp->online, online) {
if (MP_LT(qdev->mp_rxseq, lp->mp_rxseq)) struct ind_ppp *ind_ppp = qdev->ind_priv;
lp->mp_rxseq = qdev->mp_rxseq; if (MP_LT(ind_ppp->mp_rxseq, inl_ppp->mp_rxseq))
inl_ppp->mp_rxseq = ind_ppp->mp_rxseq;
} }
/* Insert the skb into the list of received fragments, ordered by /* Insert the skb into the list of received fragments, ordered by
......
...@@ -27,23 +27,25 @@ ippp_vj_free(struct slcompress *slcomp) ...@@ -27,23 +27,25 @@ ippp_vj_free(struct slcompress *slcomp)
int int
ippp_vj_set_maxcid(isdn_net_dev *idev, int val) ippp_vj_set_maxcid(isdn_net_dev *idev, int val)
{ {
struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
struct slcompress *sltmp; struct slcompress *sltmp;
sltmp = slhc_init(16, val + 1); sltmp = slhc_init(16, val + 1);
if (!sltmp) if (!sltmp)
return -ENOMEM; return -ENOMEM;
if (idev->mlp->slcomp) if (inl_ppp->slcomp)
slhc_free(idev->mlp->slcomp); slhc_free(inl_ppp->slcomp);
idev->mlp->slcomp = sltmp; inl_ppp->slcomp = sltmp;
return 0; return 0;
} }
void void
ippp_vj_decompress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 proto) ippp_vj_decompress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 proto)
{ {
struct slcompress *slcomp = idev->mlp->slcomp; struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
struct slcompress *slcomp = inl_ppp->slcomp;
struct sk_buff *skb; struct sk_buff *skb;
int len; int len;
...@@ -84,11 +86,14 @@ ippp_vj_decompress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 proto) ...@@ -84,11 +86,14 @@ ippp_vj_decompress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 proto)
struct sk_buff * struct sk_buff *
ippp_vj_compress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 *proto) ippp_vj_compress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 *proto)
{ {
struct inl_ppp *inl_ppp = idev->mlp->inl_priv;
struct ind_ppp *ind_ppp = idev->ind_priv;
struct slcompress *slcomp = inl_ppp->slcomp;
struct sk_buff *skb; struct sk_buff *skb;
unsigned char *buf; unsigned char *buf;
int len; int len;
if (!(idev->pppcfg & SC_COMP_TCP) || *proto != PPP_IP) if (!(ind_ppp->pppcfg & SC_COMP_TCP) || *proto != PPP_IP)
return skb_old; return skb_old;
skb = isdn_ppp_dev_alloc_skb(idev, skb_old->len, GFP_ATOMIC); skb = isdn_ppp_dev_alloc_skb(idev, skb_old->len, GFP_ATOMIC);
...@@ -97,8 +102,9 @@ ippp_vj_compress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 *proto) ...@@ -97,8 +102,9 @@ ippp_vj_compress(isdn_net_dev *idev, struct sk_buff *skb_old, u16 *proto)
skb_put(skb, skb_old->len); skb_put(skb, skb_old->len);
buf = skb_old->data; buf = skb_old->data;
len = slhc_compress(idev->mlp->slcomp, skb_old->data, skb_old->len, // FIXME flag should be per bundle
skb->data, &buf, !(idev->pppcfg & SC_NO_TCP_CCID)); len = slhc_compress(slcomp, skb_old->data, skb_old->len, skb->data,
&buf, !(ind_ppp->pppcfg & SC_NO_TCP_CCID));
if (buf == skb_old->data) { if (buf == skb_old->data) {
kfree_skb(skb); kfree_skb(skb);
......
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