patch-2.4.4 linux/drivers/isdn/isdn_ppp.c
Next file: linux/drivers/isdn/pcbit/drv.c
Previous file: linux/drivers/isdn/isdn_net.h
Back to the patch index
Back to the overall index
- Lines: 107
- Date:
Wed Apr 18 11:49:14 2001
- Orig file:
v2.4.3/linux/drivers/isdn/isdn_ppp.c
- Orig date:
Thu Feb 8 10:40:25 2001
diff -u --recursive --new-file v2.4.3/linux/drivers/isdn/isdn_ppp.c linux/drivers/isdn/isdn_ppp.c
@@ -1,4 +1,4 @@
-/* $Id: isdn_ppp.c,v 1.85.6.2 2001/01/23 17:45:02 kai Exp $
+/* $Id: isdn_ppp.c,v 1.85.6.4 2001/04/08 18:53:07 kai Exp $
*
* Linux ISDN subsystem, functions for synchronous PPP (linklevel).
*
@@ -83,7 +83,7 @@
static int isdn_ppp_bundle(struct ippp_struct *, int unit);
#endif /* CONFIG_ISDN_MPP */
-char *isdn_ppp_revision = "$Revision: 1.85.6.2 $";
+char *isdn_ppp_revision = "$Revision: 1.85.6.4 $";
static struct ippp_struct *ippp_table[ISDN_MAX_CHANNELS];
@@ -165,6 +165,7 @@
int unit = 0;
long flags;
struct ippp_struct *is;
+ int retval;
save_flags(flags);
cli();
@@ -197,12 +198,14 @@
if (i >= ISDN_MAX_CHANNELS) {
restore_flags(flags);
printk(KERN_WARNING "isdn_ppp_bind: Can't find a (free) connection to the ipppd daemon.\n");
- return -1;
+ retval = -1;
+ goto out;
}
unit = isdn_ppp_if_get_unit(lp->name); /* get unit number from interface name .. ugly! */
if (unit < 0) {
printk(KERN_ERR "isdn_ppp_bind: illegal interface name %s.\n", lp->name);
- return -1;
+ retval = -1;
+ goto out;
}
lp->ppp_slot = i;
@@ -211,13 +214,16 @@
is->unit = unit;
is->state = IPPP_OPEN | IPPP_ASSIGNED; /* assigned to a netdevice but not connected */
#ifdef CONFIG_ISDN_MPP
- if (isdn_ppp_mp_init(lp, NULL) < 0)
- return -ENOMEM;
+ retval = isdn_ppp_mp_init(lp, NULL);
+ if (retval < 0)
+ goto out;
#endif /* CONFIG_ISDN_MPP */
- restore_flags(flags);
+ retval = lp->ppp_slot;
- return lp->ppp_slot;
+ out:
+ restore_flags(flags);
+ return retval;
}
/*
@@ -2431,6 +2437,13 @@
switch(skb->data[0]) {
case CCP_CONFREQ:
+ if(is->debug & 0x10)
+ printk(KERN_DEBUG "Disable compression here!\n");
+ if(proto == PPP_CCP)
+ mis->compflags &= ~SC_COMP_ON;
+ else
+ is->compflags &= ~SC_LINK_COMP_ON;
+ break;
case CCP_TERMREQ:
case CCP_TERMACK:
if(is->debug & 0x10)
@@ -2546,6 +2559,17 @@
/* TODO: Clean this up with new Reset semantics */
+/* I believe the CCP handling as-is is done wrong. Compressed frames
+ * should only be sent/received after CCP reaches UP state, which means
+ * both sides have sent CONF_ACK. Currently, we handle both directions
+ * independently, which means we may accept compressed frames too early
+ * (supposedly not a problem), but may also mean we send compressed frames
+ * too early, which may turn out to be a problem.
+ * This part of state machine should actually be handled by (i)pppd, but
+ * that's too big of a change now. --kai
+ */
+
+
static void isdn_ppp_send_ccp(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff *skb)
{
struct ippp_struct *mis,*is = ippp_table[lp->ppp_slot];
@@ -2580,6 +2604,13 @@
switch(data[2]) {
case CCP_CONFREQ:
+ if(is->debug & 0x10)
+ printk(KERN_DEBUG "Disable decompression here!\n");
+ if(proto == PPP_CCP)
+ is->compflags &= ~SC_DECOMP_ON;
+ else
+ is->compflags &= ~SC_LINK_DECOMP_ON;
+ break;
case CCP_TERMREQ:
case CCP_TERMACK:
if(is->debug & 0x10)
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)