Linux 2.3.7pre1
[davej-history.git] / drivers / isdn / isdn_concap.c
blob1ca6c34e383bc33135dad195d29cf142dda610f5
1 /* $Id: isdn_concap.c,v 1.5 1998/10/30 18:44:48 he 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.5 1998/10/30 18:44:48 he
9 * pass return value from isdn_net_dial_req for dialmode change
11 * Revision 1.4 1998/10/30 17:55:24 he
12 * dialmode for x25iface and multulink ppp
14 * Revision 1.3 1998/05/26 22:39:22 he
15 * sync'ed with 2.1.102 where appropriate (CAPABILITY changes)
16 * concap typo
17 * cleared dev.tbusy in isdn_net BCONN status callback
19 * Revision 1.2 1998/01/31 22:49:21 keil
20 * correct comments
22 * Revision 1.1 1998/01/31 22:27:57 keil
23 * New files from Henner Eisen for X.25 support
28 #include <linux/isdn.h>
29 #include "isdn_x25iface.h"
30 #include "isdn_net.h"
31 #include <linux/concap.h>
32 #include "isdn_concap.h"
35 /* The following set of device service operations are for encapsulation
36 protocols that require for reliable datalink semantics. That means:
38 - before any data is to be submitted the connection must explicitly
39 be set up.
40 - after the successful set up of the connection is signalled the
41 connection is considered to be reliably up.
43 Auto-dialing ist not compatible with this requirements. Thus, auto-dialing
44 is completely bypassed.
46 It might be possible to implement a (non standardized) datalink protocol
47 that provides a reliable data link service while using some auto dialing
48 mechanism. Such a protocol would need an auxiliary channel (i.e. user-user-
49 signaling on the D-channel) while the B-channel is down.
53 int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb)
55 int tmp;
56 struct device *ndev = concap -> net_dev;
57 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
59 IX25DEBUG( "isdn_concap_dl_data_req: %s \n", concap->net_dev->name);
60 lp->huptimer = 0;
61 tmp=isdn_net_send_skb(ndev, lp, skb);
62 IX25DEBUG( "isdn_concap_dl_data_req: %s : isdn_net_send_skb returned %d\n", concap -> net_dev -> name, tmp);
63 return tmp;
67 int isdn_concap_dl_connect_req(struct concap_proto *concap)
69 struct device *ndev = concap -> net_dev;
70 isdn_net_local *lp = (isdn_net_local *) ndev->priv;
71 int ret;
72 IX25DEBUG( "isdn_concap_dl_connect_req: %s \n", ndev -> name);
74 /* dial ... */
75 ret = isdn_net_dial_req( lp );
76 if ( ret ) IX25DEBUG("dialing failed\n");
77 return ret;
80 int isdn_concap_dl_disconn_req(struct concap_proto *concap)
82 IX25DEBUG( "isdn_concap_dl_disconn_req: %s \n", concap -> net_dev -> name);
84 isdn_net_hangup( concap -> net_dev );
85 return 0;
88 struct concap_device_ops isdn_concap_reliable_dl_dops = {
89 &isdn_concap_dl_data_req,
90 &isdn_concap_dl_connect_req,
91 &isdn_concap_dl_disconn_req
94 struct concap_device_ops isdn_concap_demand_dial_dops = {
95 NULL, /* set this first entry to something like &isdn_net_start_xmit,
96 but the entry part of the current isdn_net_start_xmit must be
97 separated first. */
98 /* no connection control for demand dial semantics */
99 NULL,
100 NULL,
103 /* The following should better go into a dedicated source file such that
104 this sourcefile does not need to include any protocol specific header
105 files. For now:
107 struct concap_proto * isdn_concap_new( int encap )
109 switch ( encap ) {
110 case ISDN_NET_ENCAP_X25IFACE:
111 return isdn_x25iface_proto_new();
113 return NULL;