* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / drivers / isdn / isdn_concap.c
blobca05f8bf315b45f243d8b557813e3fa1ac0cd266
1 /* $Id: isdn_concap.c,v 1.6 1999/08/22 20:26:01 calle Exp $
3 * Stuff to support the concap_proto by isdn4linux. isdn4linux - specific
4 * stuff goes here. Stuff that depends only on the concap protocol goes to
5 * another -- protocol specific -- source file.
7 * $Log: isdn_concap.c,v $
8 * Revision 1.6 1999/08/22 20:26:01 calle
9 * backported changes from kernel 2.3.14:
10 * - several #include "config.h" gone, others come.
11 * - "struct device" changed to "struct net_device" in 2.3.14, added a
12 * define in isdn_compat.h for older kernel versions.
14 * Revision 1.5 1998/10/30 18:44:48 he
15 * pass return value from isdn_net_dial_req for dialmode change
17 * Revision 1.4 1998/10/30 17:55:24 he
18 * dialmode for x25iface and multulink ppp
20 * Revision 1.3 1998/05/26 22:39:22 he
21 * sync'ed with 2.1.102 where appropriate (CAPABILITY changes)
22 * concap typo
23 * cleared dev.tbusy in isdn_net BCONN status callback
25 * Revision 1.2 1998/01/31 22:49:21 keil
26 * correct comments
28 * Revision 1.1 1998/01/31 22:27:57 keil
29 * New files from Henner Eisen for X.25 support
34 #include <linux/isdn.h>
35 #include "isdn_x25iface.h"
36 #include "isdn_net.h"
37 #include <linux/concap.h>
38 #include "isdn_concap.h"
41 /* The following set of device service operations are for encapsulation
42 protocols that require for reliable datalink semantics. That means:
44 - before any data is to be submitted the connection must explicitly
45 be set up.
46 - after the successful set up of the connection is signalled the
47 connection is considered to be reliably up.
49 Auto-dialing ist not compatible with this requirements. Thus, auto-dialing
50 is completely bypassed.
52 It might be possible to implement a (non standardized) datalink protocol
53 that provides a reliable data link service while using some auto dialing
54 mechanism. Such a protocol would need an auxiliary channel (i.e. user-user-
55 signaling on the D-channel) while the B-channel is down.
59 int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
61 int tmp;
62 struct net_device *ndev = concap -> net_dev;
63 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
65 IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name);
66 lp->huptimer = 0;
67 tmp=isdn_net_send_skb(ndev, lp, skb);
68 IX25DEBUG( "isdn_concap_dl_data_req: %s : isdn_net_send_skb returned %d\n", concap -> net_dev -> name, tmp);
69 return tmp;
73 int isdn_concap_dl_connect_req(struct concap_proto *concap)
75 struct net_device *ndev = concap -> net_dev;
76 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
77 int ret;
78 IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
80 /* dial ... */
81 ret = isdn_net_dial_req( lp );
82 if ( ret ) IX25DEBUG("dialing failed\n");
83 return ret;
86 int isdn_concap_dl_disconn_req(struct concap_proto *concap)
88 IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name);
90 isdn_net_hangup( concap -> net_dev );
91 return 0;
94 struct concap_device_ops isdn_concap_reliable_dl_dops = {
95 &isdn_concap_dl_data_req,
96 &isdn_concap_dl_connect_req,
97 &isdn_concap_dl_disconn_req
100 struct concap_device_ops isdn_concap_demand_dial_dops = {
101 NULL, /* set this first entry to something like &isdn_net_start_xmit,
102 but the entry part of the current isdn_net_start_xmit must be
103 separated first. */
104 /* no connection control for demand dial semantics */
105 NULL,
106 NULL,
109 /* The following should better go into a dedicated source file such that
110 this sourcefile does not need to include any protocol specific header
111 files. For now:
113 struct concap_proto * isdn_concap_new( int encap )
115 switch ( encap ) {
116 case ISDN_NET_ENCAP_X25IFACE:
117 return isdn_x25iface_proto_new();
119 return NULL;