syncppp.[ch] patches for 2.1

Jan Kasprzak (Jan.Kasprzak@eunet.cz)
Wed, 14 Oct 1998 22:12:26 +0200


[Cc'd to linux-kernel]

Hi Alan,

I would like to ask you to apply the following patches
to syncppp.[ch] in the 2.1 kernels and to send the patch to Linus
for including in the new kernel release.

The patches do the following:

1) set the skb->dev before queuing the skb to the device driver.
2) internal structures in syncppp.h moved inside #ifdef __KERNEL__
(essentially everything except the ioctl numbers).
3) added the SPPPIOCDEBUG and SPPPIOCNODEBUG ioctls to enable/disable
SPPP/HDLC debugging per interface.
4) added IFF_POINTOPOINT and IFF_NOARP to the interface flags.
5) made the dev->type reflecting the current protocol encapsulation
(ARPHRD_HDLC for PP_CISCO and ARPHRD_PPP for !PP_CISCO).
The default is PP_CISCO and ARPHRD_HDLC. Now we need to teach
ifconfig about ARPHRD_HDLC too.

Thanks in advance,

-Yenya

--- /usr/src/linux/drivers/net/syncppp.h Sun Sep 6 19:47:01 1998
+++ syncppp.h Wed Oct 14 21:54:35 1998
@@ -20,6 +20,7 @@
#ifndef _SYNCPPP_H_
#define _SYNCPPP_H_ 1

+#ifdef __KERNEL__
struct slcp {
u16 state; /* state machine */
u32 magic; /* local magic number */
@@ -71,7 +72,6 @@
#define IPCP_STATE_ACK_SENT 2 /* IPCP state: conf-ack sent */
#define IPCP_STATE_OPENED 3 /* IPCP state: opened */

-#ifdef __KERNEL__
void sppp_attach (struct ppp_device *pd);
void sppp_detach (struct device *dev);
void sppp_input (struct device *dev, struct sk_buff *m);
@@ -85,5 +85,7 @@

#define SPPPIOCCISCO (SIOCDEVPRIVATE)
#define SPPPIOCPPP (SIOCDEVPRIVATE+1)
+#define SPPPIOCDEBUG (SIOCDEVPRIVATE+2)
+#define SPPPIOCNODEBUG (SIOCDEVPRIVATE+3)

#endif /* _SYNCPPP_H_ */
--- /usr/src/linux/drivers/net/syncppp.c Sun Sep 6 19:47:01 1998
+++ syncppp.c Wed Oct 14 21:54:14 1998
@@ -770,6 +770,7 @@
sp->obytes += skb->len;
/* Control is high priority so it doesnt get queued behind data */
skb->priority=1;
+ skb->dev = dev;
dev_queue_xmit(skb);
}

@@ -811,6 +812,7 @@
ch->par2, ch->rel, ch->time0, ch->time1);
sp->obytes += skb->len;
skb->priority=1;
+ skb->dev = dev;
dev_queue_xmit(skb);
}

@@ -861,9 +863,17 @@
{
case SPPPIOCCISCO:
sp->pp_flags|=PP_CISCO;
+ dev->type = ARPHRD_HDLC;
break;
case SPPPIOCPPP:
sp->pp_flags&=~PP_CISCO;
+ dev->type = ARPHRD_PPP;
+ break;
+ case SPPPIOCDEBUG:
+ sp->pp_flags|=PP_DEBUG;
+ break;
+ case SPPPIOCNODEBUG:
+ sp->pp_flags&=~PP_DEBUG;
break;
default:
return -EINVAL;
@@ -908,7 +918,7 @@
dev->hard_header = sppp_hard_header;
dev->rebuild_header = sppp_rebuild_header;
dev->tx_queue_len = 10;
- dev->type = ARPHRD_PPP;
+ dev->type = ARPHRD_HDLC;
dev->addr_len = 0;
dev->hard_header_len = sizeof(struct ppp_header);
dev->mtu = PPP_MTU;
@@ -924,7 +934,7 @@
dev->change_mtu = sppp_change_mtu;
dev->hard_header_cache = NULL;
dev->header_cache_update = NULL;
- dev->flags = IFF_MULTICAST;
+ dev->flags = IFF_MULTICAST|IFF_POINTOPOINT|IFF_NOARP;
dev_init_buffers(dev);
}

--
\   Jan "Yenya" Kasprzak <kas@eunet.cz>    http://www.fi.muni.cz/~kas/   /
\\  PGP: finger kas@brn.traveller.cz A49AB5ECECDBD3DA 83980A92BD19994B  //
\\\            Czech Linux Homepage at http://www.linux.cz             ///
/// Yow! 11.26 MB/s remote host TCP bandwidth  &  199 usec remote TCP  \\\
//  latency over 100Mb/s ethernet.  Beat that!                [Linux]   \\

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/